2 lines
7.5 KiB
JavaScript
2 lines
7.5 KiB
JavaScript
import{B as K,C as M,a1 as Q,M as $,N as G,a2 as H,t as J,D as W}from"./element-plus.10e48c93.js";import{P as X}from"./index.d5254df7.js";import{a as Y}from"./useDictOptions.7b6fff65.js";import{b as Z,c as ee,d as te}from"./admin.c4e5ae12.js";import{r as ae}from"./role.61f9c375.js";import{e as oe}from"./post.ffb173b0.js";import{d as le}from"./department.bec0f9b4.js";import{b as ue,c as re,d as se}from"./common.2f884a05.js";import{d as ne,s as h,r as ie,e as de,$ 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 pe,a as me}from"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.c80b8015.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./index.5f96f8d7.js";import"./lodash.08438971.js";import"./axios.105476b3.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.7ac6f233.js";import"./color.44a05936.js";import"./clone.0afcbf90.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.86067895.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.40d5feba.js";const ce={class:"edit-popup"},_e=me("div",{style:{"font-size":"1.2rem",margin:"10px 0"}},"\u57FA\u672C\u4FE1\u606F\u521B\u5EFA",-1),lt=ne({__name:"edit copy 2",emits:["success","close"],setup(fe,{expose:D,emit:v}){const E=h(),B=h(),w=ie("add"),A=de(()=>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"}]});Y({role:{api:ae},jobs:{api:oe},dept:{api:le}});const O=async()=>{var r,e;await((r=E.value)==null?void 0:r.validate()),w.value=="edit"?await Z(t):await ee(t),(e=B.value)==null||e.close(),v("success")},U=(r="add")=>{var e;w.value=r,(e=B.value)==null||e.open()};function k(r){t.province=r,q(r)}function x(r){t.city=r,S(r)}function L(r){t.area=r,N(r)}function R(r){t.street=r}const q=async r=>{const e=await ue({city:r});p.cityOptions=e},S=async r=>{const e=await re({area:r});p.areaOptions=e},N=async r=>{const e=await se({street:r});p.streetOptions=e},j=async r=>{V.password=[],V.password_confirm=[{validator:C,trigger:"blur"}];const e=await te({id:r.id});for(const s in t)e[s]!=null&&e[s]!=null&&(t[s]=e[s])},T=()=>{v("close")};return D({open:U,setFormData:j}),(r,e)=>{const s=K,n=M,i=Q,f=$,F=G,I=H,P=J,z=W;return d(),c("div",ce,[a(X,{ref_key:"popupRef",ref:B,title:l(A),async:!0,width:"80%",onConfirm:O,onClose:T},{default:u(()=>[a(z,{ref_key:"formRef",ref:E,model:l(t),"label-width":"84px",rules:l(V)},{default:u(()=>[_e,a(i,{span:24,class:"pt-6 !border-none"},{default:u(()=>[a(I,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:k,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:x,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:L,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:R,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(P,{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})):pe("",!0)]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{lt as default};
|