import{_ as a,r as e,b as t,d as s,e as o,f as r,h as d,w as l,g as i,j as m,k as u,i as n,n as p,E as f,q as c,t as v,v as g}from"./index.286e9b79.js";import{v as b}from"./loading.c49775a6.js";import{E as j,a as _}from"./form.ad10dcd5.js";import{E as h,a as x}from"./tab-pane.1cc0f769.js";import"./form-item.9355e6dc.js";import{E as V}from"./input.31de1b37.js";import{_ as y}from"./page-header.29890ed0.js";import{g as w,p as E}from"./http.f588794f.js";import"./_initCloneObject.fb8fbaea.js";import"./strings.8c60bfae.js";import"./event.776e7e11.js";import"./index.ed3ed02e.js";import"./divider.948c4b18.js";const k={class:"editor-card"},q={class:"editor-card-box"},C=(a=>(v("data-v-ff9a309f"),a=a(),g(),a))((()=>d("div",{class:"form-item-tips"},'以","分割数据',-1))),U={class:"tool"},F={class:"tool-box"},I=a({__name:"setting",setup(a){let v=e(!1),g=e(!1),I=e("0"),O=e(),R=t({data:{unit:""}});const z=t({unit:[{required:!0,message:"请输入商品单位",trigger:"blur"}]});g.value=!0,w("shop.goods/setting").then((a=>{g.value=!1,a.code&&(R.data=a.data)}));const A=async()=>{O.value&&await O.value.validate(((a,e)=>{g.value=!1,a?(g.value=!0,E("shop.goods/setting",R.data).then((a=>{g.value=!1,a.code?f.success("操作成功"):f.error(a.msg)})).catch((a=>{f.error(a)}))):f.error("请完善内容")}))};return(a,e)=>{const t=y,f=V,w=j,E=h,B=x,D=_,G=c,H=b;return s(),o("div",null,[r(t,{title:"基础设置"}),d("div",k,[l((s(),m(D,{model:i(R).data,rules:i(z),ref_key:"ruleFormRef",ref:O},{default:u((()=>[d("div",q,[r(B,{modelValue:i(I),"onUpdate:modelValue":e[1]||(e[1]=a=>n(I)?I.value=a:I=a)},{default:u((()=>[r(E,{label:"基本信息",name:"0"},{default:u((()=>[r(w,{label:"商品单位",prop:"unit",required:!0,"label-width":"100px"},{default:u((()=>[r(f,{type:"textarea",modelValue:i(R).data.unit,"onUpdate:modelValue":e[0]||(e[0]=a=>i(R).data.unit=a),rows:2,placeholder:"请输入单位"},null,8,["modelValue"]),C])),_:1})])),_:1})])),_:1},8,["modelValue"])])])),_:1},8,["model","rules"])),[[H,i(v)]])]),d("div",U,[d("div",F,[r(G,{type:"primary",loading:i(g),onClick:A},{default:u((()=>[p("保存")])),_:1},8,["loading"])])])])}}},[["__scopeId","data-v-ff9a309f"]]);export{I as default};
