var l=(t,m,i)=>new Promise((p,n)=>{var s=e=>{try{o(i.next(e))}catch(r){n(r)}},a=e=>{try{o(i.throw(e))}catch(r){n(r)}},o=e=>e.done?p(e.value):Promise.resolve(e.value).then(s,a);o((i=i.apply(t,m)).next())});import{d as u,U as c,a2 as f,a3 as b,k as C}from"./vue-vendor-CxLCUzY4.js";import"./index-BN5Ac_IG.js";import{o as h}from"./select-zMyHzSfa.js";import{d as E}from"./table-B2H6cgda.js";import{t as _}from"./tree-DvnmHoX2.js";import{u as w,_ as x}from"./index-CYriLmQo.js";import{useListPage as I}from"./useListPage-i3Wl0_Fg.js";import k 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 v=[{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:h,resultField:"list",labelField:"name",valueField:"id"},width:200},{title:"远程下拉树",dataIndex:"name71",edit:!0,editComponent:"ApiTreeSelect",editRule:!1,editComponentProps:{api:_,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}],P=u({components:{BasicTable:k},setup(){const{tableContext:t}=I({designScope:"basic-table-demo",tableProps:{title:"可编辑单元格示例",api:E,columns:v,showIndexColumn:!1,bordered:!0,showActionColumn:!1,useSearchForm:!1}}),[m]=t,{createMessage:i}=w();function p({record:o,index:e,key:r,value:d}){return!1}function n({value:o,key:e,id:r}){return i.loading({content:`正在模拟保存${e}`,key:"_save_fake_data",duration:0}),new Promise(d=>{setTimeout(()=>{o===""?(i.error({content:"保存失败：不能为空",key:"_save_fake_data",duration:2}),d(!1)):(i.success({content:`记录${r}的${e}已保存`,key:"_save_fake_data",duration:2}),d(!0))},2e3)})}function s(Rt){return l(this,arguments,function*({record:o,index:e,key:r,value:d}){return yield n({id:o.id,key:r,value:d})})}function a(){}return{registerTable:m,handleEditEnd:p,handleEditCancel:a,beforeEditSubmit:s}}}),S={class:"p-4"};function g(t,m,i,p,n,s){const a=c("BasicTable");return f(),b("div",S,[C(a,{onRegister:t.registerTable,onEditEnd:t.handleEditEnd,onEditCancel:t.handleEditCancel,beforeEditSubmit:t.beforeEditSubmit},null,8,["onRegister","onEditEnd","onEditCancel","beforeEditSubmit"])])}const Ft=x(P,[["render",g]]);export{Ft as default};
