import{L as B}from"./bootstrap-vue-next-C0pyDr3k.js";import{_ as h}from"./StatusBadge-74LYchi-.js";import{_ as C}from"./LoadingIndicator-BUC-Eplr.js";import{r as l,g as i,o as S,c as f,a as s,t as d,m as H,b as w,w as o,f as u,B as P,F as M,y as T,W as V}from"./index-Bb2UEb_P.js";import{_ as E}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./common-U_VzDrmL.js";const L=[{key:"StatusDate",label:"Дата изменения",headerTitle:"Дата изменения",variant:"td-gray td-order",sortable:!0},{key:"StatusID",label:"Статус",headerTitle:"Статус",variant:"td-blue",sortable:!0},{key:"Initiator",label:"Инициатор",headerTitle:"Инициатор",variant:"td-gray td-order"},{key:"Comment",label:"Комментарий",headerTitle:"Комментарий",variant:"td-gray td-order"}],N={class:"tw-text-sm tw-text-gray-500 tw-mt-1"},F={key:1,class:"tw-overflow-y-auto tw-pr-2 tw-mt-4"},W={class:"td-column-heavy"},U={class:"table-td-gray"},j={class:"td-column-heavy"},R={class:"table-td-gray"},q={class:"td-column-heavy"},A={class:"table-td-gray"},Y={__name:"ModalWindowStatusHistory",props:{data:{type:Object,default:()=>{}}},setup(r){const c=r,D=l("StatusDate"),b=l(!0),I=l(!0),p=i(()=>c.data.modeID),k=i(()=>c.data.rowID),g=i(()=>c.data.orderID),n=l({}),_=i(()=>n.value?Object.values(n.value).reverse().map(e=>({StatusDate:e.StatusDate,StatusID:e.StatusID,Initiator:e.Initiator,Comment:e.Comment})):[]);(async()=>{try{const e=g.value?`OrderID=${g.value}`:`ModeID=${p.value}&RowID=${k.value}`,t=await T.get(`${V}/API/v2/StatusesHistory?${e}`);t&&t.data?n.value=t.data:n.value={},I.value=!1}catch(e){console.error(e),n.value={}}})();function x(e){let t="";switch(e){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 $(e){const t=new Date(e*1e3),m=t.getDate().toString().padStart(2,"0"),v=(t.getMonth()+1).toString().padStart(2,"0"),y=t.getFullYear().toString(),a=t.getHours().toString().padStart(2,"0"),O=t.getMinutes().toString().padStart(2,"0");return`${m}.${v}.${y} ${a}:${O}`}return(e,t)=>{const m=C,v=h,y=B;return S(),f(M,null,[t[9]||(t[9]=s("div",{class:"tw-text-xl sm:tw-text-2xl"},"История изменений",-1)),s("div",N,d(x(r.data.modeID))+", #"+d(r.data.orderID?r.data.orderID:r.data.rowID),1),I.value?(S(),H(m,{key:0,class:"tw-mt-16"})):(S(),f("div",F,[w(y,{"sort-desc":b.value,"onUpdate:sortDesc":t[0]||(t[0]=a=>b.value=a),"sort-by":D.value,"onUpdate:sortBy":t[1]||(t[1]=a=>D.value=a),class:"basic-table",items:_.value,fields:P(L),"show-empty":!0,filterable:[],"empty-text":"У вас пока нет истории статусов.","empty-filtered-text":"Статус не найден."},{"head(StatusDate)":o(()=>t[2]||(t[2]=[u(" Дата изменения ",-1)])),"head(StatusID)":o(()=>t[3]||(t[3]=[u(" Статус ",-1)])),"head(Initiator)":o(()=>t[4]||(t[4]=[u(" Инициатор ",-1)])),"head(Comment)":o(()=>t[5]||(t[5]=[u(" Комментарий ",-1)])),"cell(StatusDate)":o(a=>[t[6]||(t[6]=s("span",{class:"td-mobile"},"Дата изменения",-1)),s("div",W,[s("div",U,d($(a.item?.StatusDate)),1)])]),"cell(StatusID)":o(a=>[w(v,{status:a.item?.StatusID,"status-table":p.value},null,8,["status","status-table"])]),"cell(Initiator)":o(a=>[t[7]||(t[7]=s("span",{class:"td-mobile"},"Инициатор",-1)),s("div",j,[s("div",R,d(a.item?.Initiator),1)])]),"cell(Comment)":o(a=>[t[8]||(t[8]=s("span",{class:"td-mobile"},"Комментарий",-1)),s("div",q,[s("div",A,d(a.item?.Comment),1)])]),_:1},8,["sort-desc","sort-by","items","fields"])]))],64)}}},tt=E(Y,[["__scopeId","data-v-d75cf636"]]);export{tt as default};
