|
|
@@ -12,9 +12,9 @@
|
|
|
</app-filter>
|
|
|
</template>
|
|
|
<!-- 表格数据 -->
|
|
|
- <app-table :data="dataList" v-model:columns="columns" :loading="loading">
|
|
|
+ <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading">
|
|
|
<template #header>
|
|
|
- <app-auth-operation :menus="['add']" @closed="onRefresh" />
|
|
|
+ <app-action-menu :menus="headerButtons" @click="openComponent" />
|
|
|
</template>
|
|
|
<!-- 价格 -->
|
|
|
<template #price="{ row }">
|
|
|
@@ -26,14 +26,16 @@
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template #operate="{ row }">
|
|
|
- <app-auth-operation :menus="handleTableButtons(row)" :options="{ selectedRow: row }"
|
|
|
- @closed="onRefresh" />
|
|
|
+ <app-action-menu type="dropdown" :menus="handleOperateButtons(row)" :record="row"
|
|
|
+ @click="openComponent" />
|
|
|
</template>
|
|
|
<template #footer>
|
|
|
<app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
|
|
|
@change="onRefresh" />
|
|
|
</template>
|
|
|
</app-table>
|
|
|
+ <component ref="componentRef" :is="asyncComponent" v-bind="{ selectedRow: activeMenu.record }"
|
|
|
+ @closed="closeComponent" v-if="asyncComponent" />
|
|
|
</app-view>
|
|
|
</template>
|
|
|
|
|
|
@@ -42,20 +44,27 @@ import { ElMessage } from 'element-plus'
|
|
|
import { formatDecimal } from '@/filters'
|
|
|
import { useDataFilter } from '@/hooks/datatable'
|
|
|
import { useSaleOrder } from '@/business/trade/list'
|
|
|
+import { useActionMenu } from '@pc/components/modules/action-menu'
|
|
|
+import AppActionMenu from '@pc/components/modules/action-menu/index.vue'
|
|
|
+import { useComposeTable } from '@pc/components/base/table'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
import AppPagination from '@pc/components/base/pagination/index.vue'
|
|
|
-import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'
|
|
|
import AppFilter from '@pc/components/base/table-filter/index.vue'
|
|
|
|
|
|
-const { loading, dataList, total, pageIndex, pageSize, filterData, columns, categoryList, getSaleOrderList } = useSaleOrder()
|
|
|
+const { loading, dataList, total, pageIndex, pageSize, filterData, categoryList, getSaleOrderList } = useSaleOrder()
|
|
|
+const { tableColumns } = useComposeTable<Ermcp.MySellOrderRsp>({ rowKey: 'wrtradeorderid', columnKey: 'listing_saleorder' })
|
|
|
+const { asyncComponent, activeMenu, getAuthButtons, openComponent, closeComponent } = useActionMenu<Ermcp.MySellOrderRsp>({ queryFn: () => onRefresh() })
|
|
|
const { filterOptons, getQueryParams } = useDataFilter<Ermcp.MySellOrderReq>()
|
|
|
|
|
|
+const headerButtons = getAuthButtons(['trade_sale_add'])
|
|
|
+const tableButtons = getAuthButtons(['trade_sale_details', 'trade_sale_cancel'])
|
|
|
+
|
|
|
// 3:委托成功 7:部成 - 状态有撤销
|
|
|
-const handleTableButtons = (row: Ermcp.MySellOrderRsp) => {
|
|
|
+const handleOperateButtons = (row: Ermcp.MySellOrderRsp) => {
|
|
|
if ([3, 7].includes(row.wrtradeorderstatus)) {
|
|
|
- return ['details', 'cancel']
|
|
|
+ return tableButtons
|
|
|
}
|
|
|
- return ['details']
|
|
|
+ return tableButtons.filter((e) => e.code !== 'trade_sale_cancel')
|
|
|
}
|
|
|
|
|
|
const onSearch = (clear = false) => {
|