2 lines
7.6 KiB
JavaScript
2 lines
7.6 KiB
JavaScript
import{B as K,C as M,_ as Q,M as G,N as H,$ as J,t as W,D as X}from"./element-plus.9c2fdfa8.js";import{P as Y}from"./index.3fc23cf2.js";import{a as Z}from"./useDictOptions.773276bb.js";import{b as ee,c as te,d as ae}from"./admin.bb6f7166.js";import{r as oe}from"./role.38f9c5c3.js";import{e as le}from"./post.e99bb110.js";import{d as ue}from"./department.e3fb3938.js";import{b as re,c as se,d as ne}from"./common.3730292b.js";import{d as ie,s as h,r as de,e as pe,$ as g,o as d,c,U as a,L as u,u as l,T as b,a7 as y,K as _,Q as me,a as ce}from"./@vue.53f8d7c3.js";import"./@vueuse.038954e7.js";import"./@element-plus.37f92579.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./@popperjs.36402333.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.vue_vue_type_style_index_0_scoped_187b1ead_lang.33043b78.js";import"./index.b57b84f0.js";import"./lodash.5512e984.js";import"./axios.92474d72.js";import"./vue-router.e2f4a118.js";import"./pinia.bd103f5d.js";import"./vue-demi.ebc8116b.js";import"./css-color-function.ee641d3d.js";import"./color.cbc2f3a9.js";import"./clone.7fddbad2.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.a7d78d4d.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.8d7a50ae.js";import"./zrender.1084fa23.js";import"./tslib.60310f1a.js";import"./highlight.js.4ebdf9a4.js";import"./@highlightjs.9cf3e967.js";const _e={class:"edit-popup"},fe=ce("div",{style:{"font-size":"1.2rem",margin:"10px 0"}},"\u57FA\u672C\u4FE1\u606F\u521B\u5EFA",-1),rt=ie({__name:"edit copy 2",emits:["success","close"],setup(Fe,{expose:D,emit:A}){const v=A,E=h(),B=h(),w=de("add"),O=pe(()=>w.value=="edit"?"\u7F16\u8F91\u7BA1\u7406\u5458":"\u65B0\u589E\u7BA1\u7406\u5458"),t=g({id:"",account:"",sex:1,id_card:"",name:"",province:"",city:"",area:"",street:"",address:"",phone:"",qualification:{id_card:"",car_card:"",bank_account:""},is_contract:0,dept_id:[],jobs_id:[],role_id:[],avatar:"",password:"",password_confirm:"",disable:0,multipoint_login:1,root:0}),p=g({provinceOptions:[],cityOptions:[],areaOptions:[],streetOptions:[],dictTypeLists:[],contract_type:[]}),C=(r,e,s)=>{t.password&&(e||s(new Error("\u8BF7\u518D\u6B21\u8F93\u5165\u5BC6\u7801")),e!==t.password&&s(new Error("\u4E24\u6B21\u8F93\u5165\u5BC6\u7801\u4E0D\u4E00\u81F4!"))),s()},V=g({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:C,trigger:"blur"}]});Z({role:{api:oe},jobs:{api:le},dept:{api:ue}});const U=async()=>{var r,e;await((r=E.value)==null?void 0:r.validate()),w.value=="edit"?await ee(t):await te(t),(e=B.value)==null||e.close(),v("success")},k=(r="add")=>{var e;w.value=r,(e=B.value)==null||e.open()};function x(r){t.province=r,S(r)}function L(r){t.city=r,N(r)}function R(r){t.area=r,j(r)}function q(r){t.street=r}const S=async r=>{const e=await re({city:r});p.cityOptions=e},N=async r=>{const e=await se({area:r});p.areaOptions=e},j=async r=>{const e=await ne({street:r});p.streetOptions=e},T=async r=>{V.password=[],V.password_confirm=[{validator:C,trigger:"blur"}];const e=await ae({id:r.id});for(const s in t)e[s]!=null&&e[s]!=null&&(t[s]=e[s])},I=()=>{v("close")};return D({open:k,setFormData:T}),(r,e)=>{const s=K,n=M,i=Q,f=G,F=H,P=J,$=W,z=X;return d(),c("div",_e,[a(Y,{ref_key:"popupRef",ref:B,title:l(O),async:!0,width:"80%",onConfirm:U,onClose:I},{default:u(()=>[a(z,{ref_key:"formRef",ref:E,model:l(t),"label-width":"84px",rules:l(V)},{default:u(()=>[fe,a(i,{span:24,class:"pt-6 !border-none"},{default:u(()=>[a(P,null,{default:u(()=>[a(i,{span:12},{default:u(()=>[a(n,{label:"\u59D3\u540D",prop:"name"},{default:u(()=>[a(s,{modelValue:l(t).name,"onUpdate:modelValue":e[0]||(e[0]=o=>l(t).name=o),placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D",clearable:"",style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1}),a(i,{span:12},{default:u(()=>[a(n,{label:"\u6027\u522B",prop:"sex"},{default:u(()=>[a(s,{modelValue:l(t).sex,"onUpdate:modelValue":e[1]||(e[1]=o=>l(t).sex=o),placeholder:"\u8BF7\u8F93\u5165\u6027\u522B",clearable:"",style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1}),a(i,{span:12},{default:u(()=>[a(n,{label:"\u8EAB\u4EFD\u8BC1\u53F7",prop:"id_card"},{default:u(()=>[a(s,{modelValue:l(t).id_card,"onUpdate:modelValue":e[2]||(e[2]=o=>l(t).id_card=o),placeholder:"\u8BF7\u8F93\u5165\u8EAB\u4EFD\u8BC1\u53F7",clearable:"",style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1}),a(i,{span:12},{default:u(()=>[a(n,{label:"\u8054\u7CFB\u7535\u8BDD",prop:"phone"},{default:u(()=>[a(s,{modelValue:l(t).phone,"onUpdate:modelValue":e[3]||(e[3]=o=>l(t).phone=o),placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u7535\u8BDD",clearable:"",style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1}),a(i,{span:3},{default:u(()=>[a(n,{label:"\u7701",prop:"province"},{default:u(()=>[a(F,{modelValue:l(t).province,"onUpdate:modelValue":e[4]||(e[4]=o=>l(t).province=o),placeholder:"\u8BF7\u9009\u62E9\u7701",clearable:"",onChange:x,style:{width:"100%"}},{default:u(()=>[(d(!0),c(b,null,y(l(p).provinceOptions,(o,m)=>(d(),_(f,{key:m,label:o.province_name,value:o.province_code},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(i,{span:3},{default:u(()=>[a(n,{label:"\u5E02",prop:"city"},{default:u(()=>[a(F,{modelValue:l(t).city,"onUpdate:modelValue":e[5]||(e[5]=o=>l(t).city=o),placeholder:"\u8BF7\u9009\u62E9\u5E02",clearable:"",onChange:L,style:{width:"100%"}},{default:u(()=>[(d(!0),c(b,null,y(l(p).cityOptions,(o,m)=>(d(),_(f,{key:m,label:o.city_name,value:o.city_code},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(i,{span:3},{default:u(()=>[a(n,{label:"\u533A",prop:"area"},{default:u(()=>[a(F,{modelValue:l(t).area,"onUpdate:modelValue":e[6]||(e[6]=o=>l(t).area=o),placeholder:"\u8BF7\u9009\u62E9\u533A",clearable:"",onChange:R,style:{width:"100%"}},{default:u(()=>[(d(!0),c(b,null,y(l(p).areaOptions,(o,m)=>(d(),_(f,{key:m,label:o.area_name,value:o.area_code},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(i,{span:3},{default:u(()=>[a(n,{label:"\u9547",prop:"street"},{default:u(()=>[a(F,{modelValue:l(t).street,"onUpdate:modelValue":e[7]||(e[7]=o=>l(t).street=o),placeholder:"\u8BF7\u9009\u62E9\u9547",clearable:"",onChange:q,style:{width:"100%"}},{default:u(()=>[(d(!0),c(b,null,y(l(p).streetOptions,(o,m)=>(d(),_(f,{key:m,label:o.street_name,value:o.street_code},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(i,{span:12},{default:u(()=>[a(n,{label:"\u6751\u793E\u5C0F\u961F",prop:"address"},{default:u(()=>[a(s,{modelValue:l(t).address,"onUpdate:modelValue":e[8]||(e[8]=o=>l(t).address=o),placeholder:"\u8BF7\u8F93\u5165\u6751\u793E\u5C0F\u961F",clearable:"",style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1}),l(t).root!=1?(d(),_(n,{key:0,label:"\u7BA1\u7406\u5458\u72B6\u6001"},{default:u(()=>[a($,{modelValue:l(t).disable,"onUpdate:modelValue":e[9]||(e[9]=o=>l(t).disable=o),"active-value":0,"inactive-value":1},null,8,["modelValue"])]),_:1})):me("",!0)]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{rt as default};
|