25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
5.1KB

  1. /* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{w as T,f as N}from"./advice-feedback.82b87890.js";import{f as C,u as B}from"./uploadAction.98a2f3db.js";import{d as $,r as z,l as S,Y as x,Z as E,V as L,a1 as G,a2 as O,X as R,W as I,$ as J,c as f,e as d,w as u,M as X,o as n,Q as i,F as v,v as g,g as m,t as V,K as _,b as q,G as K,a0 as P}from"./index.db1e0641.js";const Q={class:"adviceFeedBack"},W=q("span",{style:{color:"#999999","font-size":"12px"}},"\u652F\u6301jpg\u3001jpeg\u3001png\u56FE\u7247\u683C\u5F0F\u4E0A\u4F20",-1);const Y={style:{margin:"16px",display:"flex"}},Z=$({name:"adviceFeedBack"}),pe=Object.assign(Z,{setup(A){const D=K(),a=z({}),M=async()=>{var r,p;console.log(a.value.attachFiles);const o={...a.value,feedbackModelDetail:((p=(r=a.value)==null?void 0:r.feedbackModelDetail)==null?void 0:p.map(s=>{var c;return{...s,value:s.modelType==="FILE"?((c=s.value)==null?void 0:c.length)&&JSON.stringify(C(s.value))||void 0:s.value}}))||void 0};await N(o),X("\u63D0\u4EA4\u6210\u529F\uFF01"),D.go(-1)},h=async(o,r)=>{if(o.status="uploading",o.message="\u4E0A\u4F20\u4E2D...",o.file.type!=="image/jpeg"&&o.file.type!=="image/png"&&o.file.type!=="image/jpeg")return P("\u8BF7\u4E0A\u4F20 jpg\u3001png\u3001jpeg \u683C\u5F0F\u56FE\u7247"),r.pop(),!1;const p=new FormData;p.append("file",o.file);const s=await B(p);o.status="success",o.message="\u4E0A\u4F20\u6210\u529F",o.response=s.data};return S(async()=>{var r;const o=await T();a.value={feedbackModelDetail:((r=o.data)==null?void 0:r.modelConfigToJson)||void 0}}),(o,r)=>{const p=x,s=E,c=L,F=G,j=O,U=R,k=I,w=J;return n(),f("div",Q,[d(w,{class:"form",onSubmit:M},{default:u(()=>{var y;return[d(c,{name:"radio",label:"\u53CD\u9988\u7C7B\u578B",required:"",rules:[{required:!0,message:"\u8BF7\u9009\u62E9"}]},{input:u(()=>[d(s,{modelValue:a.value.type,"onUpdate:modelValue":r[0]||(r[0]=e=>a.value.type=e),direction:"horizontal"},{default:u(()=>[d(p,{name:1},{default:u(()=>[i("\u5EFA\u8BAE")]),_:1}),d(p,{name:2},{default:u(()=>[i("\u95EE\u9898")]),_:1})]),_:1},8,["modelValue"])]),_:1}),d(c,{modelValue:a.value.feedbackContent,"onUpdate:modelValue":r[1]||(r[1]=e=>a.value.feedbackContent=e),rows:"2",required:"",autosize:"",label:"\u53CD\u9988\u5185\u5BB9",type:"textarea",placeholder:"\u8BF7\u8F93\u5165",rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}]},null,8,["modelValue"]),(n(!0),f(v,null,g((y=a.value)==null?void 0:y.feedbackModelDetail,(e,l)=>(n(),f(v,{key:l},[e.modelType==="SINGLE"?(n(),m(c,{key:0,name:"radio",label:e.columnName,prop:`feedbackModelDetail[${l}].value`,rules:[{required:e.required,message:"\u8BF7\u9009\u62E9"}],required:e.required},{input:u(()=>[d(s,{modelValue:a.value.feedbackModelDetail[l].value,"onUpdate:modelValue":t=>a.value.feedbackModelDetail[l].value=t,direction:"horizontal"},{default:u(()=>[(n(!0),f(v,null,g(a.value.feedbackModelDetail[l].modelOptions,(t,b)=>(n(),m(p,{key:b,name:t},{default:u(()=>[i(V(t),1)]),_:2},1032,["name"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules","required"])):_("",!0),e.modelType==="TEXT"?(n(),m(c,{key:1,modelValue:a.value.feedbackModelDetail[l].value,"onUpdate:modelValue":t=>a.value.feedbackModelDetail[l].value=t,label:e.columnName,prop:`feedbackModelDetail[${l}].value`,rules:[{required:e.required,message:"\u8BF7\u8F93\u5165"}],required:e.required,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue","label","prop","rules","required"])):_("",!0),e.modelType==="MULTIPLE"?(n(),m(c,{key:2,name:"checkboxGroup",label:e.columnName,prop:`feedbackModelDetail[${l}].value`,rules:[{required:e.required,message:"\u8BF7\u9009\u62E9"}],required:e.required},{input:u(()=>[d(j,{modelValue:a.value.feedbackModelDetail[l].value,"onUpdate:modelValue":t=>a.value.feedbackModelDetail[l].value=t,direction:"horizontal",shape:"square"},{default:u(()=>[(n(!0),f(v,null,g(a.value.feedbackModelDetail[l].modelOptions,(t,b)=>(n(),m(F,{key:b,name:t,style:{"margin-bottom":"2px"}},{default:u(()=>[i(V(t),1)]),_:2},1032,["name"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules","required"])):_("",!0),e.modelType==="FILE"?(n(),m(c,{key:3,name:"uploader",label:e.columnName,prop:`feedbackModelDetail[${l}].value`,rules:[{required:e.required,message:"\u8BF7\u4E0A\u4F20"}],required:e.required},{input:u(()=>[d(U,{modelValue:a.value.feedbackModelDetail[l].value,"onUpdate:modelValue":t=>a.value.feedbackModelDetail[l].value=t,"max-count":5,"after-read":t=>h(t,a.value.feedbackModelDetail[l].value),accept:".png,.jpg,.jpeg"},null,8,["modelValue","onUpdate:modelValue","after-read"]),W]),_:2},1032,["label","prop","rules","required"])):_("",!0)],64))),128)),_("",!0),q("div",Y,[d(k,{block:"",style:{"margin-right":"12px"},size:"small",round:"",onClick:r[3]||(r[3]=e=>o.$router.go(-1))},{default:u(()=>[i(" \u8FD4\u56DE ")]),_:1}),d(k,{block:"",type:"primary","native-type":"submit",size:"small",round:""},{default:u(()=>[i(" \u63D0\u4EA4 ")]),_:1})])]}),_:1})])}}});export{pe as default};