update 流转日志展示

This commit is contained in:
2021-07-08 16:58:14 +08:00
parent ad50293249
commit a14ccf6399
16 changed files with 230 additions and 64 deletions

View File

@@ -1,10 +1,12 @@
import React, { Component } from 'react'
import { Spin, Steps, Timeline } from 'antd'
import { Descriptions, Spin, Steps, Timeline } from 'antd'
import { AntIcon } from 'components'
import { api } from 'common/api'
import getDictData from 'util/dic'
import { toCamelCase } from 'util/format'
const ellipsisType = [3, 4, 6]
export default class houseLog extends Component {
state = {
loading: true,
@@ -21,7 +23,11 @@ export default class houseLog extends Component {
state.codes = await getDictData('house_log_type')
if (id) {
const { data } = await api.houseLogList({ id })
state.data = data
} else if (infoId) {
const { data } = await api.houseLogListByInfoId({ id: infoId })
state.data = data
} else if (taskId) {
const { data } = await api.houseLogListByTaskId({ id: taskId })
state.data = data
@@ -51,18 +57,37 @@ export default class houseLog extends Component {
<Timeline.Item
key={i}
dot={
[
,
<AntIcon type="clock-circle" />,
<AntIcon type="check-circle" />,
][item.status]
item.type === 6 ? (
<AntIcon type="close-circle" className="text-error" />
) : (
[
,
<AntIcon type="clock-circle" />,
<AntIcon type="check-circle" className="text-success" />,
][item.status]
)
}
>
<h5 className="h5">
{this.bindCodeValue(item.type, 'house_log_type')}
</h5>
<p className="text-gray">{item.updatedTime}</p>
<p>{item.targetUserNames}</p>
<h6 className="h6">
<b>
{['等待', '正在', ''][item.status] +
this.bindCodeValue(item.type, 'house_log_type')}
</b>
</h6>
<p className="text-gray">{item.finishedTime}</p>
<Descriptions column={1} colon={false} labelStyle={{ opacity: 0.5 }}>
{item.remark && (
<Descriptions.Item>{item.remark}</Descriptions.Item>
)}
<Descriptions.Item label="操作人">
{item.targetUserNames.split(',').join(' / ')}
</Descriptions.Item>
{item.finishedUserName && (
<Descriptions.Item label="实际操作人">
{item.finishedUserName}
</Descriptions.Item>
)}
</Descriptions>
</Timeline.Item>
))}
</Timeline>