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