← Back
Editing: form.js
import{_ as e}from"./index100.js?v=1753755607904";import{e as a,dF as s,d as l,dG as t}from"./page_layout.js?v=1753755607904";import{u as i}from"./public.js?v=1753755607904";import{L as n}from"./like.js?v=1753755607904";import{k as r,ac as o,a1 as d,X as c,a2 as u,V as p,U as v,F as m,O as f,H as x,a3 as b,P as _,r as g,e as y,Q as k,al as h,ah as j,W as C,j as w}from"./vue.js?v=1753755607904";import{bZ as F,cC as q,cH as U,ay as H}from"./naive.js?v=1753755607904";import"./common.js?v=1753755607904";import"./__commonjsHelpers__.js?v=1753755607904";const P={class:"flex border-1px border-solid border-#f3adaa"},$=["onClick"],E={class:"flex border-1px border-solid border-#f4cf8f"},I=["onClick"],M={class:"flex border-1px border-solid border-#b8e29f"},N=["onClick"],O=a(r({__name:"rating",props:{value:{},valueModifiers:{}},emits:["update:value"],setup(e){const a=o(e,"value"),s=e=>{a.value=e};return(e,l)=>{const t=F;return c(),d(t,{class:"justify-center! mb-16px",size:20},{default:u((()=>[p("div",null,[p("div",P,[(c(),v(m,null,f(6,(e=>p("div",{key:e,class:x(["rating-item","danger-item",{active:a.value===e}]),onClick:a=>s(e)},[p("span",null,b(e),1)],10,$))),64))]),l[0]||(l[0]=p("div",{class:"rating-label danger-text"},"No",-1))]),p("div",null,[p("div",E,[(c(),v(m,null,f(2,(e=>p("div",{key:e+6,class:x(["rating-item","warning-item",{active:a.value===e+6}]),onClick:a=>s(e+6)},[p("span",null,b(e+6),1)],10,I))),64))]),l[1]||(l[1]=p("div",{class:"rating-label warning-text"},"Yes",-1))]),p("div",null,[p("div",M,[(c(),v(m,null,f(2,(e=>p("div",{key:e+8,class:x(["rating-item","success-item",{active:a.value===e+8}]),onClick:a=>s(e+8)},[p("span",null,b(e+8),1)],10,N))),64))]),l[2]||(l[2]=p("div",{class:"rating-label success-text"},"Must",-1))])])),_:1})}}}),[["__scopeId","data-v-c528e412"]]),S={class:"banner"},W={class:"banner-title"},z={class:"ml-8px"},B={key:0,class:"px-24px"},G={class:"text-primary"},J={class:"flex justify-center my-20px"},L=a(r({__name:"form",emits:["close"],setup(a,{emit:r}){const{t:o}=_(),x=g(0),F=r,P=y({}),$=y({}),E=g(null),I=g([]),M=async()=>{var e;await(null==(e=E.value)?void 0:e.validate());const a={questions:JSON.stringify(I.value.reduce(((e,a)=>(e[a.id]=P[a.id],e)),{})),rate:x.value,product_type:1};await t(a),F("close"),N()},N=()=>{const e=i({hideClose:!0,content:()=>k("div",{class:"flex-center flex-col w-230px h-124px bg-#F1F9F3"},[k("img",{class:"w-56px",src:n},null),k("div",{class:"mt-16px"},[o("Component.Feedback.index_6")])])});setTimeout((()=>{e.hide()}),3e3)};return(async()=>{const{message:e}=await s();l(e)&&(I.value=e.res,e.res.forEach((e=>{P[e.id]=""})),e.res.forEach((e=>{1===e.required&&($[e.id]={required:!0,message:e.question,trigger:["blur","change"]})})))})(),(a,s)=>{const l=e,t=q,i=U,n=H;return c(),v("div",null,[p("div",S,[p("div",W,[p("span",z,b(a.$t("Component.Feedback.index_1")),1)])]),s[1]||(s[1]=p("div",{class:"text-center text-20px font-bold my-20px"},"Would you recommend aaPanel?",-1)),k(O,{value:C(x),"onUpdate:value":s[0]||(s[0]=e=>j(x)?x.value=e:null)},null,8,["value"]),C(x)?(c(),v("div",B,[k(i,{model:C(P),rules:C($),ref_key:"formRef",ref:E},{default:u((()=>[(c(!0),v(m,null,f(C(I),(e=>(c(),d(t,{label:e.question,path:e.id,key:e.id},{default:u((()=>[k(l,{value:C(P)[e.id],"onUpdate:value":a=>C(P)[e.id]=a,placeholder:e.hint},null,8,["value","onUpdate:value","placeholder"])])),_:2},1032,["label","path"])))),128))])),_:1},8,["model","rules"]),p("div",G,b(a.$t("Component.Feedback.index_4")),1),p("div",J,[k(n,{type:"primary",class:"w-120px",onClick:M},{default:u((()=>[w(b(a.$t("Public.Btn.Submit")),1)])),_:1})])])):h("",!0)])}}}),[["__scopeId","data-v-cfb29806"]]);export{L as default};
Save File
Cancel