Compare commits
No commits in common. "3eb91882401980742d0cb8e87771cb92b7a0872d" and "3038b990784bf94bc6167d7751b5da5264338efb" have entirely different histories.
3eb9188240
...
3038b99078
|
@ -1,15 +1,16 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="table-pro-content">
|
<div class="table-pro-content">
|
||||||
<div class="card padding" v-if="props.searchFormOptions">
|
<div class="card padding" v-if="props.searchFormOptions">
|
||||||
<FormProMax ref="searchFormRef" :form-item-options="props.searchFormOptions" v-model:value="searchParams" v-bind="props.searchFormProps">
|
<FormProMax ref="searchFormRef" :form-item-options="props.searchFormOptions" v-model:value="searchParams"
|
||||||
|
v-bind="props.searchFormProps">
|
||||||
<template v-slot:formOperation>
|
<template v-slot:formOperation>
|
||||||
<a-space class="margin-right flex-end">
|
<a-space class="margin-right flex-end">
|
||||||
<a-button type="primary" @click="search">
|
<a-button type="primary" @click="search">
|
||||||
<search-outlined />
|
<search-outlined/>
|
||||||
搜索
|
搜索
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button danger @click="resetFormAndTable">
|
<a-button danger @click="resetFormAndTable">
|
||||||
<rollback-outlined />
|
<rollback-outlined/>
|
||||||
重置
|
重置
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
|
@ -26,7 +27,7 @@
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template #title>刷新数据</template>
|
<template #title>刷新数据</template>
|
||||||
<a-button shape="circle" @click="requestGetTableData">
|
<a-button shape="circle" @click="requestGetTableData">
|
||||||
<ReloadOutlined />
|
<ReloadOutlined/>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
|
@ -34,7 +35,7 @@
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template #title>打印数据</template>
|
<template #title>打印数据</template>
|
||||||
<a-button shape="circle">
|
<a-button shape="circle">
|
||||||
<PrinterOutlined />
|
<PrinterOutlined/>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
|
@ -69,12 +70,17 @@
|
||||||
|
|
||||||
<script setup lang="ts" generic="T extends BaseTableRowRecord = {},P extends { [key: string]: any } ={}">
|
<script setup lang="ts" generic="T extends BaseTableRowRecord = {},P extends { [key: string]: any } ={}">
|
||||||
import FormProMax from '@/components/form/FormProMax.vue'
|
import FormProMax from '@/components/form/FormProMax.vue'
|
||||||
import { PrinterOutlined, ReloadOutlined, RollbackOutlined, SearchOutlined } from '@ant-design/icons-vue'
|
import {PrinterOutlined, ReloadOutlined, RollbackOutlined, SearchOutlined} from '@ant-design/icons-vue'
|
||||||
import { computed, onMounted, Ref, ref } from 'vue'
|
import {computed, onMounted, Ref, ref} from 'vue'
|
||||||
import { FormInstance } from 'ant-design-vue'
|
import {FormInstance} from 'ant-design-vue'
|
||||||
import useTableProMax from '@/hooks/useTableProMax.ts'
|
import useTableProMax from '@/hooks/useTableProMax.ts'
|
||||||
import { includes, isEmpty } from 'lodash-es'
|
import {includes, isEmpty} from 'lodash-es'
|
||||||
import { BaseTableRowRecord, TableProMaxProps, TableProMaxRowSelect, TableProMaxSlots } from '@/types/components/table/index.ts'
|
import {
|
||||||
|
BaseTableRowRecord,
|
||||||
|
TableProMaxProps,
|
||||||
|
TableProMaxRowSelect,
|
||||||
|
TableProMaxSlots
|
||||||
|
} from '@/types/components/table/index.ts'
|
||||||
|
|
||||||
//
|
//
|
||||||
const selectKeys = ref<string[]>([])
|
const selectKeys = ref<string[]>([])
|
||||||
|
@ -150,7 +156,7 @@ const tableColumns = computed(() => {
|
||||||
dataIndex: 'index',
|
dataIndex: 'index',
|
||||||
width: 60,
|
width: 60,
|
||||||
title: '序号',
|
title: '序号',
|
||||||
customRender: ({ index }) => index + 1,
|
customRender: ({index}) => index + 1,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -166,7 +172,16 @@ const searchFormRef = ref<FormInstance>() as Ref<FormInstance>
|
||||||
*/
|
*/
|
||||||
const searchParams = ref<P | Record<string, any>>(props.defaultSearchParams || {}) as Ref<P>
|
const searchParams = ref<P | Record<string, any>>(props.defaultSearchParams || {}) as Ref<P>
|
||||||
|
|
||||||
const { loading, dataSource, pageParams, search, requestGetTableData, handleSizeChange, handleCurrentChange, resetState } = useTableProMax(
|
const {
|
||||||
|
loading,
|
||||||
|
dataSource,
|
||||||
|
pageParams,
|
||||||
|
search,
|
||||||
|
requestGetTableData,
|
||||||
|
handleSizeChange,
|
||||||
|
handleCurrentChange,
|
||||||
|
resetState
|
||||||
|
} = useTableProMax(
|
||||||
props.requestApi,
|
props.requestApi,
|
||||||
searchFormRef,
|
searchFormRef,
|
||||||
searchParams,
|
searchParams,
|
||||||
|
@ -174,6 +189,7 @@ const { loading, dataSource, pageParams, search, requestGetTableData, handleSize
|
||||||
props.dataCallback,
|
props.dataCallback,
|
||||||
props.requestError
|
props.requestError
|
||||||
)
|
)
|
||||||
|
// console.log('pageParams', pageParams)
|
||||||
|
|
||||||
onMounted(() => props.requestAuto && requestGetTableData(true))
|
onMounted(() => props.requestAuto && requestGetTableData(true))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue