import{B as C}from"./Table-0PViRYCf.js";import{_ as b}from"./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";import{g as R}from"./list-I2I5D8gr.js";import{_ as v}from"./index-C-XHZLOy.js";import{Z as c,d as E,r as l,a as r,c as N,o as x,w as P,j as B,l as s,W as T}from"./index-9PRMimni.js";import"./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";import"./vuedraggable.umd-Co2xEC3p.js";import"./Render.vue_vue_type_script_lang-DKUYY0Zw.js";import"./componentMap-CElCaWis.js";import"./propTypes-CebMRUpe.js";import"./format-DgF6KtHk.js";import"./omit-B2_8Y6O_.js";import"./_flatRest-DBrd2CHT.js";import"./flatten-DeoUZLdb.js";import"./print-CT_2hrjP.js";import"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import"./useModal-CO65vga3.js";import"./componentSetting-DVhNDBTO.js";import"./useTimeout-BxFilWvD.js";import"./usePageCache-DluHn7Yy.js";import"./tabsView-BXskTdVh.js";import"./Flex-CTSf12gq.js";const D=[{title:"id",key:"id",width:100},{title:"名称",key:"name",editComponent:"NInput",editRow:!0,editRule:!0,edit:!0,width:200},{title:"头像",key:"avatar",width:160,render(a){return c(v,{imageProps:{width:32,height:32},imgList:[a.avatar],spaceProps:{justify:"space-between"},style:"border-radius: 50%"})}},{title:"邮箱",key:"email",editComponent:"NInput",edit:!0,editRow:!0,width:180},{title:"城市",key:"city",editComponent:"NInput",edit:!0,editRow:!0,width:180},{title:"状态",key:"status",editRow:!0,editComponent:"NSelect",editComponentProps:{options:[{label:"取消",value:"close"},{label:"拒绝",value:"refuse"},{label:"成功",value:"success"}]},edit:!0,width:200,ellipsis:!1},{title:"创建时间",width:320,key:"createDate",align:"center",editRow:!0,edit:!0,editComponent:"NDatePicker",editComponentProps:{type:"datetime"}}],te=E({__name:"editRow",setup(a){const d=l(),i=l(""),u=r({pageSize:5,name:"NaiveAdmin"}),p=r({width:150,title:"操作",key:"action",fixed:"right",align:"center",render(e){return c(b,{style:"button",actions:_(e)})}});function m(e){console.log(e),i.value=e.key,e.onEdit?.(!0)}function f(e){i.value="",e.onEdit?.(!1,!1)}function w({column:e,value:t,record:o}){e.key==="id"&&(o.editValueRefs.name4.value=`${t}`),console.log(e,t,o)}async function y(e){await e.onEdit?.(!1,!0)&&(i.value="")}function _(e){return e.editable?[{label:"保存",onClick:y.bind(null,e)},{label:"取消",onClick:f.bind(null,e)}]:[{label:"编辑",onClick:m.bind(null,e)}]}const k=async e=>await R({...u,...e});function h(e){console.log(e)}function g({record:e,index:t,key:o,value:n}){console.log("record",e),console.log("index",t),console.log("key",o),console.log("value",n)}return(e,t)=>{const o=T;return x(),N(o,{bordered:!1,class:"proCard"},{default:P(()=>[B(s(C),{title:"整行编辑",titleTooltip:"点击操作列编辑按钮，即可开启编辑模式",columns:s(D),request:k,"row-key":n=>n.id,ref_key:"actionRef",ref:d,actionColumn:p,onEditEnd:g,onEditChange:w,"onUpdate:checkedRowKeys":h,"scroll-x":1590},null,8,["columns","row-key","actionColumn"])]),_:1})}}});export{te as default};
