import{_ as x}from"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import{B as C}from"./BasicForm-dL_oCSPM.js";import{B as k}from"./Table-0PViRYCf.js";import{d as M,V as q,r,a4 as F,c as u,o as m,l as s,w as S,D as I,j as V}from"./index-9PRMimni.js";import{c as A,a as D,b as N,g as P}from"./modalSchemas-DN-MflMO.js";import{u as j}from"./useForm-CKmgcynv.js";import{u as X}from"./useModal-CO65vga3.js";const U=M({__name:"HistoryModal",setup($,{expose:d}){const{t:n}=q(),{historyColumns:f}=A(),{resetHistoryColumns:p}=D(),{historySchemas:y}=N(),[_,{getFieldsValue:b}]=j({gridProps:{cols:3},showAdvancedButton:!1,schemas:y}),[T,{openModal:g,setProps:h}]=X({subBtuText:n("common.okText"),cancelText:n("common.cancelText"),width:900}),c=r(),l=r(0),t=r(""),R=F(()=>t.value==="resetHistory"?p:f);async function w(o,e){console.log(o,e),o&&(l.value=o.equipmentId,t.value=e,g())}async function B(o,e){return e.countType=t.value==="resetHistory"?1:e.countType,await P({...o,...e,equipmentId:l.value})}function i(){c.value?.restReload()}return d({showModal:w,setProps:h}),(o,e)=>{const H=C,v=x;return m(),u(v,{ref:"modalRef",onRegister:s(T),class:"basicModal basicFormModal",showAction:!1},{default:S(()=>[s(t)!=="resetHistory"?(m(),u(H,{key:0,onRegister:s(_),onSubmit:i,onReset:i},null,8,["onRegister"])):I("",!0),V(s(k),{class:"mt-4",columns:s(R),"row-key":a=>a.id,request:a=>B(a,s(b)()),showTableSetting:!1,ref_key:"basicTableRef",ref:c,autoScrollX:!0,"virtual-scroll":""},null,8,["columns","row-key","request"])]),_:1},8,["onRegister"])}}});export{U as _};
