|
1 |
- import{r as y,o as G,L as z,c as r,e as i,I as s,i as o,h as a,f as x,F as $,J as D,j as m,k as h,g as f}from"./index.20c8d60f.js";const j=f("span",{style:{color:"red"}},"*",-1),L=f("span",{style:{color:"red"}},"*",-1),O=f("span",{style:{color:"red"}},"*",-1),J=f("span",{style:{color:"red"}},"*",-1),M=f("span",{style:{color:"red"}},"*",-1),H={__name:"plannedUseResources",props:{detailData:{type:Object,default:()=>({})}},setup(T,{expose:w}){const c=T;function N(p){let t=[];return R.value.forEach(b=>{b.name===p&&(t=b.children)}),t}function q(p){l.value.cloudResource[p].baseSpecification=""}const R=y([{name:"ECS",children:[{name:"1\u68381G"},{name:"2\u68384G"}]},{name:"OSS",children:[{name:"100G"},{name:"200G"}]}]),k=y(),l=y({mobileTerminalEntry:[],cloudResource:[{cloudResourceType:"",baseSpecification:"",serversCount:"",description:""}],produceData:[{dataDirectoryName:"",dataItem:""}],commonComponent:[{componentName:"",componentType:""}],isCloudResource:0,isProduceData:0,isCommonComponent:0}),P={mobileTerminalEntry:[{required:!0,message:"\u8BF7\u9009\u62E9\u79FB\u52A8\u7AEF\u5165\u53E3"}],cloudResource:[{required:!0,message:"\u8BF7\u81F3\u5C11\u6DFB\u52A0\u4E00\u4E2A\u4E91\u8D44\u6E90"}],produceData:[{required:!0,message:"\u8BF7\u81F3\u5C11\u6DFB\u52A0\u4E00\u4E2A\u4EA7\u751F\u6570\u636E"}],commonComponent:[{required:!0,message:"\u8BF7\u81F3\u5C11\u6DFB\u52A0\u4E00\u4E2A\u516C\u5171\u7EC4\u4EF6"}]};G(()=>{l.value.mobileTerminalEntry=c.detailData.mobileTerminalEntry,c.detailData.cloudResource&&(l.value.cloudResource=c.detailData.cloudResource||[]),l.value.commonComponent&&(l.value.commonComponent=c.detailData.commonComponent||[]),l.value.produceData&&(l.value.produceData=c.detailData.produceData||[]),l.value.isCloudResource=c.detailData.isCloudResource,l.value.isProduceData=c.detailData.isProduceData,l.value.isCommonComponent=c.detailData.isCommonComponent}),z(()=>c.detailData,p=>{},{deep:!0});function E(p){k.value.validate(t=>{p(t)})}w({validForm:E,formData:l});const S=y([{label:"\u6D59\u91CC\u529E",value:1},{label:"\u6D59\u653F\u9489",value:2},{label:"\u5176\u4ED6",value:3},{label:"\u65E0\u79FB\u52A8\u7AEF",value:4}]);return(p,t)=>{const b=r("el-checkbox"),I=r("el-checkbox-group"),n=r("el-form-item"),C=r("el-switch"),d=r("el-table-column"),g=r("el-option"),U=r("el-select"),F=r("el-input-number"),_=r("el-input"),v=r("el-button"),V=r("el-table"),B=r("el-form");return i(),s(B,{ref_key:"ruleFormRef",ref:k,model:l.value,"label-position":"right","label-width":"180px","label-suffix":":","scroll-to-error":"",rules:P,"validate-on-rule-change":!1},{default:o(()=>[a(n,{label:"\u79FB\u52A8\u7AEF\u5165\u53E3",prop:"mobileTerminalEntry"},{default:o(()=>[a(I,{modelValue:l.value.mobileTerminalEntry,"onUpdate:modelValue":t[0]||(t[0]=e=>l.value.mobileTerminalEntry=e)},{default:o(()=>[(i(!0),x($,null,D(S.value,e=>(i(),s(b,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(n,{label:"\u662F\u5426\u4F7F\u7528\u4E91\u8D44\u6E90"},{default:o(()=>[a(C,{modelValue:l.value.isCloudResource,"onUpdate:modelValue":t[1]||(t[1]=e=>l.value.isCloudResource=e),"active-value":1,"inactive-value":0},null,8,["modelValue"])]),_:1}),l.value.isCloudResource===1?(i(),s(n,{key:0,prop:"cloudResource"},{default:o(()=>[a(V,{data:l.value.cloudResource,style:{width:"100%"}},{default:o(()=>[a(d,{type:"index",label:"\u5E8F\u53F7",width:"60"}),a(d,{prop:"state"},{header:o(()=>[j,m("\u4E91\u8D44\u6E90\u7C7B\u578B ")]),default:o(e=>[a(n,{prop:`cloudResource[${e.$index}].cloudResourceType`,rules:[{required:!0,message:""}]},{default:o(()=>[a(U,{modelValue:l.value.cloudResource[e.$index].cloudResourceType,"onUpdate:modelValue":u=>l.value.cloudResource[e.$index].cloudResourceType=u,placeholder:"\u8BF7\u9009\u62E9",size:"large",onChange:u=>q(e.$index)},{default:o(()=>[(i(!0),x($,null,D(R.value,u=>(i(),s(g,{key:u.name,label:u.name,value:u.name},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1032,["prop"])]),_:1}),a(d,{prop:"city"},{header:o(()=>[L,m("\u57FA\u7840\u89C4\u683C ")]),default:o(e=>[a(n,{prop:`cloudResource[${e.$index}].baseSpecification`,rules:[{required:!0,message:""}]},{default:o(()=>[a(U,{modelValue:l.value.cloudResource[e.$index].baseSpecification,"onUpdate:modelValue":u=>l.value.cloudResource[e.$index].baseSpecification=u,placeholder:"\u8BF7\u9009\u62E9",size:"large"},{default:o(()=>[(i(!0),x($,null,D(N(l.value.cloudResource[e.$index].cloudResourceType),u=>(i(),s(g,{key:u.name,label:u.name,value:u.name},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:1}),a(d,{prop:"address"},{header:o(()=>[O,m("\u53F0\u6570 ")]),default:o(e=>[a(n,{prop:`cloudResource[${e.$index}].serversCount`,rules:[{required:!0,message:""}]},{default:o(()=>[a(F,{modelValue:l.value.cloudResource[e.$index].serversCount,"onUpdate:modelValue":u=>l.value.cloudResource[e.$index].serversCount=u,min:1,placeholder:"\u53F0\u6570"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:1}),a(d,{prop:"zip",label:"\u63CF\u8FF0"},{default:o(e=>[a(n,null,{default:o(()=>[a(_,{modelValue:l.value.cloudResource[e.$index].description,"onUpdate:modelValue":u=>l.value.cloudResource[e.$index].description=u,placeholder:"\u63CF\u8FF0"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:1}),a(d,{fixed:"right",label:"\u64CD\u4F5C"},{default:o(e=>[a(v,{link:"",type:"primary",onClick:u=>l.value.cloudResource.splice(e.$index,1)},{default:o(()=>[m("\u5220\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),a(v,{type:"primary",plain:"",icon:"Plus",class:"w-full mb-8",onClick:t[2]||(t[2]=e=>l.value.cloudResource.push({}))},{default:o(()=>[m("\u6DFB\u52A0\u4E91\u8D44\u6E90 ")]),_:1})]),_:1})):h("",!0),a(n,{label:"\u662F\u5426\u4EA7\u751F\u6570\u636E"},{default:o(()=>[a(C,{modelValue:l.value.isProduceData,"onUpdate:modelValue":t[3]||(t[3]=e=>l.value.isProduceData=e),"active-value":1,"inactive-value":0},null,8,["modelValue"])]),_:1}),l.value.isProduceData===1?(i(),s(n,{key:1,prop:"isProduceData"},{default:o(()=>[a(V,{data:l.value.produceData,style:{width:"100%"}},{default:o(()=>[a(d,{type:"index",label:"\u5E8F\u53F7",width:"60"}),a(d,{prop:"state",label:""},{header:o(()=>[J,m("\u6570\u636E\u76EE\u5F55\u540D\u79F0 ")]),default:o(e=>[a(n,{prop:`produceData[${e.$index}].dataDirectoryName`,rules:[{required:!0,message:""}]},{default:o(()=>[a(_,{modelValue:l.value.produceData[e.$index].dataDirectoryName,"onUpdate:modelValue":u=>l.value.produceData[e.$index].dataDirectoryName=u,placeholder:"\u6570\u636E\u76EE\u5F55\u540D\u79F0"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:1}),a(d,{prop:"city"},{header:o(()=>[M,m("\u6570\u636E\u9879 ")]),default:o(e=>[a(n,{prop:`produceData[${e.$index}].dataItem`,rules:[{required:!0,message:""}]},{default:o(()=>[a(_,{modelValue:l.value.produceData[e.$index].dataItem,"onUpdate:modelValue":u=>l.value.produceData[e.$index].dataItem=u,placeholder:"\u591A\u4E2A\u6570\u636E\u9879\u65F6\uFF0C\u7528\u201C\uFF1B\u201D\u9694\u5F00"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:1}),a(d,{fixed:"right",label:"\u64CD\u4F5C"},{default:o(e=>[a(v,{link:"",type:"primary",onClick:u=>l.value.produceData.splice(e.$index,1)},{default:o(()=>[m("\u5220\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),a(v,{type:"primary",plain:"",icon:"Plus",class:"w-full mb-8",onClick:t[4]||(t[4]=e=>l.value.produceData.push({}))},{default:o(()=>[m("\u6DFB\u52A0\u6570\u636E\u9879 ")]),_:1})]),_:1})):h("",!0),a(n,{label:"\u662F\u5426\u4F7F\u7528\u516C\u5171\u7EC4\u4EF6"},{default:o(()=>[a(C,{modelValue:l.value.isCommonComponent,"onUpdate:modelValue":t[5]||(t[5]=e=>l.value.isCommonComponent=e),"active-value":1,"inactive-value":0},null,8,["modelValue"])]),_:1}),l.value.isCommonComponent===1?(i(),s(n,{key:2,prop:"isProduceData"},{default:o(()=>[a(V,{data:l.value.commonComponent,style:{width:"100%"}},{default:o(()=>[a(d,{type:"index",label:"\u5E8F\u53F7",width:"60"}),a(d,{prop:"state",label:"\u516C\u5171\u7EC4\u4EF6\u540D\u79F0\uFF08\u5F3A\u5236\u7EC4\u4EF6\u6570\u91CF\u5FC5\u987B>=1\uFF09"},{default:o(e=>[a(n,{prop:`commonComponent[${e.$index}].componentName`,rules:[{required:!0,message:""}]},{default:o(()=>[a(_,{modelValue:l.value.commonComponent[e.$index].componentName,"onUpdate:modelValue":u=>l.value.commonComponent[e.$index].componentName=u,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:1}),a(d,{prop:"city",label:"\u516C\u5171\u7EC4\u4EF6\u7C7B\u578B"},{default:o(e=>[a(n,{prop:`commonComponent[${e.$index}].componentType`,rules:[{required:!0,message:""}]},{default:o(()=>[a(_,{modelValue:l.value.commonComponent[e.$index].componentType,"onUpdate:modelValue":u=>l.value.commonComponent[e.$index].componentType=u,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:1}),a(d,{fixed:"right",label:"\u64CD\u4F5C"},{default:o(e=>[a(v,{link:"",type:"primary",onClick:u=>l.value.commonComponent.splice(e.$index,1)},{default:o(()=>[m("\u5220\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),a(v,{type:"primary",plain:"",icon:"Plus",class:"w-full mb-8",onClick:t[6]||(t[6]=e=>l.value.commonComponent.push({}))},{default:o(()=>[m("\u6DFB\u52A0\u7EC4\u4EF6 ")]),_:1})]),_:1})):h("",!0)]),_:1},8,["model"])}}};export{H as default};
|