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