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

uas手机版
通用列表item数据传递

RaoMeng 5 лет назад
Родитель
Сommit
ad4c8de326
26 измененных файлов с 126 добавлено и 92 удалено
  1. 2 2
      uas-office-web/uas-mobile/src/components/common/currencyListItem/CurrencyListItem.jsx
  2. 5 2
      uas-office-web/uas-mobile/src/components/common/currencyListItem/CurrencyRow.jsx
  3. 1 1
      uas-office-web/uas-mobile/src/components/common/formNew/FormInput.jsx
  4. 1 1
      uas-office-web/uas-mobile/src/components/common/formNew/FormTitle.jsx
  5. 1 1
      uas-office-web/uas-mobile/src/components/common/func/FuncGroup.jsx
  6. 14 1
      uas-office-web/uas-mobile/src/components/common/func/FuncItem.jsx
  7. 4 3
      uas-office-web/uas-mobile/src/components/common/mainHeader/MainHeader.jsx
  8. 1 1
      uas-office-web/uas-mobile/src/components/common/uploadEnclosure/UploadEnclosure.jsx
  9. 1 1
      uas-office-web/uas-mobile/src/components/private/kanban/KanBan.jsx
  10. 1 1
      uas-office-web/uas-mobile/src/components/private/profile/ProfileCard.jsx
  11. 1 1
      uas-office-web/uas-mobile/src/components/private/punchclock/PunchClock.jsx
  12. 3 0
      uas-office-web/uas-mobile/src/configs/api.config.js
  13. 1 1
      uas-office-web/uas-mobile/src/model/common/BillGroupModel.js
  14. 1 1
      uas-office-web/uas-mobile/src/model/common/BillModel.js
  15. 7 40
      uas-office-web/uas-mobile/src/pages/private/homePage/DocRoot.jsx
  16. 1 1
      uas-office-web/uas-mobile/src/pages/private/homePage/MainRoot.jsx
  17. 1 1
      uas-office-web/uas-mobile/src/pages/private/homePage/ReportRoot.jsx
  18. 8 7
      uas-office-web/uas-mobile/src/pages/private/oftenFunc/OftenFuncManage.jsx
  19. 1 1
      uas-office-web/uas-mobile/src/pages/private/subscribe/SubscribeList.jsx
  20. 1 1
      uas-office-web/uas-mobile/src/pages/private/subscribe/SubscribeNot.jsx
  21. 45 0
      uas-office-web/uas-mobile/src/redux/actions/docState.js
  22. 0 0
      uas-office-web/uas-mobile/src/utils/common/common.util.js
  23. 0 0
      uas-office-web/uas-mobile/src/utils/common/fetchRequest.js
  24. 5 5
      uas-office-web/uas-mobile/src/utils/common/form.util.js
  25. 0 0
      uas-office-web/uas-mobile/src/utils/common/regexp.util.js
  26. 20 19
      uas-office-web/wxuasapproval/debug.log

+ 2 - 2
uas-office-web/uas-mobile/src/components/common/currencyListItem/CurrencyListItem.jsx

@@ -6,7 +6,7 @@
 import React, { Component } from 'react'
 import './currency-list-item.less'
 import CurrencyRow from './CurrencyRow'
-import { isObjEmpty } from '../../../utils/common.util'
+import { isObjEmpty } from '../../../utils/common/common.util'
 
 export default class CurrencyListItem extends Component {
 
@@ -29,7 +29,7 @@ export default class CurrencyListItem extends Component {
     const rowItems = []
     if (!isObjEmpty(rowList)) {
       rowList.forEach((item, index) => {
-        rowItems.push(<CurrencyRow/>)
+        rowItems.push(<CurrencyRow rowObj={item}/>)
       })
     }
 

+ 5 - 2
uas-office-web/uas-mobile/src/components/common/currencyListItem/CurrencyRow.jsx

@@ -22,10 +22,13 @@ export default class CurrencyRow extends Component {
   }
 
   render () {
+    const { rowObj } = this.props
     return (
       <div className='currency-row-root'>
-        <div className='currency-row-caption'>caption</div>
-        <div className='currency-row-value'>valuevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevaluevalue</div>
+        <div className='currency-row-caption'>{rowObj.caption}</div>
+        <div
+          className='currency-row-value'>{rowObj.value}
+        </div>
       </div>
     )
   }

+ 1 - 1
uas-office-web/uas-mobile/src/components/common/formNew/FormInput.jsx

@@ -13,7 +13,7 @@ import {
   Modal,
   Toast,
 } from 'antd-mobile'
-import { isObjEmpty, isObjNull } from '../../../utils/common.util'
+import { isObjEmpty, isObjNull } from '../../../utils/common/common.util'
 import moment from 'moment'
 import BillModel from '../../../model/common/BillModel'
 

+ 1 - 1
uas-office-web/uas-mobile/src/components/common/formNew/FormTitle.jsx

@@ -5,7 +5,7 @@
 
 import React, { Component } from 'react'
 import './formCommon.less'
-import { isObjNull } from '../../../utils/common.util'
+import { isObjNull } from '../../../utils/common/common.util'
 
 export default class FormTitle extends Component {
 

+ 1 - 1
uas-office-web/uas-mobile/src/components/common/func/FuncGroup.jsx

@@ -6,7 +6,7 @@
 import React, { Component } from 'react'
 import './common-func.less'
 import FuncTitle from './FuncTitle'
-import { isObjEmpty } from '../../../utils/common.util'
+import { isObjEmpty } from '../../../utils/common/common.util'
 import FuncItem from './FuncItem'
 import {
   FUNC_OPERATION_ADD,

+ 14 - 1
uas-office-web/uas-mobile/src/components/common/func/FuncItem.jsx

@@ -6,6 +6,8 @@
 import React, { Component } from 'react'
 import './common-func.less'
 import { Icon } from 'antd-mobile'
+import { isObjEmpty } from '../../../utils/common/common.util'
+import { fetchGet } from '../../../utils/common/fetchRequest'
 
 export default class FuncItem extends Component {
 
@@ -16,7 +18,18 @@ export default class FuncItem extends Component {
   }
 
   componentDidMount () {
+    let { funcObj } = this.props
+    if (!isObjEmpty(funcObj.countUrl)) {
+      fetchGet(funcObj.countUrl).then(response => {
+        funcObj.sup = response.data || 100
+        this.render()
+      })
+    }
+  }
 
+  shouldComponentUpdate (nextProps, nextState, nextContext) {
+    console.log('rm', nextProps)
+    // return nextProps.someData !== this.state.someData
   }
 
   componentWillUnmount () {
@@ -24,7 +37,7 @@ export default class FuncItem extends Component {
   }
 
   render () {
-    const { funcObj, operation, sup } = this.props
+    let { funcObj, operation, sup } = this.props
 
     return (
       funcObj &&

+ 4 - 3
uas-office-web/uas-mobile/src/components/common/mainHeader/MainHeader.jsx

@@ -6,6 +6,7 @@
 import React, { Component } from 'react'
 import FuncItem from '../func/FuncItem'
 import { withRouter } from 'react-router-dom'
+import { API } from '../../../configs/api.config'
 
 class MainHeader extends Component {
 
@@ -25,9 +26,9 @@ class MainHeader extends Component {
 
   render () {
     let homeHeaderIcon = [
-      { 'name': '我的日程', sup: 10 },
-      { 'name': '待审批', sup: 99 },
-      { 'name': '我的待办' },
+      { 'name': '我的日程', countUrl: API.APPCOMMON_COUNT + 'dailyTask.action' },
+      { 'name': '待审批', countUrl: API.APPCOMMON_COUNT + 'processToDo.action' },
+      { 'name': '我的待办', countUrl: API.APPCOMMON_COUNT + 'taskToDo.action' },
       { 'name': '我的订阅' },
     ]
     let homeHeaderList = []

+ 1 - 1
uas-office-web/uas-mobile/src/components/common/uploadEnclosure/UploadEnclosure.jsx

@@ -7,7 +7,7 @@ import React, { Component } from 'react'
 import { Upload } from 'antd'
 import { Toast } from 'antd-mobile'
 import { PlusOutlined } from '@ant-design/icons'
-import { isObjEmpty } from '../../../utils/common.util'
+import { isObjEmpty } from '../../../utils/common/common.util'
 import ImagesViewer from '../imagesVIewer'
 import PropTypes from 'prop-types'
 import 'src/components/common/uploadEnclosure/upload.less'

+ 1 - 1
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.util'
+import { isObjEmpty } from '../../../utils/common/common.util'
 
 class KanBan extends Component {
 

+ 1 - 1
uas-office-web/uas-mobile/src/components/private/profile/ProfileCard.jsx

@@ -4,7 +4,7 @@
  */
 
 import React, { Component } from 'react'
-import { isObjEmpty } from '../../../utils/common.util'
+import { isObjEmpty } from '../../../utils/common/common.util'
 import './ProfileCard.less'
 import { Icon, List } from 'antd-mobile'
 

+ 1 - 1
uas-office-web/uas-mobile/src/components/private/punchclock/PunchClock.jsx

@@ -7,7 +7,7 @@ import React, { Component } from 'react'
 import './punch-clock.less'
 import ClockDesc from './ClockDesc'
 import ClockRecord from './ClockRecord'
-import { isEmptyObject } from '../../../utils/common.util'
+import { isEmptyObject } from '../../../utils/common/common.util'
 
 export default class PunchClock extends Component {
 

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

@@ -10,6 +10,9 @@ export const _host = window.location.origin
 export const _baseURL = _host + (process.env.REACT_APP_ROUTER_BASE_NAME || '')
 
 export const API = {
+  /*******************************通用*************************************/
+  //应用红点数
+  APPCOMMON_COUNT: _baseURL + '/mobile/appcommon/count/',
   /*******************************应用*************************************/
   //应用菜单列表
   APPCOMMON_GETSERVICE: _baseURL + '/mobile/appcommon/getServices.action',

+ 1 - 1
uas-office-web/uas-mobile/src/model/common/BillGroupModel.js

@@ -2,7 +2,7 @@
  * 单据分组Model
  * @constructor
  */
-import { isObjEmpty, isObjNull } from '../../utils/common.util'
+import { isObjEmpty, isObjNull } from '../../utils/common/common.util'
 
 export default function BillGroupModel () {
   this.isDeleteAble = false//是否可以删除

+ 1 - 1
uas-office-web/uas-mobile/src/model/common/BillModel.js

@@ -1,4 +1,4 @@
-import { isObjEmpty, isObjNull } from '../../utils/common.util'
+import { isObjEmpty, isObjNull } from '../../utils/common/common.util'
 
 export default function BillModel (billModel) {
   if (isObjNull(billModel)) {

+ 7 - 40
uas-office-web/uas-mobile/src/pages/private/homePage/DocRoot.jsx

@@ -5,13 +5,16 @@
 
 import React, { Component } from 'react'
 import { connect } from 'react-redux'
-import { isObjEmpty } from '../../../utils/common.util'
+import { isObjEmpty } from '../../../utils/common/common.util'
 import FuncGroup from '../../../components/common/func/FuncGroup'
-import { fetchPostObj } from '../../../utils/fetchRequest'
+import { fetchPostObj } from '../../../utils/common/fetchRequest'
 import { API } from '../../../configs/api.config'
 import { Toast } from 'antd-mobile'
 import { message } from 'antd'
-import { refreshDocList } from '../../../redux/actions/docState'
+import {
+  analysisDocList,
+  refreshDocList,
+} from '../../../redux/actions/docState'
 
 class DocRoot extends Component {
 
@@ -58,43 +61,7 @@ class DocRoot extends Component {
       kind: 'uasapp',
     }).then(response => {
       Toast.hide()
-      const data = response.data
-      const docFuncGroupList = []
-      if (!isObjEmpty(data)) {
-        const responseList = data.list
-        if (!isObjEmpty(responseList)) {
-          responseList.forEach((groupItem, groupIndex) => {
-            let docFuncGroup = {
-              groupTitle: groupItem.groupTitle,
-              groupIndex: groupIndex,
-            }
-            const funcList = groupItem.funcList
-            if (!isObjEmpty(funcList)) {
-              let docFuncList = []
-              funcList.forEach((childItem, childIndex) => {
-                const docFunc = {
-                  id: childIndex.fid,
-                  name: childItem.name,
-                  caller: childItem.caller,
-                  img: childItem.icon && childItem.icon.exticon,
-                  often: childItem.often,
-                  url: childItem.url && childItem.url.skipurl,
-                  countUrl: childItem.url && childItem.url.counturl,
-                  groupIndex: groupIndex,
-                  childIndex: childIndex,
-                }
-                docFuncList.push(docFunc)
-              })
-              docFuncGroup.funcList = docFuncList
-            }
-            docFuncGroupList.push(docFuncGroup)
-          })
-        }
-      }
-
-      refreshDocList({
-        docFuncGroupList,
-      })
+      analysisDocList(response)
     }).catch(error => {
       Toast.hide()
       refreshDocList({

+ 1 - 1
uas-office-web/uas-mobile/src/pages/private/homePage/MainRoot.jsx

@@ -11,7 +11,7 @@ import KanBan from '../../../components/private/kanban/KanBan'
 import './main-root.less'
 import { withRouter } from 'react-router-dom'
 import FuncGroup from '../../../components/common/func/FuncGroup'
-import { isObjEmpty, isObjNull } from '../../../utils/common.util'
+import { isObjEmpty, isObjNull } from '../../../utils/common/common.util'
 
 class MainRoot extends Component {
 

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

@@ -6,7 +6,7 @@
 import React, { Component } from 'react'
 import { connect } from 'react-redux'
 import FuncGroup from '../../../components/common/func/FuncGroup'
-import { isObjEmpty } from '../../../utils/common.util'
+import { isObjEmpty } from '../../../utils/common/common.util'
 
 class ReportRoot extends Component {
 

+ 8 - 7
uas-office-web/uas-mobile/src/pages/private/oftenFunc/OftenFuncManage.jsx

@@ -11,11 +11,14 @@ import {
   FUNC_OPERATION_CANCEL,
 } from '../../../configs/constans.config'
 import FuncGroup from '../../../components/common/func/FuncGroup'
-import { isObjEmpty, isObjNull } from '../../../utils/common.util'
-import { refreshDocList } from '../../../redux/actions/docState'
+import { isObjEmpty, isObjNull } from '../../../utils/common/common.util'
+import {
+  analysisDocList,
+  refreshDocList,
+} from '../../../redux/actions/docState'
 import { message } from 'antd'
 import { Toast } from 'antd-mobile'
-import { fetchPostObj } from '../../../utils/fetchRequest'
+import { fetchPostObj } from '../../../utils/common/fetchRequest'
 import { API } from '../../../configs/api.config'
 
 class OftenFuncManage extends Component {
@@ -41,7 +44,7 @@ class OftenFuncManage extends Component {
   }
 
   componentWillUnmount () {
-
+    Toast.hide()
   }
 
   render () {
@@ -115,9 +118,7 @@ class OftenFuncManage extends Component {
       data: this.oftenFuncList,
     }).then(response => {
       Toast.hide()
-      refreshDocList({
-        docFuncGroupList: this.state.docFuncGroupStateList,
-      })
+      analysisDocList(response)
       message.success('保存成功')
       this.props.history.goBack()
     }).catch(error => {

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

@@ -8,7 +8,7 @@ import { connect } from 'react-redux'
 import ReactDOM from 'react-dom'
 import { PullToRefresh, ListView, Toast } from 'antd-mobile'
 import LoadingMore from '../../../components/common/loading/LoadingMore'
-import { isObjEmpty } from '../../../utils/common.util'
+import { isObjEmpty } from '../../../utils/common/common.util'
 import SubscribeGroup
   from '../../../components/private/subscribe/SubscribeGroup'
 

+ 1 - 1
uas-office-web/uas-mobile/src/pages/private/subscribe/SubscribeNot.jsx

@@ -10,7 +10,7 @@ import SubAlreadyItem
 import { SUBSCRIBE_ITEM_NOT } from '../../../configs/constans.config'
 import SubLeftMenu from '../../../components/private/subscribe/SubLeftMenu'
 import { saveListState } from '../../../redux/actions/listState'
-import { isObjEmpty } from '../../../utils/common.util'
+import { isObjEmpty } from '../../../utils/common/common.util'
 
 const subMenuList = [
   {

+ 45 - 0
uas-office-web/uas-mobile/src/redux/actions/docState.js

@@ -5,6 +5,7 @@
 
 import store from '../store/store'
 import { CLEAR_DOC_STATE, REFRESH_DOC_LIST } from '../constants/actionTypes'
+import { isObjEmpty } from '../../utils/common/common.util'
 
 /**
  * 保存列表状态
@@ -27,3 +28,47 @@ export const clearDocState = () => {
     type: CLEAR_DOC_STATE,
   })
 }
+
+/**
+ * 解析并缓存应用列表数据
+ * @param response
+ */
+export const analysisDocList = (response) => {
+  const data = response.data
+  const docFuncGroupList = []
+  if (!isObjEmpty(data)) {
+    const responseList = data.list
+    if (!isObjEmpty(responseList)) {
+      responseList.forEach((groupItem, groupIndex) => {
+        let docFuncGroup = {
+          groupTitle: groupItem.groupTitle,
+          groupIndex: groupIndex,
+        }
+        const funcList = groupItem.funcList
+        if (!isObjEmpty(funcList)) {
+          let docFuncList = []
+          funcList.forEach((childItem, childIndex) => {
+            const docFunc = {
+              id: childItem.fid,
+              name: childItem.name,
+              caller: childItem.caller,
+              img: childItem.icon && childItem.icon.exticon,
+              often: childItem.often,
+              url: childItem.url && childItem.url.skipurl,
+              countUrl: childItem.url && childItem.url.counturl,
+              groupIndex: groupIndex,
+              childIndex: childIndex,
+            }
+            docFuncList.push(docFunc)
+          })
+          docFuncGroup.funcList = docFuncList
+        }
+        docFuncGroupList.push(docFuncGroup)
+      })
+    }
+  }
+
+  refreshDocList({
+    docFuncGroupList,
+  })
+}

+ 0 - 0
uas-office-web/uas-mobile/src/utils/common.util.js → uas-office-web/uas-mobile/src/utils/common/common.util.js


+ 0 - 0
uas-office-web/uas-mobile/src/utils/fetchRequest.js → uas-office-web/uas-mobile/src/utils/common/fetchRequest.js


+ 5 - 5
uas-office-web/uas-mobile/src/utils/form.util.js → uas-office-web/uas-mobile/src/utils/common/form.util.js

@@ -3,16 +3,16 @@ import {
   isObjEmpty,
   isObjNull,
 } from './common.util'
-import FormInput from '../components/common/formNew/FormInput'
-import FormAdd from '../components/common/formNew/FormAdd'
+import FormInput from '../../components/common/formNew/FormInput'
+import FormAdd from '../../components/common/formNew/FormAdd'
 import { message } from 'antd'
 import BillModel, {
   TYPE_ADD,
   TYPE_TAB,
   TYPE_TITLE,
-} from '../model/common/BillModel'
-import FormTitle from '../components/common/formNew/FormTitle'
-import BillGroupModel from '../model/common/BillGroupModel'
+} from '../../model/common/BillModel'
+import FormTitle from '../../components/common/formNew/FormTitle'
+import BillGroupModel from '../../model/common/BillGroupModel'
 
 /**
  * Created by RaoMeng on 2020/11/6

+ 0 - 0
uas-office-web/uas-mobile/src/utils/regexp.util.js → uas-office-web/uas-mobile/src/utils/common/regexp.util.js


+ 20 - 19
uas-office-web/wxuasapproval/debug.log

@@ -1,19 +1,20 @@
-[1016/170622.022:ERROR:process_info.cc(380)] UncheckedAllocate
-[1017/195912.277:ERROR:process_info.cc(380)] UncheckedAllocate
-[1017/195916.002:ERROR:process_info.cc(380)] UncheckedAllocate
-[1017/200038.779:ERROR:process_info.cc(380)] UncheckedAllocate
-[1017/200048.904:ERROR:process_info.cc(380)] UncheckedAllocate
-[1017/200052.395:ERROR:process_info.cc(380)] UncheckedAllocate
-[1017/200055.662:ERROR:process_info.cc(380)] UncheckedAllocate
-[1030/163712.412:ERROR:process_info.cc(380)] UncheckedAllocate
-[1030/163925.474:ERROR:process_info.cc(380)] UncheckedAllocate
-[1030/170104.142:ERROR:process_info.cc(380)] UncheckedAllocate
-[1030/170654.239:ERROR:process_info.cc(380)] UncheckedAllocate
-[1031/144955.675:ERROR:process_info.cc(380)] UncheckedAllocate
-[1031/195710.213:ERROR:process_info.cc(380)] UncheckedAllocate
-[1101/144144.021:ERROR:process_info.cc(380)] UncheckedAllocate
-[1101/144223.211:ERROR:process_info.cc(380)] UncheckedAllocate
-[1101/144717.152:ERROR:process_info.cc(380)] UncheckedAllocate
-[1105/192745.585:ERROR:process_info.cc(380)] UncheckedAllocate
-[1105/195751.578:ERROR:process_info.cc(380)] UncheckedAllocate
-[1105/201854.004:ERROR:process_info.cc(380)] UncheckedAllocate
+[1016/170622.022:ERROR:process_info.cc(380)] UncheckedAllocate
+[1017/195912.277:ERROR:process_info.cc(380)] UncheckedAllocate
+[1017/195916.002:ERROR:process_info.cc(380)] UncheckedAllocate
+[1017/200038.779:ERROR:process_info.cc(380)] UncheckedAllocate
+[1017/200048.904:ERROR:process_info.cc(380)] UncheckedAllocate
+[1017/200052.395:ERROR:process_info.cc(380)] UncheckedAllocate
+[1017/200055.662:ERROR:process_info.cc(380)] UncheckedAllocate
+[1030/163712.412:ERROR:process_info.cc(380)] UncheckedAllocate
+[1030/163925.474:ERROR:process_info.cc(380)] UncheckedAllocate
+[1030/170104.142:ERROR:process_info.cc(380)] UncheckedAllocate
+[1030/170654.239:ERROR:process_info.cc(380)] UncheckedAllocate
+[1031/144955.675:ERROR:process_info.cc(380)] UncheckedAllocate
+[1031/195710.213:ERROR:process_info.cc(380)] UncheckedAllocate
+[1101/144144.021:ERROR:process_info.cc(380)] UncheckedAllocate
+[1101/144223.211:ERROR:process_info.cc(380)] UncheckedAllocate
+[1101/144717.152:ERROR:process_info.cc(380)] UncheckedAllocate
+[1105/192745.585:ERROR:process_info.cc(380)] UncheckedAllocate
+[1105/195751.578:ERROR:process_info.cc(380)] UncheckedAllocate
+[1105/201854.004:ERROR:process_info.cc(380)] UncheckedAllocate
+[1201/085736.790:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)