import{a5 as $,b as T,r as d,o as B,y as D,q as s,v as b,p as t,P as k,x as g,n as p,s as v,aE as N,cp as S,cq as q,l as F,bv as M,D as P}from"./index.8d733f79.js";const I={style:{"text-align":"right"}},L={class:"dialog-footer"},O=$({name:"PeakSpectralLine"}),z=Object.assign(O,{emits:["peakValEmit"],setup(U,{expose:w,emit:h}){const{t:C}=T(),{proxy:f}=P(),o=d(!1),i=d([]);let n;const a=d(!1);function V(e,l){o.value=!0,a.value=!1,i.value=e||[],JSON.stringify(l)!=="{}"&&(n=i.value.find(c=>c.x===l.point.x),f.$refs.peakTableRef.setCurrentRow(n),a.value=l.showFiveFlag)}function y(e){console.log("table--row--click",e),n=e}function E(){if(!n){f.$modal.msgError(C("selectP"));return}h("peakValEmit",n,a.value),u()}function u(){o.value=!1}return w({showModal:V}),(e,l)=>{const c=N,m=S,x=q,_=F,R=M;return B(),D(R,{title:e.$t("peakTable"),modelValue:p(o),"onUpdate:modelValue":l[1]||(l[1]=r=>v(o)?o.value=r:null),width:"600px","align-center":!0,onClose:u},{footer:s(()=>[b("div",L,[t(_,{onClick:u},{default:s(()=>[k(g(e.$t("cancel")),1)]),_:1}),t(_,{type:"primary",onClick:E},{default:s(()=>[k(g(e.$t("confirm")),1)]),_:1})])]),default:s(()=>[b("div",I,[t(c,{modelValue:p(a),"onUpdate:modelValue":l[0]||(l[0]=r=>v(a)?a.value=r:null),label:"\u663E\u793A\u6807\u70B9"},null,8,["modelValue"])]),t(x,{ref:"peakTableRef",data:p(i),onRowClick:y,"highlight-current-row":""},{default:s(()=>[t(m,{label:e.$t("frequency"),prop:"x"},null,8,["label"]),t(m,{label:e.$t("amplitude"),prop:"y"},null,8,["label"])]),_:1},8,["data"])]),_:1},8,["title","modelValue"])}}});export{z as default};
