import{c as e,o as a,r as s,bV as l,q as o,v as t,x as n,z as r,C as u,F as i,b0 as c,K as p,A as d,I as v,J as m,y,e as f,B as x,N as b,D as _,Q as h,T as k,az as g,ab as w,a9 as M,G as V,bp as j}from"./base-lib.js?v=1761009159";import{u as C,aD as U,gs as q,bl as I,b as z,_ as B}from"./utils-lib.js?v=1761009159";import{v as H}from"./validator.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";import"./column.js?v=1761009159";const E={class:"nps-survey-box"},F={class:"py-[40px] px-[30px]"},N={class:"nps-survey-score h-[130px]"},D={id:"survey-score",class:"flex items-center justify-around"},G={class:"survey-score-num small"},J=["data-content","onMouseover","onMouseleave","onClick"],A={class:"survey-score-num medium"},K=["data-content","onMouseover","onMouseleave","onClick"],O={class:"survey-score-num large"},Q=["data-content","onMouseover","onMouseleave","onClick"],S={class:"flex flex-col items-center"},T={class:"nps-survey-title"},$={key:0,class:"text-danger"},L={class:"text-base"},P={key:0,class:"nps-surver-tips"},R=B(e({__name:"index",emits:["close"],setup(e,{emit:B}){const R=B,{proxy:W}=j(),{load:X,error:Y}=z(),{panel:Z}=C(),ee=a({}),ae=s([]),se=s(!1),le=s(0),oe=s(0),te=e=>le.value===e||oe.value===e,ne=(e,a)=>{if(oe.value===a)return!1;le.value=a},re=(e,a,s)=>{ae.value[s].error=""==e?"问题答案不可为空":"",ee[a]=e,W.$forceUpdate()},ue=(e,a)=>{if(oe.value===a)return!1;le.value=-1},ie=(e,a)=>{if(!ae.value.length)return Y("暂时无法进行评分哦~请刷新页面重试"),!1;oe.value=a},ce=async()=>{try{await ae.value.forEach(e=>{if(""!=e.error)throw Y("还有必填项没有填写哦~"),new Error("还有必填项没有填写哦~")});let e=X("正在提交问卷，请稍后...");(await I({questions:JSON.stringify(ee),product_type:0,rate:oe.value,software_name:"panel"})).status&&(e.close(),R("close"),H())}catch(e){}};return l(async()=>{try{const{data:e}=await U({version:-1,product_type:0});ae.value=e.msg,ae.value=[{id:4,hint:"您在使用产品过程中有什么需求没有被满足，或遇到什么BUG没被解决，请将您的问题或需求详细描述给我们，我们尽力为您解决及开发对应的功能",product_type:0,question:"您的哪些需求在宝塔面板上还没有被满足的?",required:1,version:0,textarea:!0,isHint:!0}],ae.value.forEach(e=>{ee[e.id]=""})}catch(e){}}),o(async()=>{Z.value.panelNps=!0,q({software_name:"panel"})}),(e,a)=>{const s=k,l=g,o=w,j=M,C=V;return t(),n("div",E,[a[5]||(a[5]=r("div",{class:"nps-survey-banner"},[r("span",null,[r("i"),u(),r("span",{style:{"vertical-align":"4px"}},"宝塔面板产品体验调查")])],-1)),r("div",F,[r("div",N,[a[2]||(a[2]=r("div",{class:"text-round font-bold text-center text-black"},"您向朋友或同事推荐宝塔面板的可能性有多大?",-1)),r("div",D,[r("ul",G,[(t(),n(i,null,c([1,2,3,4,5,6],e=>r("li",{key:e,"data-content":e,class:p({act:te(e)}),onMouseover:a=>ne(0,e),onMouseleave:a=>ue(0,e),onClick:a=>ie(0,e)},d(te(e)?"".concat(e,"分"):e),43,J)),64))]),r("ul",A,[(t(),n(i,null,c([7,8],e=>r("li",{key:e,"data-content":e,class:p({act:te(e)}),onMouseover:a=>ne(0,e),onMouseleave:a=>ue(0,e),onClick:a=>ie(0,e)},d(e+(te(e)?"分":"")),43,K)),64))]),r("ul",O,[(t(),n(i,null,c([9,10],e=>r("li",{key:e,"data-content":e,class:p({act:te(e)}),onMouseover:a=>ne(0,e),onMouseleave:a=>ue(0,e),onClick:a=>ie(0,e)},d(te(e)?"".concat(e,"分"):e),43,Q)),64))])])]),v(r("div",S,[f(j,{ref:"npsForm","label-position":"top",model:y(ee),size:"default"},{default:x(()=>[(t(!0),n(i,null,c(y(ae),(e,u)=>(t(),b(o,{key:u,label:"",error:e.error},{label:x(()=>[r("span",T,[e.required?(t(),n("span",$,"*")):_("",!0),r("span",L,d(e.question),1)]),e.textarea?_("",!0):(t(),n("span",P,d(e.hint),1))]),default:x(()=>[e.textarea?(t(),b(l,{key:0,ref_for:!0,ref:"popover",visible:y(se),"onUpdate:visible":a[1]||(a[1]=e=>h(se)?se.value=e:null),placement:"top-start","popper-class":"green-tips-popover p-20px !border-none",title:"",width:"51.2rem",trigger:"focus",content:e.hint},{reference:x(()=>[f(s,{modelValue:y(ee)[e.id],"onUpdate:modelValue":a=>y(ee)[e.id]=a,type:"textarea",class:"!w-[51.2rem]",rows:6,maxlength:500,placeholder:e.isHint?e.hint:"",onFocus:a[0]||(a[0]=e=>se.value=!0),onInput:a=>re(a,e.id,u),onBlur:a=>e.isHint=!0},null,8,["modelValue","onUpdate:modelValue","placeholder","onInput","onBlur"])]),_:2},1032,["visible","content"])):(t(),b(s,{key:1,modelValue:y(ee)[e.id],"onUpdate:modelValue":a=>y(ee)[e.id]=a,class:"w-[51.2rem]",maxlength:500,placeholder:"请填写问题答案",onInput:a=>re(a,e.id,u)},null,8,["modelValue","onUpdate:modelValue","onInput"]))]),_:2},1032,["error"]))),128))]),_:1},8,["model"]),a[4]||(a[4]=r("div",{class:"text-primary leading-[3.5rem] mb-[1rem]"},"我们特别重视您的需求反馈，我们会每周进行需求评审。希望能更好的帮到您",-1)),f(C,{class:"w-[12.5rem]",size:"large",type:"primary",onClick:ce},{default:x(()=>a[3]||(a[3]=[u("提交",-1)])),_:1,__:[3]})],512),[[m,0!==y(oe)]])])])}}}),[["__scopeId","data-v-31c39cbb"]]);export{R as default};
