index.jsx 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. import React, { Component } from "react";
  2. import { AtModal, AtModalAction, AtModalContent, AtIcon } from "taro-ui";
  3. import { Button, Image, View } from "@tarojs/components";
  4. import Taro from "@tarojs/taro";
  5. import './index.less';
  6. // import { getListPublicReleaseLog } from '../../utils/servers/servers';
  7. import "taro-ui/dist/style/components/icon.scss";
  8. import { getClockState } from "../../utils/tools";
  9. import ImagePicker from "../common/imagePicker";
  10. import { resourceAddress } from "../../utils/config";
  11. class HistoricalClock extends Component {
  12. constructor(props) {
  13. super(props);
  14. this.state = {
  15. publicReleaseLog: []
  16. }
  17. // this.getListPublicReleaseLog = this.getListPublicReleaseLog.bind(this);
  18. }
  19. componentDidMount() {
  20. // this.getListPublicReleaseLog();
  21. }
  22. // getListPublicReleaseLog() {
  23. // Taro.showLoading({
  24. // title: '加载中...'
  25. // })
  26. // getListPublicReleaseLog({
  27. // id: this.props.id
  28. // }).then(v => {
  29. // Taro.hideLoading();
  30. // if (v.error.length === 0) {
  31. // for (let d of v.data) {
  32. // let list = [];
  33. // for (let i of (d.photoUrl || '').split(',')) {
  34. // if (i) {
  35. // list.push({ 'url': resourceAddress + i })
  36. // }
  37. // }
  38. // d.photoUrl = list;
  39. // }
  40. // this.setState({
  41. // publicReleaseLog: v.data,
  42. // })
  43. // } else {
  44. // Taro.showToast({ title: v.error[0].message, icon: 'none' })
  45. // }
  46. // }).catch(err => {
  47. // Taro.hideLoading();
  48. // Taro.showToast({ title: '系统错误.请稍后重试', icon: 'none' })
  49. // //console.log(err)
  50. // })
  51. // }
  52. render() {
  53. return (
  54. <AtModal
  55. width="90%"
  56. isOpened={this.props.isOpened}
  57. onClose={this.props.onClose}
  58. onCancel={this.props.onClose}>
  59. <AtModalContent>
  60. <View className='historicalClock'>
  61. {
  62. this.state.publicReleaseLog.map((v, k) => (
  63. <View key={k} className='item'>
  64. <View className='head'>
  65. <View className='spot' />
  66. <View className='clockTime' style={{
  67. color: getClockState(v.status, true).color
  68. }}>
  69. {getClockState(v.status, true).title}
  70. </View>
  71. </View>
  72. <View className='clockContent'>
  73. <View className='verticalLine' style={{
  74. visibility: this.state.publicReleaseLog[k + 1] ? 'visible' : 'hidden'
  75. }} />
  76. <View className='rightContent' style={{
  77. paddingBottom: this.state.publicReleaseLog[k + 1] ? '30px' : 0
  78. }}>
  79. <View className='contentItem'>
  80. <AtIcon className='atIcon' value='user' size='15' color='#999999' />
  81. 操作人:{v.aname}
  82. </View>
  83. <View className='contentItem'>
  84. <AtIcon className='atIcon' value='clock' size='15' color='#999999' />
  85. 操作时间:{v.createTimes}
  86. </View>
  87. {v.remarks ? <View className='contentItem'>
  88. <AtIcon className='atIcon' value='message' size='15' color='#999999' />
  89. 备注:{v.remarks}
  90. </View> : null}
  91. {v.photoUrl.length !== 0 ? <View className='contentItem'>
  92. <AtIcon className='atIcon' value='file-generic' size='15' color='#999999' />
  93. 附件:
  94. <ImagePicker
  95. files={v.photoUrl || []}
  96. showAddBtn={false} />
  97. </View> : null}
  98. </View>
  99. </View>
  100. </View>
  101. ))
  102. }
  103. </View>
  104. </AtModalContent>
  105. <AtModalAction>
  106. <Button onClick={this.props.onClose}>确定</Button>
  107. </AtModalAction>
  108. </AtModal>
  109. )
  110. }
  111. }
  112. export default HistoricalClock;