@studio-west/employees 0.7.7 → 0.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WorkTable.cjs +2 -2
- package/dist/WorkTable.js +2 -2
- package/package.json +1 -1
package/dist/WorkTable.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),he=require("file-saver"),fe=require("exceljs"),v=require("./index-uKIn9vG1.cjs"),pe=require("vue-i18n"),i=require("element-plus"),oe=require("@imengyu/vue3-context-menu");function ye(V){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(V){for(const D in V)if(D!=="default"){const m=Object.getOwnPropertyDescriptor(V,D);Object.defineProperty(r,D,m.get?m:{enumerable:!0,get:()=>V[D]})}}return r.default=V,Object.freeze(r)}const we=ye(fe),ke={class:"work"},Ce={class:"nav"},Ve={style:{height:"100px",width:"100%",display:"inline-block"}},Se={style:{height:"100px",width:"100%",display:"inline-block"}},xe={key:0,class:"controls-container",style:{"margin-top":".5rem"}},De={class:"label"},Ne={key:0,style:{padding:"0.5em 1.5em"}},be={key:1,style:{padding:"0.5em 1.5em"}},Ee={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},query:Object},setup(V){var _,ee,le,te,ae,ne;const{t:r,d:D}=pe.useI18n(),m=V,I=e.ref(!1),n=e.ref([]),P=e.ref((_=m.query)!=null&&_.date?new Date(((ee=m.query)==null?void 0:ee.date)+"T00:00:01").getMonth():new Date().getMonth()),W=e.ref(!1),A=e.ref([]),f=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1)),u=e.ref([]),b=e.ref([0,0]),y=e.ref(9),p=e.ref(8),R=e.ref(!1),M=e.ref(!1),L=e.ref("5"),F=e.ref(1),S=e.ref([]),G=e.ref([]),E=e.ref([]),j=e.ref([]),g=e.ref({name:"Имя",length:0,code:""}),z=e.ref(!1),J=e.ref({zIndex:3,minWidth:230,x:500,y:200}),x=e.ref({}),q=e.ref("100%");e.watch(S,async(t,l)=>{t!==l&&(E.value=[],R.value=!1,m.odata.personal.forEach(o=>{t.includes(o.divisionName)&&(E.value.some(d=>(d==null?void 0:d.activeText)===o.roleName)||E.value.push({val:!0,activeText:o.roleName}))}),Z())}),e.watch(P,async t=>{let l=new Date().getMonth(),o=t===null?l:t-1;o=l-1<=o?o-l>=11?o-12:o:o+12,f.value=new Date(new Date().getFullYear(),o,1),Q()});const ue=(t,l,o,d)=>{g.value.ids=t.ids,g.value.key=t.key,g.value.add=t.days.length>0&&t.days[t.days.length-1].cont,g.value.level=l.level,g.value.day=o.cellIndex,J.value.y=d.clientY,J.value.x=d.clientX,l.level===2&&l.no===0&&m.checkEdit&&(g.value.name=r("workSchedule.autocomplete"),z.value=!0),l.level===3&&o.cellIndex-l.no===1&&m.checkEdit&&(B(o.cellIndex,t.ids),g.value.name=r("workSchedule.modeSelection"),z.value=!0)},re=({row:t,columnIndex:l})=>{if(!A.value||A.value.length===0||!W.value)return"";const o=new Date(new Date(f.value).getFullYear(),new Date(f.value).getMonth(),l).getTime()+1e3;for(let d of A.value){const{dateStart:s,dateEnd:a,code:w}=d;if(s&&a&&w===t.code&&l!==0&&l<=u.value.length){const N=new Date(v.parseDate(s)).getTime(),$=new Date(v.parseDate(a)).getTime();if(o>=N&&o<=$)return"vacation"}}return""},Q=()=>{var a,w,N,$,U,c;const t=new Date(f.value),l=new Date(t.getFullYear(),t.getMonth()+1,0).getDate();let o=[],d=0,s=0;for(let C=1;C<=l;C++){const k=v.parseTime(t.setDate(C),"{Y}-{m}-{dd}");d+=(a=x.value.nowork)!=null&&a.includes(k)||x.value.holidays.includes(k)?0:(w=x.value.preholidays)!=null&&w.includes(k)?7:8,s+=(N=x.value.nowork)!=null&&N.includes(k)||x.value.holidays.includes(k)?0:($=x.value.preholidays)!=null&&$.includes(k)?6:7;const h=(U=x.value.nowork)!=null&&U.includes(k)?"nowork":x.value.holidays.includes(k)?"holiday":(c=x.value.preholidays)!=null&&c.includes(k)?"preholiday":"";o.push({day:C,holidays:h,weekday:D(new Date(t.getFullYear(),t.getMonth(),C),"day")})}b.value[0]=d,b.value[1]=s,u.value=o,m.odata.getPersonal({dismissed:"false"}).then(C=>{var k;S.value.length===0&&(S.value=[(k=C.find(h=>h.employeeName===m.fullName&&h.dismissalDate.length===0))==null?void 0:k.divisionName]),C.forEach((h,H)=>{G.value.some(T=>h.dismissalDate.length>0&&new Date(h.dismissalDate)<new Date(f.value)||(T==null?void 0:T.value)===h.divisionName)||G.value.push({value:h.divisionName,label:h.divisionName,key:H}),S.value.includes(h.divisionName)&&!E.value.some(T=>(T==null?void 0:T.activeText)===h.roleName)&&E.value.push({val:!0,activeText:h.roleName})}),Z()})},ie=e.computed(()=>!n.value.some(t=>t.contHour!==b.value[0]
|
|
1
|
+
"use strict";const e=require("vue"),he=require("file-saver"),fe=require("exceljs"),v=require("./index-uKIn9vG1.cjs"),pe=require("vue-i18n"),i=require("element-plus"),oe=require("@imengyu/vue3-context-menu");function ye(V){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(V){for(const D in V)if(D!=="default"){const m=Object.getOwnPropertyDescriptor(V,D);Object.defineProperty(r,D,m.get?m:{enumerable:!0,get:()=>V[D]})}}return r.default=V,Object.freeze(r)}const we=ye(fe),ke={class:"work"},Ce={class:"nav"},Ve={style:{height:"100px",width:"100%",display:"inline-block"}},Se={style:{height:"100px",width:"100%",display:"inline-block"}},xe={key:0,class:"controls-container",style:{"margin-top":".5rem"}},De={class:"label"},Ne={key:0,style:{padding:"0.5em 1.5em"}},be={key:1,style:{padding:"0.5em 1.5em"}},Ee={__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},odata:Object,workSchedule:Object,fullName:{type:String,default:"Вы"},query:Object},setup(V){var _,ee,le,te,ae,ne;const{t:r,d:D}=pe.useI18n(),m=V,I=e.ref(!1),n=e.ref([]),P=e.ref((_=m.query)!=null&&_.date?new Date(((ee=m.query)==null?void 0:ee.date)+"T00:00:01").getMonth():new Date().getMonth()),W=e.ref(!1),A=e.ref([]),f=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1)),u=e.ref([]),b=e.ref([0,0]),y=e.ref(9),p=e.ref(8),R=e.ref(!1),M=e.ref(!1),L=e.ref("5"),F=e.ref(1),S=e.ref([]),G=e.ref([]),E=e.ref([]),j=e.ref([]),g=e.ref({name:"Имя",length:0,code:""}),z=e.ref(!1),J=e.ref({zIndex:3,minWidth:230,x:500,y:200}),x=e.ref({}),q=e.ref("100%");e.watch(S,async(t,l)=>{t!==l&&(E.value=[],R.value=!1,m.odata.personal.forEach(o=>{t.includes(o.divisionName)&&(E.value.some(d=>(d==null?void 0:d.activeText)===o.roleName)||E.value.push({val:!0,activeText:o.roleName}))}),Z())}),e.watch(P,async t=>{let l=new Date().getMonth(),o=t===null?l:t-1;o=l-1<=o?o-l>=11?o-12:o:o+12,f.value=new Date(new Date().getFullYear(),o,1),Q()});const ue=(t,l,o,d)=>{g.value.ids=t.ids,g.value.key=t.key,g.value.add=t.days.length>0&&t.days[t.days.length-1].cont,g.value.level=l.level,g.value.day=o.cellIndex,J.value.y=d.clientY,J.value.x=d.clientX,l.level===2&&l.no===0&&m.checkEdit&&(g.value.name=r("workSchedule.autocomplete"),z.value=!0),l.level===3&&o.cellIndex-l.no===1&&m.checkEdit&&(B(o.cellIndex,t.ids),g.value.name=r("workSchedule.modeSelection"),z.value=!0)},re=({row:t,columnIndex:l})=>{if(!A.value||A.value.length===0||!W.value)return"";const o=new Date(new Date(f.value).getFullYear(),new Date(f.value).getMonth(),l).getTime()+1e3;for(let d of A.value){const{dateStart:s,dateEnd:a,code:w}=d;if(s&&a&&w===t.code&&l!==0&&l<=u.value.length){const N=new Date(v.parseDate(s)).getTime(),$=new Date(v.parseDate(a)).getTime();if(o>=N&&o<=$)return"vacation"}}return""},Q=()=>{var a,w,N,$,U,c;const t=new Date(f.value),l=new Date(t.getFullYear(),t.getMonth()+1,0).getDate();let o=[],d=0,s=0;for(let C=1;C<=l;C++){const k=v.parseTime(t.setDate(C),"{Y}-{m}-{dd}");d+=(a=x.value.nowork)!=null&&a.includes(k)||x.value.holidays.includes(k)?0:(w=x.value.preholidays)!=null&&w.includes(k)?7:8,s+=(N=x.value.nowork)!=null&&N.includes(k)||x.value.holidays.includes(k)?0:($=x.value.preholidays)!=null&&$.includes(k)?6:7;const h=(U=x.value.nowork)!=null&&U.includes(k)?"nowork":x.value.holidays.includes(k)?"holiday":(c=x.value.preholidays)!=null&&c.includes(k)?"preholiday":"";o.push({day:C,holidays:h,weekday:D(new Date(t.getFullYear(),t.getMonth(),C),"day")})}b.value[0]=d,b.value[1]=s,u.value=o,m.odata.getPersonal({dismissed:"false"}).then(C=>{var k;S.value.length===0&&(S.value=[(k=C.find(h=>h.employeeName===m.fullName&&h.dismissalDate.length===0))==null?void 0:k.divisionName]),C.forEach((h,H)=>{G.value.some(T=>h.dismissalDate.length>0&&new Date(h.dismissalDate)<new Date(f.value)||(T==null?void 0:T.value)===h.divisionName)||G.value.push({value:h.divisionName,label:h.divisionName,key:H}),S.value.includes(h.divisionName)&&!E.value.some(T=>(T==null?void 0:T.activeText)===h.roleName)&&E.value.push({val:!0,activeText:h.roleName})}),Z()})},ie=e.computed(()=>!n.value.some(t=>t.contHour!==b.value[0]&&t.contHour!==b.value[1])),K=(t,l)=>{var a,w,N;const o=new Date(f.value),d=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`,s=(a=n.value[l])==null?void 0:a.days.findIndex($=>$.day===d);return l===-1||s===-1?"":((w=n.value[l].days[s])==null?void 0:w.tips)+`
|
|
2
2
|
`+((N=n.value[l].days[s])==null?void 0:N.time)},Z=()=>{n.value=[],j.value=[],A.value=[],m.odata.personal.forEach(t=>{if(S.value.includes(t.divisionName)&&E.value.some(l=>l.val&&l.activeText===t.roleName)&&(t.dismissalDate.length===0||new Date(t.dismissalDate)>new Date(f.value))){let l=v.byInitials(t.employeeName);n.value.push({name:l+" ("+t.roleName+")",days:[],contHour:0,code:t.employeeKey,id:!1})}}),n.value.sort((t,l)=>t.name<l.name?-1:t.name>l.name?1:0),n.value.forEach((t,l)=>{t.ids=l,j.value.push(t.code)}),m.workSchedule.getUsersYear({code:j.value,year:new Date(f.value).getFullYear()}).then(t=>{t.forEach(l=>{l.dateStart&&A.value.push({code:l.code,dateStart:l.dateStart,dateEnd:l.dateEnd})}),de(),M.value=!1})},de=()=>{m.workSchedule.getWorkSchedule({code:j.value,date:v.parseTime(new Date(f.value),"{Y}-{m}-{dd}")}).then(t=>{t.forEach((l,o)=>{l!==null&&(n.value[o].days=l.data.days,n.value[o].id=l.id)}),Y()})},Y=()=>{n.value.forEach(t=>{t.contHour=t.days.reduce((l,o)=>l+o.time,0)})},se=t=>{n.value[t].days=[],Y()},ve=t=>{switch(L.value){case"5":for(let l=F.value;l<=u.value.length;l++)u.value[l-1].holidays===""&&B(l,t,!0),u.value[l-1].holidays==="preholiday"&&(p.value-=1,B(l,t,!0),p.value+=1);break;case"2x2":for(let l=F.value;l<=u.value.length;l+=4)B(l,t,!0),l+1<=u.value.length&&B(l+1,t,!0);break;case"2x5":for(let l=F.value;l<=u.value.length;l+=7)for(let o=l;o<l+5&&o<=u.value.length;o++)u.value[o-1].holidays==="preholiday"?(p.value-=1,B(o,t,!0),p.value+=1):B(o,t,!0);break}},B=(t,l,o=!1)=>{const{date:d,ind:s}=O(t,l);s===-1?(n.value[l].days.push({day:d,time:p.value,tips:`(${y.value}:00 - ${p.value>=22?y.value+p.value+2:y.value+p.value+1}:00)`}),Y()):o||(p.value=n.value[l].days[s].time,y.value=parseInt(n.value[l].days[s].tips.slice(1,-12)))},ce=(t,l)=>{const{ind:o}=O(t,l);n.value[l].days.splice(o,1),Y(),document.querySelector(".app-main").click()},X=(t,l)=>{const{date:o,ind:d}=O(t,l);n.value[l].days[d]={day:o,time:p.value,tips:`(${y.value}:00 - ${p.value>=22?y.value+p.value+2:y.value+p.value+1}:00)`},Y()},O=(t,l)=>{var s;const o=v.parseTime(new Date(f.value).setDate(t),"{Y}-{m}-{dd}"),d=(s=n.value[l])==null?void 0:s.days.findIndex(a=>a.day===o);return{date:o,ind:d}},me=async()=>{var U;I.value=!0;const t=new we.Workbook,l=t.addWorksheet(D(f.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},d={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},s={vertical:"middle",horizontal:"center",wrapText:!0};l.mergeCells(`A1:${v.cellsDynamically("A1",u.value.length+6)}1`),l.mergeCells(`A2:${v.cellsDynamically("A2",u.value.length+6)}2`),l.mergeCells("A3:A4"),l.mergeCells(`B3:${v.cellsDynamically("B3",u.value.length)}3`),l.mergeCells(`${v.cellsDynamically("B3",u.value.length+1)}3:${v.cellsDynamically("B3",u.value.length+2)}3`),l.mergeCells(`${v.cellsDynamically("B3",u.value.length+3)}3:${v.cellsDynamically("B4",u.value.length+3)}4`),l.mergeCells(`${v.cellsDynamically("B3",u.value.length+4)}3:${v.cellsDynamically("B4",u.value.length+4)}4`),l.mergeCells(`${v.cellsDynamically("B3",u.value.length+5)}3:${v.cellsDynamically("B4",u.value.length+5)}4`),l.getCell("A1").value=r("workSchedule.firm"),l.getCell("A2").value=r("workSchedule.title",{name:S.value[0]})+D(f.value,"month")+` ${new Date(f.value).getFullYear()}`,l.getCell("A3").value=r("workSchedule.month"),l.getCell("B3").value=r("workSchedule.numbersMonth"),l.getCell(3,u.value.length+2).value=r("workSchedule.onSchedule"),l.getCell(3,u.value.length+4).value=r("workSchedule.acquainted"),l.getCell(3,u.value.length+5).value=r("workSchedule.decryption"),l.getCell(3,u.value.length+6).value=r("workSchedule.date"),l.getCell(4,u.value.length+2).value=r("workSchedule.days"),l.getCell(4,u.value.length+3).value=`${r("workSchedule.hours")} (${b.value[0]})`;for(let c=2;c<=u.value.length+1;c++)l.getCell(4,c).value=u.value[c-2].weekday+`
|
|
3
3
|
`+(c-1),l.getColumn(c).width=6,l.getColumn(c).alignment=s,l.getCell(4,c).border=d;l.getRow(1).height=40,l.getRow(2).height=30,l.getRow(3).height=20,l.getColumn(1).width=15,l.getColumn(u.value.length+2).width=5,l.getColumn(u.value.length+3).width=6,l.getColumn(u.value.length+4).width=13,l.getColumn(u.value.length+5).width=13,l.getColumn(u.value.length+6).width=13,l.getColumn(1).alignment=s,l.getCell("A2").alignment=o,l.getCell("A3").alignment=o,l.getCell("B3").alignment=o,l.getCell(3,u.value.length+2).alignment=o,l.getColumn(u.value.length+2).alignment=s,l.getColumn(u.value.length+3).alignment=s,l.getColumn(u.value.length+4).alignment=s,l.getColumn(u.value.length+5).alignment=s,l.getColumn(u.value.length+6).alignment=o,l.getCell("A3").border=d,l.getCell("B3").border=d,l.getCell(3,u.value.length+2).border=d,l.getCell(4,u.value.length+2).border=d,l.getCell(3,u.value.length+4).border=d,l.getCell(3,u.value.length+5).border=d,l.getCell(3,u.value.length+6).border=d,l.getCell(4,u.value.length+3).border=d;let a=0;for(const c of n.value){let C=[c.name];for(let h=1;h<=u.value.length;h++){const{ind:H}=O(h,a);H!==-1?C[h]=`${c.days[H].time} ${c.days[H].tips}`:C[h]=" "}C.push(((U=c.days)==null?void 0:U.length)||" ",c.contHour||0);const k=l.addRow(C);k.border=d,a++}let w="Щербина Е. В.";m.odata.personal.forEach(c=>{c.roleName==="Начальник отдела правовой и кадровой работы"&&(c.dismissalDate.length===0||new Date(c.dismissalDate)>new Date(thisMonth.value))&&(w=c.employeeName)}),l.mergeCells(`A${n.value.length+6}:P${n.value.length+6}`),l.mergeCells(`Q${n.value.length+6}:AG${n.value.length+6}`),l.mergeCells(`B${n.value.length+8}:E${n.value.length+8}`),l.mergeCells(`F${n.value.length+8}:L${n.value.length+8}`),l.mergeCells(`M${n.value.length+8}:P${n.value.length+8}`),l.mergeCells(`S${n.value.length+8}:V${n.value.length+8}`),l.mergeCells(`W${n.value.length+8}:AC${n.value.length+8}`),l.mergeCells(`AD${n.value.length+8}:AG${n.value.length+8}`),l.mergeCells(`Z${n.value.length+9}:AA${n.value.length+9}`),l.getCell(`A${n.value.length+6}`).value=r("workSchedule.byInitials"),l.getCell(`Q${n.value.length+6}`).value=r("workSchedule.supervisorHR"),l.getCell(`B${n.value.length+8}`).value=r("workSchedule.compiled")+":",l.getCell(`S${n.value.length+8}`).value=r("workSchedule.approved")+":",l.getCell(`M${n.value.length+8}`).value=v.byInitials(m.fullName),l.getCell(`AD${n.value.length+8}`).value=v.byInitials(w),l.getCell(`Z${n.value.length+9}`).value=r("workSchedule.printPlace"),l.getCell(`A${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`Q${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`B${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`F${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},l.getCell(`M${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`AD${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},l.getCell(`Z${n.value.length+9}`).alignment=o,l.getCell(`F${n.value.length+8}`).border={bottom:{style:"thin"}},l.getCell(`W${n.value.length+8}`).border={bottom:{style:"thin"}};const N="export_"+v.parseTime(Date.now(),"{dd}.{m}.{Y}")+".xlsx",$=await t.xlsx.writeBuffer();he.saveAs(new Blob([$]),N),I.value=!1},ge=async()=>{R.value||m.workSchedule.addWorkSchedule({data:n.value,date:v.parseTime(new Date(f.value),"{Y}-{m}-{dd}"),group:S.value[0]}).then(t=>R.value=t)};return(((le=m.query)==null?void 0:le.group)??!1)&&(S.value[0]=(te=m.query)==null?void 0:te.group),(((ae=m.query)==null?void 0:ae.date)??!1)&&(f.value=new Date(((ne=m.query)==null?void 0:ne.date)+"T00:00:01")),v.holidays().then(t=>{x.value=t,Q()}),(t,l)=>{const o=e.resolveComponent("el-date-picker"),d=e.resolveComponent("svg-icon"),s=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",Ce,[V.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:S.value,"onUpdate:modelValue":l[0]||(l[0]=a=>S.value=a),multiple:"","collapse-tags":"","collapse-tags-tooltip":"",placeholder:"Select",style:{width:"240px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:a.key,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),V.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:l[1]||(l[1]=a=>M.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(o,{modelValue:P.value,"onUpdate:modelValue":l[2]||(l[2]=a=>P.value=a),type:"month",placeholder:"Выберите месяц",format:"MMM","value-format":"M"},null,8,["modelValue"]),l[21]||(l[21]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(e.unref(i.ElSwitch),{modelValue:q.value,"onUpdate:modelValue":l[3]||(l[3]=a=>q.value=a),"active-text":t.$t("bids.currentHeight"),"active-value":"100%","inactive-value":"calc(100vh - var(--el-component-size)*5 - var(--el-main-padding)*2 - var(--header-height))"},null,8,["modelValue","active-text"]),e.createVNode(e.unref(i.ElSwitch),{modelValue:W.value,"onUpdate:modelValue":l[4]||(l[4]=a=>W.value=a),"active-text":"Отпуска","active-value":!0,"inactive-value":!1},null,8,["modelValue"])]),e.createVNode(e.unref(i.ElTable),{id:"printTable",data:n.value,style:{width:"100%"},"max-height":q.value,size:"small",align:"center",onCellClick:ue,"empty-text":e.unref(r)("workSchedule.emptyText"),"cell-class-name":re},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:S.value[0]})+e.unref(D)(f.value,"month")+` ${new Date(f.value).getFullYear()}`,align:"center",height:"34"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.month"),width:"180",align:"center",fixed:q.value!=="100%"},{default:e.withCtx(a=>[e.createElementVNode("div",Ve,e.toDisplayString(n.value[a.$index].name),1)]),_:1},8,["label","fixed"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.numbersMonth"),align:"center"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:`${f.value.getTime()}-${a.day}`,width:"46","class-name":a.holidays,align:"center",label:a.weekday+`
|
|
4
|
-
`+a.day.toString(),prop:"vacation"},{default:e.withCtx(w=>[e.createElementVNode("div",Se,e.toDisplayString(K(a.day,w.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.onSchedule"),align:"center",fixed:q.value!=="100%"?"right":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.days"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(n.value[a.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(r)("workSchedule.hours")} ( ${b.value[0]} / ${b.value[1]} )`,align:"center"},{default:e.withCtx(a=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${b.value
|
|
4
|
+
`+a.day.toString(),prop:"vacation"},{default:e.withCtx(w=>[e.createElementVNode("div",Se,e.toDisplayString(K(a.day,w.$index)||" "),1)]),_:2},1032,["class-name","label"]))),128))]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.onSchedule"),align:"center",fixed:q.value!=="100%"?"right":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.days"),align:"center"},{default:e.withCtx(a=>[e.createTextVNode(e.toDisplayString(n.value[a.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(r)("workSchedule.hours")} ( ${b.value[0]} / ${b.value[1]} )`,align:"center"},{default:e.withCtx(a=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${b.value.includes(a.row.contHour)?"green":"red"};`)},e.toDisplayString(a.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label","fixed"])]),_:1},8,["label"])]),_:1},8,["data","max-height","empty-text"]),ie.value&&V.checkEdit?(e.openBlock(),e.createElementBlock("div",xe,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),R.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:ge},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.confirm")),1)]),_:1})),l[22]||(l[22]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(V.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:I.value,plain:"",onClick:me,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[s,I.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:M.value,"onUpdate:modelValue":l[7]||(l[7]=a=>M.value=a),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:l[5]||(l[5]=a=>M.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:l[6]||(l[6]=a=>{Z(),M.value=!1})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:E.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,a=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:a.val,"onUpdate:modelValue":w=>a.val=w,"active-text":a.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(oe.ContextMenu),{show:z.value,"onUpdate:show":l[20]||(l[20]=a=>z.value=a),options:J.value},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"mx-context-menu-item",onClick:l[8]||(l[8]=a=>z.value=!1)},[e.createElementVNode("span",De,e.toDisplayString(g.value.name),1),l[23]||(l[23]=e.createElementVNode("div",{class:"expander"},null,-1)),e.createVNode(d,{"icon-class":"cross"})]),e.createVNode(e.unref(oe.ContextMenuSeparator)),g.value.level===2?(e.openBlock(),e.createElementBlock("div",Ne,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:L.value,"onUpdate:modelValue":l[9]||(l[9]=a=>L.value=a),size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElRadioButton),{label:e.unref(r)("workSchedule.Days5"),value:"5"},null,8,["label"]),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 2",value:"2x2"}),e.createVNode(e.unref(i.ElRadioButton),{label:"2 Х 5",value:"2x5"})]),_:1},8,["modelValue"]),l[24]||(l[24]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.fromDate"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:F.value,"onUpdate:modelValue":l[10]||(l[10]=a=>F.value=a),step:1,min:1,max:u.value.length},null,8,["modelValue","max"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:y.value,"onUpdate:modelValue":l[11]||(l[11]=a=>y.value=a),step:1,min:0,max:19},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[12]||(l[12]=a=>p.value=a),step:1,min:4,max:e.unref(v.clamp)(y.value!==1?23-y.value:21,4,22)},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[13]||(l[13]=a=>ve(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.fillOut")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[14]||(l[14]=a=>se(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",be,[e.createElementVNode("div",null,e.toDisplayString(K(g.value.day,g.value.ids)),1),l[25]||(l[25]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.with"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:y.value,"onUpdate:modelValue":l[15]||(l[15]=a=>y.value=a),step:1,min:0,max:19,onChange:l[16]||(l[16]=a=>X(g.value.day,g.value.ids))},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:p.value,"onUpdate:modelValue":l[17]||(l[17]=a=>p.value=a),step:1,min:4,max:e.unref(v.clamp)(y.value!==1?23-y.value:21,4,22),onChange:l[18]||(l[18]=a=>X(g.value.day,g.value.ids))},null,8,["modelValue","max"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:l[19]||(l[19]=a=>ce(g.value.day,g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}};module.exports=Ee;
|
package/dist/WorkTable.js
CHANGED
|
@@ -82,7 +82,7 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
82
82
|
oe.value.some((Y) => p.dismissalDate.length > 0 && new Date(p.dismissalDate) < new Date(y.value) || (Y == null ? void 0 : Y.value) === p.divisionName) || oe.value.push({ value: p.divisionName, label: p.divisionName, key: Z }), D.value.includes(p.divisionName) && !A.value.some((Y) => (Y == null ? void 0 : Y.activeText) === p.roleName) && A.value.push({ val: !0, activeText: p.roleName });
|
|
83
83
|
}), ie();
|
|
84
84
|
});
|
|
85
|
-
}, Me = Ye(() => !n.value.some((l) => l.contHour !== T.value[0]
|
|
85
|
+
}, Me = Ye(() => !n.value.some((l) => l.contHour !== T.value[0] && l.contHour !== T.value[1])), ce = (l, e) => {
|
|
86
86
|
var a, $, N;
|
|
87
87
|
const u = new Date(y.value), i = `${u.getFullYear()}-${(u.getMonth() + 1).toString().padStart(2, "0")}-${l.toString().padStart(2, "0")}`, s = (a = n.value[e]) == null ? void 0 : a.days.findIndex((B) => B.day === i);
|
|
88
88
|
return e === -1 || s === -1 ? "" : (($ = n.value[e].days[s]) == null ? void 0 : $.tips) + `
|
|
@@ -311,7 +311,7 @@ const _e = { class: "work" }, el = { class: "nav" }, ll = { style: { height: "10
|
|
|
311
311
|
}, {
|
|
312
312
|
default: g((a) => [
|
|
313
313
|
k("div", {
|
|
314
|
-
style: Ie(`color: ${T.value
|
|
314
|
+
style: Ie(`color: ${T.value.includes(a.row.contHour) ? "green" : "red"};`)
|
|
315
315
|
}, h(a.row.contHour), 5)
|
|
316
316
|
]),
|
|
317
317
|
_: 1
|