import{c as a,o as e,r as t,q as l,v as s,x as o,z as r,C as n,A as i,y as d,e as m,B as u,F as p,b0 as c,N as v,T as _,ab as f,a9 as b,G as y}from"./base-lib.js?v=1761009159";import{aD as x,bl as g,b as h,_ as w}from"./utils-lib.js?v=1761009159";import{v as j}from"./validator.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";import"./column.js?v=1761009159";const D={class:"nps_survey_box"},V={"data-v-30672cd2":"",class:"text-extraLarge font-bold text-center text-black mt-[2rem]"},q={class:"p-[2rem] flex flex-col items-center"},k={class:"w-[100%]"},z=w(a({__name:"index",emits:["close"],setup(a,{emit:w}){const z=e({mustData:"",data:[]}),S=t(),U=t([]),A=t([]),C={mustData:[{required:!0,message:"请输入内容",trigger:"blur"}]},{load:E}=h(),F=w,I=async()=>{if(await S.value.validate()){const e=E("正在提交问卷，请稍后..."),t={};for(let a=0;a<U.value.length;a++)t[U.value[a].id]=0===a?z.mustData:z.data[a];try{await g({questions:JSON.stringify(t),product_type:19,software_name:"Enterprise-Edition-Survey",rate:0}),e.close(),localStorage.setItem("ltd_nps","1"),j(),F("close")}catch(a){}finally{e.close()}}};return l(async()=>{const{data:a}=await x({product_type:19,version:-1});U.value=a.msg;for(let e=0;e<a.msg.length;e++)z.data.push("");A.value=a.msg.slice(1)}),(a,e)=>{var t;const l=_,x=f,g=b,h=y;return s(),o("div",D,[e[2]||(e[2]=r("div",{class:"nps_survey_banner"},[r("span",null,[r("i"),n(),r("span",{style:{"vertical-align":"4px"}},"企业版用户专属调研")])],-1)),r("div",V,i(null==(t=d(U)[0])?void 0:t.hint),1),r("div",q,[r("div",k,[m(g,{ref_key:"formLabelAlignFrom",ref:S,"label-position":"top","label-width":"80px",model:d(z),rules:C},{default:u(()=>{var a;return[m(x,{label:null==(a=d(U)[0])?void 0:a.question,prop:"mustData"},{default:u(()=>[m(l,{modelValue:d(z).mustData,"onUpdate:modelValue":e[0]||(e[0]=a=>d(z).mustData=a),type:"textarea",rows:3,maxlength:500,resize:"none",placeholder:"请留下您的建议"},null,8,["modelValue"])]),_:1},8,["label"]),(s(!0),o(p,null,c(d(A),(a,e)=>(s(),v(x,{key:e,label:a.question},{default:u(()=>[m(l,{modelValue:d(z).data[e+1],"onUpdate:modelValue":a=>d(z).data[e+1]=a,type:"textarea",rows:3,maxlength:500,resize:"none",placeholder:"请留下您的建议"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label"]))),128))]}),_:1},8,["model"])]),m(h,{class:"w-[12.5rem] !mt-[2rem]",type:"primary",size:"large",onClick:I},{default:u(()=>e[1]||(e[1]=[n("提交",-1)])),_:1,__:[1]})])])}}}),[["__scopeId","data-v-235d5ee3"]]);export{z as default};
