"use strict";(self["webpackChunkaida"]=self["webpackChunkaida"]||[]).push([[9206],{89206:function(e,t,a){a.r(t),a.d(t,{default:function(){return f}});var s=a(66252),i=a(49963);const l=e=>((0,s.dD)("data-v-7dae31b1"),e=e(),(0,s.Cn)(),e),r={class:"admin_page"},n={class:"admin_table_search"},o={class:"admin_state"},c={class:"admin_state_item admin_table_voluntarily"},u=l((()=>(0,s._)("span",null,"voluntarily:",-1))),d={class:"admin_state_item"},h=l((()=>(0,s._)("span",null,"State:",-1))),p={class:"admin_search"},g={class:"admin_table_content",ref:"historyTable"},m={key:0,class:"operate_list"},v=["onClick"],_=["onClick"];function y(e,t,a,l,y,w){const k=(0,s.up)("a-switch"),S=(0,s.up)("a-select"),b=(0,s.up)("a-table");return(0,s.wg)(),(0,s.iD)("div",r,[(0,s._)("div",n,[(0,s._)("div",o,[(0,s._)("div",c,[u,(0,s.Wm)(k,{checked:e.voluntarily,"onUpdate:checked":t[0]||(t[0]=t=>e.voluntarily=t),onChange:e.setIsAutoApproval},null,8,["checked","onChange"])]),(0,s._)("div",d,[h,(0,s.Wm)(S,{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"])])]),(0,s._)("div",p,[(0,s._)("div",{class:"admin_search_item",onClick:t[2]||(t[2]=(...t)=>e.searchHistoryList&&e.searchHistoryList(...t))},"Search")])]),(0,s._)("div",g,[(0,s.Wm)(b,{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:(0,s.w5)((({column:t,text:a,record:l,index:r})=>[t?.Operations?((0,s.wg)(),(0,s.iD)("div",m,[(0,s.wy)((0,s._)("div",{class:"operate_item",onClick:t=>e.setAagree(l,r)}," agree ",8,v),[[i.F8,0==e.status]]),(0,s.wy)((0,s._)("div",{class:"operate_item",onClick:t=>e.setRefuse(l,r)}," refuse ",8,_),[[i.F8,0==e.status]])])):(0,s.kq)("",!0)])),_:1},8,["columns","data-source","scroll","onChange","pagination"])],512)])}var w=a(2262),k=a(32339),S=a(74961),b=a(61446),A=(0,s.aZ)({components:{},setup(){let e=(0,w.iH)({});const t=(0,s.Fl)((()=>[{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=(0,w.iH)({name:"all",value:"",state:!1}),i=(0,w.iH)([{label:"all",value:""},{label:"pending",value:0},{label:"agree",value:1},{label:"rejected",value:2}]),l=(0,w.iH)([]),r={},n=(0,w.iH)(0),o=(0,w.iH)(!1);return{columns:t,collectionList:l,renameData:e,userInfo:r,status:n,currentState:a,state:i,voluntarily:o}},data(){return{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();let t=(0,k.ej)("userInfo");this.userInfo=JSON.parse(t),this.getIsAutoApproval()},methods:{changePage(e){this.currentPage=e.current,this.pageSize=e.pageSize,this.gettrialList()},getIsAutoApproval(){S.V.axiosPost(S.V.httpUrls.getIsAutoApproval,{}).then((e=>{this.voluntarily=e}))},searchHistoryList(){this.currentPage=1,this.gettrialList()},setIsAutoApproval(){S.V.axiosPost(S.V.httpUrls.switchIsAutoApproval,{}).then((e=>{this.getIsAutoApproval}))},gettrialList(){let e={page:this.currentPage,size:this.pageSize,status:this.currentState.value};S.V.axiosPost(S.V.httpUrls.trialOrderList,e).then((e=>{this.collectionList=e.content}))},setAgree(e,t){const a=new FormData;a.append("ids",e.id);S.V.axiosPost(S.V.httpUrls.trialOrderApproval,{ids:e.id}).then((e=>{b.ZP.success("同意成功~")}))},setRefuse(e,t){const a=new FormData;a.append("ids",e.id);let s={headers:{"Content-Type":"multipart/form-data",Accept:"*/*"}};S.V.axiosPost(S.V.httpUrls.trialOrderRefuse,a,s).then((e=>{this.gettrialList(),b.ZP.success("拒绝成功~")}))},setState(){this.currentState.state=!0},setStateItem(e){this.currentState=e,this.currentState.state=!1}}}),C=a(83744);const I=(0,C.Z)(A,[["render",y],["__scopeId","data-v-7dae31b1"]]);var f=I}}]);