import{p as M,r,A as $,t as H,F as t,J,u as U,f as X,d as x,j as e,I as o,S as d,D as K,ae as Q,G as j,C as a,B,g as Z,v as ee}from"./index-CKIL6d0V.js";import{T as ae}from"./index-DhKd6wcu.js";import"./iconUtil-Co5gbObL.js";const le=M.div`
  width: 100%;
  height: 100%;
  padding: 16px;
  padding-right: 100px;
  overflow: auto;
  background-color: ${c=>c.theme.colorBgContainer};
  .title {
    height: 36px;
    font-size: 16px;
    display: flex;
    align-items: center;
    .leftWord {
      width: 80px;
    }
    .leftLine {
      flex: 1;
      height: 2px;
      background-color: ${c=>c.theme.colorBorder};
    }
  }

  .formData {
    width: 100%;
    padding-top: 15px;
    font-size: 16px;
    .iteminfo {
      display: flex;
    }
    .ant-form-inline.ant-form {
      width: 100%;
      justify-content: left;
      .ant-form-item {
        width: 22%;
        padding-left: 80px;
        margin-bottom: 20px;

        .ant-form-item-label {
          width: 100px;
          text-align: right;
        }

        .ysh_antd_datePicker {
          width: 100%;
        }
        &:nth-last-child(1) {
          width: 45%;
        }
      }
    }

    .box {
      width: 100%;
      height: 40px;
      padding-left: 80px;
      margin-bottom: 15px;
      display: flex;
      justify-content: left;
      .leftRadio {
        width: 300px;
        display: flex;
        align-items: center;
        .titleName {
          width: 100px;
          margin-right: 15px;
          text-align: right;
        }
        .radio {
          flex: 1;
        }
      }
      .rightSelect {
        width: 400px;
        display: flex;
        align-items: center;
        .titleName {
          width: 150px;
          margin-right: 15px;
          text-align: right;
        }
        .ysh_select {
          flex: 1;
        }
      }
    }
    .checkbox {
      width: 100%;
      padding-left: 80px;
      margin-bottom: 15px;
      .ant-checkbox-wrapper {
        width: 200px;
        margin-left: 0;
        margin-bottom: 15px;
      }
      .etherInput {
        display: flex;
        margin-top: 15px;
        .titleName {
          padding-right: 15px;
        }
        .textarea {
          width: 400px;
        }
      }
    }
  }
  .basicformData {
    width: 100%;
    padding-top: 15px;
    font-size: 16px;
    .checkbox {
      width: 100%;
      padding-left: 80px;
      margin-bottom: 15px;
      .ant-checkbox-wrapper {
        width: 120px;
        margin-left: 0;
        margin-bottom: 15px;
      }
      .etherInput {
        display: flex;
        margin-top: 15px;
        .titleName {
          padding-right: 15px;
        }
        .textarea {
          width: 400px;
        }
      }
    }
  }
  .btns {
    height: 60px;
    display: flex;
    justify-content: right;
    .back {
      margin-right: 20px;
    }
  }
`,se=r.memo(()=>{const{message:c}=$.useApp(),{token:V}=H.useToken(),[h]=t.useForm(),{Option:n}=d,{TextArea:g}=o,P=J(),v=U(),[f,b]=r.useState(""),[N,y]=r.useState(null),[k,w]=r.useState([]),[C,_]=r.useState([]),[I,S]=r.useState(""),[D,A]=r.useState(""),[T,Y]=r.useState([]),{organ:u,genderList:L,educationList:m,marriageList:q}=X(l=>l),s=P.state;r.useEffect(()=>{(async()=>{try{const{data:i}=await Z("/api/Role/All",{pageSize:9999,pageIndex:1});console.log("data",i),await Y(i)}catch(i){console.log(i)}})()},[]),r.useEffect(()=>{s&&(h.setFieldsValue({code:s.code,name:s.name,mobile:s.mobile,email:s.email,roleid:s.roleid,sex:s.sex,birthday:s?x(s.birthday):x(),education:s.education,married:s.married,orgid:s.orgid}),b(s.psychology_major),y(s.psy_certificaten),w(s.good_at.split("|")),S(s.good_at_other),_(s.use_skill.split("|")),A(s.use_skill_other))},[s,h]);const E=l=>{b(l.target.value)},O=l=>{y(l)},R=l=>{w(l)},F=l=>{_(l)},W=l=>{S(l.target.value)},z=l=>{A(l.target.value)},G=()=>{const l=h.getFieldValue();l.birthday=x(l.birthday).format("YYYY-MM-DD");const i={...l,psychology_major:f,psy_certificaten:N,good_at:k.join("|"),good_at_other:I,use_skill:C.join("|"),use_skill_other:D,pwd:s?s.pwd:"",id:s?s.id:""};console.log(i),ee("/api/Counsellor/AddOrUpdate",i).then(p=>{p.code===200?(c.success(p.msg,3),v("/layout/Counselor")):c.error(p.msg,3)})};return e.jsxs(le,{theme:V,children:[e.jsxs("div",{className:"title",children:[e.jsx("div",{className:"leftWord",children:"基本信息"}),e.jsx("div",{className:"leftLine"})]}),e.jsx("div",{className:"formData",children:e.jsxs(t,{className:"forminfo",form:h,layout:"inline",children:[e.jsx(t.Item,{label:"账 号",name:"code",rules:[{required:!0,message:"请输入账号"}],children:e.jsx(o,{placeholder:"请输入账号"})}),e.jsx(t.Item,{label:"姓 名",name:"name",rules:[{required:!0,message:"请输入姓名"}],children:e.jsx(o,{placeholder:"请输入姓名"})}),e.jsx(t.Item,{label:"手机号码",name:"mobile",rules:[{required:!0,message:"请输入手机号码"}],children:e.jsx(o,{placeholder:"请输入手机号码"})}),e.jsx(t.Item,{label:"邮 箱",name:"email",rules:[{required:!0,message:"请输入邮箱"}],children:e.jsx(o,{placeholder:"请输入邮箱"})}),e.jsx(t.Item,{label:"角 色",name:"roleid",rules:[{required:!0,message:"请输入角色"}],children:e.jsx(d,{placeholder:"请选择角色",allowClear:!0,children:T.map(l=>e.jsx(n,{value:l.id,children:l.name},l.id))})}),e.jsx(t.Item,{label:"性别",name:"sex",rules:[{required:!0,message:"请选择性别"}],children:e.jsx(d,{placeholder:"请选择性别",allowClear:!0,children:Object.keys(L).map((l,i)=>e.jsx(n,{value:i,children:L[l]},l))})}),e.jsx(t.Item,{label:"生 日",name:"birthday",rules:[{required:!0,message:"请选择生日"}],children:e.jsx(K,{format:"YYYY-MM-DD",disabledDate:l=>l&&l>x().endOf("day"),className:"ysh_antd_datePicker"})}),e.jsx(t.Item,{label:"学历",name:"education",rules:[{required:!0,message:"请选择学历"}],children:e.jsx(d,{placeholder:"请选择学历",allowClear:!0,children:Object.keys(m).map(l=>e.jsx(n,{value:m[l],children:m[l]},l))})}),e.jsx(t.Item,{label:"婚姻状况",name:"married",rules:[{required:!0,message:"请选择婚姻状况"}],children:e.jsx(d,{placeholder:"请选择婚姻状况",allowClear:!0,children:Object.keys(q).map((l,i)=>e.jsx(n,{value:i,children:q[l]},l))})}),e.jsx(t.Item,{label:"机构",name:"orgid",rules:[{required:!0,message:"请选择组织机构"}],children:u[0]&&e.jsx(ae,{placement:"bottomRight",dropdownStyle:{maxHeight:400,overflow:"auto",overflowX:"scroll"},treeData:Q(u,u[0].PId),placeholder:"请选择组织机构",treeDefaultExpandAll:!0,allowClear:!0,fieldNames:{label:"Name",value:"Id",children:"children"}})})]})}),e.jsxs("div",{className:"title",children:[e.jsx("div",{className:"leftWord",children:"专业背景"}),e.jsx("div",{className:"leftLine"})]}),e.jsx("div",{className:"formData",children:e.jsxs("div",{className:"box",children:[e.jsxs("div",{className:"leftRadio",children:[e.jsx("span",{className:"titleName",children:"心理学专业 : "}),e.jsxs(j.Group,{className:"radio",onChange:E,value:f,children:[e.jsx(j,{value:1,children:"是"}),e.jsx(j,{value:0,children:"否"})]})]}),e.jsxs("div",{className:"rightSelect",children:[e.jsx("span",{className:"titleName",children:"心理咨询师资格证 : "}),e.jsxs(d,{className:"ysh_select",placeholder:"请选择",allowClear:!0,value:N,onChange:O,children:[e.jsx(n,{value:"无",children:"无"}),e.jsx(n,{value:"二级",children:"二级"}),e.jsx(n,{value:"三级",children:"三级"})]})]})]})}),e.jsxs("div",{className:"title",children:[e.jsx("div",{className:"leftWord",children:"治疗技术"}),e.jsx("div",{className:"leftLine"})]}),e.jsx("div",{className:"formData",children:e.jsxs("div",{className:"checkbox",children:[e.jsxs(a.Group,{className:"checkboxstyle",value:k,onChange:R,children:[e.jsx(a,{value:"释梦技术",children:"释梦技术"}),e.jsx(a,{value:"自由联想技术",children:"自由联想技术"}),e.jsx(a,{value:"意向对话技术",children:"意向对话技术"}),e.jsx(a,{value:"沙盘游戏治疗(箱庭疗法)",children:"沙盘游戏治疗(箱庭疗法)"}),e.jsx(a,{value:"认知治疗",children:"认知治疗"}),e.jsx(a,{value:"询者中心疗法",children:"询者中心疗法"}),e.jsx(a,{value:"合理情绪治疗",children:"合理情绪治疗"}),e.jsx(a,{value:"认知行为治疗",children:"认知行为治疗"}),e.jsx(a,{value:"森田疗法",children:"森田疗法"}),e.jsx(a,{value:"萨提亚疗法",children:"萨提亚疗法"}),e.jsx(a,{value:"交互分析法",children:"交互分析法"}),e.jsx(a,{value:"存在主义心理治疗",children:"存在主义心理治疗"}),e.jsx(a,{value:"NLP治疗",children:"NLP治疗"}),e.jsx(a,{value:"家庭治疗",children:"家庭治疗"}),e.jsx(a,{value:"短程焦点治疗",children:"短程焦点治疗"}),e.jsx(a,{value:"叙事疗法",children:"叙事疗法"}),e.jsx(a,{value:"音乐治疗",children:"音乐治疗"}),e.jsx(a,{value:"绘画治疗",children:"绘画治疗"}),e.jsx(a,{value:"催眠疗法",children:"催眠疗法"}),e.jsx(a,{value:"表达性治疗",children:"表达性治疗"}),e.jsx(a,{value:"心理剧",children:"心理剧"}),e.jsx(a,{value:"团体辅导技术",children:"团体辅导技术"}),e.jsx(a,{value:"情绪聚焦疗法",children:"情绪聚焦疗法"}),e.jsx(a,{value:"放松训练",children:"放松训练"}),e.jsx(a,{value:"系统脱敏",children:"系统脱敏"}),e.jsx(a,{value:"模仿学习",children:"模仿学习"}),e.jsx(a,{value:"角色扮演",children:"角色扮演"}),e.jsx(a,{value:"决断训练",children:"决断训练"})]}),e.jsxs("div",{className:"etherInput",children:[e.jsx("span",{className:"titleName",children:"其 他 :"}),e.jsx(g,{className:"textarea",placeholder:"请输入",value:I,onChange:W})]})]})}),e.jsxs("div",{className:"title",children:[e.jsx("div",{className:"leftWord",children:"基本技能"}),e.jsx("div",{className:"leftLine"})]}),e.jsx("div",{className:"basicformData",children:e.jsxs("div",{className:"checkbox",children:[e.jsxs(a.Group,{className:"checkboxstyle",value:C,onChange:F,children:[e.jsx(a,{value:"提(设)问",children:"提(设)问"}),e.jsx(a,{value:"倾听",children:"倾听"}),e.jsx(a,{value:"共情",children:"共情"}),e.jsx(a,{value:"鼓励",children:"鼓励"}),e.jsx(a,{value:"打断",children:"打断"}),e.jsx(a,{value:"释义",children:"释义"}),e.jsx(a,{value:"自我暴露",children:"自我暴露"}),e.jsx(a,{value:"反馈",children:"反馈"}),e.jsx(a,{value:"面质",children:"面质"})]}),e.jsxs("div",{className:"etherInput",children:[e.jsx("span",{className:"titleName",children:"其 他 :"}),e.jsx(g,{className:"textarea",placeholder:"请输入",value:D,onChange:z})]})]})}),e.jsxs("div",{className:"btns",children:[e.jsx(B,{className:"back",onClick:()=>v("/layout/Counselor"),children:"返回"}),e.jsx(B,{onClick:G,type:"primary",children:"提 交"})]})]})});se.displayName="CounselorEdit";export{se as default};
