WokerTask/public/admin/assets/edit copy 2.90b15852.js

2 lines
7.6 KiB
JavaScript

import{C as Q,D as W,a2 as $,N as G,O as H,a3 as J,t as K,F as M}from"./element-plus.ff90c99c.js";import{P as X}from"./index.9321816e.js";import{a as Y}from"./useDictOptions.262f9fba.js";import{b as Z,c as ee,d as te}from"./admin.d62b44d7.js";import{r as ae}from"./role.02cd0e39.js";import{e as oe}from"./post.bff723ad.js";import{d as le}from"./department.58bf8ac5.js";import{b as ue,c as re,d as se}from"./common.5dd3b381.js";import{d as ne,s as h,r as ie,b as de,$ as g,o as d,c,W as a,Q as u,u as l,F as b,a9 as y,P as _,T as pe,a as me}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.vue_vue_type_style_index_0_scoped_95d1884e_lang.af59f801.js";import"./index.2c97e227.js";import"./lodash.2e6f447e.js";import"./axios.075403c9.js";import"./vue-router.6d4cf914.js";import"./pinia.4b196199.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.b6f240ee.js";import"./color.35874cfa.js";import"./clone.d8e67888.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.e6aad81b.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";const ce={class:"edit-popup"},_e=me("div",{style:{"font-size":"1.2rem",margin:"10px 0"}},"\u57FA\u672C\u4FE1\u606F\u521B\u5EFA",-1),st=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")},k=(r="add")=>{var e;w.value=r,(e=B.value)==null||e.open()};function x(r){t.province=r,q(r)}function U(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])},P=()=>{v("close")};return D({open:k,setFormData:j}),(r,e)=>{const s=Q,n=W,i=$,f=G,F=H,T=J,I=K,z=M;return d(),c("div",ce,[a(X,{ref_key:"popupRef",ref:B,title:l(A),async:!0,width:"80%",onConfirm:O,onClose:P},{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(T,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:U,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(I,{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{st as default};