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-LwlFn7Y4.js";import{o as E}from"./select-D2fRWKWi.js";import{d as _}from"./table-BFzLXxhh.js";import{t as w}from"./tree-tJYnCxG-.js";import{bt as x,u as I,_ as k}from"./index-B_2CoVdl.js";import S from"./BasicTable-Clbg3fHx.js";import"./componentMap-CzCGDP7x.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./useFormItem-CWa0w7fA.js";import"./index-D2AmS0aU.js";import"./BasicModal-D3g2CFhF.js";import"./ModalHeader-C-C0dUi_.js";import"./useTimeout-CB9F1PLu.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./index-DAURrYyA.js";import"./useWindowSizeFn-C3WExEpc.js";import"./index-Dz2zbQB_.js";import"./index-exs4VcBw.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-2tYEzlDW.js";import"./base64Conver-24EVOS6V.js";import"./index-Cgt544dC.js";import"./index-BZ9ST2iq.js";import"./useCountdown-ImUE7YaG.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-BQIJUcBR.js";import"./props-BCVPj-bG.js";import"./JSelectBiz-CJyWq5s2.js";import"./JAddInput-YFlAniYT.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-CkL00Q0a.js";import"./index-BKs2x_To.js";import"./bem-C6eT35UB.js";import"./props-BLY2qIO5.js";import"./useContextMenu-CSt5a1-F.js";import"./depart.api-0qTriT9h.js";import"./JDictSelectTag-CxpDdimB.js";import"./JSelectDept-wKz_Qtmc.js";import"./JPopup-BJBYqoWe.js";import"./JEllipsis-Cn7GCKHR.js";import"./JUpload-DzM-D4DX.js";import"./index-khU3p_On.js";import"./index-DPEnuI0R.js";import"./index-Cnb8BkwG.js";import"./index-ARbUvvsq.js";import"./useForm-CcjrODHR.js";import"./JAreaLinkage-CSgDAlrn.js";import"./JCodeEditor-esTLnfS3.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-DclSHT47.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};
