import{k as b}from"./index.Df8UJ10K.js";import{G as C,c as w}from"./crud.CO2tJEQX.js";import{h as V}from"./columnPermission.qmX6FdM9.js";import{G as x}from"./api.CRRST5ut.js";import{a as d,r as B,f as G,q as O,aj as t,J as i,o as s,K as c,S as u,H as P,u as R,c as z,R as E,a9 as I}from"./vue.D1BjjNmv.js";const L=d({name:"teacherInfor"}),K=d({...L,setup(U){const{crudBinding:f,crudRef:m,crudExpose:p,crudOptions:_,resetCrudOptions:h}=b({createCrudOptions:w}),a=B([]),v=G(()=>{const e=Array.isArray(a.value)?a.value:[],r=[];return e.forEach(o=>{Array.isArray(o==null?void 0:o.children)&&r.push(...o.children)}),r.map(o=>({id:o.id,name:o.name}))}),g=()=>{x().then(e=>{if(console.log("组织架构API响应:",e),e&&(e.code===200||e.code===2e3||!e.code)){const r=e.data||e.results||e;Array.isArray(r)?(a.value=r,console.log("成功赋值组织架构数据:",a.value)):(console.warn("返回的数据不是数组格式:",r),a.value=[])}else console.error("获取组织架构数据失败:",e),a.value=[]}).catch(e=>{console.error("请求组织架构数据失败:",e),a.value=[]})};return O(async()=>{g();const e=await V(C,_);h(e),p.doRefresh()}),(e,r)=>{const o=t("el-option"),y=t("el-select"),k=t("fs-crud"),A=t("fs-page");return s(),i(A,null,{default:c(()=>[u(k,P({ref_key:"crudRef",ref:m},R(f)),{form_organization_ref:c(l=>[u(y,{disabled:l.mode=="view",modelValue:l.form.organization_ref,"onUpdate:modelValue":n=>l.form.organization_ref=n,placeholder:"请选择学院",filterable:"",clearable:""},{default:c(()=>[(s(!0),z(E,null,I(v.value,n=>(s(),i(o,{key:n.id,label:n.name,value:n.id},null,8,["label","value"]))),128))]),_:2},1032,["disabled","modelValue","onUpdate:modelValue"])]),_:1},16)]),_:1})}}});export{K as default};
