Files
zyt/server/public/admin/assets/edit-Bb9aZM6p.js
T
2026-04-20 09:04:54 +08:00

2 lines
11 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{D as W,R as X,B as Y,C as Z,G as h,I as ee,h as le,S as oe,P as te,Q as ae,g as re,i as de,e as ne}from"./element-plus-6h1hTCrQ.js";import{_ as ie}from"./picker-RR6i8slw.js";import{b as se,d as pe,e as ue}from"./admin-CKTixM2o.js";import{d as me}from"./department-X4a55vKC.js";import{j as fe}from"./post-B4qJ4BpN.js";import{i as _e,m as ge,_ as be}from"./index-55neFmjq.js";import{u as ce}from"./useDictOptions-CA4QiMnI.js";import{f as Ve,ak as _,I as v,a as t,aN as r,O as p,G as w,J as u,H as ve,F as S,ap as B,A as we}from"./@vue/runtime-core-C0pg79pw.js";import{y as l,a as ye,u as xe,o as b,r as I}from"./@vue/reactivity-BIbyPIZJ.js";import{Q as N}from"./@vue/shared-mAAVTE9n.js";import"./@vue/runtime-dom-iFk_KP8y.js";import"./lodash-D3kF6u-c.js";import"./@element-plus/icons-vue-jYCthPJY.js";import"./lodash-es-C2A-Pj28.js";import"./@popperjs/core-C5az9QE8.js";import"./dayjs-DG77mNTn.js";import"./@ctrl/tinycolor-BuyEbX8F.js";import"./async-validator-CFA_igpM.js";import"./normalize-wheel-es-BQoi3Ox2.js";import"./index-DsSo_l55.js";import"./index-B687Zw9l.js";import"./index.vue_vue_type_script_setup_true_lang-CLVBLrJv.js";import"./index-vledklw3.js";import"./index-D6IS__U-.js";import"./index.vue_vue_type_script_setup_true_lang-CU4vN34y.js";import"./@vueuse/core-DIKi2bJB.js";import"./@vueuse/shared-D8934tfB.js";import"./file-Bl00fTDO.js";import"./usePaging-B_C_SZ2Z.js";import"./vuedraggable-C3E4D3Yv.js";import"./vue-tI-HfQaQ.js";import"./@vue/compiler-dom-CqayqxS7.js";import"./@vue/compiler-core-CvbQOXIO.js";import"./sortablejs-dsEAUXlE.js";import"./jspdf-BsthCvR5.js";import"./@babel/runtime-BanGtE2-.js";import"./fflate-_ayOYiT1.js";import"./vue-router-CYz6RFzi.js";import"./pinia-Ba_jX6-d.js";import"./axios-C80V62Fs.js";import"./css-color-function-DI01JAaZ.js";import"./balanced-match-BdS7OldZ.js";import"./color-B2zxaWkI.js";import"./clone-DBZ6_OiU.js";import"./color-convert-OrFsTA_V.js";import"./color-name-Dju3oUBS.js";import"./color-string-pUQDDJII.js";import"./ms-CzQ2E3wO.js";import"./vue-clipboard3-DByT_rEQ.js";import"./clipboard-CHgxszqY.js";import"./echarts-CZvD9OL_.js";import"./tslib-BDyQ-Jie.js";import"./zrender-BQyIY4j9.js";import"./highlight.js-Bxt7hFFy.js";import"./@highlightjs/vue-plugin-BVMzZUvF.js";const Ee={class:"edit-drawer"},Ue={class:"text-primary font-medium"},je={class:"ml-2 text-gray-500"},ke={class:"flex justify-end"},De=Ve({__name:"edit",emits:["success","close"],setup(qe,{expose:O,emit:F}){const y=F,x=xe(),f=b(!1),m=b("add"),c=b(!1),E=b([]),A=async()=>{const i=await ge({type:"department"});E.value=(i==null?void 0:i.department)||[]},G=we(()=>m.value=="edit"?"编辑医助":"新增医助"),o=I({id:"",account:"",name:"",gender:1,age:null,phone:"",role_id:[2],dept_id:[],jobs_id:[],avatar:"",title:"",department:"",specialty:"",education:"",experience:"",honors:"",password:"",password_confirm:"",disable:0,multipoint_login:1,diagnosis_count:null}),{optionsData:U}=ce({jobs:{api:fe},dept:{api:me}}),V=(i,e,n)=>{o.password&&(e||n(new Error("请再次输入密码")),e!==o.password&&n(new Error("两次输入密码不一致!"))),n()},g=I({account:[{required:!0,message:"请输入账号",trigger:["blur"]}],name:[{required:!0,message:"请输入姓名",trigger:["blur"]}],gender:[{required:!0,message:"请选择性别",trigger:["change"]}],dept_id:[{required:!0,type:"array",min:1,message:"请选择归属部门",trigger:["change"]}],phone:[{validator:(i,e,n)=>{e&&!/^1[3-9]\d{9}$/.test(e)?n(new Error("请输入正确的手机号")):n()},trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:["blur"]}],password_confirm:[{required:!0,message:"请输入确认密码",trigger:["blur"]},{validator:V,trigger:"blur"}]}),T=async()=>{var i;try{await((i=x.value)==null?void 0:i.validate()),c.value=!0,m.value=="edit"?await se(o):await pe(o),_e.msgSuccess(m.value=="edit"?"编辑成功":"新增成功"),f.value=!1,y("success")}catch(e){console.error("提交失败:",e)}finally{c.value=!1}},P=(i="add")=>{m.value=i,f.value=!0,A(),i==="add"&&(Object.assign(o,{id:"",account:"",name:"",gender:1,age:null,phone:"",role_id:[2],dept_id:[],jobs_id:[],avatar:"",title:"",department:"",specialty:"",education:"",experience:"",honors:"",password:"",password_confirm:"",disable:0,multipoint_login:1,diagnosis_count:null}),g.password=[{required:!0,message:"请输入密码",trigger:["blur"]}],g.password_confirm=[{required:!0,message:"请输入确认密码",trigger:["blur"]},{validator:V,trigger:"blur"}])},Q=async i=>{g.password=[],g.password_confirm=[{validator:V,trigger:"blur"}];const e=await ue({id:i.id});for(const n in o)e[n]!=null&&e[n]!=null&&(o[n]=e[n]);o.role_id.includes(2)||o.role_id.push(2)},j=()=>{f.value=!1,y("close")};return O({open:P,setFormData:Q}),(i,e)=>{const n=X,d=Y,s=Z,z=ie,k=ee,H=h,J=le,L=oe,D=ae,q=te,C=re,$=W,R=de,K=ne;return _(),v("div",Ee,[t(K,{modelValue:l(f),"onUpdate:modelValue":e[18]||(e[18]=a=>ye(f)?f.value=a:null),title:l(G),direction:"rtl",size:"780px","before-close":j},{footer:r(()=>[u("div",ke,[t(R,{onClick:j},{default:r(()=>[...e[29]||(e[29]=[p("取消",-1)])]),_:1}),t(R,{type:"primary",onClick:T,loading:l(c)},{default:r(()=>[...e[30]||(e[30]=[p("确定",-1)])]),_:1},8,["loading"])])]),default:r(()=>[t($,{ref_key:"formRef",ref:x,model:l(o),"label-width":"100px",rules:l(g)},{default:r(()=>[t(n,{"content-position":"left"},{default:r(()=>[...e[19]||(e[19]=[p("基本信息",-1)])]),_:1}),l(m)==="edit"&&l(o).diagnosis_count!=null?(_(),w(d,{key:0,label:"创建诊单数"},{default:r(()=>[u("span",Ue,N(l(o).diagnosis_count),1),e[20]||(e[20]=u("span",{class:"text-tx-secondary text-sm ml-2"},"条",-1))]),_:1})):ve("",!0),t(d,{label:"账号",prop:"account"},{default:r(()=>[t(s,{modelValue:l(o).account,"onUpdate:modelValue":e[0]||(e[0]=a=>l(o).account=a),placeholder:"请输入账号",clearable:""},null,8,["modelValue"])]),_:1}),t(d,{label:"头像"},{default:r(()=>[u("div",null,[u("div",null,[t(z,{modelValue:l(o).avatar,"onUpdate:modelValue":e[1]||(e[1]=a=>l(o).avatar=a),limit:1},null,8,["modelValue"])]),e[21]||(e[21]=u("div",{class:"form-tips"},"建议尺寸:100*100px,支持jpgjpegpng格式",-1))])]),_:1}),t(d,{label:"姓名",prop:"name"},{default:r(()=>[t(s,{modelValue:l(o).name,"onUpdate:modelValue":e[2]||(e[2]=a=>l(o).name=a),placeholder:"请输入姓名",clearable:""},null,8,["modelValue"])]),_:1}),t(d,{label:"性别",prop:"gender"},{default:r(()=>[t(H,{modelValue:l(o).gender,"onUpdate:modelValue":e[3]||(e[3]=a=>l(o).gender=a)},{default:r(()=>[t(k,{label:1},{default:r(()=>[...e[22]||(e[22]=[p("男",-1)])]),_:1}),t(k,{label:2},{default:r(()=>[...e[23]||(e[23]=[p("女",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),t(d,{label:"年龄",prop:"age"},{default:r(()=>[t(J,{modelValue:l(o).age,"onUpdate:modelValue":e[4]||(e[4]=a=>l(o).age=a),min:18,max:100,placeholder:"请输入年龄"},null,8,["modelValue"])]),_:1}),t(d,{label:"手机号",prop:"phone"},{default:r(()=>[t(s,{modelValue:l(o).phone,"onUpdate:modelValue":e[5]||(e[5]=a=>l(o).phone=a),placeholder:"请输入手机号",clearable:""},null,8,["modelValue"])]),_:1}),t(n,{"content-position":"left"},{default:r(()=>[...e[24]||(e[24]=[p("组织信息",-1)])]),_:1}),t(d,{label:"归属部门",prop:"dept_id"},{default:r(()=>[t(L,{class:"flex-1",modelValue:l(o).dept_id,"onUpdate:modelValue":e[6]||(e[6]=a=>l(o).dept_id=a),data:l(U).dept,clearable:"",multiple:"","node-key":"id",props:{label:"name",disabled(a){return a.status!==1}},"check-strictly":"","default-expand-all":!0,placeholder:"请选择归属部门"},null,8,["modelValue","data","props"])]),_:1}),t(d,{label:"岗位",prop:"jobs_id"},{default:r(()=>[t(q,{class:"flex-1",modelValue:l(o).jobs_id,"onUpdate:modelValue":e[7]||(e[7]=a=>l(o).jobs_id=a),clearable:"",multiple:"",placeholder:"请选择岗位"},{default:r(()=>[(_(!0),v(S,null,B(l(U).jobs,(a,M)=>(_(),w(D,{key:M,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(n,{"content-position":"left"},{default:r(()=>[...e[25]||(e[25]=[p("专业信息",-1)])]),_:1}),t(d,{label:"职称",prop:"title"},{default:r(()=>[t(s,{modelValue:l(o).title,"onUpdate:modelValue":e[8]||(e[8]=a=>l(o).title=a),placeholder:"如:主任医师、副主任医师",clearable:""},null,8,["modelValue"])]),_:1}),t(d,{label:"所属科室",prop:"department"},{default:r(()=>[t(q,{modelValue:l(o).department,"onUpdate:modelValue":e[9]||(e[9]=a=>l(o).department=a),placeholder:"请选择所属科室",clearable:"",class:"flex-1"},{default:r(()=>[(_(!0),v(S,null,B(l(E),a=>(_(),w(D,{key:a.value,label:a.name,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(d,{label:"擅长领域",prop:"specialty"},{default:r(()=>[t(s,{modelValue:l(o).specialty,"onUpdate:modelValue":e[10]||(e[10]=a=>l(o).specialty=a),type:"textarea",rows:3,placeholder:"请输入擅长领域"},null,8,["modelValue"])]),_:1}),t(n,{"content-position":"left"},{default:r(()=>[...e[26]||(e[26]=[p("履历信息",-1)])]),_:1}),t(d,{label:"教育背景",prop:"education"},{default:r(()=>[t(s,{modelValue:l(o).education,"onUpdate:modelValue":e[11]||(e[11]=a=>l(o).education=a),type:"textarea",rows:3,placeholder:"请输入教育背景,如:北京中医药大学 中医学博士"},null,8,["modelValue"])]),_:1}),t(d,{label:"工作经历",prop:"experience"},{default:r(()=>[t(s,{modelValue:l(o).experience,"onUpdate:modelValue":e[12]||(e[12]=a=>l(o).experience=a),type:"textarea",rows:4,placeholder:"请输入工作经历"},null,8,["modelValue"])]),_:1}),t(d,{label:"荣誉资质",prop:"honors"},{default:r(()=>[t(s,{modelValue:l(o).honors,"onUpdate:modelValue":e[13]||(e[13]=a=>l(o).honors=a),type:"textarea",rows:3,placeholder:"请输入荣誉资质"},null,8,["modelValue"])]),_:1}),t(n,{"content-position":"left"},{default:r(()=>[...e[27]||(e[27]=[p("账号设置",-1)])]),_:1}),t(d,{label:"密码",prop:"password"},{default:r(()=>[t(s,{modelValue:l(o).password,"onUpdate:modelValue":e[14]||(e[14]=a=>l(o).password=a),"show-password":"",clearable:"",placeholder:l(m)==="edit"?"不修改请留空":"请输入密码"},null,8,["modelValue","placeholder"])]),_:1}),t(d,{label:"确认密码",prop:"password_confirm"},{default:r(()=>[t(s,{modelValue:l(o).password_confirm,"onUpdate:modelValue":e[15]||(e[15]=a=>l(o).password_confirm=a),"show-password":"",clearable:"",placeholder:l(m)==="edit"?"不修改请留空":"请输入确认密码"},null,8,["modelValue","placeholder"])]),_:1}),t(d,{label:"状态"},{default:r(()=>[t(C,{modelValue:l(o).disable,"onUpdate:modelValue":e[16]||(e[16]=a=>l(o).disable=a),"active-value":0,"inactive-value":1},null,8,["modelValue"]),u("span",je,N(l(o).disable===0?"启用":"禁用"),1)]),_:1}),t(d,{label:"多处登录"},{default:r(()=>[u("div",null,[t(C,{modelValue:l(o).multipoint_login,"onUpdate:modelValue":e[17]||(e[17]=a=>l(o).multipoint_login=a),"active-value":1,"inactive-value":0},null,8,["modelValue"]),e[28]||(e[28]=u("div",{class:"form-tips"},"允许多人同时在线登录",-1))])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"])])}}}),Sl=be(De,[["__scopeId","data-v-ccd9ff4d"]]);export{Sl as default};