var q=Object.defineProperty,z=Object.defineProperties;var H=Object.getOwnPropertyDescriptors;var T=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var V=(t,a,e)=>a in t?q(t,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[a]=e,O=(t,a)=>{for(var e in a||(a={}))K.call(a,e)&&V(t,e,a[e]);if(T)for(var e of T(a))$.call(a,e)&&V(t,e,a[e]);return t},F=(t,a)=>z(t,H(a));var U=(t,a,e)=>new Promise((B,l)=>{var y=n=>{try{p(e.next(n))}catch(f){l(f)}},I=n=>{try{p(e.throw(n))}catch(f){l(f)}},p=n=>n.done?B(n.value):Promise.resolve(n.value).then(y,I);p((e=e.apply(t,a)).next())});import{_ as A,d as Q,I as W,H as X,r as m,b as Y,f as i,g as Z,h as ee,l as s,m as o,p as b,i as se,G as ae,P as oe}from"./index.9fabe127.js";import{f as te}from"./index.d5acc404.js";const le={class:"flex"},ne=Q({name:"coreBusiness"}),re=Object.assign(ne,{props:{basicInfoData:{type:Object}},setup(t,{expose:a}){const e=t,B=W(X.userStore).userInfo||{},l=m({}),y=m(),I={coreBusiness:[{required:!0,message:"\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6838\u5FC3\u4E1A\u52A1"}]},p=r=>{y.value.validate(u=>{r(u)})},n=()=>{_.value=!0,R({pageNumber:1,pageSize:10},!0)},f=[{type:"index",label:"\u5E8F\u53F7",width:60},{label:"\u4E1A\u52A1\u540D\u79F0",key:"matterName",prop:"matterName"},{label:"\u6240\u5C5E\u5355\u4F4D",key:"orgName",prop:"orgName"}],C=m(),N=m([]),P=m(0),E=[{type:"selection"},{label:"\u4E1A\u52A1\u540D\u79F0",prop:"matterName",key:"matterName"},{label:"\u6240\u5C5E\u5355\u4F4D",prop:"orgName",key:"orgName"}],_=m(!1),R=(...h)=>U(this,[...h],function*(r=(c=>(c=C.value)==null?void 0:c.pageParams)(),u){var v,D;var d=[];(v=e==null?void 0:e.basicInfoData)!=null&&v.superOrgCode&&d.push(e.basicInfoData.superOrgCode),(D=B.value)!=null&&D.empPosUnitCode&&d.push(B.value.empPosUnitCode);const x=yield te(F(O({},r),{businessName:k.businessName,orgCode:d.join(",")}));N.value=x.data.data,P.value=x.data.total,yield oe(),u&&N.value&&N.value.forEach(g=>{(l.value.coreBusiness&&l.value.coreBusiness.map(w=>w.id)||[]).includes(g.id)?C.value.toggleRowSelect(g,!0):C.value.toggleRowSelect(g,!1)})}),G=()=>{R()},j=m(),J=r=>{j.value=r},k=Y({businessName:void 0}),L=()=>{k.businessName=""},M=()=>{l.value.coreBusiness=j.value,_.value=!1};return a({validForm:p,formData:l,setFormData:r=>{l.value={coreBusiness:r.coreBusiness?JSON.parse(r.coreBusiness):[]}}}),(r,u)=>{const c=i("el-button"),h=i("el-col"),d=i("table-list"),x=i("el-form-item"),v=i("el-row"),D=i("el-form"),g=i("el-input"),S=i("el-dialog");return Z(),ee(ae,null,[s(D,{ref_key:"formRef",ref:y,model:l.value,rules:I,"label-position":"right","label-width":"0","label-suffix":":","scroll-to-error":""},{default:o(()=>[s(v,{gutter:40},{default:o(()=>[s(h,{span:24,class:"mb-16"},{default:o(()=>[s(c,{type:"primary",class:"float-right",onClick:n},{default:o(()=>[b(" \u9009\u62E9\u6838\u5FC3\u4E1A\u52A1 ")]),_:1})]),_:1}),s(h,{span:24},{default:o(()=>[s(x,{prop:"coreBusiness"},{default:o(()=>[s(d,{pagination:!1,style:{width:"100%"},column:f,data:l.value.coreBusiness,"empty-temp":!1},null,8,["data"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),s(S,{title:"\u9009\u62E9\u6838\u5FC3\u4E1A\u52A1","close-on-click-modal":!1,"before-close":()=>_.value=!1,"model-value":_.value,width:"700px"},{footer:o(()=>[s(c,{type:"primary",onClick:M},{default:o(()=>[b(" \u63D0\u4EA4 ")]),_:1}),s(c,{onClick:u[1]||(u[1]=w=>_.value=!1)},{default:o(()=>[b(" \u5173\u95ED ")]),_:1})]),default:o(()=>[s(v,{style:{"margin-bottom":"16px"},gutter:20},{default:o(()=>[s(h,{span:12},{default:o(()=>[s(g,{modelValue:k.businessName,"onUpdate:modelValue":u[0]||(u[0]=w=>k.businessName=w),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),s(h,{span:12},{default:o(()=>[se("div",le,[s(c,{type:"primary",onClick:G},{default:o(()=>[b("\u67E5\u8BE2")]),_:1}),s(c,{onClick:L},{default:o(()=>[b("\u91CD\u7F6E")]),_:1})])]),_:1})]),_:1}),s(d,{ref_key:"tableListRef",ref:C,column:E,data:N.value,total:P.value,onSelectionChange:J,onGetTableData:R},null,8,["data","total"])]),_:1},8,["before-close","model-value"])],64)}}}),de=A(re,[["__file","/Users/chenlixin/Documents/work/NDKJ/MyProject/ls-project-v2.0/src/pages/declareManage/projectDeclare/declarePage/components/coreBusiness.vue"]]);export{de as default};
