use-page-search.5b2e253c.js 959 B

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