import{B}from"./BasicForm-dL_oCSPM.js";import{u as M}from"./useForm-CKmgcynv.js";import{_ as N}from"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import{u as k}from"./useModal-CO65vga3.js";import{P as n}from"./Password-BeBc6acq.js";import{d as x,u as $,a4 as F,a as q,r as I,c as S,o as T,w as s,j as l,l as o}from"./index-9PRMimni.js";import"./Render.vue_vue_type_script_lang-DKUYY0Zw.js";import"./SingleImageUpload-CNx4b9eC.js";import"./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";import"./componentSetting-DVhNDBTO.js";import"./ImageUpload-DUsnro3W.js";import"./vuedraggable.umd-Co2xEC3p.js";import"./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";import"./tabsView-BXskTdVh.js";import"./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";import"./propTypes-CebMRUpe.js";import"./BasicSelect-C_uwzMkE.js";import"./BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";import"./dictionary-BRse4lkf.js";import"./index-DkvzUEqh.js";import"./index-kKnqLkWM.js";import"./AutoComplete-Dv1Bqed4.js";import"./TreeSelect-BZh2DeCh.js";import"./usePageCache-DluHn7Yy.js";const pe=x({__name:"CreateModal",props:{title:{type:String,default:"添加字典"},isEdit:{type:Boolean,default:!1},createType:{type:Number,default:1}},setup(m,{expose:c}){const p=$(),i=m,e=F(()=>i.createType===1?"":"项"),d=q([{field:"label",component:"NInput",label:`字典${e.value}名称`,componentProps:{placeholder:`请输入字典${e.value}名称`},rules:[{required:!0,message:`请输入字典${e.value}名称`,trigger:["blur"]}]},{field:"value",component:"NInput",label:`字典${e.value}值`,componentProps:{placeholder:`请输入字典${e.value}值`},rules:[{required:!0,message:`请输入字典${e.value}值`,trigger:["blur"]}]},{field:"order",component:"NInputNumber",label:"排序",componentProps:{placeholder:"请输入排序"},rules:[{required:!0,type:"number",message:"请输入排序",trigger:["blur"]}]},{field:"remark",component:"NInput",label:"备注",componentProps:{placeholder:"请输入备注",type:"textarea"}}]),f=I(i.title),[b,{submit:g,setFieldsValue:v}]=M({gridProps:{cols:1},collapsed:!1,labelWidth:100,layout:"horizontal",submitButtonText:"确定",showActionButtonGroup:!1,schemas:d}),[h,{openModal:_,closeModal:u,setSubLoading:w,setProps:y}]=k({title:f,subBtuText:"确定",width:450});async function R(){await g()?(p.error("抱歉，您没有操作权限"),u()):(p.error("验证失败，请填写完整信息"),w(!1))}return c({openModal:_,closeModal:u,setFieldsValue:v,setProps:y}),(P,U)=>(T(),S(o(N),{onRegister:o(h),ref:"modalRef",class:"basicModal basicFormModal",onOnOk:R},{default:s(()=>[l(o(B),{onRegister:o(b),class:"pt-6 basicForm"},{passwordSlot:s(({model:r,field:t})=>[l(o(n),{ref:"passwordRef",value:r[t],"onUpdate:value":a=>r[t]=a,required:!1,block:""},null,8,["value","onUpdate:value"])]),rePasswordSlot:s(({model:r,field:t})=>[l(o(n),{ref:"passwordRef",value:r[t],"onUpdate:value":a=>r[t]=a,required:!1,block:""},null,8,["value","onUpdate:value"])]),_:1},8,["onRegister"])]),_:1},8,["onRegister"]))}});export{pe as default};
