var l=(t,n,r)=>new Promise((p,a)=>{var s=e=>{try{i(r.next(e))}catch(o){a(o)}},d=e=>{try{i(r.throw(e))}catch(o){a(o)}},i=e=>e.done?p(e.value):Promise.resolve(e.value).then(s,d);i((r=r.apply(t,n)).next())});import{d as u,U as c,a2 as f,a3 as b,k as C}from"./vue-vendor-CxLCUzY4.js";import{u as h}from"./index-BN5Ac_IG.js";import{o as E}from"./select-zMyHzSfa.js";import{d as _}from"./table-B2H6cgda.js";import{t as w}from"./tree-DvnmHoX2.js";import{bt as x,u as I,_ as k}from"./index-CYriLmQo.js";import S from"./BasicTable-DAfCfXmD.js";import"./componentMap-7D1QIeNI.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./useFormItem-CWa0w7fA.js";import"./index-CF_FJn6P.js";import"./BasicModal-BBgVjypv.js";import"./ModalHeader-jGKMr-DQ.js";import"./useTimeout-DC8132dd.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./index-CxQILSKV.js";import"./useWindowSizeFn-BxrEMPtP.js";import"./index-BRTtls-l.js";import"./index-DOuVMe-q.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-CkbK5et1.js";import"./base64Conver-24EVOS6V.js";import"./index-QMJkXEyl.js";import"./index-Bb_NRLur.js";import"./useCountdown-C3-PRPLY.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-nVFm3ao2.js";import"./props-DoGpHXAD.js";import"./JSelectBiz-BW6f3e--.js";import"./JAddInput-CXT54-j9.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-BTSd5ebC.js";import"./index-BTAl55Kt.js";import"./bem-2ra1afoV.js";import"./props-BLY2qIO5.js";import"./useContextMenu-DYyhcDf7.js";import"./depart.api-C9T5xfw6.js";import"./JDictSelectTag-Jqy9TBcS.js";import"./JSelectDept-DorRVguN.js";import"./JPopup-KP1kIsae.js";import"./JEllipsis-287cEHxd.js";import"./JUpload-pyrTRFCz.js";import"./index-Bx9Mnn3N.js";import"./index-B1-pj6uh.js";import"./index-isxCPgHp.js";import"./index-BkgeZpOO.js";import"./useForm-8o5KRzWo.js";import"./JAreaLinkage-DFTeDmm8.js";import"./JCodeEditor-_KZ8XnNK.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-XK54XB3r.js";import"./injectionKey-DPVn4AgL.js";const T=[{title:"输入框",dataIndex:"name",edit:!0,editComponentProps:{prefix:"$"},width:200},{title:"默认输入状态",dataIndex:"name7",edit:!0,editable:!0,width:200},{title:"输入框校验",dataIndex:"name1",edit:!0,editRule:!0,width:200},{title:"输入框函数校验",dataIndex:"name2",edit:!0,editRule:t=>l(void 0,null,function*(){return t==="2"?"不能输入该值":""}),width:200},{title:"数字输入框",dataIndex:"id",edit:!0,editRule:!0,editComponent:"InputNumber",width:200},{title:"下拉框",dataIndex:"name3",edit:!0,editComponent:"Select",editComponentProps:{options:[{label:"Option1",value:"1"},{label:"Option2",value:"2"}]},width:200},{title:"远程下拉",dataIndex:"name4",edit:!0,editComponent:"ApiSelect",editComponentProps:{api:E,resultField:"list",labelField:"name",valueField:"id"},width:200},{title:"远程下拉树",dataIndex:"name71",edit:!0,editComponent:"ApiTreeSelect",editRule:!1,editComponentProps:{api:w,resultField:"list"},width:200},{title:"日期选择",dataIndex:"date",edit:!0,editComponent:"DatePicker",editComponentProps:{valueFormat:"YYYY-MM-DD",format:"YYYY-MM-DD"},width:200},{title:"时间选择",dataIndex:"time",edit:!0,editComponent:"TimePicker",editComponentProps:{valueFormat:"HH:mm",format:"HH:mm"},width:200},{title:"勾选框",dataIndex:"name5",edit:!0,editComponent:"Checkbox",editValueMap:t=>t?"是":"否",width:200},{title:"开关",dataIndex:"name6",edit:!0,editComponent:"Switch",editValueMap:t=>t?"开":"关",width:200}],v=u({components:{BasicTable:S},setup(){const[t]=h({title:"可编辑单元格示例",api:_,columns:T,showIndexColumn:!1,bordered:!0,showSummary:!0,summaryFunc:d}),{createMessage:n}=I();function r({record:i,index:e,key:o,value:m}){return!1}function p({value:i,key:e,id:o}){return n.loading({content:`正在模拟保存${e}`,key:"_save_fake_data",duration:0}),new Promise(m=>{setTimeout(()=>{i===""?(n.error({content:"保存失败：不能为空",key:"_save_fake_data",duration:2}),m(!1)):(n.success({content:`记录${o}的${e}已保存`,key:"_save_fake_data",duration:2}),m(!0))},2e3)})}function a(At){return l(this,arguments,function*({record:i,index:e,key:o,value:m}){return yield p({id:i.id,key:o,value:m})})}function s(){}function d(i){return[x(i,["id"])]}return{registerTable:t,handleEditEnd:r,handleEditCancel:s,beforeEditSubmit:a}}}),y={class:"p-4"};function P(t,n,r,p,a,s){const d=c("BasicTable");return f(),b("div",y,[C(d,{onRegister:t.registerTable,onEditEnd:t.handleEditEnd,onEditCancel:t.handleEditCancel,beforeEditSubmit:t.beforeEditSubmit},null,8,["onRegister","onEditEnd","onEditCancel","beforeEditSubmit"])])}const gt=k(v,[["render",P]]);export{gt as default};
