Просмотр исходного кода

uas手机版
待办事项空数据展示

samhoo 5 лет назад
Родитель
Сommit
33ec62b853

+ 6 - 13
uas-office-web/uas-mobile/src/components/private/kanban/KanBan.jsx

@@ -10,11 +10,7 @@ import { isObjEmpty } from '../../../utils/common/common.util'
 import { fetchGet } from '../../../utils/common/fetchRequest'
 import { saveChartState } from '../../../redux/actions/chartState'
 import { API } from '../../../configs/api.config'
-import { message } from 'antd'
-import {
-  FolderOpenOutlined,
-} from '@ant-design/icons'
-import './kanban.less'
+import { message, Empty } from 'antd'
 
 class KanBan extends Component {
 
@@ -79,14 +75,11 @@ class KanBan extends Component {
 
   getNoneElement = () => {
     return (
-      <div className="kanban-panel-nodata" key='nodata'>
-        <div className="nodata-box">
-          <FolderOpenOutlined
-            style={{ fontSize: '50px', color: '#DCDCDC' }}
-          />
-          <p>暂无数据,<span onClick={this.addChart} className="addchart">立即添加</span></p>
-        </div>
-      </div>
+      <Empty
+        key='empty-box'
+        image={Empty.PRESENTED_IMAGE_SIMPLE}
+        description={<span>暂无数据,<span style={{ color: '#47a3ff' }} onClick={this.addChart}>立即添加</span></span>}
+      />
     )
   }
 

+ 0 - 28
uas-office-web/uas-mobile/src/components/private/kanban/kanban.less

@@ -1,28 +0,0 @@
-.kanban-panel-nodata {
-  background: #fff;
-  width: 100%;
-  min-height: 190px;
-  padding: 8px;
-  position: relative;
-
-  .nodata-box {
-    position: absolute;
-    top: 44px;
-    left: 50%;
-    transform: translate(-50%);
-
-    .anticon-folder-open {
-      display: block;
-      text-align: center;
-      margin-bottom: 6px;
-    }
-
-    p {
-      color: #C0C0C0;
-
-      .addchart {
-        color: #47a3ff;
-      }
-    }
-  }
-}

+ 11 - 0
uas-office-web/uas-mobile/src/components/private/tasktodo/TaskTodoItem.jsx

@@ -7,6 +7,7 @@ import React, { Component } from 'react'
 import { connect } from 'react-redux'
 import { isObjEmpty } from '../../../utils/common/common.util'
 import TaskTodoRow from './TaskTodoRow'
+import { Empty } from 'antd'
 
 class TaskTodoItem extends Component {
 
@@ -31,6 +32,10 @@ class TaskTodoItem extends Component {
       rowList.forEach((item, index) => {
         rowItems.push(<TaskTodoRow rowObj={item} key={index}/>)
       })
+    } else if (rowList != undefined && rowList.length == 0) {
+      rowItems.push(
+        this.getNoneElement(),
+      )
     }
 
     return (
@@ -41,6 +46,12 @@ class TaskTodoItem extends Component {
       </div>
     )
   }
+
+  getNoneElement = () => {
+    return (
+      <Empty key='empty-box' image={Empty.PRESENTED_IMAGE_SIMPLE}/>
+    )
+  }
 }
 
 let mapStateToProps = (state) => ({})

+ 1 - 1
uas-office-web/uas-mobile/src/pages/private/taskTodo/TaskTodo.jsx

@@ -20,7 +20,7 @@ class TaskTodo extends Component {
     super()
 
     this.state = {
-      data: [],
+      data: undefined,
       searchValue: '',
       refreshing: false,
       height: document.documentElement.clientHeight,