From ad50293249a3d1a297d6295d33acd0634a635d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?= <188633308@qq.com> Date: Thu, 8 Jul 2021 13:43:45 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=B5=81=E8=BD=AC=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=BD=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/business/house-log.jsx | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 web-react/src/components/business/house-log.jsx diff --git a/web-react/src/components/business/house-log.jsx b/web-react/src/components/business/house-log.jsx new file mode 100644 index 0000000..2ccf2c9 --- /dev/null +++ b/web-react/src/components/business/house-log.jsx @@ -0,0 +1,72 @@ +import React, { Component } from 'react' +import { Spin, Steps, Timeline } from 'antd' +import { AntIcon } from 'components' +import { api } from 'common/api' +import getDictData from 'util/dic' +import { toCamelCase } from 'util/format' + +export default class houseLog extends Component { + state = { + loading: true, + codes: { + houseLogType: [], + }, + data: [], + } + + async componentDidMount() { + const { id, infoId, taskId } = this.props + const state = { loading: false } + + state.codes = await getDictData('house_log_type') + + if (id) { + } else if (infoId) { + } else if (taskId) { + const { data } = await api.houseLogListByTaskId({ id: taskId }) + state.data = data + } + this.setState(state) + } + + bindCodeValue(code, name) { + name = toCamelCase(name) + const codes = this.state.codes[name] + if (codes) { + const c = codes.find(p => p.code == code) + if (c) { + return c.value + } + } + return null + } + + render() { + const { loading, codes, data } = this.state + + return ( + }> + + {data.map((item, i) => ( + , + , + ][item.status] + } + > +
+ {this.bindCodeValue(item.type, 'house_log_type')} +
+

{item.updatedTime}

+

{item.targetUserNames}

+
+ ))} +
+
+ ) + } +}