index.91be51e5.js 4.0 KB

1
  1. import L from"./test.83a7187b.js";import x from"./test-left.4bc72e00.js";import H from"./test-timeline.e4a93be6.js";import k from"./test-markline.a6ec42a4.js";import{a as o,_ as A,c,e as N,k as S,i as d,h as p,m as w}from"./index.0308b213.js";import{M as _}from"./mock.623ff5e5.js";const b=["(252, 105, 100)","(247, 167, 71)","(116, 202, 90)","(83, 186, 241)","(208, 142, 2231)"],v="\u5E0C\u671B\u53F7,\u98DE\u7FFC\u53F7,\u5149\u660E\u53F7,\u7AA5\u63A2\u53F7,\u529B\u795E\u53F7,\u8B66\u5B98\u53F7,\u95EA\u7535\u6D41\u661F\u53F7,\u535A\u58EB\u53F7,\u9739\u96F3\u706B\u795E\u53F7,\u72D9\u51FB\u624B\u53F7,\u5E0C\u671B\u4E4B\u5149\u53F7,\u5357\u6D77\u5FCD\u8005\u53F7,\u706B\u901FE3\u53F7,\u5C71\u795E\u53F7,\u5B89\u5168\u536B\u58EB\u53F7,\u94C1\u9524\u53F7,\u5BFF\u661F\u53F7,\u661F\u661F\u53F7,\u7F57\u66FC\u65AF\u5361,\u6B32\u671B\u53F7,\u9739\u96F3\u96F7\u7535\u53F7,\u6D88\u9632\u53F7,\u6B27\u6D32\u4E4B\u661F\u53F7".split(","),D="\u{1F685},\u{1F688},\u{1F684}".split(","),r=_.Random;let m=10,u=[new Date(2e3,10,10,10,10),new Date(2e3,10,11,10,10)];var K={id:()=>"JHR"+r.natural(100,999)+r.character("upper")+r.character("upper"),name:()=>r.pick(v),type:()=>r.pick(D),colorPair:()=>{let e="rgb"+r.pick(b);return{dark:e.replace(")",",0.8)"),light:e.replace(")",",0.1)")}},speed:()=>r.natural(0,200),gtArray:()=>{let e=[],i=0,a=r.natural(m-1,m),s=o(u[0]).subtract(12,"hour"),t=o(u[0]).subtract(12,"hour");for(;i<a;)s=t.add(r.natural(1,5),"hour"),t=s.add(r.natural(1,5),"hour"),e.push({id:r.character("upper")+r.character("upper")+r.natural(1e3,9999),passenger:r.natural(10,200),start:s.toString(),end:t.toString()}),i++;return e}};function h(e,i,a){m=i,u=a;let s=[];for(let t=0,l=r.natural(e,e);t<l;t++)s.push(_.mock(K));return console.log("\u6A21\u62DF\u6570\u636E::",s),s}const W="1,2,3,4,5,6,10,12,15,20,30,60,120,180,240,360,720,1440,2880,4320".split(",").map(e=>{let i=parseInt(e),a;return i<60?a=i+"minute":i>=60&&i<1440?a=i/60+"hour":a=i/1440+"day",{value:i,label:a}}),B={name:"App",components:{Test:L,TestLeft:x,TestTimeline:H,TestMarkline:k},data(){return{timeLines:[{time:o().add(2,"hour").toString(),text:"~~"},{time:o().add(5,"hour").toString(),text:"try",color:"#747e80"}],currentTime:o(),cellWidth:100,cellHeight:30,titleHeight:40,titleWidth:250,scale:60,times:[o().subtract(5,"hour").toString(),o().add(29,"day").add(2,"hour").toString()],rowNum:100,colNum:10,datasA:[],datasB:[],dataKey:"id",scaleList:W,scrollToTime:o().add(1,"day").toString(),scrollToPostion:{x:1e4,y:1e4},hideHeader:!1,hideSecondGantt:!1,arrayKeys:["gtArray","error"],scrollToY:0,positionB:{},positionA:{}}},watch:{rowNum:"updateData",colNum:"updateData",times:"updateData",scrollToY(e){this.positionA={x:e}}},mounted(){this.updateData()},methods:{updateData(){this.datasA=h(this.rowNum,this.colNum,this.times),this.datasB=h(this.rowNum,this.colNum,this.times)},updateTimeLines(e,i){this.timeLines=[{time:e,text:"\u81EA\u5B9A\u4E49"},{time:i,text:"\u6D4B\u8BD5",color:"#747e80"}]},scrollLeftA(e){this.positionB={x:e}},scrollLeftB(e){this.positionA={x:e}}}},P=w("\u94C1\u80C6\u706B\u8F66\u4FA0\u65E5\u7A0B\u8868 ");function j(e,i,a,s,t,l){const T=c("Test"),g=c("TestLeft"),f=c("v-gantt-chart");return N(),S(f,{startTime:t.times[0],endTime:t.times[1],cellWidth:t.cellWidth,cellHeight:t.cellHeight,timeLines:t.timeLines,titleHeight:t.titleHeight,scale:t.scale,titleWidth:t.titleWidth,showCurrentTime:"",hideHeader:t.hideHeader,dataKey:t.dataKey,arrayKeys:t.arrayKeys,scrollToPostion:t.positionA,onScrollLeft:l.scrollLeftA,datas:t.datasA},{block:d(({data:n,item:y})=>[p(T,{data:n,updateTimeLines:l.updateTimeLines,cellHeight:t.cellHeight,currentTime:t.currentTime,item:y},null,8,["data","updateTimeLines","cellHeight","currentTime","item"])]),left:d(({data:n})=>[p(g,{data:n},null,8,["data"])]),title:d(()=>[P]),_:1},8,["startTime","endTime","cellWidth","cellHeight","timeLines","titleHeight","scale","titleWidth","hideHeader","dataKey","arrayKeys","scrollToPostion","onScrollLeft","datas"])}const Y=A(B,[["render",j],["__scopeId","data-v-bed19728"]]);export{Y as default};