use-page-search.d97bdd00.js 747 B

1
  1. import{w as _,ae as v}from"./index.42bf163d.js";const g=o=>o?v(o).format("YYYY-MM-DD"):"";function M(o,i,u,m){const s=_(null);function D(n){var c;const{result:a,deleteProps:r}=o?o(n):{result:{},deleteProps:[]},e={...n,...a};if(u){const{formItems:d}=u;d.forEach(h=>{const{field:t,type_field:f,otherOptions:y={},type:l}=h,{startProp:p,endProp:P}=y;(p||P)&&e[t]&&(e[p]=l==="date_picker"?g(e[t][0]):e[t][0],e[P]=l==="date_picker"?g(e[t][1]):e[t][1],delete e[t]),f&&(e[e[f]]=e[t],delete e[t],delete e[f])})}r.forEach(d=>delete e[d]),(c=s.value)==null||c.getPageData(e)}function Y(n){var r;const{result:a}=o?o(n):{result:{}};(r=s.value)==null||r.getPageData(m?{}:a),i&&i()}return{pageContentRef:s,handleSearchClick:D,handleResetClick:Y}}export{M as u};