index.5f8b97.js 2.8 KB

1
  1. import{aT as n,ac as b,al as C,a$ as E,_ as P,d as D,w as p,r as f,o as x,G as w,C as y,j as v,l as h,aN as m}from"./index.js";import S from"./modal.eb608d.js";import{u as $}from"./use-page-search.f7bc460e.js";import"./index.da6d65fd.js";const{VITE_PROXY_DOMAIN_REAL:H,VITE_PROXY_USER_REAL:k}=b(),l=k+"/admin/",R=e=>n.request("post",`${l}uselist`,{data:e}),U=e=>n.request("post",`${l}useedit`,{data:e}),q=e=>n.request("post",`${l}usecreate`,{data:e}),I=e=>n.request("post",`${l}usestatus`,{data:e}),N=e=>n.request("post",`${l}usedelete`,{data:e}),O=[{prop:"id",label:"ID",width:"80px"},{prop:"order_use",label:"\u8BA2\u5355\u7528\u9014\u540D\u79F0"},{label:"\u72B6\u6001",prop:"status",width:100,cellRenderer:({row:e})=>C(E,{type:String(e.status)==="1"?"success":"danger"},{default:()=>String(e.status)==="1"?"\u542F\u7528":"\u7981\u7528"})},{prop:"creater",label:"\u521B\u5EFA\u4EBA"},{prop:"addtime",label:"\u521B\u5EFA\u65F6\u95F4"},{prop:"",label:"\u64CD\u4F5C",fixed:"right",minWidth:"90px",slot:"operation"}],T={title:"\u8BA2\u5355\u7528\u9014\u7BA1\u7406",columns:O,apis:{httpList:R,httpAdd:!0,httpStatus:I,httpUpdate:!0,httpDelete:N}},L=[{id:"0",label:"\u7981\u7528"},{id:"1",label:"\u542F\u7528"}],_={formItems:[{field:"create_timer",type:"date_picker",otherOptions:{type:"daterange",startProp:"start",endProp:"end",startPlaceholder:"\u5F00\u59CB\u65F6\u95F4",endPlaceholder:"\u7ED3\u675F\u65F6\u95F4"}},{field:"status",type:"select",options:L,placeholder:"\u72B6\u6001"},{type:"input",field:"order_use",placeholder:"\u7528\u9014\u540D\u79F0"},{type:"input",field:"creater",placeholder:"\u521B\u5EFA\u4EBA"}]},M=D({__name:"index",setup(e){const g="orderuse",c=p(null),i=p(!1),a=p(!1),r=p({}),F={pageSearchHook:()=>$(void 0,void 0,_)},A={content:{create:()=>{i.value=!1,a.value=!0},preview:s=>{const{id:t,order_use:u}=s;r.value={id:t,order_use:u},i.value=!0,a.value=!0},update:s=>{const{id:t,order_use:u}=s;r.value={id:t,order_use:u},i.value=!1,a.value=!0}}};async function B(){const{id:s,order_use:t}=r.value,u=s===void 0||!s,d={id:s,order_use:t};u&&delete d.id,(await(u?q:U)(d)).code===0?(a.value=!1,m.success(`${u?"\u6DFB\u52A0":"\u66F4\u65B0"}\u6210\u529F`),c.value.onSearch()):m.warning(`${u?"\u6DFB\u52A0":"\u66F4\u65B0"}\u5931\u8D25`)}return(s,t)=>{const u=f("PageContainer"),d=f("PageAuth");return x(),w(d,{pageName:g},{default:y(()=>[v(u,{hooks:F,events:A,contentConfig:h(T),"search-config":h(_),"get-content-ref":o=>c.value=o},null,8,["contentConfig","search-config","get-content-ref"]),v(S,{visible:a.value,"onUpdate:visible":t[0]||(t[0]=o=>a.value=o),data:r.value,"onUpdate:data":t[1]||(t[1]=o=>r.value=o),disabled:i.value,onSubmit:B},null,8,["visible","data","disabled"])]),_:1})}}});var W=P(M,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/serviceParam/orderuse/index.vue"]]);export{W as default};