import{d as e,r as a,o as l,j as t,b as s,e as u,k as d,w as i,m as n,F as o,f as r,l as c,q as v,i as f,c as _,t as p}from"./index-z4UiUMlV.js";import{g as m,a as g,p as h,d as w}from"./index.Wwo-uIrA.js";import{_ as k}from"./_plugin-vue_export-helper.BCo6x5W8.js";const b=k(e({__name:"w-level",setup(e){const k=a(!1),b=a([]),y=a(""),x=a("");l((()=>{C()}));const C=()=>{m("/rawFabricLevels",{page:1,size:100}).then((e=>{200===e.code&&(b.value=e.data.record)}))},F=()=>{history.back()},L=()=>{k.value=!0,y.value="",x.value=""},j=()=>{if(!y.value)return v("请填写等级!");x.value?g("/rawFabricLevels",{id:x.value,level:y.value}).then((e=>{200===e.code&&(k.value=!1,v("编辑成功！"),C())})):h("/rawFabricLevels",{level:y.value}).then((e=>{200===e.code&&(k.value=!1,v("提交成功！"),C())}))};return(e,a)=>{const l=t("van-nav-bar"),m=f,g=t("van-field"),h=t("van-cell-group"),V=t("van-button"),U=t("van-popup");return s(),u(o,null,[d(m,{class:"flex"},{default:i((()=>[d(l,{title:"白胚等级维护","left-text":"返回","left-arrow":"","right-text":"新增",onClickLeft:F,onClickRight:L}),d(m,{class:"content"},{default:i((()=>[d(m,{class:"grid-container"},{default:i((()=>[d(m,{class:"grid-item"},{default:i((()=>[n("编号")])),_:1}),d(m,{class:"grid-item"},{default:i((()=>[n("白胚等级")])),_:1}),d(m,{class:"grid-item"},{default:i((()=>[n("操作")])),_:1})])),_:1}),(s(!0),u(o,null,r(b.value,((e,a)=>(s(),_(m,{class:"grid-container",key:a},{default:i((()=>[d(m,{class:"grid-item"},{default:i((()=>[n(p(e.id),1)])),_:2},1024),d(m,{class:"grid-item"},{default:i((()=>[n(p(e.level),1)])),_:2},1024),d(m,{class:"grid-item"},{default:i((()=>[c("span",{style:{color:"#35a5f7"},onClick:a=>(e=>{y.value=e.level,x.value=e.id,k.value=!0})(e)},"编辑",8,["onClick"]),n("    "),c("span",{style:{color:"red"},onClick:a=>(e=>{let a=/rawFabricLevels/+e.id;w(a).then((e=>{200===e.code&&(v("删除成功！"),C())}))})(e)},"删除 ",8,["onClick"])])),_:2},1024)])),_:2},1024)))),128))])),_:1})])),_:1}),d(U,{show:k.value,"onUpdate:show":a[2]||(a[2]=e=>k.value=e),style:{width:"80%"},round:""},{default:i((()=>[d(m,null,{default:i((()=>[c("h3",{style:{"text-align":"center"}},"新增"),d(h,{inset:""},{default:i((()=>[d(g,{modelValue:y.value,"onUpdate:modelValue":a[0]||(a[0]=e=>y.value=e),name:"白胚等级",label:"白胚等级",colon:"","label-width":"5em"},null,8,["modelValue"])])),_:1}),d(m,{class:"a-c"},{default:i((()=>[d(V,{type:"danger",onClick:a[1]||(a[1]=e=>k.value=!1)},{default:i((()=>[n("取消")])),_:1}),d(V,{type:"primary",onClick:j},{default:i((()=>[n("确认")])),_:1})])),_:1})])),_:1})])),_:1},8,["show"])],64)}}}),[["__scopeId","data-v-ce6ea5c7"]]);export{b as default};
