text: var e=Object.defineProperty,i=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable,o=(i,r,t)=>r in i?e(i,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[r]=t,s=(e,i,r)=>new Promise(((t,o)=>{var s=e=>{try{d(r.next(e))}catch(i){o(i)}},a=e=>{try{d(r.throw(e))}catch(i){o(i)}},d=e=>e.done?t(e.value):Promise.resolve(e.value).then(s,a);d((r=r.apply(e,i)).next())}));import{B as a,a as d}from"./index.f287750a.js";import{_ as n}from"./BasicForm.a98eb535.js";import{u as l}from"./useForm.7ff3fa79.js";import{d as m,c,s as f}from"./dictionary.e9736d9a.js";import{j as p,r as u,u as j,i as b,K as g,o as x,m as y,Q as v,n as h,N as w}from"./vendor.686fd1d4.js";import"./index.7fecfddd.js";import"./useWindowSizeFn.d82e06bf.js";/* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              */import"./index.099c2235.js";/* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              */import"./uuid.2b29000c.js";import"./download.c870abce.js";import"./base64Conver.bb012c73.js";import"./index.d2ff26f2.js";var P=p({name:"DictionaryItemModal",components:{BasicModal:a,BasicForm:n},emits:["success","register"],setup(e,{emit:a}){const n=u(!0),[p,{setFieldsValue:g,updateSchema:x,resetFields:y,validate:v}]=l({labelWidth:100,schemas:m,showActionButtonGroup:!1,actionColOptions:{span:23}}),[h,{setModalProps:w,closeModal:P}]=d((e=>s(this,null,(function*(){yield y(),w({confirmLoading:!1}),n.value=!!(null==e?void 0:e.isUpdate);let s=e.record;yield x([{field:"code",dynamicRules:()=>{return[{required:!0,whitespace:!0,message:"名称不能为空！"},{pattern:new RegExp("^[0-9a-zA-Z_]{1,}$"),type:"string",message:"请输入英文或数字！"},{max:32,message:"字符长度不能大于32！"},...(e={id:j(n)&&s&&s.id||"",field:"code",fieldValue:"",fieldName:"编码"},[{trigger:"blur",validator:(i,r)=>r?c({id:e.id,field:e.field,fieldValue:r,fieldName:e.fieldName}).then((i=>i?Promise.resolve():Promise.reject(e.fieldName+"已存在，请修改！"))).catch((e=>Promise.reject(e))):Promise.resolve()}])];var e}}]),g(((e,s)=>{for(var a in s||(s={}))r.call(s,a)&&o(e,a,s[a]);if(i)for(var a of i(s))t.call(s,a)&&o(e,a,s[a]);return e})({},e.record))}))));return{registerModal:h,registerForm:p,getTitle:b((()=>j(n)?"修改":"新增")),handleSubmit:function(){return s(this,null,(function*(){try{w({confirmLoading:!0});const e=yield v();yield f(e),P(),a("success")}finally{w({confirmLoading:!1})}}))}}}});P.render=function(e,i,r,t,o,s){const a=g("BasicForm"),d=g("BasicModal");return x(),y(d,w(e.$attrs,{onRegister:e.registerModal,title:e.getTitle,onOk:e.handleSubmit}),{default:v((()=>[h(a,{onRegister:e.registerForm},null,8,["onRegister"])])),_:1},16,["onRegister","title","onOk"])};export default P;
  