import"./appBasicInfo.f3416fe8.js";import"./appSafeInfo.497679c6.js";import"./appResourceInfo.e7fc1b0d.js";import{d as O,z as G,r as i,c as n,e as k,f as H,h as t,i as l,j as d,I as J,g as v,k as A,F as K,a0 as Q,N as I,a1 as X,x as Y}from"./index.5bb861d3.js";import Z from"./applicationInfo.d496b4ab.js";import"./uploadAction.60610a95.js";import"./index.5b85d91e.js";const ee=["onClick"],ae=["onClick"];const le={class:"applyBottomBtn flexCenter marginTop"},te=O({name:"applications"}),we=Object.assign(te,{props:{isInnovateWholeProvinceShare:{type:Boolean,default:!1},isFirst:{type:Number,default:void 0},coreBusiness:{type:Array,default:()=>[]}},setup(h,{expose:N}){const R=G(),{proxy:B}=Y(),o=i({applicationList:[]}),x=i(),$={includeApplication:[{required:!0,message:"\u8BF7\u9009\u62E9\u662F\u5426\u5305\u542B\u5E94\u7528",trigger:"blur"}],applicationList:[{required:!0,message:"\u8BF7\u6DFB\u52A0\u5E94\u7528",trigger:"blur"}]},D=[{type:"index",label:"\u5E8F\u53F7",width:60},{label:"\u5E94\u7528\u540D\u79F0",key:"applicationName",prop:"applicationName",render:e=>{var a;return Q("span",e.applicationName||((a=e.relatedExistsApplication)==null?void 0:a.applicationName)||"")}},{label:"\u64CD\u4F5C",slot:"action"}],L=e=>{B.$messageBox.confirm("\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u9879\u5417?","\u63D0\u793A\uFF01",{type:"warning"}).then(()=>{o.value.applicationList.splice(e,1)})},r=i(!1),oe=i(["1","2","3"]),_=i({}),ie=i(),ne=i(),se=i(),s=i(),m=i(!1),b=i(),E=async(e,a)=>{m.value=!0,b.value=e,_.value=a,r.value=!0,await I(),s.value.clearValidate()},F=async()=>{m.value=!1,_.value={},r.value=!0,await I(),s.value.clearValidate()},w=()=>{X.confirm("\u786E\u5B9A\u8981\u5173\u95ED\u5E94\u7528\u7F16\u8F91\u9875\u9762\u5417\uFF1F").then(()=>{y()}).catch(()=>{})},y=()=>{s.value.formData={},s.value.clearValidate(),r.value=!1},C=()=>{m.value?o.value.applicationList[b.value]={...s.value.formData}:o.value.applicationList.push({...s.value.formData}),y()},P=()=>{const e=[];e.push(new Promise((a,u)=>{s.value.validForm(p=>{p&&a()})})),Promise.all([...e]).then(()=>{C()})},S=e=>{x.value.validate(a=>{e(a)})},j=e=>{var u;const a=R.query.isDraft?"applicationList":"projectApplications";o.value={includeApplication:e.includeApplication,applicationList:(u=e[a])!=null&&u.length?e[a].map(p=>({...p,relatedExistsApplication:p.relatedExistsApplication?{applicationCode:p.relatedExistsApplicationCode,applicationName:p.relatedExistsApplication}:void 0})):[]}},M=()=>{o.value.applicationList=[]};return N({validForm:S,formData:o,applicationData:_,setFormData:j}),(e,a)=>{const u=n("el-radio"),p=n("el-radio-group"),V=n("el-form-item"),g=n("el-col"),f=n("el-button"),q=n("table-list"),T=n("el-row"),U=n("el-form"),pe=n("el-collapse-item"),ce=n("el-collapse"),z=n("el-drawer");return k(),H(K,null,[t(U,{ref_key:"formRef",ref:x,model:o.value,rules:$,"label-position":"right","label-width":"180px","label-suffix":":","scroll-to-error":""},{default:l(()=>[t(T,{gutter:40},{default:l(()=>[t(g,{span:12},{default:l(()=>[t(V,{label:"\u662F\u5426\u5305\u542B\u5E94\u7528","label-width":"atuo",prop:"includeApplication"},{default:l(()=>[t(p,{modelValue:o.value.includeApplication,"onUpdate:modelValue":a[0]||(a[0]=c=>o.value.includeApplication=c),onChange:M},{default:l(()=>[t(u,{label:1},{default:l(()=>[d("\u662F")]),_:1}),t(u,{label:0},{default:l(()=>[d("\u5426")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),o.value.includeApplication===1?(k(),J(g,{key:0,span:24},{default:l(()=>[t(V,{label:"\u5305\u542B\u7684\u5E94\u7528",prop:"applicationList"},{default:l(()=>[t(f,{type:"primary",plain:"",class:"w-full mb-10",icon:"Plus",onClick:F},{default:l(()=>[d("\u6DFB\u52A0\u5E94\u7528")]),_:1}),t(q,{class:"w-full",pagination:!1,data:o.value.applicationList,column:D},{action:l(({scope:c})=>[v("a",{onClick:W=>E(c.$index,c.row)},"\u7F16\u8F91",8,ee),v("a",{class:"text-red-400",onClick:W=>L(c.$index)},"\u5220\u9664",8,ae)]),_:1},8,["data"])]),_:1})]),_:1})):A("",!0)]),_:1})]),_:1},8,["model"]),t(z,{modelValue:r.value,"onUpdate:modelValue":a[2]||(a[2]=c=>r.value=c),title:"\u6DFB\u52A0\u5E94\u7528","before-close":w,size:1e3},{footer:l(()=>[v("div",le,[t(f,{onClick:w},{default:l(()=>[d(" \u5173\u95ED ")]),_:1}),t(f,{type:"primary",plain:"",onClick:C},{default:l(()=>[d(" \u6682\u5B58 ")]),_:1}),t(f,{type:"primary",onClick:P},{default:l(()=>[d(" \u786E\u5B9A ")]),_:1})])]),default:l(()=>[A("",!0),t(Z,{ref_key:"applicationInfoRef",ref:s,data:_.value,"is-first":h.isFirst,"core-business":h.coreBusiness,"drawer-visible":r.value},null,8,["data","is-first","core-business","drawer-visible"])]),_:1},8,["modelValue"])],64)}}});export{we as default};
