|
|
|
@ -33,10 +33,11 @@
|
|
|
|
|
show-overflow
|
|
|
|
|
show-header-overflow
|
|
|
|
|
show-footer-overflow
|
|
|
|
|
:min-height="tableHeightRef + 35"
|
|
|
|
|
:height="tableHeightRef + 35"
|
|
|
|
|
:row-config="{ isCurrent: true, isHover: true }"
|
|
|
|
|
:column-config="{ resizable: true }"
|
|
|
|
|
:scroll-y="{ enabled: true, gt: 15 }"
|
|
|
|
|
:scroll-y="{ enabled: true, gt: 0 }"
|
|
|
|
|
:scroll-x="{ enabled: true, gt: 0 }"
|
|
|
|
|
:sort-config="{ trigger: 'cell', remote: true }"
|
|
|
|
|
rowSelection
|
|
|
|
@ -45,15 +46,14 @@
|
|
|
|
|
@cell-dblclick="dbclickVxeRow"
|
|
|
|
|
@sort-change="sortChangeEvent"
|
|
|
|
|
@resizable-change="resizableChangeEvent"
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
<template #empty>
|
|
|
|
|
<div>
|
|
|
|
|
<img style="width: 100px;" src="../../../assets/images/nodata.png" />
|
|
|
|
|
<img src="../../../assets/images/nodata.png" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<vxe-column type="checkbox" width="40"></vxe-column>
|
|
|
|
|
<!-- <vxe-column type="seq" width="40"></vxe-column> -->
|
|
|
|
|
<vxe-column type="checkbox" fixed="left" width="40"></vxe-column>
|
|
|
|
|
<!-- <vxe-column type="seq" title="序号" width="45"></vxe-column> -->
|
|
|
|
|
<template
|
|
|
|
|
v-for="(item, index) in getBindValues.columns"
|
|
|
|
|
>
|
|
|
|
@ -102,12 +102,12 @@
|
|
|
|
|
</Table>
|
|
|
|
|
<slot name="right" class="right" ></slot>
|
|
|
|
|
</div>
|
|
|
|
|
<Pagination v-if="getBindValues.tableComponent === 'vxe'" v-bind="getBindValues.pagination" @change="pageChange" />
|
|
|
|
|
<Pagination v-if="getBindValues.tableComponent === 'vxe'" v-bind="getBindValues.pagination" @change="pageChange" @showSizeChange="onShowSizeChange" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import type { BasicTableProps, TableActionType, SizeType, ColumnChangeParam } from './types/table'
|
|
|
|
|
import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect, watch, onUnmounted } from 'vue'
|
|
|
|
|
import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect, watch, onUpdated, onActivated, onDeactivated, nextTick } from 'vue'
|
|
|
|
|
import { Table, Pagination } from 'ant-design-vue'
|
|
|
|
|
import { BasicForm, useForm } from '/@/components/Form/index'
|
|
|
|
|
import { PageWrapperFixedHeightKey } from '/@/components/Page'
|
|
|
|
@ -367,6 +367,13 @@ export default defineComponent({
|
|
|
|
|
setPagination(pageConfig)
|
|
|
|
|
reload()
|
|
|
|
|
}
|
|
|
|
|
const onShowSizeChange = (current, pageSize) => {
|
|
|
|
|
const pageConfig = toRaw(unref(getPaginationInfo))
|
|
|
|
|
pageConfig.current = current
|
|
|
|
|
pageConfig.pageSize = pageSize
|
|
|
|
|
setPagination(pageConfig)
|
|
|
|
|
reload()
|
|
|
|
|
}
|
|
|
|
|
const vxeSetId = ref('0')
|
|
|
|
|
// vxe 列设置数据查询
|
|
|
|
|
const getVxeColSetData = () => {
|
|
|
|
@ -383,6 +390,27 @@ export default defineComponent({
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// let vxeTableScrollTop = null
|
|
|
|
|
// onActivated(() => {
|
|
|
|
|
// console.log(vxeTableScrollTop)
|
|
|
|
|
// if (vxeTableScrollTop && tableElRef.value?.scrollTo) {
|
|
|
|
|
// tableElRef.value.scrollTo(null, vxeTableScrollTop)
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// onUpdated(() => {
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// if (vxeTableScrollTop && tableElRef.value?.scrollTo) {
|
|
|
|
|
// tableElRef.value.scrollTo(null, vxeTableScrollTop)
|
|
|
|
|
// }
|
|
|
|
|
// }, 10)
|
|
|
|
|
// })
|
|
|
|
|
// onDeactivated(() => {
|
|
|
|
|
// if (tableElRef.value?.getScroll) {
|
|
|
|
|
// const scrollData = tableElRef.value.getScroll()
|
|
|
|
|
// vxeTableScrollTop = scrollData.scrollTop
|
|
|
|
|
// console.log(vxeTableScrollTop)
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
const tableAction: TableActionType = {
|
|
|
|
|
reload,
|
|
|
|
|
getSelectRows,
|
|
|
|
@ -443,6 +471,7 @@ export default defineComponent({
|
|
|
|
|
}
|
|
|
|
|
// vxe拖动列触发实时保存
|
|
|
|
|
const resizableChangeEvent = (item) => {
|
|
|
|
|
if (item?.columm?.type === 'seq' || item?.columm?.type === 'checkbox') return
|
|
|
|
|
if (vxeSetId.value == '0') return
|
|
|
|
|
const postData = {
|
|
|
|
|
permissionId: permissionsInfo().permissionId,
|
|
|
|
@ -459,9 +488,6 @@ export default defineComponent({
|
|
|
|
|
})
|
|
|
|
|
setColumns(data)
|
|
|
|
|
}
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
|
console.log(111111111111111)
|
|
|
|
|
})
|
|
|
|
|
// vxe服务端筛选
|
|
|
|
|
// const filterChangeEvent = ({ filterList }) => {
|
|
|
|
|
// console.log(filterList)
|
|
|
|
@ -478,6 +504,7 @@ export default defineComponent({
|
|
|
|
|
getBindValues,
|
|
|
|
|
getLoading,
|
|
|
|
|
registerForm,
|
|
|
|
|
onShowSizeChange,
|
|
|
|
|
handleSearchInfoChange,
|
|
|
|
|
getEmptyDataIsShowTable,
|
|
|
|
|
sortChangeEvent,
|
|
|
|
|