RaoMeng 4 жил өмнө
parent
commit
62d10230fd

+ 5 - 2
uas-office-web/uas-mobile/src/components/common/bizgoblin/BarGraph.jsx

@@ -37,10 +37,13 @@ export default class BarGraph extends Component {
     }
 
     return (
-      <div className='bar-graph' style={{ width: '100%', backgroundColor: '#fff' }}>
+      <div className='bar-graph'
+           style={{ width: '100%', backgroundColor: '#fff' }}>
         <div className="ant-table-title">{SONTITLE_}</div>
         <div
-          className="ant-table-title-second">{FORMULA_KEYDISPLAY_ ? FORMULA_KEYDISPLAY_ : ''}{FORMULA_VALUEDISPLAY_} {'单位(' + FORMULA_UNIT_ + ')'}</div>
+          className="ant-table-title-second">{FORMULA_KEYDISPLAY_
+          ? FORMULA_KEYDISPLAY_
+          : ''}{FORMULA_VALUEDISPLAY_} {'单位(' + FORMULA_UNIT_ + ')'}</div>
         <Chart
           theme={{ maxColumnWidth: 20 }}
           padding={[25, 15, 40, 50]}

+ 26 - 10
uas-office-web/uas-mobile/src/components/common/bizgoblin/PieChart.jsx

@@ -4,7 +4,11 @@
  */
 
 import React, { Component } from 'react'
-import { getFloat, isEmptyObject, isObjEmpty } from '../../../utils/common/common.util'
+import {
+  getFloat,
+  isObjEmpty,
+  isObjNull,
+} from '../../../utils/common/common.util'
 import {
   Chart,
   Interval,
@@ -50,11 +54,18 @@ export default class PieChart extends Component {
     }
 
     return (
-      <div className='charts-line' style={{ width: '100%', backgroundColor: '#fff' }}>
+      <div className='charts-line'
+           style={{ width: '100%', backgroundColor: '#fff' }}>
         <div className="ant-table-title">{SONTITLE_}</div>
         <div
-          className="ant-table-title-second">{FORMULA_KEYDISPLAY_ ? FORMULA_KEYDISPLAY_ : ''}{FORMULA_VALUEDISPLAY_} {'单位(' + FORMULA_UNIT_ + ')'}</div>
-        <Chart padding={[25, 25, 25, 25]} height={300} data={data} scale={cols} autoFit>
+          className="ant-table-title-second">{FORMULA_KEYDISPLAY_
+          ? FORMULA_KEYDISPLAY_
+          : ''}{FORMULA_VALUEDISPLAY_} {(!isObjNull(FORMULA_UNIT_) &&
+          FORMULA_UNIT_ !==
+          'null') &&
+        ('单位(' + FORMULA_UNIT_ + ')')}</div>
+        <Chart padding={[25, 25, 25, 25]} height={300} data={data} scale={cols}
+               autoFit>
           <Coordinate type="theta" radius={0.75}/>
           <Tooltip showTitle={false}/>
           <Axis visible={false}/>
@@ -67,11 +78,12 @@ export default class PieChart extends Component {
               lineWidth: 1,
               stroke: '#fff',
             }}
-            label={['*', {
-              content: (data) => {
-                return `${data.xField}: ${getFloat(data.percent * 100, 4)}%`
-              },
-            }]}
+            label={[
+              '*', {
+                content: (data) => {
+                  return `${data.xField}: ${getFloat(data.percent * 100, 4)}%`
+                },
+              }]}
             tooltip={[
               'yField*xField',
               (value, name) => {
@@ -96,7 +108,11 @@ export default class PieChart extends Component {
 
     //取得百分比数
     data = data.map(function (item, index, arr) {
-      item.percent = getFloat((Number(item.yField) / ageSum), 4)
+      if (item.yField == '0') {
+        item.percent = 0
+      } else {
+        item.percent = getFloat((Number(item.yField) / ageSum), 4)
+      }
       item.yField = Number(item.yField)
       return item
     })

+ 0 - 3
uas-office-web/uas-mobile/src/components/common/currencyDetail/CurrencyDetail.jsx

@@ -552,7 +552,6 @@ class CurrencyDetail extends Component {
     let newBillGroup = this.newGridBillGroup(groupIndex,
       billGroupList[groupIndex])
     billGroupList.push(newBillGroup)
-    console.log('newgroup', billGroupList)
     this.setState({
       billGroupList,
     })
@@ -707,7 +706,6 @@ class CurrencyDetail extends Component {
    * @param billGroup
    */
   getDbfindList (billModel, billGroup) {
-    console.log(billModel)
     let fieldKey = billModel.field
     let isForm = billGroup.isForm
     let gridCaller = ''
@@ -796,7 +794,6 @@ class CurrencyDetail extends Component {
         message.error('选项数据为空')
       } else {
         mSearchList = mModalList
-        console.log(mSearchList)
         this.setState({
           modalDataSource: this.state.modalDataSource.cloneWithRows(
             mSearchList),

+ 5 - 3
uas-office-web/uas-mobile/src/components/private/kanban/KanBan.jsx

@@ -6,7 +6,7 @@
 import React, { Component } from 'react'
 import { connect } from 'react-redux'
 import CommonCharts from '../../../components/common/bizgoblin/CommonCharts'
-import { isObjEmpty } from '../../../utils/common/common.util'
+import { isObjEmpty, isObjNull } from '../../../utils/common/common.util'
 import { fetchGet } from '../../../utils/common/fetchRequest'
 import { saveChartState } from '../../../redux/actions/chartState'
 import { API } from '../../../configs/api.config'
@@ -39,7 +39,8 @@ class KanBan extends Component {
       subsData.forEach((item, index) => {
         if (!isObjEmpty(item)) {
           chartItem.push(
-            <CommonCharts chartData={item} key={index} setOverflow={true} needSum={false}/>,
+            <CommonCharts chartData={item} key={index} setOverflow={true}
+                          needSum={false}/>,
           )
         }
       })
@@ -78,7 +79,8 @@ class KanBan extends Component {
       <Empty
         key='empty-box'
         image={Empty.PRESENTED_IMAGE_SIMPLE}
-        description={<span>暂无数据,<span style={{ color: '#47a3ff' }} onClick={this.addChart}>立即添加</span></span>}
+        description={<span>暂无数据,<span style={{ color: '#47a3ff' }}
+                                      onClick={this.addChart}>立即添加</span></span>}
       />
     )
   }

+ 0 - 1
uas-office-web/uas-mobile/src/pages/private/approval/pages/ApprovalAdd.jsx

@@ -399,7 +399,6 @@ export default class ApprovalAdd extends Component {
           }
         }
       }
-      // console.log(billGroupModelList)
       this.setState({
         billGroupModelList,
         modalOpen: false,