|
|
-import{x as h,u as z,r as m,j as D,b as n,o as u,c as p,d as t,w as o,e as y,f as c,k as E,F as M,G as N,E as _,l as T}from"./index.4fd8b9b3.js";import{d as f}from"./dataModel.fcd8c768.js";import"./http.100f9ea4.js";const U={class:"card-header"},j=y("span",null,"\u8BE6\u60C5",-1),O={__name:"add",setup(F){h();const V=z(),e=m({id:0,title:"",types:"",nums:""}),r=m([]),b=async()=>{const s=await f.addData({id:0,title:e.title,types:e.types,nums:e.nums});s.data.Code===200?(_.success("\u6DFB\u52A0\u6210\u529F"),e.types="",e.nums="",e.title=""):_.error(s.data.Msg)};return D(async()=>{const s=await f.getDataType();Object.assign(r,s.data.Data)}),(s,a)=>{const i=n("el-button"),g=n("el-input"),d=n("el-form-item"),k=n("el-option"),v=n("el-select"),x=n("el-input-number"),C=n("el-form"),w=n("el-card");return u(),p("div",null,[t(w,{class:"box-card"},{header:o(()=>[y("div",U,[j,t(i,{size:"mini",style:{float:"right"},type:"primary",onClick:b},{default:o(()=>[c("\u63D0\u4EA4")]),_:1}),t(i,{size:"mini",style:{float:"right"},type:"info",onClick:a[0]||(a[0]=l=>E(V).go(-1))},{default:o(()=>[c("\u8FD4\u56DE")]),_:1})])]),default:o(()=>[t(C,null,{default:o(()=>[t(d,{label:"\u6807\u9898:"},{default:o(()=>[t(g,{modelValue:e.title,"onUpdate:modelValue":a[1]||(a[1]=l=>e.title=l),placeholder:"\u8BF7\u8F93\u5165\u6807\u9898"},null,8,["modelValue"])]),_:1}),t(d,null,{default:o(()=>[t(v,{modelValue:e.types,"onUpdate:modelValue":a[2]||(a[2]=l=>e.types=l),placeholder:"\u8BF7\u9009\u62E9\u7C7B\u578B",size:"large",style:{width:"240px"}},{default:o(()=>[(u(!0),p(M,null,N(r,(l,B)=>(u(),T(k,{key:B,label:l,value:l},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(d,{label:"\u6570\u91CF:"},{default:o(()=>[t(x,{modelValue:e.nums,"onUpdate:modelValue":a[3]||(a[3]=l=>e.nums=l),placeholder:"\u8BF7\u8F93\u5165\u7B80\u4ECB"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})])}}};export{O as default};
|