var z=Object.defineProperty,F=Object.defineProperties;var H=Object.getOwnPropertyDescriptors;var T=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var V=(o,s,e)=>s in o?z(o,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[s]=e,S=(o,s)=>{for(var e in s||(s={}))J.call(s,e)&&V(o,e,s[e]);if(T)for(var e of T(s))K.call(s,e)&&V(o,e,s[e]);return o},M=(o,s)=>F(o,H(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 $,d as A,I as Q,H as W,r as b,b as X,N as Y,f as d,g as Z,h as ee,l as a,m as t,p as N,i as ae,G as se,P as te}from"./index.9fabe127.js";import{f as oe}from"./index.d5acc404.js";const le={class:"flex"},ne=A({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,I({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([]),R=b(0),O=[{type:"selection"},{label:"\u4E1A\u52A1\u540D\u79F0",prop:"matterName",key:"matterName"},{label:"\u6240\u5C5E\u5355\u4F4D",prop:"orgName",key:"orgName"}],B=b(!1),I=(...f)=>E(this,[...f],function*(c=(n=>(n=u.value)==null?void 0:n.pageParams)(),i){var p,_;var m=[];(p=e==null?void 0:e.basicInfoData)!=null&&p.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:h.businessName,orgCode:m.join(",")}));D.value=g.data.data,R.value=g.data.total,yield te(),i&&D.value&&D.value.forEach(y=>{(l.value.coreBusiness&&l.value.coreBusiness.map(k=>k.id*1)||[]).includes(y.id)?u.value.toggleRowSelect(y,!0):u.value.toggleRowSelect(y,!1)})}),U=()=>{I()},j=b(),G=c=>{j.value=c},h=X({businessName:void 0}),L=()=>{h.businessName=""},q=()=>{l.value.coreBusiness=j.value,B.value=!1};return s({formRef:C,formData:l}),Y(()=>e.detail,c=>{var i,n,f;c&&(l.value={coreBusiness:((f=(n=(i=c.apply)==null?void 0:i.baseCoreBusinessCode)==null?void 0:n.split("\uFF1B"))==null?void 0:f.map((m,g)=>{var p,_;return{id:m,matterName:(_=(p=c.apply)==null?void 0:p.baseCoreBusiness)==null?void 0:_.split("\uFF1B")[g],orgName:x.value.empPosUnitName}}))||[]})}),(c,i)=>{const n=d("el-button"),f=d("el-col"),m=d("table-list"),g=d("el-form-item"),p=d("el-row"),_=d("el-form"),y=d("el-input"),P=d("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(p,{gutter:40},{default:t(()=>[a(f,{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(f,{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:q},{default:t(()=>[N(" \u63D0\u4EA4 ")]),_:1}),a(n,{onClick:i[1]||(i[1]=k=>B.value=!1)},{default:t(()=>[N(" \u5173\u95ED ")]),_:1})]),default:t(()=>[a(p,{style:{"margin-bottom":"16px"},gutter:20},{default:t(()=>[a(f,{span:12},{default:t(()=>[a(y,{modelValue:h.businessName,"onUpdate:modelValue":i[0]||(i[0]=k=>h.businessName=k),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),a(f,{span:12},{default:t(()=>[ae("div",le,[a(n,{type:"primary",onClick:U},{default:t(()=>[N("\u67E5\u8BE2")]),_:1}),a(n,{onClick:L},{default:t(()=>[N("\u91CD\u7F6E")]),_:1})])]),_:1})]),_:1}),a(m,{ref_key:"tableListRef",ref:u,column:O,data:D.value,total:R.value,onSelectionChange:G,onGetTableData:I},null,8,["data","total"])]),_:1},8,["before-close","model-value"])],64)}}}),me=$(re,[["__file","/Users/chenlixin/Documents/work/NDKJ/MyProject/ls-project-v2.0/src/pages/declareManage/operationProjectRecord/operationProjectEdit/components/coreBusiness.vue"]]);export{me as default};
