|
|
@@ -12,19 +12,36 @@ import {
|
|
|
modalTitleEnum
|
|
|
} from '@/pages/Product/Cloud/components/Detail/UpgradeModal'
|
|
|
import { apiRoadPricingUpgradeV2 } from '@/services/product'
|
|
|
+import { dayjsFormat } from '@/utils/utils'
|
|
|
|
|
|
const PersonalTabList = props => {
|
|
|
const {
|
|
|
- compilationList,
|
|
|
- cloudUser: { online_list = [], mobile, username },
|
|
|
+ // compilationList,
|
|
|
+ cloudUser: {
|
|
|
+ // online_list = [],
|
|
|
+ mobile,
|
|
|
+ username,
|
|
|
+ proCptList
|
|
|
+ },
|
|
|
projectType,
|
|
|
ssoId,
|
|
|
actionPayload = { main: 'personal' }
|
|
|
} = props
|
|
|
+ console.log(proCptList)
|
|
|
const isUpgradeEnum = {
|
|
|
true: '已升级',
|
|
|
undefined: ''
|
|
|
}
|
|
|
+ const salesTypeEnum = {
|
|
|
+ GIFT: 'gift',
|
|
|
+ SALES: 'sales',
|
|
|
+ LEND: 'lend'
|
|
|
+ }
|
|
|
+ const salesTypeTitle = {
|
|
|
+ gift: '赠送',
|
|
|
+ sales: '销售',
|
|
|
+ lend: '借出'
|
|
|
+ }
|
|
|
const { TabPane } = Tabs
|
|
|
const dispatch = useDispatch()
|
|
|
const [roadPricingUpgradev2, setRoadPricingUpgradev2] = useState({
|
|
|
@@ -34,6 +51,7 @@ const PersonalTabList = props => {
|
|
|
upgradeTypeEnum: '',
|
|
|
compilationListName: '',
|
|
|
deadline: '',
|
|
|
+ salesType: '',
|
|
|
lockTypeEnum: '',
|
|
|
visible: false,
|
|
|
loading: false
|
|
|
@@ -64,47 +82,23 @@ const PersonalTabList = props => {
|
|
|
},
|
|
|
{
|
|
|
title: '状态',
|
|
|
- dataIndex: 'lock',
|
|
|
+ dataIndex: 'salesType',
|
|
|
onFilter: true,
|
|
|
width: '8%',
|
|
|
- render: lock => <span>{isUpgradeEnum[lock]}</span>
|
|
|
- },
|
|
|
- {
|
|
|
- title: '专业版',
|
|
|
- dataIndex: 'isUpgrade',
|
|
|
- width: '10%',
|
|
|
- render: isUpgrade => <span>{isUpgradeEnum[isUpgrade]}</span>
|
|
|
+ render: salesType => <span>{salesTypeTitle[salesType]}</span>
|
|
|
},
|
|
|
{
|
|
|
title: '限期',
|
|
|
dataIndex: 'deadline',
|
|
|
- width: '10%'
|
|
|
+ width: '10%',
|
|
|
+ render: text => dayjsFormat(text, 'YYYY-MM-DD HH:mm')
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
|
width: '25%',
|
|
|
render: (_, record) => (
|
|
|
<>
|
|
|
- <Button
|
|
|
- type="primary"
|
|
|
- ghost
|
|
|
- size="small"
|
|
|
- className="m-2px"
|
|
|
- onClick={() =>
|
|
|
- setRoadPricingUpgradev2({
|
|
|
- ...setRoadPricingUpgradev2,
|
|
|
- visible: true,
|
|
|
- type: titleType.GIVE,
|
|
|
- // eslint-disable-next-line no-underscore-dangle
|
|
|
- compilationId: record._id,
|
|
|
- compilationName: record.name,
|
|
|
- lockTypeEnum: lockTypeEnum.GIVE,
|
|
|
- upgradeTypeEnum: upgradeTypeEnum.UPGRADE
|
|
|
- })
|
|
|
- }>
|
|
|
- 赠送
|
|
|
- </Button>
|
|
|
- {record.lock === 1 ? (
|
|
|
+ {record.activated ? (
|
|
|
<>
|
|
|
<Button
|
|
|
type="primary"
|
|
|
@@ -116,8 +110,9 @@ const PersonalTabList = props => {
|
|
|
...setRoadPricingUpgradev2,
|
|
|
visible: true,
|
|
|
type: titleType.SALE,
|
|
|
+ salesType: salesTypeEnum.SALES,
|
|
|
// eslint-disable-next-line no-underscore-dangle
|
|
|
- compilationId: record._id,
|
|
|
+ compilationId: record.ID,
|
|
|
compilationName: record.name,
|
|
|
lockTypeEnum: lockTypeEnum.SALE,
|
|
|
upgradeTypeEnum: upgradeTypeEnum.UPGRADE
|
|
|
@@ -125,10 +120,6 @@ const PersonalTabList = props => {
|
|
|
}>
|
|
|
销售
|
|
|
</Button>
|
|
|
- </>
|
|
|
- ) : null}
|
|
|
- {record.isUpgrade ? (
|
|
|
- <>
|
|
|
<Button
|
|
|
type="primary"
|
|
|
ghost
|
|
|
@@ -138,19 +129,63 @@ const PersonalTabList = props => {
|
|
|
setRoadPricingUpgradev2({
|
|
|
...setRoadPricingUpgradev2,
|
|
|
visible: true,
|
|
|
- type: titleType.DEMOTION,
|
|
|
+ salesType: salesTypeEnum.GIFT,
|
|
|
+ type: titleType.GIVE,
|
|
|
// eslint-disable-next-line no-underscore-dangle
|
|
|
- compilationId: record._id,
|
|
|
+ compilationId: record.ID,
|
|
|
compilationName: record.name,
|
|
|
- compilationListName: record.name,
|
|
|
- upgradeTypeEnum: upgradeTypeEnum.DEMOTION
|
|
|
+ lockTypeEnum: lockTypeEnum.GIVE,
|
|
|
+ upgradeTypeEnum: upgradeTypeEnum.UPGRADE
|
|
|
})
|
|
|
}>
|
|
|
- 降级
|
|
|
+ 赠送
|
|
|
</Button>
|
|
|
<Button
|
|
|
type="primary"
|
|
|
ghost
|
|
|
+ size="small"
|
|
|
+ className="m-2px"
|
|
|
+ onClick={() =>
|
|
|
+ setRoadPricingUpgradev2({
|
|
|
+ ...setRoadPricingUpgradev2,
|
|
|
+ visible: true,
|
|
|
+ type: titleType.LEND,
|
|
|
+ salesType: salesTypeEnum.LEND,
|
|
|
+ compilationId: record.ID,
|
|
|
+ compilationName: record.name,
|
|
|
+ lockTypeEnum: lockTypeEnum.LEND,
|
|
|
+ upgradeTypeEnum: upgradeTypeEnum.UPGRADE
|
|
|
+ })
|
|
|
+ }>
|
|
|
+ 借出
|
|
|
+ </Button>
|
|
|
+ </>
|
|
|
+ ) : null}
|
|
|
+ {/* <Button
|
|
|
+ type="primary"
|
|
|
+ ghost
|
|
|
+ size="small"
|
|
|
+ className="m-2px"
|
|
|
+ onClick={() =>
|
|
|
+ setRoadPricingUpgradev2({
|
|
|
+ ...setRoadPricingUpgradev2,
|
|
|
+ visible: true,
|
|
|
+ salesType: salesTypeEnum.GIFT,
|
|
|
+ type: titleType.GIVE,
|
|
|
+ // eslint-disable-next-line no-underscore-dangle
|
|
|
+ compilationId: record.ID,
|
|
|
+ compilationName: record.name,
|
|
|
+ lockTypeEnum: lockTypeEnum.GIVE,
|
|
|
+ upgradeTypeEnum: upgradeTypeEnum.UPGRADE
|
|
|
+ })
|
|
|
+ }>
|
|
|
+ 赠送
|
|
|
+ </Button> */}
|
|
|
+ {/* {record.isUpgrade ? (
|
|
|
+ <>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ ghost
|
|
|
danger
|
|
|
size="small"
|
|
|
onClick={() =>
|
|
|
@@ -160,7 +195,7 @@ const PersonalTabList = props => {
|
|
|
type: titleType.DEADLINE,
|
|
|
deadline: record.deadline,
|
|
|
// eslint-disable-next-line no-underscore-dangle
|
|
|
- compilationId: record._id,
|
|
|
+ compilationId: record.ID,
|
|
|
compilationName: record.name,
|
|
|
compilationListName: record.name,
|
|
|
lockTypeEnum: record.lock,
|
|
|
@@ -182,7 +217,8 @@ const PersonalTabList = props => {
|
|
|
...setRoadPricingUpgradev2,
|
|
|
visible: true,
|
|
|
type: titleType.LEND,
|
|
|
- compilationId: record._id,
|
|
|
+ salesType: salesTypeEnum.LEND,
|
|
|
+ compilationId: record.ID,
|
|
|
compilationName: record.name,
|
|
|
lockTypeEnum: lockTypeEnum.LEND,
|
|
|
upgradeTypeEnum: upgradeTypeEnum.UPGRADE
|
|
|
@@ -200,7 +236,8 @@ const PersonalTabList = props => {
|
|
|
...setRoadPricingUpgradev2,
|
|
|
visible: true,
|
|
|
type: titleType.SALE,
|
|
|
- compilationId: record._id,
|
|
|
+ salesType: salesTypeEnum.SALES,
|
|
|
+ compilationId: record.ID,
|
|
|
compilationName: record.name,
|
|
|
lockTypeEnum: lockTypeEnum.SALE,
|
|
|
upgradeTypeEnum: upgradeTypeEnum.UPGRADE
|
|
|
@@ -209,23 +246,23 @@ const PersonalTabList = props => {
|
|
|
销售
|
|
|
</Button>
|
|
|
</>
|
|
|
- )}
|
|
|
+ )} */}
|
|
|
</>
|
|
|
)
|
|
|
}
|
|
|
]
|
|
|
- const columnOnline = [
|
|
|
- {
|
|
|
- title: '日期',
|
|
|
- dataIndex: 'dateString',
|
|
|
- width: '12%'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '时长',
|
|
|
- dataIndex: 'online_times',
|
|
|
- width: '17%'
|
|
|
- }
|
|
|
- ]
|
|
|
+ // const columnOnline = [
|
|
|
+ // {
|
|
|
+ // title: '日期',
|
|
|
+ // dataIndex: 'dateString',
|
|
|
+ // width: '12%'
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // title: '时长',
|
|
|
+ // dataIndex: 'online_times',
|
|
|
+ // width: '17%'
|
|
|
+ // }
|
|
|
+ // ]
|
|
|
return (
|
|
|
<div>
|
|
|
<div className="pl-15px">
|
|
|
@@ -237,13 +274,13 @@ const PersonalTabList = props => {
|
|
|
columns={columns}
|
|
|
search={false}
|
|
|
toolBarRender={false}
|
|
|
- rowKey={record => record._id}
|
|
|
- dataSource={compilationList}
|
|
|
+ rowKey={record => record.ID}
|
|
|
+ dataSource={proCptList}
|
|
|
pagination={false}
|
|
|
/>
|
|
|
</div>
|
|
|
</TabPane>
|
|
|
- <TabPane tab="在线时长" key="在线时长">
|
|
|
+ {/* <TabPane tab="在线时长" key="在线时长">
|
|
|
<div className="sheet-right-panel">
|
|
|
<ProTable
|
|
|
size="small"
|
|
|
@@ -255,7 +292,7 @@ const PersonalTabList = props => {
|
|
|
pagination={false}
|
|
|
/>
|
|
|
</div>
|
|
|
- </TabPane>
|
|
|
+ </TabPane> */}
|
|
|
</Tabs>
|
|
|
</div>
|
|
|
<UpgradeModalv2
|