import{d as e,r as a,o as l,j as t,b as o,c as n,w as s,k as d,e as i,f as u,F as r,m as c,q as m,i as p}from"./index-z4UiUMlV.js";import{g as f,a as _}from"./index.Wwo-uIrA.js";import{_ as g}from"./_plugin-vue_export-helper.BCo6x5W8.js";const y=g(e({__name:"m-other",setup(e){const g=a([]);function y(){f("/extraOption").then((e=>{200===e.code&&(g.value=JSON.parse(e.data.payload))}))}l((()=>{y()}));const v=()=>{history.back()},V=()=>{g.value.push({options:[{}]})},k=()=>{let e={id:1,payload:JSON.stringify(g.value)};_("/extraOption",e).then((e=>{200===e.code&&(m("提交成功！"),y())}))};return(e,a)=>{const l=t("van-nav-bar"),m=t("van-icon"),f=t("van-field"),_=t("van-button"),y=p,h=t("van-radio"),x=t("van-radio-group"),b=t("van-cell-group"),C=t("van-checkbox");return o(),n(y,{class:"flex"},{default:s((()=>[d(l,{title:"其他要求项维护","left-text":"返回","left-arrow":"","right-text":"新增",onClickLeft:v,onClickRight:V}),d(y,{class:"content"},{default:s((()=>[(o(!0),i(r,null,u(g.value,((e,a)=>(o(),n(y,{class:"card",key:a},{default:s((()=>[d(b,{inset:""},{default:s((()=>[d(y,{class:"a-b"},{default:s((()=>[d(m,{name:"clear",color:"red",size:"25",onClick:e=>g.value.splice(a,1)},null,8,["onClick"]),d(f,{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"]),d(_,{type:"primary",onClick:a=>(e=>{e.options.push({})})(e)},{default:s((()=>[c("新增选项")])),_:2},1032,["onClick"])])),_:2},1024),d(f,{name:"是否必填",label:"是否必填",colon:"","label-width":"7.5em"},{input:s((()=>[d(x,{modelValue:e.necessary,"onUpdate:modelValue":a=>e.necessary=a,direction:"horizontal"},{default:s((()=>[d(h,{name:!0},{default:s((()=>[c("是")])),_:1}),d(h,{name:!1},{default:s((()=>[c("否")])),_:1})])),_:2},1032,["modelValue","onUpdate:modelValue"])])),_:2},1024)])),_:2},1024),d(y,{class:"grid-container"},{default:s((()=>[d(y,{class:"grid-item"}),d(y,{class:"grid-item"},{default:s((()=>[c("内容")])),_:1}),d(y,{class:"grid-item"},{default:s((()=>[c("是否默认")])),_:1}),d(y,{class:"grid-item"},{default:s((()=>[c("操作")])),_:1})])),_:1}),(o(!0),i(r,null,u(e.options,((a,l)=>(o(),n(y,{class:"grid-container",key:l},{default:s((()=>[d(y,{class:"grid-item"},{default:s((()=>[c("选项")])),_:1}),d(y,{class:"grid-item"},{default:s((()=>[d(f,{modelValue:a.name,"onUpdate:modelValue":e=>a.name=e},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1024),d(y,{class:"grid-item",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:s((()=>[d(C,{modelValue:a.default,"onUpdate:modelValue":e=>a.default=e,name:!0},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1024),d(y,{class:"grid-item",style:{color:"red"},onClick:a=>e.options.splice(l,1)},{default:s((()=>[c("删除")])),_:2},1032,["onClick"])])),_:2},1024)))),128))])),_:2},1024)))),128))])),_:1}),d(_,{type:"primary",style:{margin:"10rpx"},onClick:k},{default:s((()=>[c("提交")])),_:1})])),_:1})}}}),[["__scopeId","data-v-03469636"]]);export{y as default};
