import{x as Q,c as A,r as i,k as Y,al as n,y as c,H as D,I as u,Q as o,a8 as C,a9 as k,u as a,L as w,A as b,z as v,P as N,a4 as O,O as Z,M as q}from"./vendor-6ae0c374-1783405707921v=1.0.0.js";import{r as K}from"./eleValidate-a6aac0d6-1783405707921v=1.0.0.js";import{u as W,a as X,b as ee,_ as te}from"./index-71d7b18c-1783405707921v=1.0.0.js";import{r as se}from"./role-ca48e7dd-1783405707921v=1.0.0.js";import{g as ae}from"./accountPermissionManageApi-6b6d66fe-1783405707921v=1.0.0.js";import{E as y}from"./eleVendor-d42abce8-1783405707921v=1.0.0.js";const ue={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:K,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"}]},oe={class:"mpName"},le={class:"pt20 mt30"},re=Q({__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:M}){W();const g=X(),S=ee();let _=E;const f=M,m=A({get(){return R(_.value)},set(e){console.warn({val:e}),f("update:value",e)}}),P=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([]),V=async(e,t,l)=>{t.loading=!0;try{const s=await ae({page:t.page,size:10,keyword:e,tsId:l,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{y.error("\u83B7\u53D6\u5B66\u5DE5\u53F7\u5931\u8D25")}finally{t.loading=!1}},p=i([]),L=async()=>{try{const e=await se({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:y.error(e.message)}catch(e){y.error(e)}},R=e=>e,T=()=>{let e=JSON.parse(JSON.stringify(m.value));p.value;const t=[];return p.value.forEach(l=>{l.role_list.forEach(s=>{s.is_select&&t.push(s.role_id)})}),e.roleId=t,e},z=e=>{e.validate(async(t,l)=>{if(t){let s=T();f("submit",s)}else{const s=Object.keys(l)[0];e.scrollToField(s)}})};return Y(()=>{g.query.tsId&&(m.value.tsId=Number(g.query.tsId)),L()}),(e,t)=>{const l=n("PageSelect"),s=n("el-form-item"),r=n("PaCol"),$=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(ue),"label-width":"160px"},{default:u(()=>[o(j,null,{default:u(()=>[o(r,C(k(a(I))),{default:u(()=>[o(s,{label:"\u5B66\u5DE5\u53F7",prop:"tsId"},{default:u(()=>[w(` <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>  `),o(l,{ref:"pageSelectRef",value:a(m).tsId,"onUpdate:value":t[0]||(t[0]=d=>a(m).tsId=d),disabled:E.tsIdDisable,"remote-method":V},null,8,["value","disabled"])]),_:1})]),_:1},16),o(r,C(k(a(I))),{default:u(()=>[o(s,{label:"\u8D26\u53F7\u6743\u9650",prop:""},{default:u(()=>[w(` <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>  `),b("div",null,[(c(!0),v(N,null,O(a(p),(d,J)=>(c(),v("div",{class:"mpItem",key:J+"rightList"},[b("div",oe,Z(d.mp_name),1),(c(!0),v(N,null,O(d.role_list,(B,G)=>(c(),D($,{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}),o(s,null,{default:u(()=>[b("div",le,[o(x,{type:"",onClick:t[1]||(t[1]=d=>a(S).go(-1))},{default:u(()=>t[3]||(t[3]=[q("\u8FD4\u56DE",-1)])),_:1,__:[3]}),o(x,{type:"primary",loading:a(P),onClick:t[2]||(t[2]=d=>z(a(F)))},{default:u(()=>t[4]||(t[4]=[q("\u4FDD\u5B58",-1)])),_:1,__:[4]},8,["loading"])])]),_:1})]),_:1},8,["model","rules"])}}});const pe=te(re,[["__scopeId","data-v-d33d8474"],["__file","D:/desktop/huaZhong/huazhong-common/apps/vue-admin/src/views/accountPermissionManage/components/BaseForm.vue"]]);export{pe as default};
