import{y as n,z as f,A as u}from"./index.DLhCD1Qz.js";import{_ as c}from"./yb_admin_plugin.DNFUAscl.js";import{aZ as m,aL as _,s as h,bJ as l,I as r}from"./@vue.Da0bZ210.js";import"./vue.Bj6dTZYa.js";import"./@element-plus.pQhr8KT1.js";import"./echarts.Dms41JYJ.js";import"./tslib.BDyQ-Jie.js";import"./zrender.BueMfJu3.js";import"./axios.BjtuyMK1.js";import"./pinia.Tngw-S_5.js";import"./vue-router.DaVMGKLh.js";import"./element-plus.DC208N5p.js";import"./lodash-es.DVGGNlzX.js";import"./@vueuse.BhH-hw9p.js";import"./async-validator.9PlIezaS.js";import"./@popperjs.C5az9QE8.js";import"./@ctrl.C4Rzlq_k.js";import"./dayjs.BLMYetss.js";import"./memoize-one.BdPwpGay.js";import"./normalize-wheel-es.BQoi3Ox2.js";import"./@floating-ui.DCXYYTka.js";import"./vue-i18n.C7BagGww.js";import"./@intlify.TnaUIxGf.js";import"./moment.C5S46NFB.js";const b={title:"添加分组",name:"Add",props:{edit:{type:Object,default:()=>({id:0})}},data(){return{classes:[],class_id:0,form:{name:"",id:"",sort:0},rules:{name:[{required:!0,trigger:"blur",message:"分组名称不能为空"}]}}},created(){this.edit.id&&u(this.edit.id).then(t=>{let e=t.data;this.form={...this.form,...e.info}})},methods:{onSubmit(){this.$refs.form.validate(async t=>{if(t)(this.edit.id?n:f)(this.form).then(p=>{this.$baseMessage("保存成功"),this.callBack&&this.callBack()});else return!1})}}};function V(t,e,p,g,o,k){const s=m("el-input"),a=m("el-form-item"),d=m("el-form");return _(),h(d,{ref:"form",model:o.form,rules:o.rules,"label-width":"80px"},{default:l(()=>[r(a,{label:t.translateI18n("分组名称"),prop:"name"},{default:l(()=>[r(s,{modelValue:o.form.name,"onUpdate:modelValue":e[0]||(e[0]=i=>o.form.name=i),modelModifiers:{trim:!0},placeholder:"分组名称"},null,8,["modelValue"])]),_:1},8,["label"]),r(a,{label:t.translateI18n("排序"),prop:"sort"},{default:l(()=>[r(s,{modelValue:o.form.sort,"onUpdate:modelValue":e[1]||(e[1]=i=>o.form.sort=i),modelModifiers:{trim:!0},placeholder:"排序"},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model","rules"])}const H=c(b,[["render",V]]);export{H as default};
