import{e as u,b as c,g as _}from"./index.DLhCD1Qz.js";import{_ as h}from"./yb_admin_plugin.DNFUAscl.js";import{aZ as m,aL as b,s as g,bJ as l,I as o}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 V={title:"添加应用",name:"editApply",components:{},props:{edit:{type:Object,default:()=>({id:0})}},data(){return{icons:[],form:{id:"",name:"",staff_id:"",addons_id:"",icon:"",end_time:"",description:""}}},computed:{rules(){return{name:[{required:!0,trigger:"blur",message:"请输入应用名称"}]}}},mounted(){},created(){this.edit.id&&(this.form.id=this.edit.id,_({id:this.edit.id}).then(i=>{this.form=i.data.info,this.form.icon&&(this.icons=[{id:0,image:this.form.icon}])}))},methods:{onSubmit(){this.$refs.form.validate(async i=>{if(i){let e=this.edit.id?u:c;this.icons.length>0&&(this.form.icon=this.icons[0].image),e(this.form).then(p=>{this.$baseMessage("保存成功"),this.callBack&&this.callBack()})}else return!1})}}};function y(i,e,p,v,t,a){const n=m("el-input"),s=m("el-form-item"),d=m("ImageSelect"),f=m("el-form");return b(),g(f,{ref:"form",model:t.form,rules:a.rules,"label-width":"110px"},{default:l(()=>[o(s,{label:"应用名称",prop:"name"},{default:l(()=>[o(n,{modelValue:t.form.name,"onUpdate:modelValue":e[0]||(e[0]=r=>t.form.name=r),modelModifiers:{trim:!0},placeholder:"应用名称",autocomplete:"off"},null,8,["modelValue"])]),_:1}),o(s,{label:i.translateI18n("应用图标")},{default:l(()=>[o(d,{value:t.icons,"onUpdate:value":e[1]||(e[1]=r=>t.icons=r),num:1},null,8,["value"])]),_:1},8,["label"]),o(s,{label:"应用介绍",prop:"description"},{default:l(()=>[o(n,{modelValue:t.form.description,"onUpdate:modelValue":e[2]||(e[2]=r=>t.form.description=r),modelModifiers:{trim:!0},placeholder:"应用介绍",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])}const P=h(V,[["render",y]]);export{P as default};
