manage-detail.4acae8fa.js 5.4 KB

12
  1. import{d as y,r as T,$ as I,c as t,q as d,B as _,m as f,aV as A,R as S,F as b,f as M,aW as B,ak as E,o as v}from"./index.ffe80dbe.js";import{O as x}from"./index.a0ef77e4.js";import{O as V}from"./index.1829b1b7.js";import{G as k,a as F}from"./index.72ca63b9.js";import{I as h}from"./index.7e972106.js";import{S as w}from"./index.02edecb1.js";import{i as N}from"./icon_teacher.df08d662.js";import{O as D}from"./index.4ddd16f0.js";import{C}from"./index.914765a1.js";import{C as g}from"./index.ea031708.js";import"./index.1d5c6f70.js";import"./index.339fc024.js";const q="_detailCellGroup_x1k9o_1",L="_manageTeacher_x1k9o_6",$="_sectionCellGroup_x1k9o_9",j="_detailCell_x1k9o_1",P="_img_x1k9o_16",R="_name_x1k9o_23",z="_phone_x1k9o_30",H="_sectionTitle_x1k9o_36",K="_functionGrid_x1k9o_51",U="_functionImg_x1k9o_58",W="_functionText_x1k9o_62",J="_dialogTitle_x1k9o_73";var s={detailCellGroup:q,manageTeacher:L,sectionCellGroup:$,detailCell:j,img:P,name:R,phone:z,sectionTitle:H,functionGrid:K,functionImg:U,functionText:W,dialogTitle:J};const Q="_menuFunction_1ghfh_1",X="_menuContent_1ghfh_5",Y="_functionImg_1ghfh_18",Z="_gray_1ghfh_22",tt="_functionText_1ghfh_27";var r={menuFunction:Q,menuContent:X,functionImg:Y,gray:Z,functionText:tt},et=y({name:"menu-function",props:{teacherId:{type:String,default:""},menus:{type:Array||String,default:[]}},emits:["close","success"],setup(u,{slots:e,attrs:c,emit:m}){const a=T({list:[],selectMenus:[]}),i=async()=>{try{const{data:n}=await f.post("/api-school/sysMenuButton/page",{data:{auditFlag:!1,status:!0,clientType:"SCHOOL",page:1,rows:100}});a.list=n.rows||[]}catch{}},o=n=>a.selectMenus.includes(n),G=n=>{if(o(n.id)){const l=a.selectMenus.findIndex(p=>p===n.id);a.selectMenus.splice(l,1)}else a.selectMenus.push(n.id)},O=async()=>{try{const n=[];a.list&&a.list.forEach(l=>{o(l.id)&&n.push({buttonImage:l.buttonImage,sortOrder:l.order,id:l.id,title:l.title,homePage:l.homePage})}),await f.post("/api-school/schoolStaff/updateButton",{hideLoading:!1,data:{teacherId:u.teacherId,menuButtons:[...n]}}),m("close"),m("success")}catch{}};return I(()=>{i();const l=(u.menus?u.menus:[]).map(p=>p.id);a.selectMenus=[...l]}),()=>t("div",{class:r.menuFunction},[t(x,{desotry:!1},null),t("div",{class:r.menuContent},[t("h2",null,[d("\u5168\u90E8\u529F\u80FD")]),t(k,{border:!1,class:r.functionGrid},{default:()=>[a.list&&a.list.map(n=>t(F,{onClick:()=>G(n),class:o(n.id)?"":r.gray},{icon:()=>t(h,{class:[r.functionImg],src:n.buttonImage},null),text:()=>t("div",{class:[r.functionText,"van-ellipsis"]},[n.title])}))]})]),t(w,{position:"bottom"},{default:()=>[t("div",{class:"btnGroup"},[t(_,{block:!0,round:!0,type:"primary",onClick:O},{default:()=>[d("\u786E\u8BA4\u4FEE\u6539")]})])]})])}});function nt(u){return typeof u=="function"||Object.prototype.toString.call(u)==="[object Object]"&&!E(u)}var gt=y({name:"manage-detail",setup(){const u=A(),e=S({}),c=T({menuStatus:!1,status:!1}),m=async()=>{try{const i=u.query,{data:o}=await f.get("/api-school/schoolStaff/detail/"+i.id);e.value={...o}}catch{}},a=async()=>{try{const i=u.query;await f.post("/api-school/schoolStaff/freeze/"+i.id,{hideLoading:!1}),setTimeout(()=>{e.value.status==="ACTIVATION"?(e.value.status="LOCKED",v("\u51BB\u7ED3\u6210\u529F")):(e.value.status="ACTIVATION",v("\u89E3\u51BB\u6210\u529F"))},100)}catch{}};return I(()=>{m()}),()=>{let i;return t("div",{class:s.manageTeacher},[t(x,null,null),t(C,{inset:!0,class:s.detailCellGroup},{default:()=>[t(g,{center:!0,class:s.detailCell},{icon:()=>t(h,{class:s.img,src:e.value.avatar?e.value.avatar:N},null),title:()=>t("div",{class:s.content},[t("p",{class:[s.name,"van-ellipsis"]},[e.value.nickname]),t("p",{class:s.phone},[e.value.phone])])})]}),t("div",{class:s.sectionTitle},[t("i",null,null),d("\u57FA\u672C\u4FE1\u606F")]),t(C,{inset:!0,class:[s.detailCellGroup,s.sectionCellGroup]},{default:()=>[t(g,{title:"\u624B\u673A\u53F7\u7801",value:e.value.nickname},null),t(g,{title:"\u6027\u522B",value:e.value.gender==1?"\u7537":e.value.gender==0?"\u5973":""},null)]}),e.value.menuButtons&&e.value.menuButtons.length>0&&t(b,null,[t("div",{class:s.sectionTitle},[t("i",null,null),d("\u529F\u80FD\u6743\u9650")]),t(k,{border:!1,class:s.functionGrid},nt(i=e.value.menuButtons.map(o=>t(F,null,{icon:()=>t(h,{class:s.functionImg,src:o.buttonImage},null),text:()=>t("div",{class:[s.functionText,"van-ellipsis"]},[o.title])})))?i:{default:()=>[i]})]),t(D,{position:"bottom"},{default:()=>[t("div",{class:["btnGroup","btnMore"],style:{paddingLeft:"13px",paddingRight:"13px"}},[M.user.data.manageAdmin&&t(_,{type:"primary",round:!0,onClick:()=>c.menuStatus=!0},{default:()=>[d("\u4FEE\u6539\u6743\u9650")]}),t(_,{type:"primary",round:!0,color:"#64A9FF",onClick:()=>c.status=!0},{default:()=>[e.value.status==="ACTIVATION"&&"\u51BB\u7ED3\u8D26\u53F7",e.value.status==="LOCKED"&&"\u89E3\u51BB\u8D26\u53F7"]})])]}),t(V,{modelValue:c.menuStatus,"onUpdate:modelValue":o=>c.menuStatus=o,destroy:!0},{default:()=>[t(et,{onClose:()=>c.menuStatus=!1,onSuccess:()=>m(),teacherId:e.value.id,menus:e.value.menuButtons},null)]}),t(B,{show:c.status,"onUpdate:show":o=>c.status=o,message:`${e.value.status==="ACTIVATION"?`\u51BB\u7ED3\u540E\u8BE5\u7BA1\u7406\u8001\u5E08\u5C06\u65E0\u6CD5\u767B\u5F55
  2. \u786E\u8BA4\u9700\u8981\u51BB\u7ED3\u5417\uFF1F`:"\u786E\u8BA4\u9700\u8981\u89E3\u51BB\u5417\uFF1F"}`,messageAlign:"left",showCancelButton:!0,onConfirm:a},{title:()=>t("div",{class:s.dialogTitle},[t("i",null,null),e.value.status==="ACTIVATION"?"\u51BB\u7ED3":"\u89E3\u51BB",d("\u7BA1\u7406\u8001\u5E08")])})])}}});export{gt as default};