text: var e=Object.defineProperty,t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(t,r,o)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o,i=(e,t,r)=>new Promise(((o,a)=>{var i=e=>{try{s(r.next(e))}catch(t){a(t)}},n=e=>{try{s(r.throw(e))}catch(t){a(t)}},s=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,n);s((r=r.apply(e,t)).next())}));import{B as n,a as s}from"./index.d939de4e.js";import{_ as l}from"./BasicForm.2ed1f7b7.js";import{u as d}from"./useForm.16917873.js";import{s as m}from"./appPrivilegeValue.ce3193ed.js";import{j as u,r as c,u as p,i as f,K as g,o as b,m as h,Q as v,n as y,N as w}from"./vendor.686fd1d4.js";const j=[{title:"名称",dataIndex:"name",width:100,align:"left"},{title:"位",dataIndex:"position",width:100},{title:"排序号",dataIndex:"orderNo",width:100},{title:"备注",dataIndex:"remark",width:400,align:"left"}],x=[{field:"id",label:"ID",component:"Input",show:!1},{field:"name",label:"名称",required:!0,component:"Input",rules:[{required:!0,whitespace:!0,message:"名称不能为空！"},{max:32,message:"字符长度不能大于32！"}]},{field:"position",label:"位",required:!0,component:"InputNumber"},{field:"orderNo",label:"排序",required:!0,component:"InputNumber"},{label:"备注",field:"remark",component:"InputTextArea",rules:[{max:200,message:"字符长度不能大于200！"}]}];var I=u({name:"AppPrivilegeValueModal",components:{BasicModal:n,BasicForm:l},emits:["success","register"],setup(e,{emit:n}){const l=c(!0),[u,{resetFields:g,setFieldsValue:b,validate:h}]=d({labelWidth:100,schemas:x,showActionButtonGroup:!1}),[v,{setModalProps:y,closeModal:w}]=s((e=>i(this,null,(function*(){g(),y({confirmLoading:!1}),l.value=!!(null==e?void 0:e.isUpdate),p(l)&&b(((e,i)=>{for(var n in i||(i={}))r.call(i,n)&&a(e,n,i[n]);if(t)for(var n of t(i))o.call(i,n)&&a(e,n,i[n]);return e})({},e.record))}))));return{registerModal:v,registerForm:u,getTitle:f((()=>p(l)?"修改":"新增")),handleSubmit:function(){return i(this,null,(function*(){try{y({confirmLoading:!0});const e=yield h();yield m(e);w(),n("success")}finally{y({confirmLoading:!1})}}))}}}});I.render=function(e,t,r,o,a,i){const n=g("BasicForm"),s=g("BasicModal");return b(),h(s,w(e.$attrs,{onRegister:e.registerModal,title:e.getTitle,onOk:e.handleSubmit}),{default:v((()=>[y(n,{onRegister:e.registerForm},null,8,["onRegister"])])),_:1},16,["onRegister","title","onOk"])};var O=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:I});export{O as A,I as _,j as c};
  