@studio-west/employees 0.0.1 → 0.0.3
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 +3 -3
- package/dist/WorkTable.js +64 -64
- package/package.json +5 -5
package/dist/WorkTable.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(e,D){typeof exports=="object"&&typeof module<"u"?module.exports=D(require("vue"),require("file-saver"),require("exceljs"),require("vue-i18n"),require("element-plus"),require("@imengyu/vue3-context-menu"),require("js-cookie")):typeof define=="function"&&define.amd?define(["vue","file-saver","exceljs","vue-i18n","element-plus","@imengyu/vue3-context-menu","js-cookie"],D):(e=typeof globalThis<"u"?globalThis:e||self,e["employees-vue"]=D(e.vue,e.fileSaver,e.ExcelJS,e.vueI18n,e.elementPlus,e.vue3ContextMenu,e.Cookies))})(this,function(e,D,_,P,i,
|
|
2
|
-
`+(f-1),t.getColumn(f).width=6,t.getColumn(f).alignment=c,t.getCell(4,f).border=l;t.getRow(1).height=40,t.getRow(2).height=30,t.getRow(3).height=20,t.getColumn(1).width=15,t.getColumn(d.value.length+2).width=5,t.getColumn(d.value.length+3).width=6,t.getColumn(d.value.length+4).width=13,t.getColumn(d.value.length+5).width=13,t.getColumn(1).alignment=c,t.getCell("A2").alignment=o,t.getCell("A3").alignment=o,t.getCell("B3").alignment=o,t.getCell(3,d.value.length+2).alignment=o,t.getColumn(d.value.length+2).alignment=c,t.getColumn(d.value.length+3).alignment=c,t.getColumn(d.value.length+4).alignment=o,t.getColumn(d.value.length+5).alignment=o,t.getCell("A3").border=l,t.getCell("B3").border=l,t.getCell(3,d.value.length+2).border=l,t.getCell(4,d.value.length+2).border=l,t.getCell(3,d.value.length+4).border=l,t.getCell(3,d.value.length+5).border=l,t.getCell(4,d.value.length+3).border=l;let m=0;for(const f of n.value){let R=[f.name];for(let A=1;A<=d.value.length;A++){const{ind:W}=
|
|
3
|
-
`+l.day.toString()},{default:e.withCtx(c=>[e.createElementVNode("div",ne,e.toDisplayString(Z(l.day,c.$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"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.days"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(n.value[l.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(r)("workSchedule.hours")} ( ${N.value} )`,align:"center"},{default:e.withCtx(l=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${N.value===l.row.contHour?"green":"red"};`)},e.toDisplayString(l.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])]),_:1},8,["loading"]),ue.value&&u.checkEdit?(e.openBlock(),e.createElementBlock("div",oe,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),
|
|
1
|
+
(function(e,D){typeof exports=="object"&&typeof module<"u"?module.exports=D(require("vue"),require("file-saver"),require("exceljs"),require("vue-i18n"),require("element-plus"),require("@imengyu/vue3-context-menu"),require("js-cookie")):typeof define=="function"&&define.amd?define(["vue","file-saver","exceljs","vue-i18n","element-plus","@imengyu/vue3-context-menu","js-cookie"],D):(e=typeof globalThis<"u"?globalThis:e||self,e["employees-vue"]=D(e.vue,e.fileSaver,e.ExcelJS,e.vueI18n,e.elementPlus,e.vue3ContextMenu,e.Cookies))})(this,function(e,D,_,P,i,z,ee){"use strict";function te(u){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const y in u)if(y!=="default"){const s=Object.getOwnPropertyDescriptor(u,y);Object.defineProperty(r,y,s.get?s:{enumerable:!0,get:()=>u[y]})}}return r.default=u,Object.freeze(r)}const le=te(_);function $(u,r){if(arguments.length===0||!u)return null;const y=r||"{Y}-{m}-{d} {G}:{i}:{s}";let s;typeof u=="object"?s=u:(typeof u=="string"&&(/^[0-9]+$/.test(u)?u=parseInt(u):u=u.replace(new RegExp(/-/gm),"/")),typeof u=="number"&&u.toString().length===10&&(u=u*1e3),s=new Date(u));const C="ru-RU",n={Y:s.getFullYear(),m:(s.getMonth()+1).toString().padStart(2,"0"),d:s.getDate(),dd:s.getDate().toString().padStart(2,"0"),G:s.getHours(),H:s.getHours().toString().padStart(2,"0"),i:s.getMinutes().toString().padStart(2,"0"),s:s.getSeconds().toString().padStart(2,"0"),D:new Intl.DateTimeFormat(C,{weekday:"short"}).format(s),F:new Intl.DateTimeFormat(C,{month:"long"}).format(s),M:new Intl.DateTimeFormat(C,{month:"short"}).format(s)};return y.replace(/{(dd|[YmdGHisDFM])+}/g,(G,w)=>n[w])}function x(u,r){let s=u.replace(/[0-9]/g,"").split("").reverse().map(C=>C.charCodeAt(0));return process(s,r,0),s.map(C=>String.fromCharCode(C)).reverse().join("")}function Y(u){return u.split(" ",3).map((r,y)=>y!==0?r.slice(0,1)+".":r).join(" ")}const ae={style:{height:"100px",width:"100%",display:"inline-block"}},ne={style:{height:"100px",width:"100%",display:"inline-block"}},oe={key:2,class:"controls-container"},re={key:0,style:{padding:"0.5em 1.5em"}},de={key:1,style:{padding:"0.5em 1.5em"}};return{__name:"WorkTable",props:{checkEdit:{type:Boolean,default:()=>!0},data:Object,workSchedule:Object,fullName:{type:String,default:"Вы"}},setup(u){const{t:r,d:y}=P.useI18n(),s=u,C=e.ref(!1),n=e.ref([]),G=e.ref(1),w=e.ref(new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(G.value))),d=e.ref([]),N=e.ref(0),V=e.ref(9),k=e.ref(8),F=e.ref(!1),L=e.ref(!0),B=e.ref(!1),H=e.ref("5"),T=e.ref(1),b=e.ref("Сектор разработок и эксплуатации сети"),U=e.ref([]),v=e.ref([]),g=e.ref({name:"Имя",length:0,code:""}),I=e.ref(!1),O=e.ref({zIndex:30,minWidth:220,x:500,y:200}),J=e.ref([]);e.watch(b,async(a,t)=>{a!==t&&(v.value=[],F.value=!1,s.odata.personalManagerData.forEach(o=>{o.Status!=="Увольнение"&&o.Group===a&&(v.value.some(l=>(l==null?void 0:l.activeText)===o.Role)||v.value.push({val:!0,activeText:o.Role}))}),q())}),e.watch(G,async(a,t)=>{a!==t&&(w.value=new Date(new Date().getFullYear(),new Date().getMonth(),1).setMonth(new Date().getMonth()+Number(a)),X())});const ie=(a,t,o,l)=>{g.value.ids=a.ids,g.value.key=a.key,g.value.add=a.days.length>0&&a.days[a.days.length-1].cont,g.value.level=t.level,g.value.day=o.cellIndex,O.value.y=l.clientY,O.value.x=l.clientX,t.level===2&&t.no===0&&s.checkEdit&&(g.value.name=r("workSchedule.autocomplete"),I.value=!0),t.level===3&&o.cellIndex-t.no===1&&s.checkEdit&&(E(o.cellIndex,a.ids),g.value.name=r("workSchedule.modeSelection"),I.value=!0)},X=()=>{const a=J.value,t=new Date(w.value),o=new Date(t.getFullYear(),t.getMonth()+1,0).getDate();let l=[],c=0;for(let m=1;m<=o;m++){const p=$(t.setDate(m),"{Y}-{m}-{dd}");c+=a.nowork.includes(p)||a.holidays.includes(p)?0:a.preholidays.includes(p)?7:8;const h=a.nowork.includes(p)?"nowork":a.holidays.includes(p)?"holiday":a.preholidays.includes(p)?"preholiday":"";l.push({day:m,holidays:h,weekday:y(new Date(t.getFullYear(),t.getMonth(),m),"day")})}N.value=c,d.value=l,s.odata.getPersonalManagerData({}).then(m=>{var p;b.value=(p=m.find(h=>h.Status!=="Увольнение"&&h.Description===s.fullName))==null?void 0:p.Group,m.forEach(h=>{h.Status!=="Увольнение"&&(U.value.some(S=>(S==null?void 0:S.value)===h.Group)||U.value.push({value:h.Group,label:h.Group,key:h.Group}),h.Group===b.value&&!v.value.some(S=>(S==null?void 0:S.activeText)===h.Role)&&v.value.push({val:!0,activeText:h.Role}))}),q(),L.value=!1})},ue=e.computed(()=>!n.value.some(a=>a.contHour!==N.value)),Z=(a,t)=>{var m,p,h;const o=new Date(w.value),l=`${o.getFullYear()}-${(o.getMonth()+1).toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}`,c=(m=n.value[t])==null?void 0:m.days.findIndex(S=>S.day===l);return t===-1||c===-1?"":((p=n.value[t].days[c])==null?void 0:p.time)+" "+((h=n.value[t].days[c])==null?void 0:h.tips)},q=()=>{n.value=[];let a=[];s.odata.personalManagerData.forEach(t=>{if(t.Status!=="Увольнение"&&t.Group===b.value&&v.value.some(o=>o.val&&o.activeText===t.Role)){let o=Y(t.Description);a.push(t.Code),n.value.push({name:o+" ("+t.Role+")",days:[],contHour:0,code:t.Code,id:!1,ids:n.value.length})}}),se(a),B.value=!1},se=a=>{s.workSchedule.getWorkSchedule({code:a,date:$(new Date(w.value),"{Y}-{m}-{dd}")}).then(t=>{t.forEach((o,l)=>{o!==null&&(n.value[l].days=o.data.days,n.value[l].id=o.id)}),M()})},M=()=>{n.value.forEach(a=>{a.contHour=a.days.reduce((t,o)=>t+o.time,0)})},ce=a=>{n.value[a].days=[],M()},ge=a=>{switch(H.value){case"5":for(let t=T.value;t<=d.value.length;t++)d.value[t-1].holidays===""&&E(t,a,!0),d.value[t-1].holidays==="preholiday"&&(k.value-=1,E(t,a,!0),k.value+=1);break;case"2x2":for(let t=T.value;t<=d.value.length;t+=4)E(t,a,!0),t+1<=d.value.length&&E(t+1,a,!0);break;case"2x5":for(let t=T.value;t<=d.value.length;t+=7)for(let o=t;o<t+5&&o<=d.value.length;o++)d.value[o-1].holidays==="preholiday"?(k.value-=1,E(o,a,!0),k.value+=1):E(o,a,!0);break}},E=(a,t,o=!1)=>{const{date:l,ind:c}=j(a,t);c===-1?(n.value[t].days.push({day:l,time:k.value,tips:`(${V.value}:00 - ${V.value+k.value+1}:00)`}),M()):o||(k.value=n.value[t].days[c].time,V.value=parseInt(n.value[t].days[c].tips.slice(1,-12)))},he=(a,t)=>{const{ind:o}=j(a,t);n.value[t].days.splice(o,1),M(),document.querySelector(".app-main").click()},Q=(a,t)=>{const{date:o,ind:l}=j(a,t);n.value[t].days[l]={day:o,time:k.value,tips:`(${V.value}:00 - ${V.value+k.value+1}:00)`},M()},j=(a,t)=>{var c;const o=$(new Date(w.value).setDate(a),"{Y}-{m}-{dd}"),l=(c=n.value[t])==null?void 0:c.days.findIndex(m=>m.day===o);return{date:o,ind:l}},fe=async()=>{var K;C.value=!0;const a=new le.Workbook,t=a.addWorksheet(y(w.value,"month"),{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0}}),o={vertical:"middle",horizontal:"center"},l={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}},c={vertical:"middle",horizontal:"center",wrapText:!0};t.mergeCells(`A1:${x("A1",d.value.length+5)}1`),t.mergeCells(`A2:${x("A2",d.value.length+5)}2`),t.mergeCells("A3:A4"),t.mergeCells(`B3:${x("B3",d.value.length)}3`),t.mergeCells(`${x("B3",d.value.length+1)}3:${x("B3",d.value.length+2)}3`),t.mergeCells(`${x("B3",d.value.length+3)}3:${x("B4",d.value.length+3)}4`),t.mergeCells(`${x("B3",d.value.length+4)}3:${x("B4",d.value.length+4)}4`),t.getCell("A1").value=r("workSchedule.firm"),t.getCell("A2").value=r("workSchedule.title",{name:b.value})+y(w.value,"month")+` ${new Date(w.value).getFullYear()}`,t.getCell("A3").value=r("workSchedule.month"),t.getCell("B3").value=r("workSchedule.numbersMonth"),t.getCell(3,d.value.length+2).value=r("workSchedule.onSchedule"),t.getCell(3,d.value.length+4).value=r("workSchedule.acquainted"),t.getCell(3,d.value.length+5).value=r("workSchedule.date"),t.getCell(4,d.value.length+2).value=r("workSchedule.days"),t.getCell(4,d.value.length+3).value=`${r("workSchedule.hours")} (${N.value})`;for(let f=2;f<=d.value.length+1;f++)t.getCell(4,f).value=d.value[f-2].weekday+`
|
|
2
|
+
`+(f-1),t.getColumn(f).width=6,t.getColumn(f).alignment=c,t.getCell(4,f).border=l;t.getRow(1).height=40,t.getRow(2).height=30,t.getRow(3).height=20,t.getColumn(1).width=15,t.getColumn(d.value.length+2).width=5,t.getColumn(d.value.length+3).width=6,t.getColumn(d.value.length+4).width=13,t.getColumn(d.value.length+5).width=13,t.getColumn(1).alignment=c,t.getCell("A2").alignment=o,t.getCell("A3").alignment=o,t.getCell("B3").alignment=o,t.getCell(3,d.value.length+2).alignment=o,t.getColumn(d.value.length+2).alignment=c,t.getColumn(d.value.length+3).alignment=c,t.getColumn(d.value.length+4).alignment=o,t.getColumn(d.value.length+5).alignment=o,t.getCell("A3").border=l,t.getCell("B3").border=l,t.getCell(3,d.value.length+2).border=l,t.getCell(4,d.value.length+2).border=l,t.getCell(3,d.value.length+4).border=l,t.getCell(3,d.value.length+5).border=l,t.getCell(4,d.value.length+3).border=l;let m=0;for(const f of n.value){let R=[f.name];for(let A=1;A<=d.value.length;A++){const{ind:W}=j(A,m);W!==-1?R[A]=`${f.days[W].time} ${f.days[W].tips}`:R[A]=" "}R.push(((K=f.days)==null?void 0:K.length)||" ",f.contHour||0);const pe=t.addRow(R);pe.border=l,m++}let p="Щербина Е. В.";s.odata.personalManagerData.forEach(f=>{f.Status!=="Увольнение"&&f.Role==="Начальник отдела правовой и кадровой работы"&&(p=f.Description)}),t.mergeCells(`A${n.value.length+6}:P${n.value.length+6}`),t.mergeCells(`Q${n.value.length+6}:AG${n.value.length+6}`),t.mergeCells(`B${n.value.length+8}:E${n.value.length+8}`),t.mergeCells(`F${n.value.length+8}:L${n.value.length+8}`),t.mergeCells(`M${n.value.length+8}:P${n.value.length+8}`),t.mergeCells(`S${n.value.length+8}:V${n.value.length+8}`),t.mergeCells(`W${n.value.length+8}:AC${n.value.length+8}`),t.mergeCells(`AD${n.value.length+8}:AG${n.value.length+8}`),t.mergeCells(`Z${n.value.length+9}:AA${n.value.length+9}`),t.getCell(`A${n.value.length+6}`).value=r("workSchedule.byInitials"),t.getCell(`Q${n.value.length+6}`).value=r("workSchedule.supervisorHR"),t.getCell(`B${n.value.length+8}`).value=r("workSchedule.compiled")+":",t.getCell(`S${n.value.length+8}`).value=r("workSchedule.approved")+":",t.getCell(`M${n.value.length+8}`).value=Y(s.fullName),t.getCell(`AD${n.value.length+8}`).value=Y(p),t.getCell(`Z${n.value.length+9}`).value=r("workSchedule.printPlace"),t.getCell(`A${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},t.getCell(`Q${n.value.length+6}`).alignment={vertical:"middle",horizontal:"right"},t.getCell(`B${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},t.getCell(`F${n.value.length+8}`).alignment={vertical:"middle",horizontal:"right"},t.getCell(`M${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},t.getCell(`AD${n.value.length+8}`).alignment={vertical:"middle",horizontal:"left"},t.getCell(`Z${n.value.length+9}`).alignment=o,t.getCell(`F${n.value.length+8}`).border={bottom:{style:"thin"}},t.getCell(`W${n.value.length+8}`).border={bottom:{style:"thin"}};const h="export_"+$(Date.now(),"{dd}.{m}.{Y}")+".xlsx",S=await a.xlsx.writeBuffer();D.saveAs(new Blob([S]),h),C.value=!1},me=async()=>{F.value||s.workSchedule.addWorkSchedule({data:n.value,date:$(new Date(w.value),"{Y}-{m}-{dd}")}).then(a=>F.value=a)};return fetch("https://cp.avanta-telecom.ru/api/v2/calendar/getHoliday",{method:"GET",mode:"cors",cache:"default",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"text/html","X-Token":ee.get("X-Token")||!1,"Cache-Control":"no-cache"},redirect:"follow",referrerPolicy:"no-referrer"}).then(a=>{if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return a.json()}).then(a=>{J.value=a.result,X()}).catch(a=>{console.error("Ошибка загрузки файла:",a)}),(a,t)=>{const o=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[u.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElSelect),{key:0,modelValue:b.value,"onUpdate:modelValue":t[0]||(t[0]=l=>b.value=l),placeholder:"Select",style:{width:"240px","margin-bottom":".5rem","margin-right":".5rem"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,l=>(e.openBlock(),e.createBlock(e.unref(i.ElOption),{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),u.checkEdit?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:1,plain:"",onClick:t[1]||(t[1]=l=>B.value=!0),style:{"margin-bottom":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.jobTitle")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(i.ElSkeleton),{style:{width:"100%"},loading:L.value,animated:""},{template:e.withCtx(()=>[e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"100%",height:"2rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"4rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"4rem"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"180px",height:"8rem","margin-right":"4px"}}),e.createVNode(e.unref(i.ElSkeletonItem),{variant:"text",style:{width:"calc( 100% - 184px)",height:"8rem"}})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTable),{id:"printTable",data:n.value,style:{width:"100%"},size:"small",align:"center",onCellClick:ie,"empty-text":e.unref(r)("workSchedule.emptyText")},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.title",{name:b.value})+e.unref(y)(w.value,"month")+` ${new Date(w.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"},{default:e.withCtx(l=>[e.createElementVNode("div",ae,e.toDisplayString(n.value[l.$index].name),1)]),_:1},8,["label"]),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(d.value,l=>(e.openBlock(),e.createBlock(e.unref(i.ElTableColumn),{key:l.day,width:"45","class-name":l.holidays,align:"center",label:l.weekday+`
|
|
3
|
+
`+l.day.toString()},{default:e.withCtx(c=>[e.createElementVNode("div",ne,e.toDisplayString(Z(l.day,c.$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"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElTableColumn),{label:e.unref(r)("workSchedule.days"),align:"center"},{default:e.withCtx(l=>[e.createTextVNode(e.toDisplayString(n.value[l.$index].days.length||0),1)]),_:1},8,["label"]),e.createVNode(e.unref(i.ElTableColumn),{label:`${e.unref(r)("workSchedule.hours")} ( ${N.value} )`,align:"center"},{default:e.withCtx(l=>[e.createElementVNode("div",{style:e.normalizeStyle(`color: ${N.value===l.row.contHour?"green":"red"};`)},e.toDisplayString(l.row.contHour),5)]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["label"])]),_:1},8,["data","empty-text"])]),_:1},8,["loading"]),ue.value&&u.checkEdit?(e.openBlock(),e.createElementBlock("div",oe,[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.chartsFilled"))+": ",1),F.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,type:"primary",onClick:me},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.confirm")),1)]),_:1})),t[16]||(t[16]=e.createTextVNode()),e.createElementVNode("span",null,e.toDisplayString(u.fullName),1)])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(e.unref(i.ElButton),{disabled:C.value,plain:"",onClick:fe,style:{"margin-top":".5rem"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.exportExcel")),1)]),_:1},8,["disabled"])),[[o,C.value]]),e.createVNode(e.unref(i.ElDialog),{title:e.unref(r)("workSchedule.jobTitle"),modelValue:B.value,"onUpdate:modelValue":t[3]||(t[3]=l=>B.value=l),width:"400px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:t[2]||(t[2]=l=>B.value=!1),size:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.cancel")),1)]),_:1}),e.createVNode(e.unref(i.ElButton),{size:"default",type:"primary",onClick:q},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("workSchedule.select")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(i.ElForm),{ref:"dialogForm",model:v.value,autocomplete:"on"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,l=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ElSwitch),{modelValue:l.val,"onUpdate:modelValue":c=>l.val=c,"active-text":l.activeText},null,8,["modelValue","onUpdate:modelValue","active-text"])]),_:2},1024))),256))]),_:1},8,["model"])]),_:1},8,["title","modelValue"]),e.createVNode(e.unref(z.ContextMenu),{show:I.value,"onUpdate:show":t[15]||(t[15]=l=>I.value=l),options:O.value},{default:e.withCtx(()=>[e.createVNode(e.unref(z.ContextMenuItem),{label:g.value.name,disabled:""},null,8,["label"]),e.createVNode(e.unref(z.ContextMenuSeparator)),g.value.level===2?(e.openBlock(),e.createElementBlock("div",re,[e.createVNode(e.unref(i.ElRadioGroup),{modelValue:H.value,"onUpdate:modelValue":t[4]||(t[4]=l=>H.value=l),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"]),t[17]||(t[17]=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:T.value,"onUpdate:modelValue":t[5]||(t[5]=l=>T.value=l),step:1,min:1,max:d.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:V.value,"onUpdate:modelValue":t[6]||(t[6]=l=>V.value=l),step:1,min:8,max:11},null,8,["modelValue"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("workSchedule.duration"))+":",1),e.createVNode(e.unref(i.ElSlider),{modelValue:k.value,"onUpdate:modelValue":t[7]||(t[7]=l=>k.value=l),step:1,min:4,max:12},null,8,["modelValue"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:t[8]||(t[8]=l=>ge(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:t[9]||(t[9]=l=>ce(g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.clearRow")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",de,[e.createElementVNode("div",null,e.toDisplayString(Z(g.value.day,g.value.ids)),1),t[18]||(t[18]=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:V.value,"onUpdate:modelValue":t[10]||(t[10]=l=>V.value=l),step:1,min:8,max:11,onChange:t[11]||(t[11]=l=>Q(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:k.value,"onUpdate:modelValue":t[12]||(t[12]=l=>k.value=l),step:1,min:4,max:12,onChange:t[13]||(t[13]=l=>Q(g.value.day,g.value.ids))},null,8,["modelValue"]),e.createVNode(e.unref(i.ElButton),{style:{"margin-top":".5rem"},size:"small",onClick:t[14]||(t[14]=l=>he(g.value.day,g.value.ids))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("workSchedule.delete")),1)]),_:1})]))]),_:1},8,["show","options"])])}}}});
|
package/dist/WorkTable.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as h, watch as ge, computed as Se, resolveDirective as be, openBlock as k, createElementBlock as z, createBlock as I, unref as a, withCtx as s, Fragment as te, renderList as ae, createCommentVNode as
|
|
1
|
+
import { ref as h, watch as ge, computed as Se, resolveDirective as be, openBlock as k, createElementBlock as z, createBlock as I, unref as a, withCtx as s, Fragment as te, renderList as ae, createCommentVNode as q, createTextVNode as D, toDisplayString as m, createVNode as d, createElementVNode as $, normalizeStyle as $e, withDirectives as xe } from "vue";
|
|
2
2
|
import { saveAs as De } from "file-saver";
|
|
3
3
|
import * as Ee from "exceljs";
|
|
4
4
|
import { useI18n as Ve } from "vue-i18n";
|
|
@@ -11,7 +11,7 @@ function P(v, u) {
|
|
|
11
11
|
const E = u || "{Y}-{m}-{d} {G}:{i}:{s}";
|
|
12
12
|
let i;
|
|
13
13
|
typeof v == "object" ? i = v : (typeof v == "string" && (/^[0-9]+$/.test(v) ? v = parseInt(v) : v = v.replace(new RegExp(/-/gm), "/")), typeof v == "number" && v.toString().length === 10 && (v = v * 1e3), i = new Date(v));
|
|
14
|
-
const
|
|
14
|
+
const b = "ru-RU", n = {
|
|
15
15
|
Y: i.getFullYear(),
|
|
16
16
|
m: (i.getMonth() + 1).toString().padStart(2, "0"),
|
|
17
17
|
d: i.getDate(),
|
|
@@ -23,15 +23,15 @@ function P(v, u) {
|
|
|
23
23
|
// D: this.$t('el.datepicker.weeks.' + new Intl.DateTimeFormat('en-En',{weekday: 'short'}).format(date)),
|
|
24
24
|
// F: this.$t('el.datepicker.month' + (date.getMonth() + 1)),
|
|
25
25
|
// M: this.$t('el.datepicker.months.' + Intl.DateTimeFormat('en-En',{month: 'short'}).format(date))
|
|
26
|
-
D: new Intl.DateTimeFormat(
|
|
27
|
-
F: new Intl.DateTimeFormat(
|
|
28
|
-
M: new Intl.DateTimeFormat(
|
|
26
|
+
D: new Intl.DateTimeFormat(b, { weekday: "short" }).format(i),
|
|
27
|
+
F: new Intl.DateTimeFormat(b, { month: "long" }).format(i),
|
|
28
|
+
M: new Intl.DateTimeFormat(b, { month: "short" }).format(i)
|
|
29
29
|
};
|
|
30
|
-
return E.replace(/{(dd|[YmdGHisDFM])+}/g, (
|
|
30
|
+
return E.replace(/{(dd|[YmdGHisDFM])+}/g, (J, C) => n[C]);
|
|
31
31
|
}
|
|
32
32
|
function M(v, u) {
|
|
33
|
-
let i = v.replace(/[0-9]/g, "").split("").reverse().map((
|
|
34
|
-
return process(i, u, 0), i.map((
|
|
33
|
+
let i = v.replace(/[0-9]/g, "").split("").reverse().map((b) => b.charCodeAt(0));
|
|
34
|
+
return process(i, u, 0), i.map((b) => String.fromCharCode(b)).reverse().join("");
|
|
35
35
|
}
|
|
36
36
|
function oe(v) {
|
|
37
37
|
return v.split(" ", 3).map((u, E) => E !== 0 ? u.slice(0, 1) + "." : u).join(" ");
|
|
@@ -54,7 +54,7 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
54
54
|
fullName: { type: String, default: "Вы" }
|
|
55
55
|
},
|
|
56
56
|
setup(v) {
|
|
57
|
-
const { t: u, d: E } = Ve(), i = v,
|
|
57
|
+
const { t: u, d: E } = Ve(), i = v, b = h(!1), n = h([
|
|
58
58
|
// { name: 'Иванов П.М. (Ведущий работник месяца)',
|
|
59
59
|
// days: [], // {day: "2024-11-01", tips: '(9:00 - 18:00)', time: 8 }
|
|
60
60
|
// contHour: 0,
|
|
@@ -67,23 +67,23 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
67
67
|
// code: '0000-00052'
|
|
68
68
|
// ids: 1
|
|
69
69
|
// }
|
|
70
|
-
]),
|
|
70
|
+
]), J = h(1), C = h(new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(J.value))), r = h([]), Y = h(0), V = h(9), S = h(8), O = h(!1), ue = h(!0), G = h(!1), Q = h("5"), H = h(1), T = h("Сектор разработок и эксплуатации сети"), K = h([]), A = h([]), c = h({ name: "Имя", length: 0, code: "" }), L = h(!1), _ = h({
|
|
71
71
|
zIndex: 30,
|
|
72
72
|
minWidth: 220,
|
|
73
73
|
x: 500,
|
|
74
74
|
y: 200
|
|
75
75
|
}), re = h([]);
|
|
76
76
|
ge(T, async (t, e) => {
|
|
77
|
-
t !== e && (A.value = [],
|
|
77
|
+
t !== e && (A.value = [], O.value = !1, i.odata.personalManagerData.forEach((o) => {
|
|
78
78
|
o.Status !== "Увольнение" && o.Group === t && (A.value.some((l) => (l == null ? void 0 : l.activeText) === o.Role) || A.value.push({ val: !0, activeText: o.Role }));
|
|
79
79
|
}), ee());
|
|
80
|
-
}), ge(
|
|
81
|
-
t !== e && (
|
|
80
|
+
}), ge(J, async (t, e) => {
|
|
81
|
+
t !== e && (C.value = new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1).setMonth((/* @__PURE__ */ new Date()).getMonth() + Number(t)), de());
|
|
82
82
|
});
|
|
83
83
|
const he = (t, e, o, l) => {
|
|
84
|
-
c.value.ids = t.ids, c.value.key = t.key, c.value.add = t.days.length > 0 && t.days[t.days.length - 1].cont, c.value.level = e.level, c.value.day = o.cellIndex, _.value.y = l.clientY, _.value.x = l.clientX, e.level === 2 && e.no === 0 && i.checkEdit && (c.value.name = u("workSchedule.autocomplete"),
|
|
84
|
+
c.value.ids = t.ids, c.value.key = t.key, c.value.add = t.days.length > 0 && t.days[t.days.length - 1].cont, c.value.level = e.level, c.value.day = o.cellIndex, _.value.y = l.clientY, _.value.x = l.clientX, e.level === 2 && e.no === 0 && i.checkEdit && (c.value.name = u("workSchedule.autocomplete"), L.value = !0), e.level === 3 && o.cellIndex - e.no === 1 && i.checkEdit && (F(o.cellIndex, t.ids), c.value.name = u("workSchedule.modeSelection"), L.value = !0);
|
|
85
85
|
}, de = () => {
|
|
86
|
-
const t = re.value, e = new Date(
|
|
86
|
+
const t = re.value, e = new Date(C.value), o = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
|
|
87
87
|
let l = [], g = 0;
|
|
88
88
|
for (let y = 1; y <= o; y++) {
|
|
89
89
|
const w = P(e.setDate(y), "{Y}-{m}-{dd}");
|
|
@@ -99,7 +99,7 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
99
99
|
});
|
|
100
100
|
}, me = Se(() => !n.value.some((t) => t.contHour !== Y.value)), ie = (t, e) => {
|
|
101
101
|
var y, w, p;
|
|
102
|
-
const o = new Date(
|
|
102
|
+
const o = new Date(C.value), l = `${o.getFullYear()}-${(o.getMonth() + 1).toString().padStart(2, "0")}-${t.toString().padStart(2, "0")}`, g = (y = n.value[e]) == null ? void 0 : y.days.findIndex((x) => x.day === l);
|
|
103
103
|
return e === -1 || g === -1 ? "" : ((w = n.value[e].days[g]) == null ? void 0 : w.time) + " " + ((p = n.value[e].days[g]) == null ? void 0 : p.tips);
|
|
104
104
|
}, ee = () => {
|
|
105
105
|
n.value = [];
|
|
@@ -111,7 +111,7 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
111
111
|
}
|
|
112
112
|
}), ce(t), G.value = !1;
|
|
113
113
|
}, ce = (t) => {
|
|
114
|
-
i.workSchedule.getWorkSchedule({ code: t, date: P(new Date(
|
|
114
|
+
i.workSchedule.getWorkSchedule({ code: t, date: P(new Date(C.value), "{Y}-{m}-{dd}") }).then(
|
|
115
115
|
(e) => {
|
|
116
116
|
e.forEach((o, l) => {
|
|
117
117
|
o !== null && (n.value[l].days = o.data.days, n.value[l].id = o.id);
|
|
@@ -128,7 +128,7 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
128
128
|
switch (Q.value) {
|
|
129
129
|
case "5":
|
|
130
130
|
for (let e = H.value; e <= r.value.length; e++)
|
|
131
|
-
r.value[e - 1].holidays === "" && F(e, t, !0), r.value[e - 1].holidays === "preholiday" && (
|
|
131
|
+
r.value[e - 1].holidays === "" && F(e, t, !0), r.value[e - 1].holidays === "preholiday" && (S.value -= 1, F(e, t, !0), S.value += 1);
|
|
132
132
|
break;
|
|
133
133
|
case "2x2":
|
|
134
134
|
for (let e = H.value; e <= r.value.length; e += 4)
|
|
@@ -137,48 +137,48 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
137
137
|
case "2x5":
|
|
138
138
|
for (let e = H.value; e <= r.value.length; e += 7)
|
|
139
139
|
for (let o = e; o < e + 5 && o <= r.value.length; o++)
|
|
140
|
-
r.value[o - 1].holidays === "preholiday" ? (
|
|
140
|
+
r.value[o - 1].holidays === "preholiday" ? (S.value -= 1, F(o, t, !0), S.value += 1) : F(o, t, !0);
|
|
141
141
|
break;
|
|
142
142
|
}
|
|
143
143
|
}, F = (t, e, o = !1) => {
|
|
144
|
-
const { date: l, ind: g } =
|
|
144
|
+
const { date: l, ind: g } = X(t, e);
|
|
145
145
|
g === -1 ? (n.value[e].days.push({
|
|
146
146
|
day: l,
|
|
147
|
-
time:
|
|
148
|
-
tips: `(${V.value}:00 - ${V.value +
|
|
149
|
-
}), U()) : o || (
|
|
147
|
+
time: S.value,
|
|
148
|
+
tips: `(${V.value}:00 - ${V.value + S.value + 1}:00)`
|
|
149
|
+
}), U()) : o || (S.value = n.value[e].days[g].time, V.value = parseInt(n.value[e].days[g].tips.slice(1, -12)));
|
|
150
150
|
}, ye = (t, e) => {
|
|
151
|
-
const { ind: o } =
|
|
151
|
+
const { ind: o } = X(t, e);
|
|
152
152
|
n.value[e].days.splice(o, 1), U(), document.querySelector(".app-main").click();
|
|
153
153
|
}, se = (t, e) => {
|
|
154
|
-
const { date: o, ind: l } =
|
|
154
|
+
const { date: o, ind: l } = X(t, e);
|
|
155
155
|
n.value[e].days[l] = {
|
|
156
156
|
day: o,
|
|
157
|
-
time:
|
|
158
|
-
tips: `(${V.value}:00 - ${V.value +
|
|
157
|
+
time: S.value,
|
|
158
|
+
tips: `(${V.value}:00 - ${V.value + S.value + 1}:00)`
|
|
159
159
|
}, U();
|
|
160
|
-
},
|
|
160
|
+
}, X = (t, e) => {
|
|
161
161
|
var g;
|
|
162
|
-
const o = P(new Date(
|
|
162
|
+
const o = P(new Date(C.value).setDate(t), "{Y}-{m}-{dd}"), l = (g = n.value[e]) == null ? void 0 : g.days.findIndex((y) => y.day === o);
|
|
163
163
|
return { date: o, ind: l };
|
|
164
164
|
}, we = async () => {
|
|
165
165
|
var ve;
|
|
166
|
-
|
|
167
|
-
const t = new Ee.Workbook(), e = t.addWorksheet(E(
|
|
168
|
-
e.mergeCells(`A1:${M("A1", r.value.length + 5)}1`), e.mergeCells(`A2:${M("A2", r.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${M("B3", r.value.length)}3`), e.mergeCells(`${M("B3", r.value.length + 1)}3:${M("B3", r.value.length + 2)}3`), e.mergeCells(`${M("B3", r.value.length + 3)}3:${M("B4", r.value.length + 3)}4`), e.mergeCells(`${M("B3", r.value.length + 4)}3:${M("B4", r.value.length + 4)}4`), e.getCell("A1").value = u("workSchedule.firm"), e.getCell("A2").value = u("workSchedule.title", { name: T.value }) + E(
|
|
166
|
+
b.value = !0;
|
|
167
|
+
const t = new Ee.Workbook(), e = t.addWorksheet(E(C.value, "month"), { pageSetup: { paperSize: 9, orientation: "landscape", fitToPage: !0 } }), o = { vertical: "middle", horizontal: "center" }, l = { top: { style: "thin" }, left: { style: "thin" }, bottom: { style: "thin" }, right: { style: "thin" } }, g = { vertical: "middle", horizontal: "center", wrapText: !0 };
|
|
168
|
+
e.mergeCells(`A1:${M("A1", r.value.length + 5)}1`), e.mergeCells(`A2:${M("A2", r.value.length + 5)}2`), e.mergeCells("A3:A4"), e.mergeCells(`B3:${M("B3", r.value.length)}3`), e.mergeCells(`${M("B3", r.value.length + 1)}3:${M("B3", r.value.length + 2)}3`), e.mergeCells(`${M("B3", r.value.length + 3)}3:${M("B4", r.value.length + 3)}4`), e.mergeCells(`${M("B3", r.value.length + 4)}3:${M("B4", r.value.length + 4)}4`), e.getCell("A1").value = u("workSchedule.firm"), e.getCell("A2").value = u("workSchedule.title", { name: T.value }) + E(C.value, "month") + ` ${new Date(C.value).getFullYear()}`, e.getCell("A3").value = u("workSchedule.month"), e.getCell("B3").value = u("workSchedule.numbersMonth"), e.getCell(3, r.value.length + 2).value = u("workSchedule.onSchedule"), e.getCell(3, r.value.length + 4).value = u("workSchedule.acquainted"), e.getCell(3, r.value.length + 5).value = u("workSchedule.date"), e.getCell(4, r.value.length + 2).value = u("workSchedule.days"), e.getCell(4, r.value.length + 3).value = `${u("workSchedule.hours")} (${Y.value})`;
|
|
169
169
|
for (let f = 2; f <= r.value.length + 1; f++)
|
|
170
170
|
e.getCell(4, f).value = r.value[f - 2].weekday + `
|
|
171
171
|
` + (f - 1), e.getColumn(f).width = 6, e.getColumn(f).alignment = g, e.getCell(4, f).border = l;
|
|
172
172
|
e.getRow(1).height = 40, e.getRow(2).height = 30, e.getRow(3).height = 20, e.getColumn(1).width = 15, e.getColumn(r.value.length + 2).width = 5, e.getColumn(r.value.length + 3).width = 6, e.getColumn(r.value.length + 4).width = 13, e.getColumn(r.value.length + 5).width = 13, e.getColumn(1).alignment = g, e.getCell("A2").alignment = o, e.getCell("A3").alignment = o, e.getCell("B3").alignment = o, e.getCell(3, r.value.length + 2).alignment = o, e.getColumn(r.value.length + 2).alignment = g, e.getColumn(r.value.length + 3).alignment = g, e.getColumn(r.value.length + 4).alignment = o, e.getColumn(r.value.length + 5).alignment = o, e.getCell("A3").border = l, e.getCell("B3").border = l, e.getCell(3, r.value.length + 2).border = l, e.getCell(4, r.value.length + 2).border = l, e.getCell(3, r.value.length + 4).border = l, e.getCell(3, r.value.length + 5).border = l, e.getCell(4, r.value.length + 3).border = l;
|
|
173
173
|
let y = 0;
|
|
174
174
|
for (const f of n.value) {
|
|
175
|
-
let
|
|
175
|
+
let Z = [f.name];
|
|
176
176
|
for (let j = 1; j <= r.value.length; j++) {
|
|
177
|
-
const { ind: le } =
|
|
178
|
-
le !== -1 ?
|
|
177
|
+
const { ind: le } = X(j, y);
|
|
178
|
+
le !== -1 ? Z[j] = `${f.days[le].time} ${f.days[le].tips}` : Z[j] = " ";
|
|
179
179
|
}
|
|
180
|
-
|
|
181
|
-
const Ce = e.addRow(
|
|
180
|
+
Z.push(((ve = f.days) == null ? void 0 : ve.length) || " ", f.contHour || 0);
|
|
181
|
+
const Ce = e.addRow(Z);
|
|
182
182
|
Ce.border = l, y++;
|
|
183
183
|
}
|
|
184
184
|
let w = "Щербина Е. В.";
|
|
@@ -186,9 +186,9 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
186
186
|
f.Status !== "Увольнение" && f.Role === "Начальник отдела правовой и кадровой работы" && (w = f.Description);
|
|
187
187
|
}), e.mergeCells(`A${n.value.length + 6}:P${n.value.length + 6}`), e.mergeCells(`Q${n.value.length + 6}:AG${n.value.length + 6}`), e.mergeCells(`B${n.value.length + 8}:E${n.value.length + 8}`), e.mergeCells(`F${n.value.length + 8}:L${n.value.length + 8}`), e.mergeCells(`M${n.value.length + 8}:P${n.value.length + 8}`), e.mergeCells(`S${n.value.length + 8}:V${n.value.length + 8}`), e.mergeCells(`W${n.value.length + 8}:AC${n.value.length + 8}`), e.mergeCells(`AD${n.value.length + 8}:AG${n.value.length + 8}`), e.mergeCells(`Z${n.value.length + 9}:AA${n.value.length + 9}`), e.getCell(`A${n.value.length + 6}`).value = u("workSchedule.byInitials"), e.getCell(`Q${n.value.length + 6}`).value = u("workSchedule.supervisorHR"), e.getCell(`B${n.value.length + 8}`).value = u("workSchedule.compiled") + ":", e.getCell(`S${n.value.length + 8}`).value = u("workSchedule.approved") + ":", e.getCell(`M${n.value.length + 8}`).value = oe(i.fullName), e.getCell(`AD${n.value.length + 8}`).value = oe(w), e.getCell(`Z${n.value.length + 9}`).value = u("workSchedule.printPlace"), e.getCell(`A${n.value.length + 6}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`Q${n.value.length + 6}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`B${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`F${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "right" }, e.getCell(`M${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`AD${n.value.length + 8}`).alignment = { vertical: "middle", horizontal: "left" }, e.getCell(`Z${n.value.length + 9}`).alignment = o, e.getCell(`F${n.value.length + 8}`).border = { bottom: { style: "thin" } }, e.getCell(`W${n.value.length + 8}`).border = { bottom: { style: "thin" } };
|
|
188
188
|
const p = "export_" + P(Date.now(), "{dd}.{m}.{Y}") + ".xlsx", x = await t.xlsx.writeBuffer();
|
|
189
|
-
De(new Blob([x]), p),
|
|
189
|
+
De(new Blob([x]), p), b.value = !1;
|
|
190
190
|
}, ke = async () => {
|
|
191
|
-
|
|
191
|
+
O.value || i.workSchedule.addWorkSchedule({ data: n.value, date: P(new Date(C.value), "{Y}-{m}-{dd}") }).then((t) => O.value = t);
|
|
192
192
|
};
|
|
193
193
|
return fetch(
|
|
194
194
|
"https://cp.avanta-telecom.ru/api/v2/calendar/getHoliday",
|
|
@@ -239,7 +239,7 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
239
239
|
}, null, 8, ["label", "value"]))), 128))
|
|
240
240
|
]),
|
|
241
241
|
_: 1
|
|
242
|
-
}, 8, ["modelValue"])) :
|
|
242
|
+
}, 8, ["modelValue"])) : q("", !0),
|
|
243
243
|
v.checkEdit ? (k(), I(a(B), {
|
|
244
244
|
key: 1,
|
|
245
245
|
plain: "",
|
|
@@ -250,7 +250,7 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
250
250
|
D(m(a(u)("workSchedule.jobTitle")), 1)
|
|
251
251
|
]),
|
|
252
252
|
_: 1
|
|
253
|
-
})) :
|
|
253
|
+
})) : q("", !0),
|
|
254
254
|
d(a(Ae), {
|
|
255
255
|
style: { width: "100%" },
|
|
256
256
|
loading: ue.value,
|
|
@@ -290,7 +290,7 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
290
290
|
}, {
|
|
291
291
|
default: s(() => [
|
|
292
292
|
d(a(R), {
|
|
293
|
-
label: a(u)("workSchedule.title", { name: T.value }) + a(E)(
|
|
293
|
+
label: a(u)("workSchedule.title", { name: T.value }) + a(E)(C.value, "month") + ` ${new Date(C.value).getFullYear()}`,
|
|
294
294
|
align: "center",
|
|
295
295
|
height: "34"
|
|
296
296
|
}, {
|
|
@@ -301,7 +301,7 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
301
301
|
align: "center"
|
|
302
302
|
}, {
|
|
303
303
|
default: s((l) => [
|
|
304
|
-
|
|
304
|
+
$("div", Ne, m(n.value[l.$index].name), 1)
|
|
305
305
|
]),
|
|
306
306
|
_: 1
|
|
307
307
|
}, 8, ["label"]),
|
|
@@ -319,7 +319,7 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
319
319
|
` + l.day.toString()
|
|
320
320
|
}, {
|
|
321
321
|
default: s((g) => [
|
|
322
|
-
|
|
322
|
+
$("div", We, m(ie(l.day, g.$index) || " "), 1)
|
|
323
323
|
]),
|
|
324
324
|
_: 2
|
|
325
325
|
}, 1032, ["class-name", "label"]))), 128))
|
|
@@ -345,7 +345,7 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
345
345
|
align: "center"
|
|
346
346
|
}, {
|
|
347
347
|
default: s((l) => [
|
|
348
|
-
|
|
348
|
+
$("div", {
|
|
349
349
|
style: $e(`color: ${Y.value === l.row.contHour ? "green" : "red"};`)
|
|
350
350
|
}, m(l.row.contHour), 5)
|
|
351
351
|
]),
|
|
@@ -365,7 +365,7 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
365
365
|
}, 8, ["loading"]),
|
|
366
366
|
me.value && v.checkEdit ? (k(), z("div", Pe, [
|
|
367
367
|
D(m(a(u)("workSchedule.chartsFilled")) + ": ", 1),
|
|
368
|
-
|
|
368
|
+
O.value ? q("", !0) : (k(), I(a(B), {
|
|
369
369
|
key: 0,
|
|
370
370
|
type: "primary",
|
|
371
371
|
onClick: ke
|
|
@@ -376,10 +376,10 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
376
376
|
_: 1
|
|
377
377
|
})),
|
|
378
378
|
e[16] || (e[16] = D()),
|
|
379
|
-
|
|
380
|
-
])) :
|
|
379
|
+
$("span", null, m(v.fullName), 1)
|
|
380
|
+
])) : q("", !0),
|
|
381
381
|
xe((k(), I(a(B), {
|
|
382
|
-
disabled:
|
|
382
|
+
disabled: b.value,
|
|
383
383
|
plain: "",
|
|
384
384
|
onClick: we,
|
|
385
385
|
style: { "margin-top": ".5rem" }
|
|
@@ -389,7 +389,7 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
389
389
|
]),
|
|
390
390
|
_: 1
|
|
391
391
|
}, 8, ["disabled"])), [
|
|
392
|
-
[o,
|
|
392
|
+
[o, b.value]
|
|
393
393
|
]),
|
|
394
394
|
d(a(Fe), {
|
|
395
395
|
title: a(u)("workSchedule.jobTitle"),
|
|
@@ -442,8 +442,8 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
442
442
|
_: 1
|
|
443
443
|
}, 8, ["title", "modelValue"]),
|
|
444
444
|
d(a(Ge), {
|
|
445
|
-
show:
|
|
446
|
-
"onUpdate:show": e[15] || (e[15] = (l) =>
|
|
445
|
+
show: L.value,
|
|
446
|
+
"onUpdate:show": e[15] || (e[15] = (l) => L.value = l),
|
|
447
447
|
options: _.value
|
|
448
448
|
}, {
|
|
449
449
|
default: s(() => [
|
|
@@ -474,8 +474,8 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
474
474
|
]),
|
|
475
475
|
_: 1
|
|
476
476
|
}, 8, ["modelValue"]),
|
|
477
|
-
e[17] || (e[17] =
|
|
478
|
-
|
|
477
|
+
e[17] || (e[17] = $("br", null, null, -1)),
|
|
478
|
+
$("span", null, m(a(u)("workSchedule.fromDate")) + ":", 1),
|
|
479
479
|
d(a(W), {
|
|
480
480
|
modelValue: H.value,
|
|
481
481
|
"onUpdate:modelValue": e[5] || (e[5] = (l) => H.value = l),
|
|
@@ -483,7 +483,7 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
483
483
|
min: 1,
|
|
484
484
|
max: r.value.length
|
|
485
485
|
}, null, 8, ["modelValue", "max"]),
|
|
486
|
-
|
|
486
|
+
$("span", null, m(a(u)("workSchedule.with")) + ":", 1),
|
|
487
487
|
d(a(W), {
|
|
488
488
|
modelValue: V.value,
|
|
489
489
|
"onUpdate:modelValue": e[6] || (e[6] = (l) => V.value = l),
|
|
@@ -491,10 +491,10 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
491
491
|
min: 8,
|
|
492
492
|
max: 11
|
|
493
493
|
}, null, 8, ["modelValue"]),
|
|
494
|
-
|
|
494
|
+
$("span", null, m(a(u)("workSchedule.duration")) + ":", 1),
|
|
495
495
|
d(a(W), {
|
|
496
|
-
modelValue:
|
|
497
|
-
"onUpdate:modelValue": e[7] || (e[7] = (l) =>
|
|
496
|
+
modelValue: S.value,
|
|
497
|
+
"onUpdate:modelValue": e[7] || (e[7] = (l) => S.value = l),
|
|
498
498
|
step: 1,
|
|
499
499
|
min: 4,
|
|
500
500
|
max: 12
|
|
@@ -520,9 +520,9 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
520
520
|
_: 1
|
|
521
521
|
})
|
|
522
522
|
])) : (k(), z("div", Le, [
|
|
523
|
-
|
|
524
|
-
e[18] || (e[18] =
|
|
525
|
-
|
|
523
|
+
$("div", null, m(ie(c.value.day, c.value.ids)), 1),
|
|
524
|
+
e[18] || (e[18] = $("br", null, null, -1)),
|
|
525
|
+
$("span", null, m(a(u)("workSchedule.with")) + ":", 1),
|
|
526
526
|
d(a(W), {
|
|
527
527
|
modelValue: V.value,
|
|
528
528
|
"onUpdate:modelValue": e[10] || (e[10] = (l) => V.value = l),
|
|
@@ -531,10 +531,10 @@ const Ne = { style: { height: "100px", width: "100%", display: "inline-block" }
|
|
|
531
531
|
max: 11,
|
|
532
532
|
onChange: e[11] || (e[11] = (l) => se(c.value.day, c.value.ids))
|
|
533
533
|
}, null, 8, ["modelValue"]),
|
|
534
|
-
|
|
534
|
+
$("span", null, m(a(u)("workSchedule.duration")) + ":", 1),
|
|
535
535
|
d(a(W), {
|
|
536
|
-
modelValue:
|
|
537
|
-
"onUpdate:modelValue": e[12] || (e[12] = (l) =>
|
|
536
|
+
modelValue: S.value,
|
|
537
|
+
"onUpdate:modelValue": e[12] || (e[12] = (l) => S.value = l),
|
|
538
538
|
step: 1,
|
|
539
539
|
min: 4,
|
|
540
540
|
max: 12,
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studio-west/employees",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
7
|
-
"main": "./dist/
|
|
8
|
-
"module": "./dist/
|
|
7
|
+
"main": "./dist/WorkTable.cjs",
|
|
8
|
+
"module": "./dist/WorkTable.js",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"import": "./dist/
|
|
12
|
-
"require": "./dist/
|
|
11
|
+
"import": "./dist/WorkTable.js",
|
|
12
|
+
"require": "./dist/WorkTable.cjs"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"type": "module",
|