"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BB7fFseo.cjs"),d=l=>(e.pushScopeId("data-v-681b5912"),l=l(),e.popScopeId(),l),m={class:"panel-box"},p=d(()=>e.createBaseVNode("div",{class:"box-title"},"确认码",-1)),v=d(()=>e.createBaseVNode("div",{class:"tip"},"由系统或根据规则自动生成一串编号，用作优惠码、确认码、核销码、会员号、证书编码、员工编号、准考证号等。",-1)),_={class:"box-row"},f={class:"form"},V={key:0},N=d(()=>e.createBaseVNode("div",{class:"tip"},"确认码生成方式",-1)),g={class:"box-container"},h=d(()=>e.createBaseVNode("div",{class:"text-container"},"系统将自动生成一串 12位数字代码，如：5869 5589 1558",-1)),x={class:"tip"},C=e.defineComponent({__name:"ConfirmCode",setup(l){const i=e.ref("1"),a=e.ref(e.FormSetting.value.details.confirmName),n=e.computed({get:()=>e.FormSetting.value.details.confirmCode,set:t=>{e.FormSetting.value.details.confirmCode=t,e.updateSetting()}}),c=async()=>{if(a.value.length<2){e.ElMessage.error("确认码不能少于2个字");return}try{e.FormSetting.value.details.confirmName=a.value,e.FormSetting.value.details.confirm=i.value,await e.updateSetting()&&e.ElMessage.success("保存设置成功")}catch(t){e.ElMessage.error("保存失败"+t)}},r=t=>{t=t.replace(/\s/g,""),t.length>6&&(t=t.slice(0,6)),a.value=t},u=t=>{t&&e.globalInject.postCollection("editor_form_set_navigation_confirmcode")};return(t,o)=>(e.openBlock(),e.createElementBlock("section",null,[e.createBaseVNode("div",m,[p,v,e.createBaseVNode("div",_,[e.createBaseVNode("div",f,[e.createVNode(e.unref(e.ElSwitch),{modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=s=>n.value=s),"active-text":n.value===1?"已开启":"已关闭","active-value":1,"inactive-value":0,onChange:u},null,8,["modelValue","active-text"])])]),n.value==1?(e.openBlock(),e.createElementBlock("div",V,[N,e.createVNode(e.unref(e.ElRadioGroup),{modelValue:i.value,"onUpdate:modelValue":o[1]||(o[1]=s=>i.value=s)},{default:e.withCtx(()=>[e.createVNode(e.unref(e.ElRadio),{value:"1"},{default:e.withCtx(()=>[e.createTextVNode("系统自动生成")]),_:1})]),_:1},8,["modelValue"]),e.createBaseVNode("div",g,[h,e.createBaseVNode("div",x,[e.createTextVNode(" 确认码文案（2-6个字） "),e.createVNode(e.unref(e.ElInput),{modelValue:a.value,"onUpdate:modelValue":o[2]||(o[2]=s=>a.value=s),style:{width:"240px"},placeholder:"确认码",onInput:r},null,8,["modelValue"])])]),e.createVNode(e.unref(e.ElButton),{class:"button",type:"primary",onClick:c},{default:e.withCtx(()=>[e.createTextVNode(" 保存设置 ")]),_:1})])):e.createCommentVNode("",!0)])]))}}),B=e._export_sfc(C,[["__scopeId","data-v-681b5912"]]);exports.default=B;
