import{B as V,C as g,D as c}from"./index.DLhCD1Qz.js";import{_ as k}from"./yb_admin_plugin.DNFUAscl.js";import{aZ as s,aL as u,s as f,bJ as m,I as l,v as n,bb as d,t as I}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 h={title:"添加公众号",name:"Add",props:{edit:{type:Object,default:()=>({id:0})}},components:{},data(){return{form:{name:"",appid:"",secret:"",url:"",token:"",js_domain_name:""}}},computed:{rules(){return{name:[{required:!0,trigger:"blur",message:"请输入名称"}],appid:[{required:!0,trigger:"blur",message:"请输入appid"}],secret:[{required:!0,trigger:"blur",message:"请输入secret"}],token:[{required:!0,trigger:"blur",message:"请输入Token"}]}}},created(){c({id:this.edit.id}).then(o=>{this.form=o.data})},methods:{onSubmit(){this.$refs.form.validate(async o=>{if(o)this.edit.id&&(this.form.id=this.edit.id),(this.edit.id?V:g)(this.form).then(p=>{this.$baseMessage("保存成功"),this.callBack&&this.callBack()});else return!1})}}},v={class:"input-tip"},y={class:"input-tip"},B={class:"input-tip"};function U(o,e,p,j,t,_){const i=s("el-input"),a=s("el-form-item"),b=s("el-form");return u(),f(b,{ref:"form",model:t.form,rules:_.rules,"label-width":"90px"},{default:m(()=>[l(a,{label:o.translateI18n("名称"),prop:"name"},{default:m(()=>[l(i,{modelValue:t.form.name,"onUpdate:modelValue":e[0]||(e[0]=r=>t.form.name=r)},null,8,["modelValue"])]),_:1},8,["label"]),l(a,{label:"appid",prop:"appid"},{default:m(()=>[l(i,{modelValue:t.form.appid,"onUpdate:modelValue":e[1]||(e[1]=r=>t.form.appid=r)},null,8,["modelValue"])]),_:1}),l(a,{label:"secret",prop:"secret"},{default:m(()=>[l(i,{modelValue:t.form.secret,"onUpdate:modelValue":e[2]||(e[2]=r=>t.form.secret=r)},null,8,["modelValue"])]),_:1}),l(a,{label:o.translateI18n("token"),prop:"token"},{default:m(()=>[l(i,{modelValue:t.form.token,"onUpdate:modelValue":e[3]||(e[3]=r=>t.form.token=r)},null,8,["modelValue"]),n("div",v,d(o.translateI18n("用于填写公众号后台服务器配置令牌token")),1)]),_:1},8,["label"]),p.edit.id>0?(u(),f(a,{key:0,label:o.translateI18n("服务器地址"),prop:"url"},{default:m(()=>[l(i,{modelValue:t.form.url,"onUpdate:modelValue":e[4]||(e[4]=r=>t.form.url=r),readonly:""},null,8,["modelValue"]),n("div",y,d(o.translateI18n("用于填写公众号后台服务器配置地址")),1)]),_:1},8,["label"])):I("",!0),l(a,{label:o.translateI18n("JS安全域名"),prop:"js_domain_nam"},{default:m(()=>[l(i,{modelValue:t.form.js_domain_name,"onUpdate:modelValue":e[5]||(e[5]=r=>t.form.js_domain_name=r),readonly:""},null,8,["modelValue"]),n("div",B,d(o.translateI18n("用于填写公众号后台功能设置中JS接口安全域名")),1)]),_:1},8,["label"])]),_:1},8,["model","rules"])}const Y=k(h,[["render",U],["__scopeId","data-v-25b24681"]]);export{Y as default};
