import{y as e,v as l,x as a,Y as t,D as s}from"./element-plus-DSMJnpwa.js";import{d as o}from"./index-mv7arXuk.js";/* empty css               */import{g as n}from"./index-DGMMwRja.js";import{B as i,aE as d,aB as p,H as c,L as r,P as u,M as v,O as m,Y as y,u as f,V as x,Z as b,F as h,ab as k,X as _,R as V,d as g}from"./vue-vendor-DZekML78.js";import"./utils-cPVb2Haz.js";const j={class:"p-2 h-full flex flex-col"},q={class:"container_box flex-1"},U={class:"titlebox flex justify-between items-center"},w={class:"contentBox h-full"},B={class:"detail-header"},I={style:{color:"#666"}},O={class:"detail-content"},T={class:"title"},Y={style:{"font-weight":"bold"}},z={key:0,style:{color:"#f56c6c","margin-left":"5px"}},C={class:"type-tag"},D={key:0,class:"options"},E={class:"option-label"},F={key:1,class:"input-placeholder"},H={key:2,class:"input-placeholder"},J=o(i({__name:"QuestionnaireView",setup(o){const i=g(!1),J=g({id:"",villageId:null,title:"",description:"",content:[],status:"0",scope:"0",residents:"",startTime:"2026-04-03 00:00:00",endTime:"2026-04-09 00:00:00",remark:""}),L=d(),M=p(),N=g(null),P=[{type:"radio",label:"单选题"},{type:"checkbox",label:"多选题"},{type:"input",label:"填空题"},{type:"textarea",label:"多行文本"}];function Q(e){const l=P.find(l=>l.type===e);return l?l.label:""}return M.query.id&&(N.value=M.query.id),i.value=!0,n(N.value).then(e=>{J.value={...J.value,...e.data},"string"==typeof e.data.content?J.value.content=JSON.parse(e.data.content):J.value.content=e.data.content,i.value=!1}),(o,n)=>{const d=e,p=a,g=t,M=s,N=l;return c(),r("div",j,[u("div",q,[u("div",U,[n[2]||(n[2]=u("span",null,"问卷内容",-1)),v(d,{link:"",type:"primary",onClick:n[0]||(n[0]=e=>f(L).back())},{default:m(()=>[...n[1]||(n[1]=[y("返回",-1)])]),_:1})]),x((c(),r("div",w,[u("div",B,[u("h2",null,b(J.value.title),1),u("p",I,b(J.value.description),1)]),v(p),u("div",O,[(c(!0),r(h,null,k(J.value.content,(e,l)=>(c(),r("div",{key:e.cid,class:"question-item"},[u("div",T,[u("span",Y,b(l+1)+". "+b(e.title),1),e.required?(c(),r("span",z,"*")):_("",!0)]),u("div",C,[v(g,{size:"small"},{default:m(()=>[y(b(Q(e.type)),1)]),_:2},1024)]),"radio"===e.type||"checkbox"===e.type?(c(),r("div",D,[(c(!0),r(h,null,k(e.options,(l,a)=>(c(),r("div",{key:a,class:"option-item"},[u("span",{class:V("radio"===e.type?"radio__type":"checkbox__type")},null,2),u("span",E,b(l.label),1)]))),128))])):"input"===e.type?(c(),r("div",F,[v(M,{modelValue:e.placeholder,"onUpdate:modelValue":l=>e.placeholder=l,placeholder:"用户输入区域"},null,8,["modelValue","onUpdate:modelValue"])])):"textarea"===e.type?(c(),r("div",H,[v(M,{type:"textarea",modelValue:e.placeholder,"onUpdate:modelValue":l=>e.placeholder=l,placeholder:"用户输入区域"},null,8,["modelValue","onUpdate:modelValue"])])):_("",!0)]))),128))]),v(p),u("div",null,[u("span",null,"备注: "+b(J.value.remark?J.value.remark:"暂无"),1)])])),[[N,i.value]])])])}}}),[["__scopeId","data-v-dcb49f83"]]);export{J as default};
