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-KOQNKxnC.js";import{o as h}from"./select-u2i3bTSx.js";import{d as E}from"./table-CVQJbEH2.js";import{t as _}from"./tree-C1BP1hGh.js";import{u as w,_ as x}from"./index-CLZzJyTP.js";import{useListPage as I}from"./useListPage-CevWQ3ci.js";import k from"./BasicTable-DUJWN3yz.js";import"./componentMap-DpsJvoqz.js";import"./antd-vue-vendor-CahNzUUa.js";import"./useFormItem-IOFWTdED.js";import"./index-XZKTTfG1.js";import"./BasicModal-B8XmAOm7.js";import"./ModalHeader-DIFQSP_0.js";import"./useTimeout-KpZCXEcl.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-DvqyyN77.js";import"./useWindowSizeFn-D9PllI8g.js";import"./index-DS3utcig.js";import"./index-BZbg0EjM.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-DopMSmFN.js";import"./base64Conver-24EVOS6V.js";import"./index-CDa2_aYE.js";import"./index-D0jTtUNS.js";import"./useCountdown-BpP55PQ2.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-CfAGgHjD.js";import"./props-BtZrRNiI.js";import"./JSelectBiz-CLnJTMe2.js";import"./JAddInput-B36c3B5x.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-C7yPiS0L.js";import"./index-44tRnyoF.js";import"./bem-DT3DdmOs.js";import"./props-CG-jAkbI.js";import"./useContextMenu-BGU2vdqV.js";import"./depart.api-DHG2p2Yd.js";import"./JImageUpload-BFwNYdm5.js";import"./JDictSelectTag-CfF54ALX.js";import"./JSelectDept-CaEHrQp6.js";import"./JPopup-BvqhHpPl.js";import"./JEllipsis-C_gT_vEQ.js";import"./JUpload-DgDEmizw.js";import"./index-Bn2zmO2L.js";import"./index-CEznvAVZ.js";import"./index-CfAukas3.js";import"./index-ByX9XNkE.js";import"./useForm-Dx3lJ3DG.js";import"./JAreaLinkage-M9TGy8nY.js";import"./JCodeEditor-CR57XeIe.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CWOTSpxK.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(yt){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 At=x(P,[["render",g]]);export{At as default};
