mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-02-14 04:43:48 +00:00
2 lines
3.3 KiB
JavaScript
2 lines
3.3 KiB
JavaScript
import{d as C,r as g,R as h,e as x,f as B,Q as F,v as N,x as s,y as i,g as f,B as _,u as a,A as D}from"./base-04829be5.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{t as l}from"./index-043d021e.js";import{L as I,M as R}from"./member-8c8e20d6.js";import{E as M}from"./index-db9b8d96.js";import{a as $,E as P}from"./index-6bd50bb5.js";import{E as k}from"./index-88566e4e.js";import{E as A}from"./index-eb678249.js";import{v as H}from"./directive-013f0a4e.js";import{_ as L}from"./_plugin-vue_export-helper-c27b6911.js";import"./common-111e3797.js";import"./common-2cf17469.js";import"./index-faea7bd5.js";import"./vue-router-fee568b2.js";import"./storage-1a3ddb14.js";import"./index-7e933ae4.js";import"./index-30df2c14.js";import"./index-236cb599.js";import"./index-92283b18.js";import"./typescript-defaf979.js";import"./index-a2524300.js";import"./event-9519ab40.js";import"./index-d7f4b4bb.js";import"./index-de053f2e.js";import"./error-78e43d3e.js";import"./castArray-11aea762.js";import"./_Uint8Array-99b916e9.js";import"./_initCloneObject-e5a1aa13.js";import"./index-4edf2cad.js";const S={class:"main-container"},T={class:"panel-title"},U={class:"form-tip"},j={class:"text-lg"},q={class:"fixed-footer-wrap"},z={class:"fixed-footer"},O=C({__name:"member",setup(Q){const m=g(!0),p=g({});let v=g("");const b=h({prefix:[{validator:(r,e,o)=>{e&&!/^[a-zA-Z]*$/g.test(e)?o(new Error(l("prefixHint"))):o()},trigger:"blur"}],length:[{required:!0,message:l("lengthPlaceholder"),trigger:"blur"},{validator:(r,e,o)=>{parseInt(e)>30||parseInt(e)-t.prefix.length<4?o(new Error(l("lengthHint"))):o()},trigger:"blur"}]}),t=h({prefix:"",length:10});(async()=>{const r=await(await I()).data;Object.keys(t).forEach(e=>{r[e]!=null&&(t[e]=r[e])}),c(p.value),m.value=!1})();const c=async r=>{await r.validate(e=>{if(e){let o="",d=t.length-t.prefix.length-1;for(let u=1;u<=d;u++)o+="0";v.value=t.prefix+o+"1"}})},w=async r=>{m.value||!r||await r.validate(e=>{e&&R(t).then(()=>{m.value=!1,c()}).catch(()=>{m.value=!1})})};return(r,e)=>{const o=M,d=$,u=k,y=P,E=A,V=H;return x(),B("div",S,[F((x(),N(y,{model:t,"label-width":"150px",ref_key:"ruleFormRef",ref:p,rules:b,class:"page-form"},{default:s(()=>[i(u,{class:"box-card !border-none",shadow:"never"},{default:s(()=>[f("h3",T,_(a(l)("memberNoRule")),1),i(d,{label:a(l)("prefix"),prop:"prefix"},{default:s(()=>[i(o,{modelValue:t.prefix,"onUpdate:modelValue":e[0]||(e[0]=n=>t.prefix=n),placeholder:a(l)("prefixPlaceholder"),class:"input-width",clearable:"",maxlength:"20",onChange:e[1]||(e[1]=n=>c(p.value))},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),i(d,{label:a(l)("length"),prop:"length"},{default:s(()=>[i(o,{modelValue:t.length,"onUpdate:modelValue":e[2]||(e[2]=n=>t.length=n),placeholder:a(l)("lengthPlaceholder"),class:"input-width",clearable:"",type:"number",onChange:e[3]||(e[3]=n=>c(p.value))},null,8,["modelValue","placeholder"]),f("div",U,_(a(l)("lengthTips")),1)]),_:1},8,["label"]),i(d,null,{default:s(()=>[f("div",j,_(a(v)),1)]),_:1})]),_:1})]),_:1},8,["model","rules"])),[[V,m.value]]),f("div",q,[f("div",z,[i(E,{type:"primary",onClick:e[4]||(e[4]=n=>w(p.value))},{default:s(()=>[D(_(a(l)("save")),1)]),_:1})])])])}}});const Ne=L(O,[["__scopeId","data-v-202fd84c"]]);export{Ne as default};
|