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