import{aT as c,ac as y,al as m,a$ as _,_ as P,d as R,w as f,r as h,o as S,G as $,C as D,j as g,l as F,aN as b}from"./index.js";import{o as x,s as C,M as U}from"./modal.140b2a.js";import{u as k}from"./use-page-search.f7bc460e.js";import"./index.da6d65fd.js";const{VITE_PROXY_DOMAIN_REAL:K,VITE_PROXY_USER_REAL:q}=y(),d=q+"/admin/",N=e=>c.request("post",`${d}resultlist`,{data:e}),I=e=>c.request("post",`${d}resultedit`,{data:e}),M=e=>c.request("post",`${d}resultcreate`,{data:e}),O=e=>c.request("post",`${d}resultstatu`,{data:e}),T=e=>c.request("post",`${d}resultdel`,{data:e}),L=[{prop:"result_code",label:"\u539F\u56E0\u7F16\u53F7",width:"120px"},{prop:"result",label:"\u539F\u56E0\u6807\u9898"},{prop:"status",width:"140px",label:"\u539F\u56E0\u7C7B\u578B",cellRenderer:({row:e})=>m(_,{},{default:()=>{var n;return((n=x.find(({value:a})=>a===String(e.type)))==null?void 0:n.label)||"--"}})},{prop:"result_desc",label:"\u5F02\u5E38\u63CF\u8FF0"},{prop:"status",label:"\u72B6\u6001",width:"80px",cellRenderer:({row:e})=>{var n;return m(_,{type:((n=C.find(({value:a})=>a===String(e.status)))==null?void 0:n.type)||"info"},{default:()=>{var a;return((a=C.find(({value:l})=>l===String(e.status)))==null?void 0:a.label)||"--"}})}},{prop:"addtime",label:"\u521B\u5EFA\u65F6\u95F4",width:"140px"},{prop:"",label:"\u64CD\u4F5C",fixed:"right",slot:"operation",width:"150px"}],V={title:"\u539F\u56E0\u7BA1\u7406",columns:L,apis:{httpList:N,httpAdd:!0,httpStatus:O,httpUpdate:!0,httpDelete:T}},E={formItems:[{options:x,field:"type",type:"select",placeholder:"\u539F\u56E0\u7C7B\u578B"}]},j=R({__name:"index",setup(e){const n="unusualReason",a=f(null),l=f(!1),i=f(!1),p=f({}),A={pageSearchHook:()=>k(void 0,void 0,E)},B={content:{create:()=>{l.value=!1,i.value=!0},preview:u=>{const{id:s,type:o,result:r,result_desc:t}=u;p.value={id:s,type:o,result:r,result_desc:t},l.value=!0,i.value=!0},update:u=>{const{id:s,type:o,result:r,result_desc:t}=u;p.value={id:s,type:o,result:r,result_desc:t},l.value=!1,i.value=!0}}};async function w(){const{id:u,type:s,result:o,result_desc:r}=p.value,t=u===void 0||!u,v={id:u,type:s,result:o,result_desc:r};t&&delete v.id,(await(t?M:I)(v)).code===0?(i.value=!1,b.success(`${t?"\u6DFB\u52A0":"\u66F4\u65B0"}\u6210\u529F`),a.value.onSearch()):b.warning(`${t?"\u6DFB\u52A0":"\u66F4\u65B0"}\u5931\u8D25`)}return(u,s)=>{const o=h("PageContainer"),r=h("PageAuth");return S(),$(r,{pageName:n},{default:D(()=>[g(o,{hooks:A,events:B,contentConfig:F(V),"search-config":F(E),"get-content-ref":t=>a.value=t},null,8,["contentConfig","search-config","get-content-ref"]),g(U,{visible:i.value,"onUpdate:visible":s[0]||(s[0]=t=>i.value=t),data:p.value,"onUpdate:data":s[1]||(s[1]=t=>p.value=t),disabled:l.value,onSubmit:w},null,8,["visible","data","disabled"])]),_:1})}}});var Q=P(j,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/serviceParam/unusualReason/index.vue"]]);export{Q as default};