Procházet zdrojové kódy

Merge branches 'dev' and 'master' of ssh://10.10.100.21/source/uas-office-integration into dev

samhoo před 5 roky
rodič
revize
40746cdbd3
18 změnil soubory, kde provedl 110 přidání a 157 odebrání
  1. 7 5
      uas-office-web/uas-mobile/src/components/common/currencyList/CurrencyList.jsx
  2. 5 1
      uas-office-web/uas-mobile/src/components/common/currencyList/currency-list-item.less
  3. 2 1
      uas-office-web/uas-mobile/src/components/common/loading/PageLoading.jsx
  4. 20 4
      uas-office-web/uas-mobile/src/configs/antd.config.less
  5. 4 3
      uas-office-web/uas-mobile/src/configs/api.config.js
  6. 2 2
      uas-office-web/uas-mobile/src/pages/private/approval/components/LoadingMore.jsx
  7. 0 35
      uas-office-web/uas-mobile/src/pages/private/approval/components/PageLoading.jsx
  8. 0 72
      uas-office-web/uas-mobile/src/pages/private/approval/components/RefreshLayout.jsx
  9. 1 1
      uas-office-web/uas-mobile/src/pages/private/approval/pages/ApprovalHome.jsx
  10. 9 8
      uas-office-web/uas-mobile/src/pages/private/homePage/DocRoot.jsx
  11. 9 4
      uas-office-web/uas-mobile/src/pages/private/homePage/ReportRoot.jsx
  12. 1 1
      uas-office-web/uas-mobile/src/pages/private/report/report.less
  13. 5 3
      uas-office-web/uas-mobile/src/pages/private/schedulePage/ConferenceDetail.jsx
  14. 35 17
      uas-office-web/uas-mobile/src/pages/private/subscribe/SubscribeList.jsx
  15. 1 0
      uas-office-web/uas-mobile/src/redux/reducers/redDocState.js
  16. 1 0
      uas-office-web/uas-mobile/src/redux/reducers/redReportState.js
  17. 4 0
      uas-office-web/uas-mobile/src/utils/private/report.util.js
  18. 4 0
      uas-office-web/uas-mobile/src/utils/private/services.util.js

+ 7 - 5
uas-office-web/uas-mobile/src/components/common/currencyList/CurrencyList.jsx

@@ -62,10 +62,12 @@ class CurrencyList extends Component {
       }),
     })
     setTimeout(() => {
-      this.setState({
-        height: document.documentElement.clientHeight -
-          ReactDOM.findDOMNode(this.lv).offsetTop,
-      })
+      if (ReactDOM.findDOMNode(this.lv)) {
+        this.setState({
+          height: document.documentElement.clientHeight -
+            ReactDOM.findDOMNode(this.lv).offsetTop,
+        })
+      }
     }, 400)
 
     const {
@@ -124,8 +126,8 @@ class CurrencyList extends Component {
     const {
       listDataSource,
       height,
-      hasNextPage,
       filterOpen,
+      hasNextPage,
       isEmpty,
     } = this.state
 

+ 5 - 1
uas-office-web/uas-mobile/src/components/common/currencyList/currency-list-item.less

@@ -23,12 +23,16 @@
 
   .currency-row-value {
     flex: 1;
-    max-height: 80px;
+    max-height: 120px;
     padding-left: 10px;
     overflow: auto;
     word-wrap: break-word;
     word-break: normal;
     color: @com-text-color-normal;
+
+    &::-webkit-scrollbar {
+      display: none;
+    }
   }
 }
 

+ 2 - 1
uas-office-web/uas-mobile/src/components/common/loading/PageLoading.jsx

@@ -26,9 +26,10 @@ export default class PageLoading extends Component {
         flexDirection: 'column',
         alignItems: 'center',
         justifyContent: 'center',
+        padding: '24px',
       }}>
         <ActivityIndicator size="large"/>
-        <span style={{ marginTop: 8 }}>页面加载中</span>
+        {/*<span style={{ marginTop: 8 }}>数据加载中</span>*/}
       </div>
     )
   }

+ 20 - 4
uas-office-web/uas-mobile/src/configs/antd.config.less

@@ -50,8 +50,10 @@
   white-space: normal !important;
 }
 
-.am-list-view-scrollview::-webkit-scrollbar {
-  display: none;
+.am-list-view-scrollview {
+  &::-webkit-scrollbar {
+    display: none;
+  }
 }
 
 /********************Button按钮的样式***********************/
@@ -66,6 +68,12 @@
   min-height: 100%;
 }
 
+.am-pull-to-refresh {
+  &::-webkit-scrollbar {
+    display: none;
+  }
+}
+
 /********************图表的title***********************/
 .ant-table-title {
   font-size: 14px !important;
@@ -160,6 +168,14 @@
 
 /*************************弹框**************************/
 
-.am-modal-wrap-popup::-webkit-scrollbar {
-  display: none;
+.am-modal-wrap-popup {
+  &::-webkit-scrollbar {
+    display: none;
+  }
+}
+
+.am-modal-body {
+  &::-webkit-scrollbar {
+    display: none;
+  }
 }

+ 4 - 3
uas-office-web/uas-mobile/src/configs/api.config.js

@@ -4,9 +4,10 @@
  */
 
 export const _host = window.location.origin
-  // && 'http://10.1.7.44:8081/erp'//吴雨骁
-  // && 'http://10.1.7.137:8090/ERP'//吴炳
-  // && 'http://usoft.f3322.net:10007/uas'
+// && 'http://10.1.7.44:8081/erp'//吴雨骁
+// && 'http://10.1.7.137:8090/ERP'//吴炳
+// && 'http://usoft.f3322.net:10007/uas'
+// && 'http://erp.yitoa.com:8888/ERP/'
 
 export const _baseURL = _host + (process.env.REACT_APP_ROUTER_BASE_NAME || '')
 

+ 2 - 2
uas-office-web/uas-mobile/src/pages/private/approval/components/LoadingMore.jsx

@@ -4,7 +4,7 @@
  */
 
 import React, { Component } from 'react'
-import { Icon } from 'antd'
+import { LoadingOutlined } from '@ant-design/icons'
 
 export default class LoadingMore extends Component {
 
@@ -20,7 +20,7 @@ export default class LoadingMore extends Component {
   render () {
     return (
       <div className='common-load-more'>
-        <Icon type="loading" theme="outlined"/>
+        <LoadingOutlined/>
         <span style={{ marginLeft: '10px' }}>正在加载</span>
       </div>
     )

+ 0 - 35
uas-office-web/uas-mobile/src/pages/private/approval/components/PageLoading.jsx

@@ -1,35 +0,0 @@
-/**
- * Created by RaoMeng on 2020/3/4
- * Desc: 页面加载组件
- */
-
-import React, { Component } from 'react'
-import { ActivityIndicator } from 'antd-mobile'
-
-export default class PageLoading extends Component {
-
-  constructor () {
-    super()
-
-    this.state = {}
-  }
-
-  componentDidMount () {
-  }
-
-  render () {
-    return (
-      <div style={{
-        width: '100%',
-        height: '100%',
-        display: 'flex',
-        flexDirection: 'column',
-        alignItems: 'center',
-        justifyContent: 'center',
-      }}>
-        <ActivityIndicator size="large"/>
-        <span style={{ marginTop: 8 }}>页面加载中</span>
-      </div>
-    )
-  }
-}

+ 0 - 72
uas-office-web/uas-mobile/src/pages/private/approval/components/RefreshLayout.jsx

@@ -1,72 +0,0 @@
-/**
- * Created by RaoMeng on 2018/12/1
- * Desc: antd刷新组件二次封装
- */
-
-import React, {Component} from 'react'
-import {PullToRefresh} from "antd-mobile";
-import PropTypes from 'prop-types'
-
-export default class RefreshLayout extends Component {
-
-    static propTypes = {
-        direction: PropTypes.string,//刷新方向:up或down,默认up
-        refreshing: PropTypes.bool.isRequired,//是否正在刷新
-        style: PropTypes.object,//样式,有默认样式一般可以不传
-        onRefresh: PropTypes.func.isRequired,//加载方法,必传
-        damping: PropTypes.number,//加载距离,不用传
-        distanceToRefresh: PropTypes.number,//可拉动距离,不用传
-        height:PropTypes.number,//组件高度,一般不用传
-    }
-
-    static defaultProps = {
-        direction: 'up',
-        damping: 120,
-        distanceToRefresh: 30
-    }
-
-    constructor() {
-        super()
-
-        this.state = {
-            height: document.documentElement.clientHeight
-        }
-    }
-
-    componentDidMount() {
-        setTimeout(() => {
-            if (this.props.height) {
-                this.setState({
-                    height: this.props.height,
-                })
-            } else {
-                // const hei = this.state.height - ReactDOM.findDOMNode(this.ptr).offsetTop;
-                // this.setState({
-                //     height: hei
-                // })
-            }
-        }, 0);
-    }
-
-    render() {
-        const {height} = this.state
-        const {direction, refreshing,style, onRefresh, damping, distanceToRefresh} = this.props
-
-        return (
-            <PullToRefresh
-                direction={direction}
-                refreshing={refreshing}
-                ref={el => this.ptr = el}
-                style={{
-                    height: height,
-                    overflow: 'auto',
-                    ...style
-                }}
-                damping={damping}
-                distanceToRefresh={distanceToRefresh}
-                onRefresh={onRefresh}>
-                {this.props.children}
-            </PullToRefresh>
-        )
-    }
-}

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

@@ -58,7 +58,7 @@ class ApprovalHome extends Component {
 
   componentDidMount () {
     mMaster = this.props.match.params.master
-    document.title = 'U审批'
+    document.title = '审批'
 
     const { homeState } = this.props
     let { newState, receiveState, sendState, selectedTab } = homeState

+ 9 - 8
uas-office-web/uas-mobile/src/pages/private/homePage/DocRoot.jsx

@@ -8,12 +8,10 @@ import { connect } from 'react-redux'
 import { isObjEmpty } from '../../../utils/common/common.util'
 import FuncGroup from '../../../components/common/func/FuncGroup'
 import { requestServices } from '../../../utils/private/services.util'
-import RefreshLayout
-  from '../../../components/common/refreshLayout/RefreshLayout'
 import { PullToRefresh } from 'antd-mobile'
-import { GlobalEvent } from '../../../utils/common/eventbus/eventbus'
-import { EVENT_DOC_FUNC_COUNT } from '../../../utils/common/eventbus/events.types'
 import { refreshDocList } from '../../../redux/actions/docState'
+import { Empty } from 'antd'
+import PageLoading from '../../../components/common/loading/PageLoading'
 
 class DocRoot extends Component {
 
@@ -35,10 +33,10 @@ class DocRoot extends Component {
   }
 
   render () {
-    const { docState } = this.props
+    const { docState: { docFuncGroupList, docEmpty } } = this.props
     const funcGroupItems = []
-    if (!isObjEmpty(docState, docState.docFuncGroupList)) {
-      docState.docFuncGroupList.forEach((item, index) => {
+    if (!isObjEmpty(docFuncGroupList)) {
+      docFuncGroupList.forEach((item, index) => {
         funcGroupItems.push(
           <FuncGroup
             funcGroup={item}
@@ -58,7 +56,10 @@ class DocRoot extends Component {
         refreshing={this.state.refreshing}
         onRefresh={this.refreshFunc}
         className='doc-root'>
-        {funcGroupItems}
+        {funcGroupItems.length > 0 ?
+          funcGroupItems :
+          docEmpty ? <Empty image={Empty.PRESENTED_IMAGE_SIMPLE}/> :
+            this.state.refreshing ? '' : <PageLoading/>}
       </PullToRefresh>
     )
   }

+ 9 - 4
uas-office-web/uas-mobile/src/pages/private/homePage/ReportRoot.jsx

@@ -8,8 +8,10 @@ import { withRouter } from 'react-router-dom'
 import { connect } from 'react-redux'
 import FuncGroup from '../../../components/common/func/FuncGroup'
 import { isObjEmpty } from '../../../utils/common/common.util'
-import { SearchBar, PullToRefresh } from 'antd-mobile'
+import { SearchBar, PullToRefresh, ActivityIndicator } from 'antd-mobile'
 import { requestReportFunc } from '../../../utils/private/report.util'
+import { Empty } from 'antd'
+import PageLoading from '../../../components/common/loading/PageLoading'
 
 class ReportRoot extends Component {
 
@@ -30,8 +32,8 @@ class ReportRoot extends Component {
   }
 
   render () {
-    const { reportState: { reportFuncGroupList, recentUse } } = this.props
-    const funcGroupItems = []
+    const { reportState: { reportFuncGroupList, recentUse, reportEmpty } } = this.props
+    let funcGroupItems = []
     if (!isObjEmpty(recentUse)) {
       const recentItem = {
         groupTitle: '最近查询',
@@ -73,7 +75,10 @@ class ReportRoot extends Component {
           onRefresh={this.refreshFunc}
           className='report-func-root'
         >
-          {funcGroupItems}
+          {funcGroupItems.length > 0 ?
+            funcGroupItems :
+            reportEmpty ? <Empty image={Empty.PRESENTED_IMAGE_SIMPLE}/> :
+              this.state.refreshing ? '' : <PageLoading/>}
         </PullToRefresh>
       </div>
     )

+ 1 - 1
uas-office-web/uas-mobile/src/pages/private/report/report.less

@@ -16,7 +16,7 @@
 
 .report-detail-root {
   width: 100%;
-  height: 80vh;
+  max-height: 80vh;
   background-color: white;
   overflow: auto;
   display: flex;

+ 5 - 3
uas-office-web/uas-mobile/src/pages/private/schedulePage/ConferenceDetail.jsx

@@ -10,7 +10,8 @@ import { message } from 'antd'
 import { isObjEmpty } from '../../../utils/common/common.util'
 import { API } from '../../../configs/api.config'
 import { fetchPostObj } from '../../../utils/common/fetchRequest'
-import CurrencyDetail from '../../../components/common/currencyDetail/CurrencyDetail'
+import CurrencyDetail
+  from '../../../components/common/currencyDetail/CurrencyDetail'
 import FormInput from '../../../components/common/formNew/FormInput'
 import './conference-detail.less'
 
@@ -111,9 +112,10 @@ class ConferenceDetail extends Component {
 
   onDataLoadComplete = (billGroupList) => {
     if (billGroupList && billGroupList[0] && billGroupList[0].showBillFields) {
-      for (let index = 0; index < billGroupList[0].showBillFields.length; index++) {
+      for (let index = 0; index <
+      billGroupList[0].showBillFields.length; index++) {
         const item = billGroupList[0].showBillFields[index]
-        if (item.caption === '与会人员') {
+        if (item.caption === '与会人员' || item.caption === '参会人员') {
           billGroupList[0].showBillFields.splice(index, 1)
           break
         }

+ 35 - 17
uas-office-web/uas-mobile/src/pages/private/subscribe/SubscribeList.jsx

@@ -12,8 +12,8 @@ import { isObjEmpty } from '../../../utils/common/common.util'
 import SubscribeGroup
   from '../../../components/private/subscribe/SubscribeGroup'
 import { fetchPostObj } from '../../../utils/common/fetchRequest'
-import { _baseURL, _host, API } from '../../../configs/api.config'
-import { message } from 'antd'
+import { API } from '../../../configs/api.config'
+import { Empty, message } from 'antd'
 import { saveListState } from '../../../redux/actions/listState'
 import { LIST_PAGE_SIZE } from '../../../configs/constans.config'
 
@@ -27,7 +27,8 @@ class SubscribeList extends Component {
 
     this.state = {
       refreshing: true,
-      // hasNextPage: true,
+      hasNextPage: true,
+      isEmpty: false,
       height: document.documentElement.clientHeight,
       subscribeDataSource: new ListView.DataSource({
         rowHasChanged: (row1, row2) => row1 !== row2,
@@ -41,6 +42,7 @@ class SubscribeList extends Component {
     this.setState({
       height: hei,
       refreshing: false,
+      isEmpty: false,
     })
     if (this.props.listState && !isObjEmpty(this.props.listState.listData)) {
       mPageIndex = this.props.listState.pageIndex
@@ -48,14 +50,14 @@ class SubscribeList extends Component {
       this.setState({
           subscribeDataSource: this.state.subscribeDataSource.cloneWithRows(
             mSubscribeList),
-          // hasNextPage: this.props.listState.hasNextPage,
+          hasNextPage: this.props.listState.hasNextPage,
         },
         () => {
           ReactDOM.findDOMNode(
             this.lv).scrollTop = this.props.listState.scrollTop
-          // if (this.state.hasNextPage) {
-          this.loadSubscribeList()
-          // }
+          if (this.state.hasNextPage) {
+            this.loadSubscribeList()
+          }
         },
       )
     } else {
@@ -70,7 +72,13 @@ class SubscribeList extends Component {
   }
 
   render () {
-    const { subscribeDataSource, height } = this.state
+    const {
+      subscribeDataSource,
+      height,
+      hasNextPage,
+      isEmpty,
+    } = this.state
+
     const refreshLayout = this.getRefreshLayout()
     return (
       <div className='com-column-flex'>
@@ -79,7 +87,10 @@ class SubscribeList extends Component {
           dataSource={subscribeDataSource}
           initialListSize={LIST_PAGE_SIZE}
           renderFooter={() => {
-            return <LoadingMore/>
+            return (
+              hasNextPage ? <LoadingMore/> :
+                (isEmpty ? <Empty image={Empty.PRESENTED_IMAGE_SIMPLE}/> : '')
+            )
           }}
           renderRow={(rowData, sectionID, rowID) => {
             return <SubscribeGroup
@@ -105,6 +116,8 @@ class SubscribeList extends Component {
       onRefresh={() => {
         this.setState({
           refreshing: true,
+          isEmpty: false,
+          hasNextPage: true,
         })
         mPageIndex = 0
         mSubscribeList = []
@@ -145,11 +158,19 @@ class SubscribeList extends Component {
         this.setState({
           subscribeDataSource: this.state.subscribeDataSource.cloneWithRows(
             mSubscribeList),
-          refreshing: false,
+          hasNextPage: response.data.list.length >= LIST_PAGE_SIZE,
+          isEmpty: false,
         })
       } else {
         mPageIndex--
+        this.setState({
+          hasNextPage: false,
+          isEmpty: mPageIndex === 0,
+        })
       }
+      this.setState({
+        refreshing: false,
+      })
     }).catch(error => {
       mPageIndex--
       if (typeof error === 'string') {
@@ -178,14 +199,11 @@ class SubscribeList extends Component {
         scrollTop: ReactDOM.findDOMNode(this.lv).scrollTop,
         pageIndex: mPageIndex,
         listData: mSubscribeList,
+        hasNextPage: this.state.hasNextPage,
       })
-      // window.open(
-      //   _baseURL + '/common/charts/mobileCharts.action?numId=' + subObj.NUM_ID_
-      //   + '&mainId=' + subObj.INSTANCE_ID_
-      //   + '&insId=' + subObj.ID_
-      //   + '&title=' + subObj.TITLE_, '_self',
-      // )
-      this.props.history.push('/subscribeChart/' + subObj.ID_ + '/' + subObj.NUM_ID_ + '/' + subObj.INSTANCE_ID_)
+      this.props.history.push(
+        '/subscribeChart/' + subObj.ID_ + '/' + subObj.NUM_ID_ + '/' +
+        subObj.INSTANCE_ID_)
     }
   }
 }

+ 1 - 0
uas-office-web/uas-mobile/src/redux/reducers/redDocState.js

@@ -11,6 +11,7 @@ import { isObjEmpty } from '../../utils/common/common.util'
 
 const initDocState = {
   docFuncGroupList: [],
+  docEmpty: false,
 }
 
 const redDocState = (state = initDocState, action) => {

+ 1 - 0
uas-office-web/uas-mobile/src/redux/reducers/redReportState.js

@@ -11,6 +11,7 @@ import {
 const initReportState = {
   reportFuncGroupList: [],//报表菜单
   recentUse: [],//最近使用
+  reportEmpty: false,
 }
 
 const redReportState = (state = initReportState, action) => {

+ 4 - 0
uas-office-web/uas-mobile/src/utils/private/report.util.js

@@ -18,6 +18,9 @@ import { FUNC_TYPE_REPORT } from '../../configs/constans.config'
  * 获取报表菜单
  */
 export function requestReportFunc () {
+  refreshReportList({
+    reportEmpty: false,
+  })
   return fetchGet(API.REPORT_QUERYREPORTLIST).then(response => {
     Toast.hide()
     analysisReportList(response)
@@ -88,6 +91,7 @@ export const analysisReportList = (response) => {
   refreshReportList({
     reportFuncGroupList,
     recentUse,
+    reportEmpty: isObjEmpty(reportFuncGroupList) && isObjEmpty(recentUse),
   })
 }
 

+ 4 - 0
uas-office-web/uas-mobile/src/utils/private/services.util.js

@@ -15,6 +15,9 @@ import { FUNC_TYPE_DOC } from '../../configs/constans.config'
  * 获取应用列表
  */
 export function requestServices () {
+  refreshDocList({
+    docEmpty: false,
+  })
   return fetchPostObj(API.APPCOMMON_GETSERVICE, {
     kind: 'uasapp',
   }).then(response => {
@@ -92,5 +95,6 @@ export const analysisDocList = (response) => {
 
   refreshDocList({
     docFuncGroupList,
+    docEmpty: isObjEmpty(docFuncGroupList),
   })
 }