|
|
|
@ -9,6 +9,16 @@
|
|
|
|
|
</BasicForm>
|
|
|
|
|
<div class="ds-vxe-tb-header" v-if="getBindValues.tableComponent === 'vxe'">
|
|
|
|
|
<slot name="tableTitle"></slot>
|
|
|
|
|
<div style="padding-right: 10px;">
|
|
|
|
|
<a-button type="link" @click="reload">
|
|
|
|
|
<span class="iconfont icon-refresh-1-copy"></span>
|
|
|
|
|
刷新
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button type="link" @click="initColSet">
|
|
|
|
|
<span class="iconfont icon-shuliebiao"></span>
|
|
|
|
|
列设置
|
|
|
|
|
</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="table-wrapper" >
|
|
|
|
|
<slot name="left" class="left" ></slot>
|
|
|
|
@ -20,23 +30,27 @@
|
|
|
|
|
show-header-overflow
|
|
|
|
|
show-footer-overflow
|
|
|
|
|
:height="tableHeightRef + 35"
|
|
|
|
|
:row-config="{isCurrent: true, isHover: true}"
|
|
|
|
|
:column-config="{resizable: true}"
|
|
|
|
|
:scroll-y="{enabled: true, gt: 0}"
|
|
|
|
|
:scroll-x="{enabled: true, gt: 0}"
|
|
|
|
|
:row-config="{ isCurrent: true, isHover: true }"
|
|
|
|
|
:column-config="{ resizable: true }"
|
|
|
|
|
:scroll-y="{ enabled: true, gt: 0 }"
|
|
|
|
|
:scroll-x="{ enabled: true, gt: 0 }"
|
|
|
|
|
:sort-config="{ trigger: 'cell', remote: true }"
|
|
|
|
|
rowSelection
|
|
|
|
|
size="mini"
|
|
|
|
|
:loading="getBindValues.loading"
|
|
|
|
|
@cell-dblclick="dbclickVxeRow"
|
|
|
|
|
@checkbox-change="vxeCheckBoxChange"
|
|
|
|
|
@sort-change="sortChangeEvent"
|
|
|
|
|
>
|
|
|
|
|
<vxe-column type="checkbox" width="40"></vxe-column>
|
|
|
|
|
<!-- <vxe-column type="seq" width="40"></vxe-column> -->
|
|
|
|
|
<vxe-column
|
|
|
|
|
v-for="(item, index) in getBindValues.columns"
|
|
|
|
|
:key="`${item.dataIndex}-${index}`"
|
|
|
|
|
:title="item.customTitle"
|
|
|
|
|
:field="item.dataIndex"
|
|
|
|
|
:width="item.width"
|
|
|
|
|
:sortable="item.sorter"
|
|
|
|
|
:filters="item.filters"
|
|
|
|
|
>
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<slot name="bodyCell" :column="item" :record="row">{{ row[item.dataIndex] }}</slot>
|
|
|
|
@ -326,7 +340,7 @@ export default defineComponent({
|
|
|
|
|
setPagination(pageConfig)
|
|
|
|
|
reload()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const tableAction: TableActionType = {
|
|
|
|
|
reload,
|
|
|
|
|
getSelectRows,
|
|
|
|
@ -378,17 +392,37 @@ export default defineComponent({
|
|
|
|
|
emit('row-dbClick', row)
|
|
|
|
|
// props.rowDbClick(row)
|
|
|
|
|
}
|
|
|
|
|
const vxeCheckBoxChange = (v) => {
|
|
|
|
|
// vxe服务端排序
|
|
|
|
|
const sortChangeEvent = ({ field, order }) => {
|
|
|
|
|
if (order) {
|
|
|
|
|
fetch({ sortInfo: { field, order: order == 'asc' ? 'ascend' : order }})
|
|
|
|
|
} else {
|
|
|
|
|
fetch()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 初始化列设置
|
|
|
|
|
const initColSet = () => {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// vxe服务端筛选
|
|
|
|
|
// const filterChangeEvent = ({ filterList }) => {
|
|
|
|
|
// console.log(filterList)
|
|
|
|
|
// if (filterList) {
|
|
|
|
|
// fetch({ filterInfo: filterList})
|
|
|
|
|
// } else {
|
|
|
|
|
// fetch()
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
return {
|
|
|
|
|
formRef,
|
|
|
|
|
tableElRef,
|
|
|
|
|
getBindValues,
|
|
|
|
|
getLoading,
|
|
|
|
|
registerForm,
|
|
|
|
|
vxeCheckBoxChange,
|
|
|
|
|
handleSearchInfoChange,
|
|
|
|
|
getEmptyDataIsShowTable,
|
|
|
|
|
sortChangeEvent,
|
|
|
|
|
// filterChangeEvent,
|
|
|
|
|
handleTableChange,
|
|
|
|
|
getRowClassName,
|
|
|
|
|
getVxeSelectRows,
|
|
|
|
@ -398,13 +432,15 @@ export default defineComponent({
|
|
|
|
|
dbclickVxeRow,
|
|
|
|
|
redoHeight,
|
|
|
|
|
fetch,
|
|
|
|
|
initColSet,
|
|
|
|
|
getFormProps: getFormProps as any,
|
|
|
|
|
replaceFormSlotKey,
|
|
|
|
|
getFormSlotKeys,
|
|
|
|
|
pageChange,
|
|
|
|
|
getWrapperClass,
|
|
|
|
|
columns: getViewColumns,
|
|
|
|
|
resizeColumn
|
|
|
|
|
resizeColumn,
|
|
|
|
|
reload
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
@ -430,6 +466,7 @@ export default defineComponent({
|
|
|
|
|
.ds-vxe-tb-header {
|
|
|
|
|
height: 48px;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding-left: 10px;
|
|
|
|
|
}
|
|
|
|
@ -535,4 +572,14 @@ export default defineComponent({
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.vxe-icon-checkbox-checked {
|
|
|
|
|
color: #257afa!important;
|
|
|
|
|
}
|
|
|
|
|
.vxe-cell--sort {
|
|
|
|
|
font-size: 0.8em!important;
|
|
|
|
|
height: 1.5em!important;
|
|
|
|
|
}
|
|
|
|
|
.vxe-header--row {
|
|
|
|
|
background: #f0f4fa!important;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|