You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
4.4KB

  1. import{r as V,B as q,b as o,c as m,L as p,h as a,f as n,i as y,j as f,N as B,e as J,k as S}from"./index-dd5fae99.js";const M=["onClick"],R=S({name:"projectContentDialog"}),D=Object.assign(R,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close","setContent"],setup(x,{emit:$}){const c=x,t=V({perIndicator:[]}),v=V(),g={mainContent:[{required:!0,message:"请输入项目主要内容"}],businessObject:[{required:!0,message:"请输入业务对象"}],perIndicator:[{required:!0,message:"请至少添加一个预期成效指标"}]},k=[{label:"预期成效指标名称",key:"name",slot:"name",width:140},{label:"符号",key:"symbol",slot:"symbol"},{label:"数值",key:"nums",slot:"nums"},{label:"单位",key:"unit",slot:"unit"},{label:"操作",key:"action",slot:"action",width:70}],I=()=>{t.value.perIndicator.push({})},C=r=>{t.value.perIndicator.splice(r,1)},w=async r=>{r&&await r.validate(async l=>{if(l){const u=JSON.parse(JSON.stringify(t.value));b("setContent",u),b("close",!0)}})},b=$;return q(()=>c.visible,async r=>{var l;r&&c.data?t.value=JSON.parse(JSON.stringify(c.data)):((l=v.value)==null||l.resetFields(),t.value={perIndicator:[]})}),(r,l)=>{const u=o("el-input"),d=o("el-form-item"),_=o("el-button"),s=o("el-option"),O=o("el-select"),U=o("el-input-number"),N=o("table-list"),j=o("el-form"),h=o("el-dialog");return m(),p(h,{"model-value":x.visible,title:"添加",size:840,onClose:l[5]||(l[5]=e=>b("close"))},{footer:a(()=>[n(_,{type:"primary",onClick:l[3]||(l[3]=e=>w(v.value))},{default:a(()=>l[7]||(l[7]=[y("提交")])),_:1}),n(_,{onClick:l[4]||(l[4]=e=>b("close"))},{default:a(()=>l[8]||(l[8]=[y("取消")])),_:1})]),default:a(()=>[n(j,{ref_key:"formRef",ref:v,"label-suffix":":",model:t.value,rules:g,"label-width":"160"},{default:a(()=>[n(d,{label:"项目主要内容",prop:"mainContent"},{default:a(()=>[n(u,{modelValue:t.value.mainContent,"onUpdate:modelValue":l[0]||(l[0]=e=>t.value.mainContent=e),placeholder:"请输入",maxlength:"100"},null,8,["modelValue"])]),_:1}),n(d,{label:"业务对象",prop:"businessObject"},{default:a(()=>[n(u,{modelValue:t.value.businessObject,"onUpdate:modelValue":l[1]||(l[1]=e=>t.value.businessObject=e),placeholder:"请输入",maxlength:"100"},null,8,["modelValue"])]),_:1}),n(_,{type:"primary",plain:"",icon:"Plus",class:"w-full mb-8",onClick:I},{default:a(()=>l[6]||(l[6]=[y("添加 ")])),_:1}),n(N,{pagination:!1,column:k,"empty-temp":!1,data:t.value.perIndicator},{name:a(({scope:e})=>[e.$index>=0?(m(),p(d,{key:0,prop:`perIndicator[${e.$index}].name`,rules:[{required:!0,message:" "}],"label-width":"0",style:{"margin-bottom":"0"}},{default:a(()=>[n(u,{modelValue:t.value.perIndicator[e.$index].name,"onUpdate:modelValue":i=>t.value.perIndicator[e.$index].name=i,placeholder:"请输入",maxlength:"50"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])):f("",!0)]),symbol:a(({scope:e})=>[e.$index>=0?(m(),p(d,{key:0,prop:`perIndicator[${e.$index}].symbol`,"label-width":"0",style:{"margin-bottom":"0"}},{default:a(()=>[n(O,{modelValue:t.value.perIndicator[e.$index].symbol,"onUpdate:modelValue":i=>t.value.perIndicator[e.$index].symbol=i},{default:a(()=>[n(s,{label:"等于",value:"等于"}),n(s,{label:"大于",value:"大于"}),n(s,{label:"大于等于",value:"大于等于"}),n(s,{label:"小于",value:"小于"}),n(s,{label:"小于等于",value:"小于等于"})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])):f("",!0)]),nums:a(({scope:e})=>[e.$index>=0?(m(),p(d,{key:0,prop:`perIndicator[${e.$index}].nums`,"label-width":"0",style:{"margin-bottom":"0"}},{default:a(()=>[n(U,{modelValue:t.value.perIndicator[e.$index].nums,"onUpdate:modelValue":i=>t.value.perIndicator[e.$index].nums=i,controls:!1,class:"flex-1 mr-8",placeholder:"请输入",onMousewheel:l[2]||(l[2]=B(()=>{},["prevent"]))},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])):f("",!0)]),unit:a(({scope:e})=>[e.$index>=0?(m(),p(d,{key:0,prop:`perIndicator[${e.$index}].unit`,"label-width":"0",style:{"margin-bottom":"0"}},{default:a(()=>[n(u,{modelValue:t.value.perIndicator[e.$index].unit,"onUpdate:modelValue":i=>t.value.perIndicator[e.$index].unit=i,placeholder:"请输入",maxlength:"10"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])):f("",!0)]),action:a(({scope:e})=>[J("a",{class:"text-danger cursor-pointer",onClick:i=>C(e.$index)},"移除",8,M)]),_:1},8,["data"])]),_:1},8,["model"])]),_:1},8,["model-value"])}}});export{D as default};