(function(b,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("element-plus"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue"],p):(b=typeof globalThis<"u"?globalThis:b||self,p(b["gantt-chart-vue3"]={},b.elementPlus,b.Vue))})(this,function(b,p,l){"use strict";function O(e,t){var i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[],s;t=t||i.length;{var a;for(n[8]=n[13]=n[18]=n[23]="-",n[14]="4",s=0;s<36;s++)n[s]||(a=0|Math.random()*16,n[s]=i[s==19?a&3|8:a])}return n.join("")}Function.prototype.call.bind(Object.prototype.toString);function R(e){let t=null;if(Object.prototype.toString.call(e)==="[object Array]"){t=[];for(let i=0;it)||""},delValUnit(e,t){if(!t&&(t=this.getUnit(e),!t))return e;let i=new RegExp(t+"$","ig");return e.replace(i,"")},oncontextmenuDisabled(e){return e.stopPropagation(),e.preventDefault(),!1},setDOMH(e,t){!e||!e.style||(e.style.height=t+"px")},setDOMW(e,t){!e||!e.style||(e.style.width=t+"px")},getDOMWH(e){let t=e||{};return{w:t.offsetWidth||0,h:t.offsetHeight||0}},clearCanvas(e){if(!e)return;e.getContext("2d").clearRect(0,0,e.width,e.height)},setCanvasWH(e,t,i){e&&(e.width=t,e.height=i,e.style.width=t+"px",e.style.height=i+"px")},easeInOutQuad(e,t,i,n){return e/=n/2,e<1?i/2*e*e+t:(e--,-i/2*(e*(e-2)-1)+t)},smoothScroll({startPosition:e,distance:t,duration:i=300,callBack:n}={duration:300}){let s=null,a=d=>{!s&&(s=d);let f=d-s,r=this.easeInOutQuad(f,e,t,i);n&&n(r),fd&&(i=d),n>f&&(n=f),{left:i,top:n}}function E({disabledYMin:e,disabledYMax:t,tagHeight:i,tagTop:n}){return n>e-i&&n{const i=e.__vccOpts||e;for(const[n,s]of t)i[n]=s;return i},G={name:"tagItemLabel",props:{tagItem:{type:Object,default(){return{}}},showOperateMark:{type:Boolean,default:!1}}},A={class:"label-yc"},X={key:0,class:"taglabel-af"};function z(e,t,i,n,s,a){return l.openBlock(),l.createElementBlock("span",A,[l.createElementVNode("i",{class:l.normalizeClass(["taglabel-bf",i.tagItem.preIcon||""])},null,2),l.createTextVNode(" "+l.toDisplayString(i.tagItem.label)+" ",1),i.showOperateMark?(l.openBlock(),l.createElementBlock("i",X)):l.createCommentVNode("",!0)])}const v=C(G,[["render",z],["__scopeId","data-v-66e88bcf"]]),j={name:"tagItem",components:{ElPopover:p.ElPopover,tagItemLabel:v},props:{tagItem:{type:Object,default(){return{}}},dragable:{type:Boolean,default:!0},tagMoveCallback:{type:Function,default:null},closeTip:{type:Boolean,default:!1},showOperateMark:{type:Boolean,default:!1},showSelected:{type:Boolean,default:!1},tipWdith:{type:[String,Number],default:206},tipEnterable:{type:Boolean,default:!1}},data(){return{utils:h,moving:!1,changeWHing:!1,visibleTip:!1,moved:!1,changeTimer:null}},methods:{contextmenuHandle(e){return this.$emit("tagContextmenu",{e,tagItem:this.tagItem,dragable:this.dragable,closeTip:this.closeTip,showOperateMark:this.showOperateMark}),h.oncontextmenuDisabled(e)},tagBlur(){this.$emit("tagBlur")},clickHandle(e){this.moving||this.moved||this.$emit("tagClick",{e,tagItem:this.tagItem,dragable:this.dragable,closeTip:this.closeTip,showOperateMark:this.showOperateMark})},getToContainerXY(e){return{x:e.x||e.pageX,y:e.y||e.pageY}},addRemoveMouseEvent(e){let t=n=>{e&&e(n)},i=()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",i),this.changeChangeWHing(!1),this.changeMoveing(!1),this.$emit("changeEnd")};window.addEventListener("mousemove",t,!1),window.addEventListener("mouseup",i,!1)},changeChangeWHing(e=!1){this.changeWHing=e},changeMoveing(e=!1){this.moving=e,this.moving&&this.showTagTip(!1)},moveBox(e){if(e&&+e.button==2||!this.dragable||this.changeWHing)return;let t=R(this.tagItem);this.changeMoveing(!0),this.$emit("tagDragStart",{tagItem:this.tagItem});let i=Y(this.$refs.dragBoxRef),n=0,s=0;if(i){let o=i.getBoundingClientRect();n=o.left,s=o.top}let a=this.$refs.dragBoxRef.offsetLeft,d=this.$refs.dragBoxRef.offsetTop,{x:f,y:r}=this.getToContainerXY(e),g=f-a-n,c=r-d-s;this.addRemoveMouseEvent(o=>{let{x:m,y:T}=this.getToContainerXY(o),u=i.getBoundingClientRect(),w=u.left,D=u.top,y=m-g-w,x=T-c-D;this.tagMoveCallback&&this.tagMoveCallback(o,{tagItemDom:this.$refs.dragBoxRef,tagItemOld:t,tagItem:this.tagItem,left:y,top:x,toBox_X:g,toBox_Y:c}),this.moved=!0,clearTimeout(this.changeTimer),this.changeTimer=setTimeout(()=>{this.moved=!1},500)})},showTagTip(e=!1){this.moving?this.visibleTip=!1:this.visibleTip=e}},mounted(){},beforeDestroy(){clearTimeout(this.changeTimer)}};function P(e,t,i,n,s,a){const d=l.resolveComponent("tagItemLabel"),f=l.resolveComponent("el-popover");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["tagItem",s.moving?"moving":"",this.dragable?"dragable":"",i.showSelected&&i.tagItem.selected?"selected":""]),style:l.normalizeStyle(i.tagItem.style),onMousedown:t[4]||(t[4]=l.withModifiers((...r)=>a.moveBox&&a.moveBox(...r),["stop"])),ref:"dragBoxRef",onContextmenu:t[5]||(t[5]=l.withModifiers((...r)=>a.contextmenuHandle&&a.contextmenuHandle(...r),["stop"])),onClick:t[6]||(t[6]=l.withModifiers((...r)=>a.clickHandle&&a.clickHandle(...r),["stop"])),tabindex:"-2",onBlurCapture:t[7]||(t[7]=(...r)=>a.tagBlur&&a.tagBlur(...r))},[i.closeTip?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["tagLabel",i.tagItem.className])},[l.createVNode(d,{"tag-item":i.tagItem,showOperateMark:i.showOperateMark},null,8,["tag-item","showOperateMark"])],2)):(l.openBlock(),l.createBlock(f,{key:1,"popper-class":"ganTTTagTip",placement:"right",width:i.tipWdith,visible:s.visibleTip,"onUpdate:visible":t[3]||(t[3]=r=>s.visibleTip=r),"show-arrow":!1,offset:0,enterable:i.tipEnterable},{reference:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(["tagLabel",i.tagItem.className]),onPointerenter:t[0]||(t[0]=r=>a.showTagTip(!0)),onPointermove:t[1]||(t[1]=r=>a.showTagTip(!0)),onPointerleave:t[2]||(t[2]=r=>a.showTagTip(!1))},[l.createVNode(d,{"tag-item":i.tagItem,showOperateMark:i.showOperateMark},null,8,["tag-item","showOperateMark"])],34)]),default:l.withCtx(()=>[l.renderSlot(e.$slots,"tagTip",{tagData:i.tagItem},()=>[l.createTextVNode(l.toDisplayString(i.tagItem.label),1)],!0)]),_:3},8,["width","visible","enterable"]))],38)}const F=C(j,[["render",P],["__scopeId","data-v-dd4eeaa7"]]),U={name:"yTimeLine",props:{visible:{type:Boolean,default:!1},left:{type:String,default:""},title:{type:String,default:"时间线"},color:{type:String,default:"#000000"}},data(){return{}}};function $(e,t,i,n,s,a){return l.withDirectives((l.openBlock(),l.createElementBlock("div",{class:"timeLine",style:l.normalizeStyle({left:i.left})},[l.createElementVNode("span",{class:"timeBox",style:l.normalizeStyle({backgroundColor:i.color})},[l.createElementVNode("i",{style:l.normalizeStyle({borderTopColor:i.color})},null,4),l.createTextVNode(" "+l.toDisplayString(i.title),1)],4),l.createElementVNode("span",{class:"line",style:l.normalizeStyle({borderLeftColor:i.color})},null,4)],4)),[[l.vShow,i.visible]])}const q=C(U,[["render",$],["__scopeId","data-v-cab0e786"]]);let M;const B=4,K=28,k=28,_=5,Q=100;let L=2;const S=2*B+Math.min(k,K);L=L<0?1:L;let H=2*B+L*k+(L-1)*_;H=Math.max(H,S);const J={name:"gantt-chart-vue3",components:{ElButton:p.ElButton,ElDialog:p.ElDialog,ElDatePicker:p.ElDatePicker,tagItem:F,yTimeLine:q},props:{readOnly:{type:Boolean,default:!1},disabledRowSilent:{type:Boolean,default:!1},showSelected:{type:Boolean,default:!1},selfAdaptionGanTTHeight:{type:Boolean,default:!0},legend:{type:Array,default(){return[]}},title:{type:String,default:"甘特图"},startDate:{type:String,default:"2023/12/01"},dateDuration:{type:Number,default:7},decreaseDayNum:{type:Number,default:0,validator:function(e){return e>=0}},IncreaseDayNum:{type:Number,default:0,validator:function(e){return e>=0}},timeFormat:{type:String,default:"YYYY-MM-DD"},rows:{type:Array,default:()=>[]},summaryRows:{type:Array,default(){return[]}},showMarkLine:{type:Boolean,default:!1},markLineTime:{type:String,default:""},rightClickMenuList:{type:Array,default(){return[]}},taskMenuList:{type:Array,default(){return[]}},dragTagEndShowTimeDialog:{type:Boolean,default:!1},openTagMoveDodgeAnimate:{type:Boolean,default:!1},tipWdith:{type:[String,Number],default:206},tipEnterable:{type:Boolean,default:!1},ganttBgColor:{type:String,default:"#ffffff"},disabledBgColor:{type:String,default:"#ececec"},paintLeft:{type:String,default:"80px"},paintTop:{type:String,default:"40px"},gridLineColor:{type:String,default:"#dddddd"}},data(){return{rowMinRowHeight:S+"px",ganTTBottomHeight:0,utils:h,isFirstInit:!0,scrolledXPercent:0,tickTimer:null,scrollTimer:null,rowsInfo:[],colsInfo:[],paintBoxInfo:{width:0,height:0},tagList:[],draging:{tagItemOld:{},tagItem:{},tagItemDom:null,left:0,top:0},historyDraging:{left:null,top:null},dodgeTagsInfo:{},movingTimeLine:{visible:!1,left:"0px",title:"",color:"#000000"},markLine:{visible:!1,left:"0px",title:"",color:"red"},currentTimeLine:{visible:!1,left:"0px",title:"",color:"#000000"},tickCurrentTimer:null,rightMenuTemObj:{},taskMenu:{visible:!1,btnList:[],selectRow:{},style:{left:"0px",top:"0px"}},tagMenu:{visible:!1,btnList:[],selectTag:{},style:{left:"0px",top:"0px"}},autoCloseTagMenu:!0,tagTimeDialog:{visible:!1,timeRange:[],tag:{}},pickerOptions:{shortcuts:[{text:"最近一周",onClick(e){const t=new Date,i=new Date;i.setTime(i.getTime()-3600*1e3*24*7),e.$emit("pick",[i,t])}},{text:"最近一个月",onClick(e){const t=new Date,i=new Date;i.setTime(i.getTime()-3600*1e3*24*30),e.$emit("pick",[i,t])}},{text:"最近三个月",onClick(e){const t=new Date,i=new Date;i.setTime(i.getTime()-3600*1e3*24*90),e.$emit("pick",[i,t])}}]}}},watch:{rows:{handler(){console.log("ganTT rows change..."),this.init()},deep:!0},startDate:{handler(){this.init()}},dateDuration:{handler(){this.init()}},decreaseDayNum:{handler(){this.init()}},IncreaseDayNum:{handler(){this.init()}},showMarkLine:{handler(){this.showAxisTime(this.markLineTime)}},markLineTime:{handler(){this.showAxisTime(this.markLineTime)}}},computed:{paintLeftVal(){return+h.delValUnit(this.paintLeft)},paintTopVal(){return+h.delValUnit(this.paintTop)}},methods:{reW(e,t=!0){let i=(Number(e||0)/h.getDOMWH(this.$refs.paintBoxRefDom).w*100).toFixed(2);return t?`${i}%`:i},reH(e,t=!0){let i=(Number(e||0)/h.getDOMWH(this.$refs.paintBoxRefDom).h*100).toFixed(2);return t?`${i}%`:i},dealTime(e,t=!1){let i=e;return t||(i=new Date(e).getTime()),i/1e3/60},dealTimeToMs(e){return e*60*1e3},getGanTTimeRange(){if(this.colsInfo.length<=0)return null;let e=new Date(`${this.colsInfo[0].label} 00:00:00`).getTime(),t=new Date(`${this.colsInfo[this.colsInfo.length-1].label} 23:59:59`).getTime();return{startTime:e,endTime:t}},getPxOfTimeParticle(){let e=this.$refs.paintBoxRefDom;if(this.colsInfo.length<=0||!e)return!1;let{startTime:t,endTime:i}=this.getGanTTimeRange();return((i-t)/1e3/60).toFixed(0)/h.getDOMWH(e).w},timeStampGapToInfeedDistance(e){let t=this.dealTime(e,!0);return Number(t/this.getPxOfTimeParticle()).toFixed(6)},getStartTimeByLeft(e=0,t){if(this.colsInfo.length<=0)return!1;t=new Date(t).getTime()||new Date(`${this.colsInfo[0].label} 00:00:00`).getTime();let i=this.dealTimeToMs(e*this.getPxOfTimeParticle());return h._date.format(t+i,"YYYY/MM/DD HH:mm:ss")},getLeftByStartTime(e=""){if(!e)return 0;if(this.colsInfo.length<=0)return!1;let t=this.dealTime(`${this.colsInfo[0].label} 00:00:00`);if(e-1?this.rowsInfo[i].label:null]}},getDisabledYS(){let e=0,t=[];return this.rowsInfo.map(i=>{i.disabled&&t.push({min:e,max:e+i.h}),e+=i.h}),t},getPreNoDisabledRowIndex(e=0){let t=this.rowsInfo,i=e-1;if(i<0)return-1;for(;i>=0&&t[i].disabled;i--);return i<0?-1:i},getNextNoDisabledRowIndex(e=0){let t=this.rowsInfo,i=e+1;if(i>=this.rowsInfo.length)return-1;for(;i=this.rowsInfo.length?-1:i},judgeYisInDisabledRow(e){let t=this.getDisabledYS();for(let i=0;i=n&&e<=s)return!0}return!1},getRowIndexByTop(e=0){let t=0,i=this.rowsInfo,n=0;for(let s=0;s0},getLegendConfig(e){return this.legend.find(t=>t.type==e.type)||{}},getTagsMapByRowItem(e={}){if(!e||!Object.keys(e).length)return{};let t={};return(e.tags||[]).map(n=>{t[n.type]||(t[n.type]=[]),t[n.type].push(n)}),t},calcTagLeftAndWidth(e,t){if(!e||!t)return null;if(this.colsInfo.length<=0)return!1;let i=this.dealTime(`${this.colsInfo[0].label} 00:00:00`);if(en.tagId===e?{...t,timeStampDiffer:new Date(t.endTime).getTime()-new Date(t.startTime).getTime()}:n),this.backfillTagListToRowsInfo(),i&&this.refreshGTTWH(),!0):!1},deleteTag(e){return e?(this.tagList=this.tagList.filter(t=>t.tagId!==e),this.tagChangThenRefreshAll(),!0):!1},tagDragStart(e={}){this.$emit("tagDragStart",e)},tagChangeEnd(){let{tagItemOld:e,tagItem:t,tagItemDom:i,left:n,top:s}=this.draging,a=s,d=this.rowsInfo.map(g=>({label:g.label,h:g.h}));if(this.disabledRowSilent){if(this.rowsInfo.filter(c=>c.disabled).length===this.rowsInfo.length)return;if(t&&t.style){let c=this.getDisabledYS(),o=0,m=a;h.getDOMWH(this.$refs.paintBoxRefDom).h;let T=h.getDOMWH(i).h;for(;o!==c.length;){o=0;for(let u=0;uD||m===0?(y=this.getNextNoDisabledRowIndex(x),y<0&&(y=this.getPreNoDisabledRowIndex(x))):(y=this.getPreNoDisabledRowIndex(x+1),y<0&&(y=this.getNextNoDisabledRowIndex(x+1))),m=this.getTopByRowIndex(y);break}}}a=m}}let f=this.getRowIndexByTop(a),r=d[f].label;this.tagList.some(g=>{if(g.tagId===t.tagId)return g.parentKey=r,g.startTime=this.getStartTimeByLeft(n),g.endTime=h._date.format(new Date(g.startTime).getTime()+g.timeStampDiffer,"YYYY/MM/DD HH:mm:ss"),!0}),this.tagChangThenRefreshAll(),this.$emit("tagDragEnd",{...this.draging}),this.dragTagEndShowTimeDialog&&this.draging.tagItemDom&&this.openTagTimeDialog(this.draging.tagItem),this.draging.tagItemOld={},this.draging.tagItem={},this.draging.tagItemDom=null,this.historyDraging={left:null,top:null},this.clearGuideLine()},dodgeTag(e={},t=[]){if(!e||!Object.keys(e).length||!t||!t.length)return;let i=e._dodge;i?i.startTime:new Date(e.startTime).getTime();let n=i?i.endTime:new Date(e.endTime).getTime(),s=t[0],a=new Date(s.startTime).getTime(),d=new Date(s.endTime).getTime(),f=n-a;f>0&&(s.style.transform=`translateX(${this.timeStampGapToInfeedDistance(f)}px)`,s._dodge={startTime:a+f,endTime:d+f},this.dodgeTagsInfo[s.tagId]=s.style.transform);let r=t.slice(1);r.length&&this.dodgeTag(s,r)},clearTagDodge(e){e.style.transform="translateX(0)",delete e._dodge},tagMoveDodgeAnimate(e={}){if(!this.openTagMoveDodgeAnimate||!e||!Object.keys(e).length)return;let t=h.delValUnit(e.style.left),i=h.delValUnit(e.style.top),n=this.getStartTimeByLeft(t),s=h._date.format(new Date(n).getTime()+e.timeStampDiffer,"YYYY/MM/DD HH:mm:ss"),a=this.getRowIndexByTop(i),d=this.rowsInfo[a].label,r=this.tagList.filter(c=>c.tagId!==e.tagId&&c.type===e.type&&c.dragable!==!1).filter(c=>c.parentKey===d);this.dodgeTagsInfo={},this.tagList.map(c=>this.clearTagDodge(c));let g=r.filter(c=>new Date(c.startTime).getTime()>new Date(n).getTime());g.sort((c,o)=>new Date(c.startTime).getTime()-new Date(o.startTime).getTime()),this.dodgeTag({...e,startTime:n,endTime:s},g)},tagMove(e,{tagItemDom:t,tagItemOld:i,tagItem:n,left:s,top:a,toBox_X:d,toBox_Y:f}){if(this.historyDraging.left===null&&(this.historyDraging.left=s),this.historyDraging.top===null&&(this.historyDraging.top=a),this.clearGuideLine(),this.closeAllMenu("tagMove"),!t)return;let r=h.getDOMWH(t).w,g=h.getDOMWH(t).h;if(this.disabledRowSilent){let o=this.getDisabledYS();if(o.length===this.rowsInfo.length)return;let m=!1;o.map(({max:T,min:u})=>{E({disabledYMin:u,disabledYMax:T,tagHeight:g,tagTop:a})&&(m=!0)}),m?t.style.cursor="not-allowed":t.style.cursor="move"}let c=W({contentDom:this.$refs.paintBoxRefDom,dragDom:t,left:s,top:a});s=c.left,a=c.top;{let o=s-this.historyDraging.left,m=a-this.historyDraging.top,T=this.getScrollLeft();this.getTimeColW();let u=h.getDOMWH(this.$refs.boxRightRefDom).w;o<0&&s0&&s+r>u+T&&this.scrollGanTTXTo(T+(s+r-u-T));let w=this.getScrollTop(),D=h.getDOMWH(this.$refs.boxRightRefDom).h;m<0&&a0&&a+g>D+w&&this.scrollGanTTYTo(w+(a+g-D-w))}n.style.left=s+"px",n.style.top=a+"px",this.tagMoveDodgeAnimate(n),this.draging={tagItemOld:i,tagItem:n,tagItemDom:t,left:s,top:a},this.historyDraging={left:s,top:a},this.drawMoveGuideLineY(s,a)},backfillTag(e={}){return{...e.data||{},tagId:e.tagId,startTime:e.startTime||"",endTime:e.endTime||"",label:e.label||"甘特图 tag",type:e.type||"",closeTip:e.closeTip,dragable:e.dragable,className:e.className,selected:e.selected,preIcon:e.preIcon,hide:e.hide}},factoryTag(e={},t={}){let i=this.backfillTag(e),n={data:e,parentKey:t.label||"",...i,tagId:i.tagId||`tag-${new Date().getTime()}-${O()}`,timeStampDiffer:new Date(e.endTime).getTime()-new Date(e.startTime).getTime(),style:{top:0,width:"auto",left:0,height:k+"px",transform:"translateX(0)"}};this.dodgeTagsInfo[n.tagId]&&(n.style.transform=this.dodgeTagsInfo[n.tagId]);let s=this.calcTagLeftAndWidth(n.startTime,n.endTime);s&&(n.style.left=s.left,n.style.width=s.width);let a=this.calcTagTopAndHeight(n.parentKey,n.type);return a&&(n.style.top=a.top,n.style.height=a.height),n},createTagList(){let e=[];this.rowsInfo.map(t=>{let i=(t.tags||[]).map(n=>this.factoryTag(n,t));e=e.concat(i)}),this.tagList=e,this.verticalTag()},verticalTag(){let e={};this.tagList.map(n=>{let s=+h.delValUnit(n.style.top);e[n.parentKey]||(e[n.parentKey]=s),s>e[n.parentKey]&&(e[n.parentKey]=s)});let t=0,i=B;this.rowsInfo.map(n=>{let s=n.label,a=+n.h;h.isNull(e[s])||(e[s]=t+a-Number(e[s])-k-i),t+=n.h}),this.tagList.map(n=>{h.isNull(e[n.parentKey])||(n.style.top=+h.delValUnit(n.style.top)+Number((e[n.parentKey]/2||0).toFixed(4))+"px")})},backfillTagListToRowsInfo(){this.rowsInfo=this.rowsInfo.map(e=>({...e,tags:this.tagList.filter(t=>t.parentKey===e.label).map(t=>this.backfillTag(t))}))},closeTagTimeDialog(){this.tagTimeDialog.visible=!1,this.$emit("closeTagTimeDialog")},confirmTagTimeDlaiog(){let e=this.tagTimeDialog.tag,t=this.tagTimeDialog.timeRange;if(!t||!t.length||!t[0]||!t[1])return p.ElMessage({message:"请选择时间",type:"warning"});let i=t[0],n=t[1];if(new Date(i).getTime()>new Date(n).getTime())return p.ElMessage({message:"开始时间应小于结束时间",type:"warning"});this.updateTag(e.tagId,{...e,startTime:i,endTime:n}),this.closeTagTimeDialog()},openTagTimeDialog(e={}){if(!e||!Object.keys(e).length)return;let{startTime:t,endTime:i}=e;!t||!i||(this.tagTimeDialog.tag=e,this.tagTimeDialog.timeRange=[t,i],this.tagTimeDialog.visible=!0)},tagClickHandle(e){if(this.readOnly)return;let{e:t,tagItem:i}=e;this.$emit("tagClick",{e:t,tag:i})},clearAllTagSelected(){this.tagList.map(e=>{e.selected=!1}),this.backfillTagListToRowsInfo()},tagblurHandle(){this.autoCloseTagMenu=!0,setTimeout(()=>{if(this&&this.tagMenu_close&&this.autoCloseTagMenu)try{this.tagMenu_close()}catch(e){console.log("tagblurHandle error:",e)}},400)},tagContextmenuHandle(e){this.closeAllMenu("tagContextmenuHandle"),this.autoCloseTagMenu=!1;let{tagItem:t,showOperateMark:i}=e;if(this.readOnly||!i)return;let n=this.getLegendConfig(t),s=t.style,a=+h.delValUnit(s.left),d=+h.delValUnit(s.top),f=+h.delValUnit(s.width),r=+h.delValUnit(s.height),g=5,c=a+f,o=d;this.tagMenu={...this.tagMenu,visible:!0,btnList:n.btnList||[],selectTag:{...t}},this.$nextTick(()=>{let m=this.$refs.tagMenuRefDom,T=this.$refs.paintBoxRefDom;if(!T||!m)return;let{w:u,h:w}=h.getDOMWH(T),{w:D,h:y}=h.getDOMWH(m);c+D+g>u?c=a-D-g:c=c+g,o+y>w&&(o=d-y+r),o=Math.max(o,0),this.tagMenu={...this.tagMenu,style:{left:c+"px",top:o+"px"}}}),this.$emit("tagContextmenu",{tag:t})},tagMenu_close(){this.tagMenu={...this.tagMenu,visible:!1,btnList:[],selectTag:{}}},tagMenuBtnClickHandle(e,t,i){this.readOnly||!t||t.disabled||(this.$emit("tagMenuBtnClick",{e,target:t,triggerIndex:i,tag:{...this.tagMenu.selectTag}}),this.tagMenu_close())},drawGridLine(e,t=[],i=[]){!t.length===2||!i.length===2||(e.beginPath(),e.moveTo(t[0]+.5,t[1]+.5),e.lineTo(i[0]+.5,i[1]+.5),e.lineWidth=1,e.strokeStyle=this.gridLineColor,e.lineCap="butt",e.stroke())},drawDisabledRow(e){if(!e)return;let t=e.getContext("2d"),i=0,n=0;this.rowsInfo.map(s=>{s.disabled&&(t.fillStyle=this.disabledBgColor,t.fillRect(i,n,e.width,s.h)),n+=s.h})},drawGridCanvas(){let e=this.$refs.canvasGridRefDom;if(!e)return;let t=e.width,i=e.height,n=e.getContext("2d");h.clearCanvas(e),this.drawDisabledRow(e);{let s=this.rowsInfo,a=0;s.map((r,g)=>{a+=r.h,(g!==0||g!==s.length-1)&&this.drawGridLine(n,[0,a],[t,a])});let d=this.colsInfo,f=0;d.map((r,g)=>{f+=r.w,(g!==0||g!==d.length-1)&&this.drawGridLine(n,[f,0],[f,i])})}{let s=this.$refs.canvasGanttRefDom;if(!s)return;let a=s.width-1.2,d=s.height-1.2,f=s.getContext("2d"),r={leftTop:[0,0],rightTop:[a,0],rightBottom:[a,d],leftBottom:[0,d]};this.drawGridLine(f,r.leftTop,r.rightTop),this.drawGridLine(f,r.rightTop,r.rightBottom),this.drawGridLine(f,r.leftBottom,r.rightBottom),this.drawGridLine(f,r.leftTop,r.leftBottom),this.drawGridLine(f,[0,this.paintTopVal],[a,this.paintTopVal]),this.drawGridLine(f,[this.paintLeftVal,0],[this.paintLeftVal,d]);let g=this.$refs.ganttBoxRefDom;if(!g)return;let c=g.querySelectorAll(".stat-bottom")||[],o=s.height,m=s.width;for(let T=c.length-1;T>=0;T--){let u=c[T];o-=h.getDOMWH(u).h,this.drawGridLine(f,[0,o],[m,o])}}},drawMoveGuideLineY(e,t){let i=this.$refs.canvasGuideBoxRefDom;if(!i)return;i.offsetHeight;let n=i.getContext("2d");n.setLineDash([5]),n.lineWidth=1,n.beginPath();let s=t;n.moveTo(0,s),n.lineTo(e,s),n.strokeStyle="rgba(0,0,0,0.2)",n.stroke(),e>=this.getScrollLeft()?this.movingTimeLine={...this.movingTimeLine,visible:!0,left:this.canvasLeftToGanTTLeft(e)+"px",title:h._date.format(this.getStartTimeByLeft(e),"HH:mm")}:this.movingTimeLine.visible=!1},clearGuideLine(){h.clearCanvas(this.$refs.canvasGuideBoxRefDom),this.movingTimeLine.visible=!1},calcTagInRowTop(e,t){if(!e||h.isNull(t))return 0;let n=this.rowsInfo.find(g=>g.label===e),s=this.getTagsMapByRowItem(n),a=k,d=this.legend,f=_,r=0;for(let g=0;gs.label===e);return i<0?0:this.calcRowTopByRowIndex(i)},calcRowHeightByRowsInfoItem(e={}){let t=2*B,i=this.getTagsMapByRowItem(e),n=Object.keys(i).length;return n>0&&(t+=n*k+(n-1)*_,t=Math.max(t,H)),Math.max(t,S)},renderToDom(){let e=this.$refs.ganttBoxRefDom;if(!e)return;let t=+this.colsInfo.reduce((n,s)=>n+=Number(s.w),0),i=+this.rowsInfo.reduce((n,s)=>n+=Number(s.h),0);this.paintBoxInfo.width=t,this.paintBoxInfo.height=i;{let n=this.$refs.paintBoxRefDom;n.style.width=t+"px",n.style.height=i+"px"}(e.querySelectorAll(".paint-row")||[]).forEach((s,a)=>{h.setDOMH(s,this.rowsInfo[a].h)}),(e.querySelectorAll(".paint-col")||[]).forEach((s,a)=>{h.setDOMW(s,this.colsInfo[a].w)});{let n=this.$refs.ganttBoxRefDom,s=this.$refs.canvasGanttRefDom;h.setCanvasWH(s,h.getDOMWH(n).w,h.getDOMWH(n).h)}{let n=this.$refs.canvasGridRefDom;h.setCanvasWH(n,t,i)}{let n=this.$refs.canvasGuideBoxRefDom;h.setCanvasWH(n,t,i)}},factoryColsInfoItem({w:e,t}){return{w:e,label:h._date.format(t,"YYYY-MM-DD")}},calcWHCore(e=[]){(!e||!e.length)&&(e=this.rowsInfo);let t=this.$refs.headerBoxRefDom;if(!t||!t.parentNode)return;let i=h.getDOMWH(t).w,n=Math.max(Q,(i/this.dateDuration).toFixed(2)),s=Array.from({length:this.dateDuration}).map((f,r)=>this.factoryColsInfoItem({w:n,t:h._date.add(this.startDate,r,"day")}));if(s.length>0){let f=[s[0].label,s.at(-1).label],r=[],g=[],c=Math.abs(+this.decreaseDayNum);c>0&&(r=Array.from({length:c}).map((m,T)=>this.factoryColsInfoItem({w:n,t:h._date.add(f[0],-1*(T+1),"day")})));let o=Math.abs(+this.IncreaseDayNum);o>0&&(g=Array.from({length:o}).map((m,T)=>this.factoryColsInfoItem({w:n,t:h._date.add(f[1],T+1,"day")}))),s=[...r.reverse(),...s,...g]}else return console.error("任务持续时间为空!甘特图渲染失败!");this.colsInfo=s;let a=e.map(f=>({...f,h:+this.calcRowHeightByRowsInfoItem(f)}));this.rowsInfo=a;let d=this.$refs.ganttBoxRefDom;if(d){if(this.selfAdaptionGanTTHeight){let{h:f}=h.getDOMWH(d),r=f-this.paintTopVal-this.getSummaryRowsHeight();r<=0&&(r=this.rowsInfo.reduce((c,o)=>c+o.h,0));let g=a.reduce((c,o)=>c+o.h,0);if(r>=g){let c=0;a.map(m=>{m.tags&&m.tags.length&&c++});let o=Number(((r-g)/c).toFixed(6));a.map(m=>{m.tags&&m.tags.length&&(m.h=Math.floor(o+m.h))})}this.ganTTBottomHeight=r}this.rowsInfo=a}},getTimeColW(){return this.colsInfo.length&&this.colsInfo[0].w||0},getDurationTimeWidth(){return this.getTimeColW()*this.dateDuration},getSummaryRowsHeight(){let e=this.$refs.ganttBoxRefDom;if(!e)return 0;let t=e.querySelectorAll(".stat-bottom")||[],i=0;for(let n=t.length-1;n>=0;n--){let s=t[n];i+=h.getDOMWH(s).h}return i},refreshGTTWH(){this.calcWHCore(),this.renderToDom(),this.drawGridCanvas(),this.createTagList(),this.showAxisTime(this.markLineTime),this.tickTimeLineHandle()},tagChangThenRefreshAll(){this.backfillTagListToRowsInfo(),this.refreshGTTWH()},getdecreaseDayWidth(){return this.getTimeColW()*Math.abs(this.decreaseDayNum)},scrollXToLastPercent(){let e=this.$refs.scrollXBarDom;e&&this.scrolledXPercent>=0&&this.scrollGanTTXTo(e.scrollWidth*this.scrolledXPercent/100)},scrollToDurationTime(){this.scrollGanTTXTo(this.getdecreaseDayWidth())},scrollGanTTXTo(e=0){let t=this.$refs.scrollXBarDom;t&&(t.scrollLeft=e||0)},getScrollLeft(){let e=this.$refs.scrollXBarDom;return e?e.scrollLeft:0},scrollXHandle(e){this.closeAllMenu("scrollXHandle");let t=this.$refs.ganttBoxRefDom,i=this.$refs.scrollXBarDom,n=this.$refs.paintBoxRefDom;if(!t||!i||!n)return;let s=t.querySelectorAll(".scrollX"),a=-1*(this.getScrollLeft()||0);s.forEach(d=>{d.style.transform=`translateX(${a}px)`}),n.style.left=`${a}px`,this.showAxisTime(this.markLineTime),this.tickTimeLineHandle(),this.scrolledXPercent=Number((this.getScrollLeft()/i.scrollWidth).toFixed(6))*100},addScrollXEvent(){let e=this.$refs.scrollXBarDom;e&&e.addEventListener("scroll",this.scrollXHandle,!1)},removeScrollXEvent(){let e=this.$refs.scrollXBarDom;e&&e.removeEventListener("scroll",this.scrollXHandle)},scrollGanTTYTo(e=0){let t=this.$refs.scrollYBarDom;t&&(t.scrollTop=e||0)},getScrollTop(){let e=this.$refs.scrollYBarDom;return e?e.scrollTop:0},scrollYHandle(e){this.closeAllMenu("scrollYHandle");let t=this.$refs.ganttBoxRefDom,i=this.$refs.scrollYBarDom;if(!t||!i)return;let n=t.querySelectorAll(".scrollY"),s=-1*(this.getScrollTop()||0);n.forEach(a=>{a.style.transform=`translateY(${s}px)`})},mousewheelHandle(e){let t=this.$refs.scrollYBarDom;t&&t.scrollHeight!==t.offsetHeight&&(e.stopPropagation(),e.preventDefault(),this.scrollTimer&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{let i=-e.deltaY||e.wheelDeltaY,n=this.$refs.scrollYBarDom;if(!n)return;let s=n.scrollTop,a=h.getDOMWH(n).h/6;i<0||(a=-1*a),n.scrollTop=s+a,this.scrollYHandle()}))},addScrollYEvent(){let e=this.$refs.scrollYBarDom,t=this.$refs.paintBoxRefDom;!e||!t||(e.addEventListener("scroll",this.scrollYHandle,!1),t.addEventListener("mousewheel",this.mousewheelHandle,!1))},removeScrollYEvent(){this.scrollTimer&&clearTimeout(this.scrollTimer);let e=this.$refs.scrollYBarDom,t=this.$refs.paintBoxRefDom;!e||!t||(e.removeEventListener("scroll",this.scrollYHandle),t.removeEventListener("mousewheel",this.mousewheelHandle,!1))},clickShowMarkLine(e){if(!this.showMarkLine)return;let t=e.x||e.pageX||0,i=this.$refs.ganttBoxRefDom;if(!i)return;let{left:n}=i.getBoundingClientRect(),s=t-n;if(si||n=this.getScrollLeft()?this.currentTimeLine={...this.currentTimeLine,visible:!0,left:this.canvasLeftToGanTTLeft(s)+"px",title:h._date.format(n,"HH:mm")}:this.hide_TickTimerLine()},init_TickTimer(){clearTimeout(this.tickCurrentTimer),this.tickCurrentTimer=setTimeout(()=>{this.tickTimeLineHandle(),this.init_TickTimer()},1e3)},rightMenu_init(){let e=this.$refs.paintBoxRefDom;e&&(e.oncontextmenu=t=>{let i=t||window.event;if(i.preventDefault(),this.closeAllMenu("rightMenu_init"),this.readOnly||this.draging.tagItemDom)return!1;let n=this.$refs.rightClickMenuRefDom;if(!n)return;let s=i.offsetX,a=i.offsetY;if(this.disabledRowSilent&&this.judgeYisInDisabledRow(a))return!1;n.style.display="block",this.rightMenuTemObj=this.pixelToDataCoordinate(s,a);let{w:d,h:f}=h.getDOMWH(this.$refs.boxRightRefDom),r=this.getScrollTop()||0,g=this.getScrollLeft()||0,{w:c,h:o}=h.getDOMWH(n);return c+s>d+g&&(s=s-c),a+o>f+r&&(a=a-o),n.style.left=s+"px",n.style.top=a+"px",!1})},rightMenu_close(){let e=this.$refs.rightClickMenuRefDom;e&&(e.style.display="none")},rightClickMenuEvent(e,t,i){this.readOnly||!t||t.disabled||(this.$emit("rightClickMenuClick",{e,target:t,triggerIndex:i,coordsInfo:this.rightMenuTemObj}),this.rightMenu_close())},taskMenu_Open(e,t={}){if(e.stopPropagation(),e.preventDefault(),this.closeAllMenu("taskMenu_Open"),this.readOnly||!t||!Object.keys(t).length)return;let i=[];if(t.taskMenuList?i=t.taskMenuList:i=this.taskMenuList,i.length){let n=this.calcRowTopByRowLabel(t.label),s=this.paintLeftVal+4,a=this.paintTopVal+n+t.h-this.getScrollTop()-10;this.taskMenu.visible=!0,this.taskMenu.btnList=i,this.taskMenu={...this.taskMenu,visible:!0,btnList:i,selectRow:{...t}},this.$nextTick(()=>{let d=this.$refs.ganttBoxRefDom,f=this.$refs.taskMenuRefDom;if(d&&f){let r=h.getDOMWH(d).h,g=h.getDOMWH(f).h;g+a>r&&(a=r-g)}else return;this.taskMenu={...this.taskMenu,style:{left:s+"px",top:a+"px"}}})}else this.taskMenu_close()},taskMenu_close(){this.taskMenu={...this.taskMenu,visible:!1,btnList:[],selectRow:{}}},taskMenuBtnClick(e,t,i){this.readOnly||!t||t.disabled||(this.$emit("taskMenuBtnClick",{e,target:t,triggerIndex:i,rowData:{...this.taskMenu.selectRow,tags:this.getTagsByRowLabel(this.taskMenu.selectRow.label)}}),this.taskMenu_close())},getTagsByRowLabel(e=""){return e?this.tagList.filter(t=>t.parentKey===e).map(t=>this.backfillTag(t)):[]},getTimePierceTags(e=""){if(!e)return[];let t=[],i=new Date(e).getTime();return this.tagList.map(n=>{let{startTime:s,endTime:a}=n;i>=new Date(s).getTime()&&i<=new Date(a).getTime()&&t.push({...n,data:this.backfillTag(n)})}),t},getRowsData(){return this.backfillTagListToRowsInfo(),this.refreshGTTWH(),this.rowsInfo.map(e=>{let t={...e,tags:e.tags.map(i=>{let n={...i};return delete n.tagId,n})};return delete t.h,t})},getAllSelectedTags(){let e=[];return this.tagList.map(t=>{t.selected&&e.push({...t,data:this.backfillTag(t)})}),e},closeAllMenu(e){this.rightMenu_close(),this.taskMenu_close(),this.tagMenu_close()},ganTTblur(){this.closeAllMenu("ganTTblur")},ganTTClick(e){this.closeAllMenu("ganTTClick"),this.clickShowMarkLine(e)},event_windowResize(){clearTimeout(this.tickTimer),this.tickTimer=setTimeout(()=>{console.log("甘特图 resize...");try{this.closeAllMenu("event_windowResize"),this.refreshGTTWH(),this.isFirstInit&&this.$nextTick(()=>{this.isFirstInit=!1,this.scrollToDurationTime()})}catch(e){console.error("甘特图 resize error:",e)}},50)},init(){this.dodgeTagsInfo={},this.calcWHCore(R(this.rows)),this.addEvents(),this.init_TickTimer()},addEvents(){this.removeEvents();let e=this.$refs.ganttBoxRefDom;M=new ResizeObserver(this.event_windowResize),M.observe(e),this.addScrollXEvent(),this.addScrollYEvent(),this.rightMenu_init()},removeEvents(){let e=this.$refs.ganttBoxRefDom;e&&(M==null||M.unobserve(e)),this.removeScrollXEvent(),this.removeScrollYEvent(),clearTimeout(this.tickCurrentTimer)}},mounted(){this.init()},beforeDestroy(){this.removeEvents()}},Z={class:"gantt-chart-wrap"},ee={ref:"canvasGanttRefDom"},te={class:"header-right"},ie={class:"scrollX",ref:"headerBoxRefDom"},le={class:"name"},ne=["onContextmenu"],se={class:"name"},ae={class:"box-right",ref:"boxRightRefDom"},oe={class:"box-paint scrollY",ref:"paintBoxRefDom",style:{"text-align":"right"}},re={ref:"canvasGridRefDom"},he={ref:"canvasGuideBoxRefDom",style:{"z-index":"99"}},ge=["onClick"],de=["onClick"],fe={class:"scrollXBar",ref:"scrollXBarDom"},ce={class:"scrollYBar",ref:"scrollYBarDom"},me={class:"stat-bottom_right"},Te={class:"scrollX"},ue={class:"name"},pe=["onClick"],ye={class:"dialog-footer"};function we(e,t,i,n,s,a){const d=l.resolveComponent("yTimeLine"),f=l.resolveComponent("tagItem"),r=l.resolveComponent("el-date-picker"),g=l.resolveComponent("el-button"),c=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",Z,[l.createElementVNode("div",{class:"gap",style:l.normalizeStyle({background:i.ganttBgColor})},null,4),l.createElementVNode("div",{style:l.normalizeStyle({background:i.ganttBgColor}),tabindex:"-2",class:"gantt-chart-box",ref:"ganttBoxRefDom",onClick:t[5]||(t[5]=(...o)=>a.ganTTClick&&a.ganTTClick(...o)),onBlur:t[6]||(t[6]=(...o)=>a.ganTTblur&&a.ganTTblur(...o)),onContextmenu:t[7]||(t[7]=(...o)=>s.utils.oncontextmenuDisabled&&s.utils.oncontextmenuDisabled(...o))},[l.createVNode(d,l.normalizeProps(l.guardReactiveProps(s.currentTimeLine)),null,16),l.createVNode(d,l.normalizeProps(l.guardReactiveProps(s.markLine)),null,16),l.createVNode(d,l.mergeProps(s.movingTimeLine,{style:{"z-index":"20"}}),null,16),l.createElementVNode("canvas",ee,"您的浏览器不支持 HTML5 canvas标签",512),l.createElementVNode("div",{class:"row-header",style:l.normalizeStyle({height:i.paintTop})},[l.createElementVNode("span",{class:"gt-title",ref:"titleRefDom",style:l.normalizeStyle({width:i.paintLeft,height:i.paintTop})},l.toDisplayString(i.title),5),l.createElementVNode("div",te,[l.createElementVNode("div",ie,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(s.colsInfo,(o,m)=>(l.openBlock(),l.createElementBlock("span",{class:"paint-col",key:m},[l.createElementVNode("span",le,l.toDisplayString(s.utils._date.format(o.label,i.timeFormat)),1),l.createElementVNode("i",{class:"sLine",style:l.normalizeStyle({background:i.gridLineColor})},null,4)]))),128))],512)])],4),l.createElementVNode("div",{class:"row-bottom",style:l.normalizeStyle({height:s.ganTTBottomHeight?s.ganTTBottomHeight+"px":""})},[l.createElementVNode("div",{class:"box-left scrollY",style:l.normalizeStyle({width:i.paintLeft})},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(s.rowsInfo,(o,m)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass({"paint-row":!0,disabled:o.disabled,canSelected:i.taskMenuList.length||o.taskMenuList,selected:s.taskMenu.selectRow&&s.taskMenu.selectRow.label===o.label}),key:m,style:l.normalizeStyle({backgroundColor:o.disabled?i.disabledBgColor:""}),onContextmenu:l.withModifiers(T=>a.taskMenu_Open(T,o),["stop"])},[l.createElementVNode("span",se,l.toDisplayString(o.label),1),l.createElementVNode("i",{class:"sLine",style:l.normalizeStyle({background:i.gridLineColor})},null,4)],46,ne))),128))],4),l.createElementVNode("div",ae,[l.createElementVNode("div",oe,[l.createElementVNode("canvas",re,"您的浏览器不支持 HTML5 canvas标签",512),l.createElementVNode("canvas",he,"您的浏览器不支持 HTML5 canvas标签",512),l.createElementVNode("div",{class:"rightClickMenu",ref:"rightClickMenuRefDom",onContextmenu:t[1]||(t[1]=(...o)=>s.utils.oncontextmenuDisabled&&s.utils.oncontextmenuDisabled(...o))},[l.createElementVNode("ul",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.rightClickMenuList,(o,m)=>(l.openBlock(),l.createElementBlock("li",{class:l.normalizeClass({disabled:o.disabled}),onClick:l.withModifiers(T=>a.rightClickMenuEvent(T,o,m),["stop"]),onContextmenu:t[0]||(t[0]=l.withModifiers((...T)=>s.utils.oncontextmenuDisabled&&s.utils.oncontextmenuDisabled(...T),["stop"])),key:`${o}-${m}}}`},l.toDisplayString(o.label),43,ge))),128))])],544),l.withDirectives(l.createElementVNode("ul",{class:"tag-menu",ref:"tagMenuRefDom",style:l.normalizeStyle(s.tagMenu.style),onClick:t[3]||(t[3]=o=>s.autoCloseTagMenu=!1)},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(s.tagMenu.btnList,(o,m)=>(l.openBlock(),l.createElementBlock("li",{key:`${o.label}-${m}}`,class:l.normalizeClass({disabled:o.disabled}),onClick:l.withModifiers(T=>a.tagMenuBtnClickHandle(T,o,m),["stop"]),onContextmenu:t[2]||(t[2]=l.withModifiers((...T)=>s.utils.oncontextmenuDisabled&&s.utils.oncontextmenuDisabled(...T),["stop"]))},l.toDisplayString(o.label),43,de))),128))],4),[[l.vShow,s.tagMenu.visible]]),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(s.tagList,o=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[o.hide?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(f,{key:o.tagId,tipWdith:i.tipWdith,tagItem:o,tagMoveCallback:a.tagMove,onTagDragStart:a.tagDragStart,onChangeEnd:a.tagChangeEnd,style:l.normalizeStyle({background:a.getLegendConfig(o).color||"#000000"}),dragable:a.tagItemDragable(o),closeTip:a.tagItemCloseTip(o),showOperateMark:a.tagHasOperateMenu(o),showSelected:i.showSelected,onTagContextmenu:a.tagContextmenuHandle,onTagClick:a.tagClickHandle,onTagBlur:a.tagblurHandle,tipEnterable:i.tipEnterable},{tagTip:l.withCtx(({tagData:m})=>[l.renderSlot(e.$slots,"tagTip",{tagData:m},void 0,!0)]),_:2},1032,["tipWdith","tagItem","tagMoveCallback","onTagDragStart","onChangeEnd","style","dragable","closeTip","showOperateMark","showSelected","onTagContextmenu","onTagClick","onTagBlur","tipEnterable"]))],64))),256))],512),l.createElementVNode("div",fe,[l.createElementVNode("div",{style:l.normalizeStyle({width:this.paintBoxInfo.width+"px"})},null,4)],512)],512),l.createElementVNode("div",ce,[l.createElementVNode("div",{style:l.normalizeStyle({height:this.paintBoxInfo.height+"px"})},null,4)],512)],4),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.summaryRows,(o,m)=>(l.openBlock(),l.createElementBlock("div",{class:"stat-bottom",key:m},[o.length>0?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("div",{class:"stat-bottom_title",style:l.normalizeStyle({width:i.paintLeft,minHeight:s.rowMinRowHeight})},l.toDisplayString(o[0]),5),l.createElementVNode("div",me,[l.createElementVNode("div",Te,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(s.colsInfo,(T,u)=>(l.openBlock(),l.createElementBlock("span",{class:"stat-bottom_col",key:`${m}-${u}`,style:l.normalizeStyle({width:`${s.colsInfo[u]?s.colsInfo[u].w:0}px`})},[l.createElementVNode("span",ue,l.toDisplayString(o[u+1]),1),l.createElementVNode("i",{class:"sLine",style:l.normalizeStyle({background:i.gridLineColor})},null,4)],4))),128))])])],64)):l.createCommentVNode("",!0)]))),128)),l.withDirectives(l.createElementVNode("ul",{class:"task-menu",ref:"taskMenuRefDom",style:l.normalizeStyle(s.taskMenu.style)},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(s.taskMenu.btnList,(o,m)=>(l.openBlock(),l.createElementBlock("li",{key:`${o.label}-${m}}`,class:l.normalizeClass({disabled:o.disabled}),onClick:l.withModifiers(T=>a.taskMenuBtnClick(T,o,m),["stop"]),onContextmenu:t[4]||(t[4]=l.withModifiers((...T)=>s.utils.oncontextmenuDisabled&&s.utils.oncontextmenuDisabled(...T),["stop"]))},l.toDisplayString(o.label),43,pe))),128))],4),[[l.vShow,s.taskMenu.visible]])],36),l.createVNode(c,{title:"时间选择",modelValue:s.tagTimeDialog.visible,"onUpdate:modelValue":t[9]||(t[9]=o=>s.tagTimeDialog.visible=o),width:"450px","close-on-click-modal":!1},{footer:l.withCtx(()=>[l.createElementVNode("span",ye,[l.createVNode(g,{onClick:a.closeTagTimeDialog},{default:l.withCtx(()=>[l.createTextVNode("取 消")]),_:1},8,["onClick"]),l.createVNode(g,{type:"primary",onClick:a.confirmTagTimeDlaiog},{default:l.withCtx(()=>[l.createTextVNode("确 定")]),_:1},8,["onClick"])])]),default:l.withCtx(()=>[l.createElementVNode("div",null,[l.createVNode(r,{modelValue:s.tagTimeDialog.timeRange,"onUpdate:modelValue":t[8]||(t[8]=o=>s.tagTimeDialog.timeRange=o),type:"datetimerange","picker-options":s.pickerOptions,"range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"yyyy/MM/dd HH:mm:ss"},null,8,["modelValue","picker-options"])])]),_:1},8,["modelValue"])])}const N=C(J,[["render",we],["__scopeId","data-v-f58ae14c"]]),De=[N],I=function(e){I.installed||(I.installed=!0,De.forEach(t=>{e.component(t.name,t)}))};typeof window<"u"&&window.Vue&&I(window.Vue),b.default=N,b.install=I,Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});