import{H as e,_ as t}from"./index-ANzWZHpw.js";import{h as a,o as s,j as i,F as l}from"./antd-CKo75OZH.js";import{d as r,k as n,c as o,a0 as c,a3 as d,f as u,a8 as h,a1 as p,a5 as m,v as g,A as v}from"./vendor-DezibNX8.js";import"./utils-D7vwahzQ.js";const y=r({components:{},setup(){let e=n({});const t=o(()=>[{title:"Email",align:"center",ellipsis:!0,width:100,dataIndex:"email",key:"email"},{title:"Create Time",align:"center",width:70,dataIndex:"updateTime",key:"updateTime"},{title:"State",align:"center",ellipsis:!0,width:70,dataIndex:"status",key:"status",customRender:e=>{let t;return 0==e.value?t="pending":1==e.value?t="agree":2==e.value&&(t="reject"),t}},{title:"Address",align:"center",ellipsis:!0,width:70,dataIndex:"country",key:"country"},{title:"Surname",align:"center",ellipsis:!0,width:70,dataIndex:"surname",key:"surname"},{title:"User Name",align:"center",ellipsis:!0,width:70,dataIndex:"userName",key:"userName"},{title:"Operations",key:"operation",align:"center",fixed:"right",width:70,Operations:!0}]);let a=n({name:"all",value:"",state:!1}),s=n([{label:"all",value:""},{label:"pending",value:0},{label:"agree",value:1},{label:"rejected",value:2}]);return{columns:t,collectionList:n([]),renameData:e,status:n(0),currentState:a,state:s,voluntarily:n(!1)}},data:()=>({currentPage:1,pageSize:10,total:0,historyTableHeight:0,newCollectionName:"",renameVisivle:!1,collectionName:"",searchCollectionName:""}),mounted(){let e=this.$refs.historyTable;this.historyTableHeight=e.clientHeight-200,this.gettrialList(),this.getIsAutoApproval()},methods:{changePage(e){this.currentPage=e.current,this.pageSize=e.pageSize,this.gettrialList()},getIsAutoApproval(){e.axiosPost(e.httpUrls.getIsAutoApproval,{}).then(e=>{this.voluntarily=e})},searchHistoryList(){this.currentPage=1,this.gettrialList()},setIsAutoApproval(){e.axiosPost(e.httpUrls.switchIsAutoApproval,{}).then(e=>{this.getIsAutoApproval})},gettrialList(){let t={page:this.currentPage,size:this.pageSize,status:this.currentState.value};e.axiosPost(e.httpUrls.trialOrderList,t).then(e=>{this.collectionList=e.content})},setAgree(t,s){(new FormData).append("ids",t.id),e.axiosPost(e.httpUrls.trialOrderApproval,{ids:t.id}).then(e=>{a.success("同意成功~")})},setRefuse(t,s){const i=new FormData;i.append("ids",t.id);e.axiosPost(e.httpUrls.trialOrderRefuse,i,{headers:{"Content-Type":"multipart/form-data",Accept:"*/*"}}).then(e=>{this.gettrialList(),a.success("拒绝成功~")})},setState(){this.currentState.state=!0},setStateItem(e){this.currentState=e,this.currentState.state=!1}}}),_={class:"admin_page"},A={class:"admin_table_search"},S={class:"admin_state"},k={class:"admin_state_item admin_table_voluntarily"},x={class:"admin_state_item"},w={class:"admin_search"},C={class:"admin_table_content",ref:"historyTable"},b={key:0,class:"operate_list"},I=["onClick"],f=["onClick"];const P=t(y,[["render",function(e,t,a,r,n,o){const y=s,P=i,L=l;return p(),c("div",_,[d("div",A,[d("div",S,[d("div",k,[t[3]||(t[3]=d("span",null,"voluntarily:",-1)),u(y,{checked:e.voluntarily,"onUpdate:checked":t[0]||(t[0]=t=>e.voluntarily=t),onChange:e.setIsAutoApproval},null,8,["checked","onChange"])]),d("div",x,[t[4]||(t[4]=d("span",null,"State:",-1)),u(P,{value:e.currentState.value,"onUpdate:value":t[1]||(t[1]=t=>e.currentState.value=t),size:"large",style:{width:"280px"},optionFilterProp:"label",options:e.state,placeholder:"Please select",allowClear:"","show-search":""},null,8,["value","options"])])]),d("div",w,[d("div",{class:"admin_search_item",onClick:t[2]||(t[2]=(...t)=>e.searchHistoryList&&e.searchHistoryList(...t))},"Search")])]),d("div",C,[u(L,{columns:e.columns,"data-source":e.collectionList,scroll:{y:e.historyTableHeight},onChange:e.changePage,pagination:{showSizeChanger:!0,current:e.currentPage,pageSize:e.pageSize,total:e.total,showQuickJumper:!0,bordered:!1}},{bodyCell:h(({column:t,text:a,record:s,index:i})=>[(null==t?void 0:t.Operations)?(p(),c("div",b,[g(d("div",{class:"operate_item",onClick:t=>e.setAgree(s,i)}," agree ",8,I),[[v,0==e.status]]),g(d("div",{class:"operate_item",onClick:t=>e.setRefuse(s,i)}," refuse ",8,f),[[v,0==e.status]])])):m("",!0)]),_:1},8,["columns","data-source","scroll","onChange","pagination"])],512)])}],["__scopeId","data-v-19edddc0"]]);export{P as default};
