import{P as R}from"./page.3b4d44cb.js";import{b7 as W,b as P,ar as j,a as z,E as p,_ as T,c as r,e as h,f as x,h as l,i as t,F as $,g as _,t as E,k as v,A as y,j as q,m as g,R as G,S as H}from"./index.0308b213.js";import{c as J,g as K,a as O,u as Q,b as X,s as Y,d as Z,e as ee,f as ae,h as le}from"./clerk.01becc32.js";import{M as te}from"./index.dfdc0704.js";import"./index.vue_vue_type_style_index_0_scoped_f00ed21d_lang.2c48f49b.js";import"./vuedraggable.umd.405b1bec.js";import"./index.35b8c9ab.js";import"./index.9e8820cd.js";import"./sort_out.2008c10d.js";const oe={components:{Page:R,MaterialSelect:te},setup(){const u=W(),a=P({loading:!1,delLoading:!1,addLoading:!1,showDialog:!1,loginUrl:window.location.protocol+"//"+window.location.host+"/admin/pawn/login",tableData:[],mobile:"",selectIds:[],roles:[],pawn_roles:[],showAvatarDialog:!1,avatar:"",changeAvatarId:0}),S=o=>{a.changeAvatarId=o,a.showAvatarDialog=!a.showAvatarDialog},i=()=>{if(!a.avatar){p.error("\u8BF7\u4E0A\u4F20\u5934\u50CF");return}J({id:a.changeAvatarId,avatar:a.avatar}).then(o=>{p.success("\u4FEE\u6539\u6210\u529F"),a.showAvatarDialog=!1,a.avatar="",a.changeAvatarId=0,c()})},U=P({page:1}),I=(o,d="url")=>{d=="router"&&(o=u.resolve({path:o}).href),window.open(o)},m=o=>{console.log("\u9009\u4E2D",o),a.selectIds=o.map(d=>d.id)},c=()=>{a.loading=!0,K({page:1}).then(o=>{console.log("\u8BF7\u6C42\u7ED3\u679C\uFF1A",o),a.tableData=o.list,a.roles=o.roles,a.pawn_roles=o.pawn_roles}).finally(()=>{a.loading=!1})};c();const F=()=>{a.addLoading=!0,O({mobile:a.mobile}).then(o=>{a.showDialog=!1,c(),p.success("\u6DFB\u52A0\u6210\u529F")}).finally(()=>{a.addLoading=!1})},B=o=>{const d=o.pawn_role_id,w=o.role_id;Q({id:o.clerk.id,pawn_role_id:d,role_id:w}).then(()=>{p({message:"\u8BBE\u7F6E\u5E97\u5458\u89D2\u8272\u6210\u529F",type:"success"}),c()})},s=(o,d,w)=>{X({id:o,type:d,value:w}).then(b=>{p.success("\u5207\u6362\u6210\u529F")})},k=o=>{Y({id:o}).then(d=>{p.success("\u8BBE\u7F6E\u7BA1\u7406\u5458\u6210\u529F"),c()})},f=o=>{a.delLoading=!0,Z({ids:o||a.selectIds}).then(d=>{p.success("\u5220\u9664\u6210\u529F"),c()}).finally(()=>{a.delLoading=!1})},D=(o,d)=>{ee({id:o,position:d}).then(w=>{p.success("\u4FEE\u6539\u6210\u529F"),c()})},C=(o,d)=>{ae({id:o,show_status:d?"normal":"hidden"}).then(b=>{p.success("\u4FEE\u6539\u6210\u529F"),c()})},V=(o,d)=>{le({id:o,uid:d}).then(w=>{p.success("\u4FEE\u6539\u6210\u529F"),c()})};return{...j(a),openWindow:I,params:U,add:F,tableSelects:m,changeStatus:s,setAdmin:k,del:f,dayjs:z,changePosition:D,handleCategoryChange:B,changeShowStatus:C,changeAvatar:S,changeAvatarSubmit:i,changeUid:V}}};const M=u=>(G("data-v-ddd4a6e8"),u=u(),H(),u),ue={class:"container"},ne=g("\u6DFB\u52A0\u5E97\u5458"),ie=M(()=>_("span",null,"\u6BCF\u4E2A\u5E97\u94FA\u53EF\u8BBE\u7F6E\u4E00\u4E2A\u7BA1\u7406\u5458, \u7BA1\u7406\u5458\u53EF\u5728\u7535\u8111\u7AEF\u767B\u5F55\u5178\u5F53\u540E\u53F0,\u5E97\u5458\u53EA\u80FD\u5728\u624B\u673A\u4E0A\u767B\u5F55\u7BA1\u7406\u95E8\u5E97\u3002\u7535\u8111\u7AEF\u767B\u5F55\u5730\u5740:",-1)),de=g("\u7BA1\u7406\u5458"),se=g("\u5E97\u5458"),re=g("\u8BBE\u4E3A\u7BA1\u7406\u5458"),ce=g("\u5220\u9664"),_e=g("\u66F4\u6362\u5934\u50CF"),ge=g("\u5220\u9664"),me=g("\u6DFB\u52A0\u5E97\u5458\u4E4B\u524D, \u4F60\u9700\u8981\u65B0\u589E\u4E00\u4E2A\u5E97\u5458\u8D26\u6237("),pe=g("), \u7136\u540E\u901A\u8FC7\u641C\u7D22\u201C\u624B\u673A\u53F7\u201D\u628A\u4ED6\u6DFB\u52A0\u8FDB\u6765"),we={class:"dialog-content"},he=M(()=>_("p",null,"\u5E97\u5458\u624B\u673A\u53F7",-1)),ve={class:"dialog-footer"},Fe=g("\u53D6\u6D88"),fe=g("\u6DFB\u52A0"),Ae={class:"dialog-footer"},Ee=g("\u53D6\u6D88"),Be=g("\u786E\u5B9A");function De(u,a,S,i,U,I){const m=r("el-button"),c=r("el-col"),F=r("el-row"),B=r("el-alert"),s=r("el-table-column"),k=r("el-image"),f=r("el-switch"),D=r("el-tag"),C=r("el-option"),V=r("el-select"),o=r("el-input"),d=r("el-table"),w=r("Page"),b=r("el-dialog"),N=r("MaterialSelect");return h(),x($,null,[l(w,{showBorder:!1,loading:u.loading},{main:t(()=>[_("div",ue,[l(F,null,{default:t(()=>[l(c,null,{default:t(()=>[l(m,{type:"primary",onClick:a[0]||(a[0]=e=>u.showDialog=!0)},{default:t(()=>[ne]),_:1})]),_:1})]),_:1}),l(F,null,{default:t(()=>[l(c,null,{default:t(()=>[l(B,{type:"warning",closable:!1,"show-icon":""},{default:t(()=>[ie,_("span",{class:"url",onClick:a[1]||(a[1]=e=>i.openWindow(`${u.loginUrl}`))},E(u.loginUrl),1)]),_:1})]),_:1})]),_:1}),l(F,null,{default:t(()=>[l(c,null,{default:t(()=>[l(d,{border:"",data:u.tableData,style:{width:"100%"},onSelectionChange:i.tableSelects},{default:t(()=>[l(s,{align:"center",type:"selection",width:"55"}),l(s,{align:"center",label:"\u5934\u50CF",width:"80"},{default:t(e=>[l(k,{style:{width:"48px",height:"48px"},src:e.row.avatar?e.row.avatar:e.row.clerk.avatar,fit:"contain"},null,8,["src"])]),_:1}),l(s,{align:"center",label:"\u5FAE\u4FE1\u6635\u79F0"},{default:t(e=>[_("span",null,E(e.row.clerk.nickname),1)]),_:1}),l(s,{align:"center",label:"\u5E97\u5458\u540D\u79F0"},{default:t(e=>[_("span",null,E(e.row.clerk.title),1)]),_:1}),l(s,{align:"center",label:"\u624B\u673A\u53F7"},{default:t(e=>[_("span",null,E(e.row.clerk.mobile),1)]),_:1}),l(s,{align:"center",label:" \u5FAE\u4FE1\u6A21\u677F\u6D88\u606F\u63D0\u9192\u8BED\u97F3\u7535\u8BDD\u63D0\u9192",width:"200"},{default:t(e=>{var n,L;return[((n=e.row.extra)==null?void 0:n.accept_wechat_notice)!=null?(h(),v(f,{key:0,modelValue:e.row.extra.accept_wechat_notice,"onUpdate:modelValue":A=>e.row.extra.accept_wechat_notice=A,"active-value":1,"inactive-value":0,"active-text":"\u6A21\u677F","inactive-text":"\u5173\u95ED",onChange:A=>i.changeStatus(e.row.clerk.id,"accept_wechat_notice",e.row.extra.accept_wechat_notice)},null,8,["modelValue","onUpdate:modelValue","onChange"])):y("",!0),((L=e.row.extra)==null?void 0:L.accept_voice_notice)!=null?(h(),v(f,{key:1,modelValue:e.row.extra.accept_voice_notice,"onUpdate:modelValue":A=>e.row.extra.accept_voice_notice=A,"active-value":1,"inactive-value":0,"active-text":"\u8BED\u97F3","inactive-text":"\u5173\u95ED",onChange:A=>i.changeStatus(e.row.clerk.id,"accept_voice_notice",e.row.extra.accept_voice_notice)},null,8,["modelValue","onUpdate:modelValue","onChange"])):y("",!0)]}),_:1}),l(s,{align:"center",label:"\u8EAB\u4EFD"},{default:t(e=>[e.row.role=="manager"?(h(),v(D,{key:0,type:"danger",effect:"dark"},{default:t(()=>[de]),_:1})):(h(),v(D,{key:1,type:"success",effect:"dark"},{default:t(()=>[se]),_:1}))]),_:1}),l(s,{label:"\u5178\u5F53\u89D2\u8272",width:"120px",align:"center"},{default:t(e=>[l(V,{modelValue:e.row.pawn_role_id,"onUpdate:modelValue":n=>e.row.pawn_role_id=n,placeholder:"\u8BF7\u9009\u62E9\u89D2\u8272",onChange:n=>i.handleCategoryChange(e.row),filterable:""},{default:t(()=>[l(C,{label:"\u65E0",value:0}),(h(!0),x($,null,q(u.pawn_roles,n=>(h(),v(C,{key:"table-category-label"+n.id,label:n.name,value:n.id},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),l(s,{align:"center",label:"\u5C97\u4F4D"},{default:t(e=>[l(o,{modelValue:e.row.position,"onUpdate:modelValue":n=>e.row.position=n,size:"mini",placeholder:"\u8BF7\u8F93\u5165\u5C97\u4F4D",onBlur:n=>i.changePosition(e.row.id,e.row.position)},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1}),l(s,{align:"center",label:"uid"},{default:t(e=>[l(o,{modelValue:e.row.uid,"onUpdate:modelValue":n=>e.row.uid=n,size:"mini",placeholder:"\u8BF7\u8F93\u5165uid",onBlur:n=>i.changeUid(e.row.id,e.row.uid)},null,8,["modelValue","onUpdate:modelValue","onBlur"])]),_:1}),l(s,{align:"center",label:"\u663E\u793A\u72B6\u6001",width:"150"},{default:t(e=>[l(f,{modelValue:e.row.show_status,"onUpdate:modelValue":n=>e.row.show_status=n,"active-value":"normal","inactive-value":"hidden","active-text":"\u663E\u793A","inactive-text":"\u9690\u85CF",onClick:n=>i.changeShowStatus(e.row.id,e.row.show_status)},null,8,["modelValue","onUpdate:modelValue","onClick"])]),_:1}),l(s,{align:"center",label:"\u6DFB\u52A0\u65F6\u95F4"},{default:t(e=>[_("span",null,E(e.row.clerk.addtime),1)]),_:1}),l(s,{align:"center",label:"\u64CD\u4F5C"},{default:t(e=>[e.row.role!="manager"?(h(),v(m,{key:0,onClick:n=>i.setAdmin(e.row.id)},{default:t(()=>[re]),_:2},1032,["onClick"])):y("",!0),l(m,{onClick:n=>i.del([e.row.id])},{default:t(()=>[ce]),_:2},1032,["onClick"]),l(m,{onClick:n=>i.changeAvatar(e.row.id)},{default:t(()=>[_e]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data","onSelectionChange"])]),_:1})]),_:1}),l(m,{type:"danger",loading:u.delLoading,onClick:a[2]||(a[2]=e=>i.del())},{default:t(()=>[ge]),_:1},8,["loading"])])]),_:1},8,["loading"]),l(b,{modelValue:u.showDialog,"onUpdate:modelValue":a[7]||(a[7]=e=>u.showDialog=e),title:"\u6DFB\u52A0\u5E97\u5458",draggable:""},{footer:t(()=>[_("span",ve,[l(m,{onClick:a[5]||(a[5]=e=>u.showDialog=!1)},{default:t(()=>[Fe]),_:1}),l(m,{loading:u.addLoading,type:"primary",onClick:a[6]||(a[6]=e=>i.add())},{default:t(()=>[fe]),_:1},8,["loading"])])]),default:t(()=>[l(B,{closable:!1,"show-icon":""},{default:t(()=>[_("span",null,[me,_("span",{class:"url",onClick:a[3]||(a[3]=e=>i.openWindow("/store/shop/managementPortal","router"))},"\u6CE8\u518C\u94FE\u63A5"),pe])]),_:1}),_("div",we,[he,l(o,{modelValue:u.mobile,"onUpdate:modelValue":a[4]||(a[4]=e=>u.mobile=e),placeholder:"\u8BF7\u8F93\u5165\u5E97\u5458\u624B\u673A\u53F7"},null,8,["modelValue"])])]),_:1},8,["modelValue"]),l(b,{modelValue:u.showAvatarDialog,"onUpdate:modelValue":a[11]||(a[11]=e=>u.showAvatarDialog=e),title:"\u66F4\u6362\u5934\u50CF",draggable:""},{footer:t(()=>[_("span",Ae,[l(m,{onClick:a[9]||(a[9]=e=>u.showAvatarDialog=!1)},{default:t(()=>[Ee]),_:1}),l(m,{loading:u.avatarLoading,type:"primary",onClick:a[10]||(a[10]=e=>i.changeAvatarSubmit())},{default:t(()=>[Be]),_:1},8,["loading"])])]),default:t(()=>[l(N,{limit:1,modelValue:u.avatar,"onUpdate:modelValue":a[8]||(a[8]=e=>u.avatar=e)},null,8,["modelValue"])]),_:1},8,["modelValue"])],64)}const Pe=T(oe,[["render",De],["__scopeId","data-v-ddd4a6e8"]]);export{Pe as default};