import{a5 as T,C as h,D as I,N as L,O as Q,t as W,F as $}from"./element-plus.ff90c99c.js";import{_ as z}from"./picker.ffe50cdd.js";import{P as G}from"./index.000b2a9c.js";import{a as H}from"./useDictOptions.15bfecbd.js";import{b as J,c as K,d as M}from"./admin.a95437d5.js";import{r as X}from"./role.fe83a826.js";import{e as Y}from"./post.18441934.js";import{d as Z}from"./department.5d2f03e6.js";import{d as ee,s as C,r as oe,b as ue,$ as D,o as s,c as B,W as t,Q as a,u,a as d,F as A,a9 as y,P as m,T as k}from"./@vue.f8dfc830.js";import"./lodash-es.a73406b7.js";import"./@vueuse.a2e59ee9.js";import"./@element-plus.0374639c.js";import"./@popperjs.36402333.js";import"./@ctrl.b082b0c1.js";import"./dayjs.7f1be2bc.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./memoize-one.4ee5c96d.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./@floating-ui.34a21088.js";import"./index.5098f7f9.js";import"./index.vue_vue_type_script_setup_true_lang.44dbc460.js";import"./index.4cdb7b3d.js";import"./index.87cea444.js";import"./lodash.3e731b89.js";import"./axios.c2babb35.js";import"./vue-router.6d4cf914.js";import"./pinia.4b196199.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.3a7f085f.js";import"./color.5ae3e2dd.js";import"./clone.7bcb5228.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.37836f15.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.79024f1a.js";import"./index.d9c62109.js";import"./index.vue_vue_type_script_setup_true_lang.ec118b31.js";import"./usePaging.bd7a7dec.js";import"./vue3-video-play.5592bdaa.js";import"./vuedraggable.99ce9db3.js";import"./vue.80fb6650.js";import"./sortablejs.76b408b5.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.af59f801.js";const le={class:"edit-popup"},te=d("div",{class:"form-tips"},"\u5EFA\u8BAE\u5C3A\u5BF8\uFF1A100*100px\uFF0C\u652F\u6301jpg\uFF0Cjpeg\uFF0Cpng\u683C\u5F0F",-1),ae=d("div",{class:"form-tips"},"\u5141\u8BB8\u591A\u4EBA\u540C\u65F6\u5728\u7EBF\u767B\u5F55",-1),po=ee({__name:"edit copy",emits:["success","close"],setup(re,{expose:x,emit:V}){const v=C(),n=C(),c=oe("add"),U=ue(()=>c.value=="edit"?"\u7F16\u8F91\u7BA1\u7406\u5458":"\u5458"),o=D({id:"",account:"",name:"",dept_id:[],jobs_id:[],role_id:[],avatar:"",password:"",password_confirm:"",disable:0,multipoint_login:1,root:0}),E=(p,e,r)=>{o.password&&(e||r(new Error("\u8BF7\u518D\u6B21\u8F93\u5165\u5BC6\u7801")),e!==o.password&&r(new Error("\u4E24\u6B21\u8F93\u5165\u5BC6\u7801\u4E0D\u4E00\u81F4!"))),r()},_=D({account:[{required:!0,message:"\u8BF7\u8F93\u5165\u8D26\u53F7",trigger:["blur"]}],name:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0",trigger:["blur"]}],role_id:[{type:"array",required:!0,message:"\u8BF7\u9009\u62E9\u89D2\u8272",trigger:["blur"]}],password:[{required:!0,message:"\u8BF7\u8F93\u5165\u5BC6\u7801",trigger:["blur"]}],password_confirm:[{required:!0,message:"\u8BF7\u8F93\u5165\u786E\u8BA4\u5BC6\u7801",trigger:["blur"]},{validator:E,trigger:"blur"}]}),{optionsData:f}=H({role:{api:X},jobs:{api:Y},dept:{api:Z}}),j=async()=>{var p,e;await((p=v.value)==null?void 0:p.validate()),c.value=="edit"?await J(o):await K(o),(e=n.value)==null||e.close(),V("success")},R=(p="add")=>{var e;c.value=p,(e=n.value)==null||e.open()},q=async p=>{_.password=[],_.password_confirm=[{validator:E,trigger:"blur"}];const e=await M({id:p.id});for(const r in o)e[r]!=null&&e[r]!=null&&(o[r]=e[r])},N=()=>{V("close")};return x({open:R,setFormData:q}),(p,e)=>{const r=h,i=I,S=z,O=T,F=L,w=Q,g=W,P=$;return s(),B("div",le,[t(G,{ref_key:"popupRef",ref:n,title:u(U),async:!0,width:"550px",onConfirm:j,onClose:N},{default:a(()=>[t(P,{ref_key:"formRef",ref:v,model:u(o),"label-width":"84px",rules:u(_)},{default:a(()=>[t(i,{label:"\u8D26\u53F7",prop:"account"},{default:a(()=>[t(r,{modelValue:u(o).account,"onUpdate:modelValue":e[0]||(e[0]=l=>u(o).account=l),disabled:u(o).root==1,placeholder:"\u8BF7\u8F93\u5165\u8D26\u53F7",clearable:""},null,8,["modelValue","disabled"])]),_:1}),t(i,{label:"\u5934\u50CF"},{default:a(()=>[d("div",null,[d("div",null,[t(S,{modelValue:u(o).avatar,"onUpdate:modelValue":e[1]||(e[1]=l=>u(o).avatar=l),limit:1},null,8,["modelValue"])]),te])]),_:1}),t(i,{label:"\u540D\u79F0",prop:"name"},{default:a(()=>[t(r,{modelValue:u(o).name,"onUpdate:modelValue":e[2]||(e[2]=l=>u(o).name=l),placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0",clearable:""},null,8,["modelValue"])]),_:1}),t(i,{label:"\u5F52\u5C5E\u90E8\u95E8",prop:"dept_id"},{default:a(()=>[t(O,{class:"flex-1",modelValue:u(o).dept_id,"onUpdate:modelValue":e[3]||(e[3]=l=>u(o).dept_id=l),data:u(f).dept,clearable:"",multiple:"","node-key":"id",props:{value:"id",label:"name",disabled(l){return l.status!==1}},"check-strictly":"","default-expand-all":!0,placeholder:"\u8BF7\u9009\u62E9\u4E0A\u7EA7\u90E8\u95E8"},null,8,["modelValue","data","props"])]),_:1}),t(i,{label:"\u5C97\u4F4D",prop:"jobs_id"},{default:a(()=>[t(w,{class:"flex-1",modelValue:u(o).jobs_id,"onUpdate:modelValue":e[4]||(e[4]=l=>u(o).jobs_id=l),clearable:"",multiple:"",placeholder:"\u8BF7\u9009\u62E9\u5C97\u4F4D"},{default:a(()=>[(s(!0),B(A,null,y(u(f).jobs,(l,b)=>(s(),m(F,{key:b,label:l.name,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(i,{label:"\u89D2\u8272",prop:"role_id"},{default:a(()=>[t(w,{modelValue:u(o).role_id,"onUpdate:modelValue":e[5]||(e[5]=l=>u(o).role_id=l),disabled:u(o).root==1,class:"flex-1",multiple:"",placeholder:"\u8BF7\u9009\u62E9\u89D2\u8272",clearable:""},{default:a(()=>[u(o).root==1?(s(),m(F,{key:0,label:"\u7CFB\u7EDF\u7BA1\u7406\u5458",value:0})):k("",!0),(s(!0),B(A,null,y(u(f).role,(l,b)=>(s(),m(F,{key:b,label:l.name,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1}),t(i,{label:"\u5BC6\u7801",prop:"password"},{default:a(()=>[t(r,{modelValue:u(o).password,"onUpdate:modelValue":e[6]||(e[6]=l=>u(o).password=l),"show-password":"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801"},null,8,["modelValue"])]),_:1}),t(i,{label:"\u786E\u8BA4\u5BC6\u7801",prop:"password_confirm"},{default:a(()=>[t(r,{modelValue:u(o).password_confirm,"onUpdate:modelValue":e[7]||(e[7]=l=>u(o).password_confirm=l),"show-password":"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u786E\u8BA4\u5BC6\u7801"},null,8,["modelValue"])]),_:1}),u(o).root!=1?(s(),m(i,{key:0,label:"\u7BA1\u7406\u5458\u72B6\u6001"},{default:a(()=>[t(g,{modelValue:u(o).disable,"onUpdate:modelValue":e[8]||(e[8]=l=>u(o).disable=l),"active-value":0,"inactive-value":1},null,8,["modelValue"])]),_:1})):k("",!0),t(i,{label:"\u591A\u5904\u767B\u5F55"},{default:a(()=>[d("div",null,[t(g,{modelValue:u(o).multipoint_login,"onUpdate:modelValue":e[9]||(e[9]=l=>u(o).multipoint_login=l),"active-value":1,"inactive-value":0},null,8,["modelValue"]),ae])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{po as default};