text: var e=Object.defineProperty,t=Object.defineProperties,r=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(t,r,i)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,n=(e,t,r)=>new Promise(((i,s)=>{var o=e=>{try{n(r.next(e))}catch(t){s(t)}},a=e=>{try{n(r.throw(e))}catch(t){s(t)}},n=e=>e.done?i(e.value):Promise.resolve(e.value).then(o,a);n((r=r.apply(e,t)).next())}));import{B as d,a as l}from"./index.0433a71f.js";import{_ as c}from"./BasicForm.8dd34761.js";import{u as m}from"./useForm.ba0f60da.js";import{f,a as u,b as p}from"./module.data.1f04011f.js";import{y as j,r as b,u as g,j as h,Z as x,B as v,F as y,a2 as w,v as P,a0 as O}from"./vendor.880b4c6c.js";import"./index.63ccfb82.js";import"./useWindowSizeFn.564cf32e.js";/* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              */import"./index.b3d678de.js";/* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              */import"./uuid.2b29000c.js";import"./download.41df5c96.js";import"./base64Conver.bb012c73.js";import"./index.c6f733ce.js";var F=j({name:"ModuleModal",components:{BasicModal:d,BasicForm:c},emits:["success","register"],setup(e,{emit:d}){const c=b(!0),[j,{resetFields:x,setFieldsValue:v,updateSchema:y,validate:w}]=m({labelWidth:100,schemas:f,showActionButtonGroup:!1}),[P,{setModalProps:O,closeModal:F}]=l((e=>n(this,null,(function*(){yield x(),O({confirmLoading:!1}),c.value=!!(null==e?void 0:e.isUpdate);let n=e.record;var d,l;yield y([{field:"sn",dynamicRules:()=>{return[{required:!0,whitespace:!0,message:"标识不能为空！"},{trigger:["change","blur"],pattern:new RegExp("^[0-9a-zA-Z_]{1,}$"),type:"string",message:"请输入英文或数字！"},{trigger:["change","blur"],max:64,message:"字符长度不能大于64！"},...(e={id:g(c)&&n&&n.id||"",field:"sn",fieldValue:"",fieldName:"标识"},[{trigger:"blur",validator:(t,r)=>r?u({id:e.id,field:e.field,fieldValue:r,fieldName:e.fieldName}).then((t=>t?Promise.resolve():Promise.reject(e.fieldName+"已存在，请修改！"))).catch((e=>Promise.reject(e))):Promise.resolve()}])];var e}}]),g(c)&&v((d=((e,t)=>{for(var r in t||(t={}))s.call(t,r)&&a(e,r,t[r]);if(i)for(var r of i(t))o.call(t,r)&&a(e,r,t[r]);return e})({},n),l={status:1===n.status,showStatus:1===n.showStatus},t(d,r(l)))),e.record.id?y([{field:"component",show:!1},{field:"url",show:!1}]):y([{field:"component",show:!0},{field:"url",show:!0}])}))));return{registerModal:P,registerForm:j,getTitle:h((()=>g(c)?"修改":"新增")),handleSubmit:function(){return n(this,null,(function*(){try{O({confirmLoading:!0});const e=yield w();e.status=e.status?1:0,e.showStatus=e.showStatus?1:0,yield p(e),F(),d("success")}finally{O({confirmLoading:!1})}}))}}}});F.render=function(e,t,r,i,s,o){const a=x("BasicForm"),n=x("BasicModal");return v(),y(n,O(e.$attrs,{onRegister:e.registerModal,title:e.getTitle,onOk:e.handleSubmit}),{default:w((()=>[P(a,{onRegister:e.registerForm},null,8,["onRegister"])])),_:1},16,["onRegister","title","onOk"])};export default F;
  