迭代vxe表格

frame-financialTax-yjl-1204
lijingjia 2 weeks ago
parent ba170893b4
commit 715aaa20ae

@ -51,13 +51,15 @@
@cell-dblclick="dbclickVxeRow" @cell-dblclick="dbclickVxeRow"
@sort-change="sortChangeEvent" @sort-change="sortChangeEvent"
@resizable-change="resizableChangeEvent" @resizable-change="resizableChangeEvent"
@radio-change="rowChange"
@checkbox-change="rowChange"
> >
<template #empty> <template #empty>
<div> <div>
<img src="../../../assets/images/nodata.png" /> <img src="../../../assets/images/nodata.png" />
</div> </div>
</template> </template>
<vxe-column type="checkbox" fixed="left" width="40"></vxe-column> <vxe-column :type="getBindValues?.rowSelection?.type" fixed="left" width="40"></vxe-column>
<vxe-column v-if="numberCol !== false" type="seq" title="序号" width="50"></vxe-column> <vxe-column v-if="numberCol !== false" type="seq" title="序号" width="50"></vxe-column>
<template <template
v-for="(item, index) in getBindValues.columns" v-for="(item, index) in getBindValues.columns"
@ -182,7 +184,8 @@ export default defineComponent({
'edit-change', 'edit-change',
'expanded-rows-change', 'expanded-rows-change',
'change', 'change',
'columns-change' 'columns-change',
'row-change'
], ],
setup(props, { attrs, emit, slots, expose }) { setup(props, { attrs, emit, slots, expose }) {
const tableElRef = ref(null) const tableElRef = ref(null)
@ -518,6 +521,10 @@ export default defineComponent({
// fetch() // fetch()
// } // }
// } // }
// vxetable
const rowChange = (data) => {
emit('row-change', data)
}
return { return {
vxeSetId, vxeSetId,
formRef, formRef,
@ -549,7 +556,8 @@ export default defineComponent({
resizeColumn, resizeColumn,
reload, reload,
updateCol, updateCol,
numberCol numberCol,
rowChange
} }
}, },
}) })

@ -103,7 +103,7 @@ export const basicProps = {
resizeHeightOffset: propTypes.number.def(0), resizeHeightOffset: propTypes.number.def(0),
rowSelection: { rowSelection: {
type: Object as PropType<TableRowSelection | null>, type: Object as PropType<TableRowSelection | null>,
default: null, default: { type: 'checkbox' },
}, },
title: { title: {
type: [String, Function] as PropType<string | ((data: Recordable) => string)>, type: [String, Function] as PropType<string | ((data: Recordable) => string)>,

@ -1,7 +1,7 @@
<template> <template>
<div class="ds-sea-export-table p20"> <div class="ds-sea-export-table p20">
<div class="ds-table"> <div class="ds-table">
<BasicTable @register="registerTable" @rowDbClick="handledbclick"> <BasicTable @register="registerTable" @rowDbClick="handledbclick" @row-change="rowChange">
<template #tableTitle> <template #tableTitle>
<TableActionBar :selectRow="getVxeSelectRows" :reload="reload" :columns="getColumns" :queryData="queryData"> <TableActionBar :selectRow="getVxeSelectRows" :reload="reload" :columns="getColumns" :queryData="queryData">
<!-- <tableActionBarRight :selectRow="getVxeSelectRows" :reload="reload"></tableActionBarRight> --> <!-- <tableActionBarRight :selectRow="getVxeSelectRows" :reload="reload"></tableActionBarRight> -->
@ -504,6 +504,9 @@ const [registerTable, { reload, getVxeSelectRows, setLoading, getColumns }] = us
indexColumnProps: { indexColumnProps: {
width: 60, width: 60,
}, },
rowSelection: {
type: 'radio'
},
canResize: true, canResize: true,
resizeHeightOffset: 131, resizeHeightOffset: 131,
immediate: false, immediate: false,
@ -517,6 +520,9 @@ const [registerTable, { reload, getVxeSelectRows, setLoading, getColumns }] = us
// fixed: 'right' // fixed: 'right'
// } // }
}) })
const rowChange = (data) => {
console.log(data)
}
function editColumns(row) { function editColumns(row) {
if (row.mblno) { if (row.mblno) {
go(`/BookingDetail?id=${row.id}&source=edit&mblno=${row.mblno}`) go(`/BookingDetail?id=${row.id}&source=edit&mblno=${row.mblno}`)

Loading…
Cancel
Save