|
@@ -1,8 +1,9 @@
|
|
|
import { PageContainer, ProTable } from "@ant-design/pro-components"
|
|
|
import { columns } from "./tableConfig"
|
|
|
import { useAjax } from "@/Hook/useAjax"
|
|
|
-import { bookCoinList } from "@/services/miniApp/consume"
|
|
|
+import { shortBookCoinList, longBookCoinList } from "@/services/miniApp/consume"
|
|
|
import { useModel } from "@umijs/max"
|
|
|
+import { useMemo } from "react"
|
|
|
|
|
|
const Page: React.FC = () => {
|
|
|
let { initialState } = useModel("@@initialState")
|
|
@@ -11,7 +12,12 @@ const Page: React.FC = () => {
|
|
|
enumList: global.state.enumList
|
|
|
}
|
|
|
})
|
|
|
- let getList = useAjax((params) => bookCoinList(params), { type: 'table' })
|
|
|
+ let getShortList = useAjax((params) => shortBookCoinList(params), { type: 'table' })
|
|
|
+ let getLongList = useAjax((params) => longBookCoinList(params), { type: 'table' })
|
|
|
+
|
|
|
+ let api = useMemo(() => {
|
|
|
+ return initialState?.selectApp?.appCategory === 1 ? getLongList : getShortList
|
|
|
+ }, [initialState?.selectApp?.appCategory])
|
|
|
return <PageContainer
|
|
|
tabProps={{ type: 'card' }}
|
|
|
>
|
|
@@ -21,14 +27,14 @@ const Page: React.FC = () => {
|
|
|
distributorId: initialState?.currentUser?.distributorId,
|
|
|
appType: initialState?.selectApp?.appType || ""
|
|
|
}}
|
|
|
- scroll={{x:true,y:500}}
|
|
|
+ scroll={{ x: true, y: 500 }}
|
|
|
headerTitle={"书币消耗列表"}
|
|
|
rowKey={(r) => r.id}
|
|
|
search={{
|
|
|
labelWidth: 120,
|
|
|
}}
|
|
|
request={async (params) => {
|
|
|
- return await getList.run(params)
|
|
|
+ return await api.run(params)
|
|
|
}}
|
|
|
columns={columns(enumList)}
|
|
|
// bordered
|