|
|
|
@ -1,31 +1,16 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div ref="wrapRef" :class="getWrapperClass" class="basic-table-search-form">
|
|
|
|
|
<BasicForm
|
|
|
|
|
v-if="getBindValues.useSearchForm"
|
|
|
|
|
v-show="showSearchForm"
|
|
|
|
|
ref="formRef"
|
|
|
|
|
submit-on-reset
|
|
|
|
|
v-bind="getFormProps"
|
|
|
|
|
:fetch="fetch"
|
|
|
|
|
:table-action="tableAction"
|
|
|
|
|
:autoSubmitOnEnter="true"
|
|
|
|
|
@register="registerForm"
|
|
|
|
|
@submit="handleSearchInfoChange"
|
|
|
|
|
@advanced-change="redoHeight"
|
|
|
|
|
>
|
|
|
|
|
<BasicForm v-if="getBindValues.useSearchForm" v-show="showSearchForm" ref="formRef" submit-on-reset
|
|
|
|
|
v-bind="getFormProps" :fetch="fetch" :table-action="tableAction" :autoSubmitOnEnter="true"
|
|
|
|
|
@register="registerForm" @submit="handleSearchInfoChange" @advanced-change="redoHeight">
|
|
|
|
|
<template v-for="item in getFormSlotKeys" #[replaceFormSlotKey(item)]="data">
|
|
|
|
|
<slot :name="item" v-bind="data || {}"></slot>
|
|
|
|
|
</template>
|
|
|
|
|
</BasicForm>
|
|
|
|
|
|
|
|
|
|
<Table
|
|
|
|
|
v-show="getEmptyDataIsShowTable"
|
|
|
|
|
ref="tableElRef"
|
|
|
|
|
v-bind="getBindValues"
|
|
|
|
|
:row-class-name="getRowClassName"
|
|
|
|
|
@change="handleTableChange"
|
|
|
|
|
@resize-column="resizeColumn"
|
|
|
|
|
>
|
|
|
|
|
<div class="table-wrapper" >
|
|
|
|
|
<slot name="left" class="left" ></slot>
|
|
|
|
|
<Table class="basic-table" v-show="getEmptyDataIsShowTable" ref="tableElRef" v-bind="getBindValues" :row-class-name="getRowClassName"
|
|
|
|
|
@change="handleTableChange" @resize-column="resizeColumn">
|
|
|
|
|
<template v-for="item in Object.keys($slots)" #[item]="data" :key="item">
|
|
|
|
|
<slot :name="item" v-bind="data || {}"></slot>
|
|
|
|
|
</template>
|
|
|
|
@ -41,39 +26,41 @@
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
</Table>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import type { BasicTableProps, TableActionType, SizeType, ColumnChangeParam } from './types/table'
|
|
|
|
|
|
|
|
|
|
import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect } from 'vue'
|
|
|
|
|
import { Table } from 'ant-design-vue'
|
|
|
|
|
import { BasicForm, useForm } from '/@/components/Form/index'
|
|
|
|
|
import { PageWrapperFixedHeightKey } from '/@/components/Page'
|
|
|
|
|
import HeaderCell from './components/HeaderCell.vue'
|
|
|
|
|
import { InnerHandlers } from './types/table'
|
|
|
|
|
|
|
|
|
|
import { usePagination } from './hooks/usePagination'
|
|
|
|
|
import { useColumns } from './hooks/useColumns'
|
|
|
|
|
import { useDataSource } from './hooks/useDataSource'
|
|
|
|
|
import { useLoading } from './hooks/useLoading'
|
|
|
|
|
import { useRowSelection } from './hooks/useRowSelection'
|
|
|
|
|
import { useTableScroll } from './hooks/useTableScroll'
|
|
|
|
|
import { useTableScrollTo } from './hooks/useScrollTo'
|
|
|
|
|
import { useCustomRow } from './hooks/useCustomRow'
|
|
|
|
|
import { useTableStyle } from './hooks/useTableStyle'
|
|
|
|
|
import { useTableHeader } from './hooks/useTableHeader'
|
|
|
|
|
import { useTableExpand } from './hooks/useTableExpand'
|
|
|
|
|
import { createTableContext } from './hooks/useTableContext'
|
|
|
|
|
import { useTableFooter } from './hooks/useTableFooter'
|
|
|
|
|
import { useTableForm } from './hooks/useTableForm'
|
|
|
|
|
import { useDesign } from '/@/hooks/web/useDesign'
|
|
|
|
|
|
|
|
|
|
import { omit } from 'lodash-es'
|
|
|
|
|
import { basicProps } from './props'
|
|
|
|
|
import { isFunction } from '/@/utils/is'
|
|
|
|
|
import { warn } from '/@/utils/log'
|
|
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
import type { BasicTableProps, TableActionType, SizeType, ColumnChangeParam } from './types/table'
|
|
|
|
|
|
|
|
|
|
import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect } from 'vue'
|
|
|
|
|
import { Table } from 'ant-design-vue'
|
|
|
|
|
import { BasicForm, useForm } from '/@/components/Form/index'
|
|
|
|
|
import { PageWrapperFixedHeightKey } from '/@/components/Page'
|
|
|
|
|
import HeaderCell from './components/HeaderCell.vue'
|
|
|
|
|
import { InnerHandlers } from './types/table'
|
|
|
|
|
|
|
|
|
|
import { usePagination } from './hooks/usePagination'
|
|
|
|
|
import { useColumns } from './hooks/useColumns'
|
|
|
|
|
import { useDataSource } from './hooks/useDataSource'
|
|
|
|
|
import { useLoading } from './hooks/useLoading'
|
|
|
|
|
import { useRowSelection } from './hooks/useRowSelection'
|
|
|
|
|
import { useTableScroll } from './hooks/useTableScroll'
|
|
|
|
|
import { useTableScrollTo } from './hooks/useScrollTo'
|
|
|
|
|
import { useCustomRow } from './hooks/useCustomRow'
|
|
|
|
|
import { useTableStyle } from './hooks/useTableStyle'
|
|
|
|
|
import { useTableHeader } from './hooks/useTableHeader'
|
|
|
|
|
import { useTableExpand } from './hooks/useTableExpand'
|
|
|
|
|
import { createTableContext } from './hooks/useTableContext'
|
|
|
|
|
import { useTableFooter } from './hooks/useTableFooter'
|
|
|
|
|
import { useTableForm } from './hooks/useTableForm'
|
|
|
|
|
import { useDesign } from '/@/hooks/web/useDesign'
|
|
|
|
|
|
|
|
|
|
import { omit } from 'lodash-es'
|
|
|
|
|
import { basicProps } from './props'
|
|
|
|
|
import { isFunction } from '/@/utils/is'
|
|
|
|
|
import { warn } from '/@/utils/log'
|
|
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
name: 'BasicTable',
|
|
|
|
|
components: {
|
|
|
|
|
Table,
|
|
|
|
@ -352,21 +339,22 @@
|
|
|
|
|
resizeColumn
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less">
|
|
|
|
|
@border-color: #cecece4d;
|
|
|
|
|
@border-color: #cecece4d;
|
|
|
|
|
|
|
|
|
|
@prefix-cls: ~'@{namespace}-basic-table';
|
|
|
|
|
@prefix-cls: ~'@{namespace}-basic-table';
|
|
|
|
|
|
|
|
|
|
[data-theme='dark'] {
|
|
|
|
|
.ant-table-tbody > tr:hover.ant-table-row-selected > td,
|
|
|
|
|
.ant-table-tbody > tr.ant-table-row-selected td {
|
|
|
|
|
[data-theme='dark'] {
|
|
|
|
|
|
|
|
|
|
.ant-table-tbody>tr:hover.ant-table-row-selected>td,
|
|
|
|
|
.ant-table-tbody>tr.ant-table-row-selected td {
|
|
|
|
|
background-color: #262626;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.@{prefix-cls} {
|
|
|
|
|
.@{prefix-cls} {
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
|
@ -394,6 +382,7 @@
|
|
|
|
|
padding: 6px;
|
|
|
|
|
background-color: @component-background;
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
|
|
|
|
.ant-table.ant-table-bordered .ant-table-title {
|
|
|
|
|
border: none !important;
|
|
|
|
|
}
|
|
|
|
@ -433,7 +422,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
td {
|
|
|
|
|
padding: 12px 6px!important;
|
|
|
|
|
padding: 12px 6px !important;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -442,16 +431,26 @@
|
|
|
|
|
padding: 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// .basic-table-search-form {
|
|
|
|
|
// .ant-form-item-no-colon {
|
|
|
|
|
// color: @main-color;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// .ant-table-small {
|
|
|
|
|
// font-size: 12px !important;
|
|
|
|
|
// .ant-table-cell {
|
|
|
|
|
// padding: 9px 15px !important;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// .basic-table-search-form {
|
|
|
|
|
// .ant-form-item-no-colon {
|
|
|
|
|
// color: @main-color;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// .ant-table-small {
|
|
|
|
|
// font-size: 12px !important;
|
|
|
|
|
// .ant-table-cell {
|
|
|
|
|
// padding: 9px 15px !important;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
.table-wrapper{
|
|
|
|
|
display:flex;
|
|
|
|
|
.basic-table{
|
|
|
|
|
flex: 1;
|
|
|
|
|
min-width: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|