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-gyz1IdHU.js";import{o as h}from"./select-7sxOfiAw.js";import{d as E}from"./table-BDpZPeJG.js";import{t as _}from"./tree-C2n6TXTD.js";import{u as w,_ as x}from"./index-Cy4uayzW.js";import{useListPage as I}from"./useListPage-TMORxSEa.js";import k from"./BasicTable-CgafrQwz.js";import"./componentMap-0iK4HQBq.js";import"./antd-vue-vendor-CahNzUUa.js";import"./useFormItem-IOFWTdED.js";import"./index-zKZnG1QC.js";import"./BasicModal-sKcs_9Ir.js";import"./ModalHeader-ByCVDoqO.js";import"./useTimeout-gJpgadD6.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-Bdn0r8CG.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-Bn4f3tzD.js";import"./base64Conver-24EVOS6V.js";import"./index-D6H6KsT6.js";import"./index-CLxBW_h0.js";import"./useCountdown-2P9HvnfJ.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-B98pRPrS.js";import"./props-CtlWAg-s.js";import"./JSelectBiz-vYDBA0SK.js";import"./JAddInput-DP4caUmw.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-tDBMxW9-.js";import"./index-CNQBnF3P.js";import"./bem-IZKqD41e.js";import"./props-CG-jAkbI.js";import"./useContextMenu-Q6J5bB_u.js";import"./depart.api-B8q8MC-j.js";import"./JImageUpload-C5OCTlCG.js";import"./JDictSelectTag-CalJXNVe.js";import"./JSelectDept-D-TUaHvK.js";import"./JPopup-CVHkQZFq.js";import"./JEllipsis-TuDc52fh.js";import"./JUpload-DSWoDwh2.js";import"./index-B4vNk56t.js";import"./index-Dc7Jr5-j.js";import"./index-Dm1rPBfc.js";import"./index-BN26Feep.js";import"./useForm-DfoT2G6J.js";import"./JAreaLinkage-CTMEfTuh.js";import"./JCodeEditor-U9QIstNN.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CZdChTcP.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};
