mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-08 08:05:07 +08:00
reactor: 重构 XTable
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 列表 -->
|
||||
<vxe-grid ref="xGrid" v-bind="gridOptions" class="xtable-scrollbar">
|
||||
<XTable @register="registerTable">
|
||||
<template #toolbar_buttons>
|
||||
<!-- 操作:新增 -->
|
||||
<XButton
|
||||
@ -29,7 +29,7 @@
|
||||
@click="handleDetail(row.id)"
|
||||
/>
|
||||
</template>
|
||||
</vxe-grid>
|
||||
</XTable>
|
||||
</ContentWrap>
|
||||
<XModal v-model="dialogVisible" :title="dialogTitle">
|
||||
<!-- 对话框(详情) -->
|
||||
@ -44,15 +44,13 @@
|
||||
<script setup lang="ts" name="Order">
|
||||
import { ref } from 'vue'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { useVxeGrid } from '@/hooks/web/useVxeGrid'
|
||||
import { VxeGridInstance } from 'vxe-table'
|
||||
import { useXTable } from '@/hooks/web/useXTable'
|
||||
import { allSchemas } from './order.data'
|
||||
import * as OrderApi from '@/api/pay/order'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
// 列表相关的变量
|
||||
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
|
||||
const { gridOptions, exportList } = useVxeGrid<OrderApi.OrderVO>({
|
||||
const [registerTable, { exportList }] = useXTable({
|
||||
allSchemas: allSchemas,
|
||||
getListApi: OrderApi.getOrderPageApi,
|
||||
exportListApi: OrderApi.exportOrderApi
|
||||
@ -76,7 +74,7 @@ const handleCreate = () => {
|
||||
}
|
||||
// 导出操作
|
||||
const handleExport = async () => {
|
||||
await exportList(xGrid, '订单数据.xls')
|
||||
await exportList('订单数据.xls')
|
||||
}
|
||||
|
||||
// 详情操作
|
||||
|
Reference in New Issue
Block a user