import{d as e,r as a,o as l,j as t,b as o,c as n,w as d,k as s,e as u,f as i,F as m,m as r,q as c,i as p,h as f}from"./index-z4UiUMlV.js";import{g as _,a as y}from"./index.Wwo-uIrA.js";import{_ as V}from"./_plugin-vue_export-helper.BCo6x5W8.js";const g=V(e({__name:"quality",setup(e){const V=a([]);function g(){_("/testItem").then((e=>{200===e.code&&(V.value=JSON.parse(e.data.payload))}))}l((()=>{g()}));const h=()=>{history.back()},b=()=>{V.value.push({options:[{}]})},k=()=>{let e={id:1,payload:JSON.stringify(V.value)};y("/testItem",e).then((e=>{200===e.code&&(c("提交成功！"),g())}))};return(e,a)=>{const l=t("van-nav-bar"),c=t("van-icon"),_=t("van-field"),y=t("van-button"),g=p,v=t("van-radio"),x=t("van-radio-group"),U=t("van-cell-group"),C=t("van-checkbox"),w=t("van-checkbox-group");return o(),n(g,{class:"flex"},{default:d((()=>[s(l,{title:"色胚质检项维护","left-text":"返回","left-arrow":"","right-text":"新增",onClickLeft:h,onClickRight:b}),s(g,{class:"content"},{default:d((()=>[(o(!0),u(m,null,i(V.value,((e,a)=>(o(),n(g,{class:"card",key:a},{default:d((()=>[s(U,{inset:""},{default:d((()=>[s(g,{class:"a-b"},{default:d((()=>[s(c,{name:"clear",color:"red",size:"25",onClick:e=>V.value.splice(a,1)},null,8,["onClick"]),s(_,{modelValue:e.name,"onUpdate:modelValue":a=>e.name=a,name:"质检项名称",label:"质检项名称",colon:"",class:"a-c","label-width":"6em",rules:[{required:!0,message:"请填写"}]},null,8,["modelValue","onUpdate:modelValue"]),s(y,{type:"primary",onClick:a=>(e=>{e.options.push({})})(e)},{default:d((()=>[r("新增选项")])),_:2},1032,["onClick"])])),_:2},1024),s(_,{label:" ","label-width":"7.5em",style:{margin:"15rpx 0"}},{input:d((()=>[s(x,{modelValue:e.type,"onUpdate:modelValue":a=>e.type=a,direction:"horizontal"},{default:d((()=>[s(v,{name:"Text"},{default:d((()=>[r("填空")])),_:1}),s(v,{name:"Select"},{default:d((()=>[r("选择")])),_:1})])),_:2},1032,["modelValue","onUpdate:modelValue"])])),_:2},1024),s(_,{name:"是否必填",label:"是否必填",colon:"","label-width":"7.5em"},{input:d((()=>[s(x,{modelValue:e.necessary,"onUpdate:modelValue":a=>e.necessary=a,direction:"horizontal"},{default:d((()=>[s(v,{name:!0},{default:d((()=>[r("是")])),_:1}),s(v,{name:!1},{default:d((()=>[r("否")])),_:1})])),_:2},1032,["modelValue","onUpdate:modelValue"])])),_:2},1024)])),_:2},1024),"Select"==e.type?(o(),n(g,{key:0},{default:d((()=>[s(g,{class:"grid-container"},{default:d((()=>[s(g,{class:"grid-item"}),s(g,{class:"grid-item"},{default:d((()=>[r("内容")])),_:1}),s(g,{class:"grid-item"},{default:d((()=>[r("是否默认")])),_:1}),s(g,{class:"grid-item"},{default:d((()=>[r("操作")])),_:1})])),_:1}),(o(!0),u(m,null,i(e.options,((a,l)=>(o(),n(g,{class:"grid-container",key:l},{default:d((()=>[s(g,{class:"grid-item"},{default:d((()=>[r("选项")])),_:1}),s(g,{class:"grid-item"},{default:d((()=>[s(_,{modelValue:a.name,"onUpdate:modelValue":e=>a.name=e},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1024),s(g,{class:"grid-item",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:d((()=>[s(C,{modelValue:a.default,"onUpdate:modelValue":e=>a.default=e,name:!0},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1024),s(g,{class:"grid-item",style:{color:"red"},onClick:a=>e.options.splice(l,1)},{default:d((()=>[r("删除")])),_:2},1032,["onClick"])])),_:2},1024)))),128))])),_:2},1024)):f("",!0),"Text"==e.type?(o(),n(g,{key:1,style:{"margin-top":"15rpx"}},{default:d((()=>[s(_,{name:"填写内容",label:"填写内容",colon:"","label-width":"7.5em"},{input:d((()=>[s(w,{modelValue:e.contentType,"onUpdate:modelValue":a=>e.contentType=a,direction:"horizontal",shape:"square"},{default:d((()=>[s(C,{name:"Text"},{default:d((()=>[r("文字")])),_:1}),s(C,{name:"File"},{default:d((()=>[r("图片")])),_:1})])),_:2},1032,["modelValue","onUpdate:modelValue"])])),_:2},1024)])),_:2},1024)):f("",!0)])),_:2},1024)))),128))])),_:1}),s(y,{type:"primary",style:{margin:"10rpx"},onClick:k},{default:d((()=>[r("提交")])),_:1})])),_:1})}}}),[["__scopeId","data-v-17bbb34c"]]);export{g as default};
