|
|
@@ -5,7 +5,7 @@ import { dayjsFormat, refactorSortField } from '@/utils/utils'
|
|
|
import { queryRoadpricingList } from '@/services/product'
|
|
|
import { Input, Tag, Tooltip } from 'antd'
|
|
|
import consts from '@/consts'
|
|
|
-import { useSelector, useDispatch } from 'umi'
|
|
|
+import { useLocation, useSelector, useDispatch } from 'umi'
|
|
|
|
|
|
export const roadpricingEnum = {
|
|
|
CURING: 1, // 养护云
|
|
|
@@ -14,7 +14,9 @@ export const roadpricingEnum = {
|
|
|
GS: 4 // 大司空概算
|
|
|
}
|
|
|
|
|
|
-export const CloudTable = ({ columnStateType }) => {
|
|
|
+const Cloud = () => {
|
|
|
+ const { pathname = '' } = useLocation()
|
|
|
+ const columnStateType = pathname?.match(/\/([^/]*)$/)[1]?.toUpperCase()
|
|
|
const dispatch = useDispatch()
|
|
|
const { cloud } = useSelector(state => ({
|
|
|
cloud: state.cloud,
|
|
|
@@ -130,7 +132,7 @@ export const CloudTable = ({ columnStateType }) => {
|
|
|
{record.online_list?.map(
|
|
|
(item, i) =>
|
|
|
i < 10 && (
|
|
|
- <div className="flex justify-between">
|
|
|
+ <div className="flex justify-between" key={item.dateString}>
|
|
|
<span>{item.online_times}</span>
|
|
|
<span className="ml-4">{item.dateString}</span>
|
|
|
</div>
|
|
|
@@ -245,8 +247,4 @@ export const CloudTable = ({ columnStateType }) => {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
-const Building = () => {
|
|
|
- return <CloudTable columnStateType="BUILDING" />
|
|
|
-}
|
|
|
-
|
|
|
-export default Building
|
|
|
+export default Cloud
|