WokerTask/public/admin/assets/edit copy 2.a56357a1.js

2 lines
7.5 KiB
JavaScript
Raw Normal View History

2023-12-27 14:06:33 +08:00
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.b0ecf6ae.js";import{P as X}from"./index.3a572f9b.js";import{a as Y}from"./useDictOptions.adeec031.js";import{b as Z,c as ee,d as te}from"./admin.daaa57de.js";import{r as ae}from"./role.988dab1c.js";import{e as oe}from"./post.eb455df0.js";import{d as le}from"./department.da4e2f9b.js";import{b as ue,c as re,d as se}from"./common.68489d2e.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"./@popperjs.36402333.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.9e5a9063.js";import"./lodash.ffb5376d.js";import"./axios.f9df025a.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.4b0c77cb.js";import"./color.992612d2.js";import"./clone.d8d3ae9a.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.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),at=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(()=