import{L as x}from"./bootstrap-vue-next-DwS3lKQb.js";import{_ as O}from"./StatusBadge-CjHHKSUG.js";import{r as d,f as m,c as $,o as H,a,t as n,b,w as o,e as i,F as P,am as B,W as C}from"./index-CmCGXBst.js";import{_ as h}from"./_plugin-vue_export-helper-DlAUqK2U.js";const E={class:"tw-text-xl sm:tw-text-2xl"},M={class:"tw-overflow-y-auto tw-pr-2 tw-mt-4"},V={class:"td-column-heavy"},N={class:"table-td-gray"},T={class:"td-column-heavy"},F={class:"table-td-gray"},L={class:"td-column-heavy"},U={class:"table-td-gray"},W={__name:"ModalWindowStatusHistory",props:{data:{type:Object,default:()=>{}}},setup(l){const S=l,D=d("StatusDate"),p=d(!0),y=d("desc"),v=m(()=>S.data.modeID),I=m(()=>S.data.rowID),r=d({}),f=m(()=>r.value?Object.keys(r.value).map(s=>r.value[s]).reverse().map(s=>({StatusDate:s.StatusDate,StatusID:s.StatusID,Initiator:s.Initiator,Comment:s.Comment})):[]);(async()=>{try{const s=await B.get(`${C}/API/v2/StatusesHistory?ModeID=${v.value}&RowID=${I.value}`);s&&s.data?r.value=s.data:r.value={}}catch(s){console.error(s),r.value={}}})();function g(s){let t="";switch(s){case"HostingOrders":t="Хостинг";break;case"DomainOrders":t="Домен";break;case"DSOrders":t="Выделенный сервер";break;case"VPSOrders":t="VPS/VDS Сервер";break;case"ExtraIPOrders":t="IP адрес";break;case"ISPswOrders":t="Лицензия ISPsystem";break;case"DNSmanagerOrders":t="Вторичный DNS";break;case"Contracts":t="Договор";break;case"Profiles":t="Профиль";break;case"Invoices":t="Счёт на оплату";break;case"Edesks":t="Тикет";break}return t}function w(s){const t=new Date(s*1e3),u=t.getDate().toString().padStart(2,"0"),c=(t.getMonth()+1).toString().padStart(2,"0"),e=t.getFullYear().toString(),k=t.getHours().toString().padStart(2,"0"),_=t.getMinutes().toString().padStart(2,"0");return`${u}.${c}.${e} ${k}:${_}`}return(s,t)=>{const u=O,c=x;return H(),$(P,null,[a("div",E,"История изменений: "+n(g(l.data?.modeID))+", #"+n(l.data?.rowID),1),a("div",M,[b(c,{class:"basic-table",items:f.value,fields:s.statusesHistoryFields,"show-empty":!0,filterable:[],"sort-desc":p.value,"onUpdate:sortDesc":t[0]||(t[0]=e=>p.value=e),"sort-by":D.value,"onUpdate:sortBy":t[1]||(t[1]=e=>D.value=e),"sort-direction":y.value,"empty-text":"У вас пока нет истории статусов.","empty-filtered-text":"Статус не найден."},{"head(StatusDate)":o(()=>t[2]||(t[2]=[i(" Дата изменения ",-1)])),"head(StatusID)":o(()=>t[3]||(t[3]=[i(" Статус ",-1)])),"head(Initiator)":o(()=>t[4]||(t[4]=[i(" Инициатор ",-1)])),"head(Comment)":o(()=>t[5]||(t[5]=[i(" Комментарий ",-1)])),"cell(StatusDate)":o(e=>[t[6]||(t[6]=a("span",{class:"td-mobile"},"Дата изменения",-1)),a("div",V,[a("div",N,n(w(e.item?.StatusDate)),1)])]),"cell(StatusID)":o(e=>[b(u,{status:e.item?.StatusID,"status-table":v.value},null,8,["status","status-table"])]),"cell(Initiator)":o(e=>[t[7]||(t[7]=a("span",{class:"td-mobile"},"Инициатор",-1)),a("div",T,[a("div",F,n(e.item?.Initiator),1)])]),"cell(Comment)":o(e=>[t[8]||(t[8]=a("span",{class:"td-mobile"},"Комментарий",-1)),a("div",L,[a("div",U,n(e.item?.Comment),1)])]),_:1},8,["items","fields","sort-desc","sort-by","sort-direction"])])],64)}}},z=h(W,[["__scopeId","data-v-6975f33a"]]);export{z as default};
