|
- import"./appBasicInfo-1a556abd.js";import"./appSafeInfo-110bc394.js";import"./appResourceInfo-7c676f05.js";import{x as H,r as n,b as i,c as C,d as J,f as t,h as a,i as d,L as B,e as x,j as w,F as K,k as Q,$ as X,C as N,a0 as Y,s as Z}from"./index-dd5fae99.js";import ee from"./applicationInfo-d0f5a252.js";import"./uploadAction-3962500e.js";import"./index-b6aa4cff.js";const ae=["onClick"],le=["onClick"],te={class:"applyBottomBtn flexCenter marginTop"},oe=Q({name:"applications"}),Ve=Object.assign(oe,{props:{isInnovateWholeProvinceShare:{type:Boolean,default:!1},isFirst:{type:Number,default:void 0},coreBusiness:{type:Array,default:()=>[]}},setup(V,{expose:R}){const I=H(),{proxy:$}=Z(),o=n({applicationList:[]}),y=n(),D={includeApplication:[{required:!0,message:"请选择是否包含应用",trigger:"blur"}],applicationList:[{required:!0,message:"请添加应用",trigger:"blur"}],includeCause:[{required:!0,message:"请填写不包括原因",trigger:"blur"}]},L=[{type:"index",label:"序号",width:60},{label:"应用名称",key:"applicationName",prop:"applicationName",render:l=>{var e;return X("span",l.applicationName||((e=l.relatedExistsApplication)==null?void 0:e.applicationName)||"")}},{label:"操作",slot:"action"}],E=l=>{$.$messageBox.confirm("确定要删除该项吗?","提示!",{type:"warning"}).then(()=>{o.value.applicationList.splice(l,1)})},c=n(!1),ie=n(["1","2","3"]),f=n({}),ne=n(),se=n(),pe=n(),p=n(),_=n(!1),h=n(),F=async(l,e)=>{_.value=!0,h.value=l,f.value=e,c.value=!0,await N(),p.value.clearValidate()},P=async()=>{_.value=!1,f.value={},c.value=!0,await N(),p.value.clearValidate()},g=()=>{Y.confirm("确定要关闭应用编辑页面吗?").then(()=>{k()}).catch(()=>{})},k=()=>{p.value.formData={},p.value.clearValidate(),c.value=!1},A=()=>{_.value?o.value.applicationList[h.value]={...p.value.formData}:o.value.applicationList.push({...p.value.formData}),k()},S=()=>{const l=[];l.push(new Promise((e,u)=>{p.value.validForm(r=>{r&&e()})})),Promise.all([...l]).then(()=>{A()})},j=l=>{y.value.validate(e=>{l(e)})},q=l=>{var u;const e=I.query.isDraft?"applicationList":"projectApplications";o.value={includeApplication:l.includeApplication,applicationList:(u=l[e])!=null&&u.length?l[e].map(r=>({...r,relatedExistsApplication:r.relatedExistsApplication?{applicationCode:r.relatedExistsApplicationCode,applicationName:r.relatedExistsApplication}:void 0})):[],includeCause:l.includeCause}},M=()=>{o.value.applicationList=[]};return R({validForm:j,formData:o,applicationData:f,setFormData:q}),(l,e)=>{const u=i("el-radio"),r=i("el-radio-group"),v=i("el-form-item"),b=i("el-col"),m=i("el-button"),U=i("table-list"),T=i("el-input"),W=i("el-row"),z=i("el-form"),re=i("el-collapse-item"),ce=i("el-collapse"),O=i("el-drawer");return C(),J(K,null,[t(z,{ref_key:"formRef",ref:y,model:o.value,rules:D,"label-position":"right","label-width":"180px","label-suffix":":","scroll-to-error":""},{default:a(()=>[t(W,{gutter:40},{default:a(()=>[t(b,{span:12},{default:a(()=>[t(v,{label:"是否包含应用","label-width":"atuo",prop:"includeApplication"},{default:a(()=>[t(r,{modelValue:o.value.includeApplication,"onUpdate:modelValue":e[0]||(e[0]=s=>o.value.includeApplication=s),onChange:M},{default:a(()=>[t(u,{label:1},{default:a(()=>e[4]||(e[4]=[d("是")])),_:1}),t(u,{label:0},{default:a(()=>e[5]||(e[5]=[d("否")])),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),o.value.includeApplication===1?(C(),B(b,{key:0,span:24},{default:a(()=>[t(v,{label:"包含的应用",prop:"applicationList"},{default:a(()=>[t(m,{type:"primary",plain:"",class:"w-full mb-10",icon:"Plus",onClick:P},{default:a(()=>e[6]||(e[6]=[d("添加应用")])),_:1}),t(U,{class:"w-full",pagination:!1,data:o.value.applicationList,column:L},{action:a(({scope:s})=>[x("a",{onClick:G=>F(s.$index,s.row)},"编辑",8,ae),x("a",{class:"text-red-400",onClick:G=>E(s.$index)},"删除",8,le)]),_:1},8,["data"])]),_:1})]),_:1})):w("",!0),o.value.includeApplication!==1?(C(),B(b,{key:1,span:24},{default:a(()=>[t(v,{label:"不包含应用原因",prop:"includeCause"},{default:a(()=>[t(T,{modelValue:o.value.includeCause,"onUpdate:modelValue":e[1]||(e[1]=s=>o.value.includeCause=s),placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1})):w("",!0)]),_:1})]),_:1},8,["model"]),t(O,{modelValue:c.value,"onUpdate:modelValue":e[3]||(e[3]=s=>c.value=s),title:"添加应用","before-close":g,size:1e3},{footer:a(()=>[x("div",te,[t(m,{onClick:g},{default:a(()=>e[10]||(e[10]=[d(" 关闭 ")])),_:1}),t(m,{type:"primary",plain:"",onClick:A},{default:a(()=>e[11]||(e[11]=[d(" 暂存 ")])),_:1}),t(m,{type:"primary",onClick:S},{default:a(()=>e[12]||(e[12]=[d(" 确定 ")])),_:1})])]),default:a(()=>[w("",!0),t(ee,{ref_key:"applicationInfoRef",ref:p,data:f.value,"is-first":V.isFirst,"core-business":V.coreBusiness,"drawer-visible":c.value},null,8,["data","is-first","core-business","drawer-visible"])]),_:1},8,["modelValue"])],64)}}});export{Ve as default};
|