import{r as Q}from"./eleValidate-846b8983-1782468512657v=1.0.0.js";import{u as Y,a as K,b as W,_ as X}from"./index-c87bcfde-1782468512657v=1.0.0.js";import{r as Z}from"./role-d87c2313-1782468512657v=1.0.0.js";import{g as ee}from"./accountPermissionManageApi-2cda4906-1782468512657v=1.0.0.js";import{E as b}from"./eleVendor-12a75a9a-1782468512657v=1.0.0.js";import{x as te,c as A,r as i,k as se,al as n,y as c,H as D,I as l,Q as u,a8 as C,a9 as k,u as a,L as N,A as v,z as y,P as O,a4 as q,O as ae,M as w}from"./vendor-27e23c1b-1782468512657v=1.0.0.js";const le={tsType:[{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"}],tsId:[{required:!0,message:"\u8BF7\u9009\u62E9\u5B66\u5DE5\u53F7",trigger:"change"}],name:[{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"}],tsManageType:[{max:255,message:"\u6700\u591A 255 \u4E2A\u5B57\u7B26",trigger:"blur"}],grade:[{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"}],enrollmentYear:[{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"}],email:[{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"}],phone:[{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"},{pattern:Q,message:"\u8F93\u5165\u7684\u624B\u673A\u53F7\u683C\u5F0F\u6709\u8BEF",trigger:"blur"}],collegeId:[{required:!0,message:"\u8BF7\u9009\u62E9\u9662\u7CFBid",trigger:"change"}],majorId:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E13\u4E1Aid",trigger:"change"}],courseId:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0Bid",trigger:"change"}],clubId:[{required:!0,message:"\u8BF7\u9009\u62E9\u4FF1\u4E50\u90E8id",trigger:"change"}],classId:[{required:!0,message:"\u8BF7\u9009\u62E9\u73ED\u7EA7id",trigger:"change"}]},ue={class:"mpName"},oe={class:"pt20 mt30"},re=te({__name:"BaseForm",props:{value:Object,loading:{type:Boolean,default:!1},tsIdDisable:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(E,{emit:S}){Y();const g=K(),M=W();let _=E;const f=S,m=A({get(){return R(_.value)},set(e){console.warn({val:e}),f("update:value",e)}}),V=A({get(){return _.loading},set(e){f("update:loading",e)}}),F=i(),I=i({xs:24,sm:22,md:20,lg:14,xl:13});i({xs:24,sm:24,md:12,lg:12,xl:12}),i({xs:24,sm:22,md:18,lg:16,xl:8});const h=i([]),L=async(e,t,o)=>{t.loading=!0;try{const s=await ee({page:t.page,size:10,keyword:e,tsId:o,tsManageType:_.tsIdDisable?"":"not"});if(s.code===0)return h.value=s.data.listData.map(r=>({label:`${r.tsNo}-${r.name}-${r.collegeName}`,value:r.tsId})),[h.value,s.data.total]}catch{b.error("\u83B7\u53D6\u5B66\u5DE5\u53F7\u5931\u8D25")}finally{t.loading=!1}},p=i([]),P=async()=>{try{const e=await Z({page:1,size:999,personnel_id:g.query.personnel_id||0,post_personnel_id:g.query.personnel_id||0});e.code===200?p.value=e.data:b.error(e.message)}catch(e){b.error(e)}},R=e=>e,T=()=>{let e=JSON.parse(JSON.stringify(m.value));p.value;const t=[];return p.value.forEach(o=>{o.role_list.forEach(s=>{s.is_select&&t.push(s.role_id)})}),e.roleId=t,e},$=e=>{e.validate(async(t,o)=>{if(t){let s=T();f("submit",s)}else{const s=Object.keys(o)[0];e.scrollToField(s)}})};return se(()=>{g.query.tsId&&(m.value.tsId=Number(g.query.tsId)),P()}),(e,t)=>{const o=n("PageSelect"),s=n("el-form-item"),r=n("PaCol"),z=n("el-checkbox"),j=n("PaRow"),x=n("el-button"),U=n("el-form");return c(),D(U,{model:a(m),ref_key:"formRef",ref:F,rules:a(le),"label-width":"160px"},{default:l(()=>[u(j,null,{default:l(()=>[u(r,C(k(a(I))),{default:l(()=>[u(s,{label:"\u5B66\u5DE5\u53F7",prop:"tsId"},{default:l(()=>[N(` <el-select
						v-model="form.tsId"
						filterable
						@change="handleChangeTsIdSelect"
						placeholder="\u8BF7\u9009\u62E9\u5B66\u5DE5\u53F7"
						style="width: 100%"
						:remote="true"
						:remote-method="_getTsManageList"
						:disabled="props.tsIdDisable"
					>
						<el-option v-for="item in tsIdOptions" :key="item.value" :label="item.label" :value="item.value" />
					</el-select>  `),u(o,{ref:"pageSelectRef",value:a(m).tsId,"onUpdate:value":t[0]||(t[0]=d=>a(m).tsId=d),disabled:E.tsIdDisable,"remote-method":L},null,8,["value","disabled"])]),_:1})]),_:1},16),u(r,C(k(a(I))),{default:l(()=>[u(s,{label:"\u8D26\u53F7\u6743\u9650",prop:""},{default:l(()=>[N(` <el-select
						v-model="form.classId"
						filterable
						@change="handleChangeClassIdSelect"
						placeholder="\u8BF7\u9009\u62E9\u73ED\u7EA7id"
						style="width: 100%"
					>
						<el-option v-for="item in classIdOptions" :key="item.value" :label="item.label" :value="item.value" />
					</el-select>  `),v("div",null,[(c(!0),y(O,null,q(a(p),(d,J)=>(c(),y("div",{class:"mpItem",key:J+"rightList"},[v("div",ue,ae(d.mp_name),1),(c(!0),y(O,null,q(d.role_list,(B,G)=>(c(),D(z,{class:"roleList",key:G,label:B.role_name,modelValue:B.is_select,"onUpdate:modelValue":H=>B.is_select=H},null,8,["label","modelValue","onUpdate:modelValue"]))),128))]))),128))])]),_:1})]),_:1},16)]),_:1}),u(s,null,{default:l(()=>[v("div",oe,[u(x,{type:"",onClick:t[1]||(t[1]=d=>a(M).go(-1))},{default:l(()=>t[3]||(t[3]=[w("\u8FD4\u56DE",-1)])),_:1,__:[3]}),u(x,{type:"primary",loading:a(V),onClick:t[2]||(t[2]=d=>$(a(F)))},{default:l(()=>t[4]||(t[4]=[w("\u4FDD\u5B58",-1)])),_:1,__:[4]},8,["loading"])])]),_:1})]),_:1},8,["model","rules"])}}});const pe=X(re,[["__scopeId","data-v-0a65c095"]]);export{pe as default};
