ソースを参照

uas手机版
通用列表简单demo

RaoMeng 5 年 前
コミット
9ef50fc56d

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

@@ -34,9 +34,16 @@ export default class CurrencyListItem extends Component {
     }
 
     return (
-      <div className='currency-list-item-root'>
+      <div
+        className='currency-list-item-root'
+        onClick={this.onItemClick}
+      >
         {rowItems}
       </div>
     )
   }
+
+  onItemClick = () => {
+    this.props.onItemClick && this.props.onItemClick()
+  }
 }

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

@@ -5,7 +5,7 @@
 
 import React, { Component } from 'react'
 import './ProfileCard.less'
-import { Icon, List } from 'antd-mobile'
+import { List } from 'antd-mobile'
 
 const Item = List.Item
 

+ 4 - 0
uas-office-web/uas-mobile/src/configs/router.config.js

@@ -24,6 +24,8 @@ const UasEntry = PageLoadable(
 
 const CurrencyList = PageLoadable(
   import(/* webpackChunkName:'common' */'@/pages/common/currencyList/CurrencyList'))
+const CurrencyDetail = PageLoadable(
+  import(/* webpackChunkName:'common' */'@/pages/common/currencyDetail/CurrencyDetail'))
 
 /**************************************************主页**************************************************/
 const HomePage = PageLoadable(
@@ -83,6 +85,8 @@ class Routes extends React.Component {
 
           {/*通用列表页面*/}
           <Route path={'/currencyList'} component={CurrencyList}/>
+          {/*通用列表页面*/}
+          <Route path={'/currencyDetail'} component={CurrencyDetail}/>
 
           {/***************************************主页*******************************************/}
           {/*主页*/}

+ 36 - 0
uas-office-web/uas-mobile/src/pages/common/currencyDetail/CurrencyDetail.jsx

@@ -0,0 +1,36 @@
+/**
+ * Created by RaoMeng on 2020/11/25
+ * Desc: 通用表单详情
+ */
+
+import React, { Component } from 'react'
+import { connect } from 'react-redux'
+
+class CurrencyDetail extends Component {
+
+  constructor () {
+    super()
+
+    this.state = {}
+  }
+
+  componentDidMount () {
+    document.title = '单据详情'
+  }
+
+  componentWillUnmount () {
+
+  }
+
+  render () {
+    return (
+      <div>
+        单据详情
+      </div>
+    )
+  }
+}
+
+let mapStateToProps = (state) => ({})
+
+export default connect(mapStateToProps)(CurrencyDetail)

+ 7 - 3
uas-office-web/uas-mobile/src/pages/common/currencyList/CurrencyList.jsx

@@ -11,8 +11,6 @@ import { SearchBar, PullToRefresh, ListView } from 'antd-mobile'
 import './currency-list.less'
 import UasIcon from '../../../configs/iconfont.conig'
 import LoadingMore from '../../../components/common/loading/LoadingMore'
-import SubscribeGroup
-  from '../../../components/private/subscribe/SubscribeGroup'
 import ReactDOM from 'react-dom'
 
 const currencyArray = [
@@ -86,7 +84,9 @@ class CurrencyList extends Component {
             return hasNextPage && <LoadingMore/>
           }}
           renderRow={(rowData, sectionID, rowID) => {
-            return <CurrencyListItem rowList={rowData}/>
+            return <CurrencyListItem
+              rowList={rowData}
+              onItemClick={this.onItemClick}/>
           }}
           style={{
             height,
@@ -129,6 +129,10 @@ class CurrencyList extends Component {
         currencyArray),
     })
   }
+
+  onItemClick = () => {
+    this.props.history.push('/currencyDetail')
+  }
 }
 
 let mapStateToProps = (state) => ({})

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

@@ -5,13 +5,8 @@
 
 import React, { Component } from 'react'
 import { connect } from 'react-redux'
-import FuncItem from '../../../components/common/func/FuncItem'
 import FuncGroup from '../../../components/common/func/FuncGroup'
-import {
-  FUNC_OPERATION_ADD, FUNC_OPERATION_ADD_DISABLE,
-  FUNC_OPERATION_CANCEL,
-} from '../../../configs/constans.config'
-import { isObjEmpty, isObjNull } from '../../../utils/common.util'
+import { isObjEmpty } from '../../../utils/common.util'
 
 class ReportRoot extends Component {
 

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

@@ -4,7 +4,7 @@
  * @returns {boolean}
  */
 export function isObjNull (obj) {
-  return (obj == null || obj == undefined)
+  return (obj === null || obj === undefined)
 }
 
 /**
@@ -20,7 +20,7 @@ export function isObjEmpty () {
     for (let i = 0; i < args.length; i++) {
       let arg = args[i]
       if (isObjNull(arg) ||
-        (typeof arg === 'string' ? arg.trim().length == 0 : arg.length == 0)) {
+        (typeof arg === 'string' ? arg.trim().length === 0 : arg.length === 0)) {
         return true
       }
     }
@@ -37,7 +37,7 @@ export function isEmptyObject (obj) {
   if (isObjNull(obj)) {
     return false
   }
-  if (obj.length == 0) {
+  if (obj.length === 0) {
     return false
   }
   for (var n in obj) {
@@ -56,7 +56,7 @@ export function strContain (parent, child) {
   if (isObjEmpty(parent)) {
     return false
   }
-  return (parent.indexOf(child) != -1)
+  return (parent.indexOf(child) !== -1)
 }
 
 /**
@@ -105,7 +105,7 @@ export function getTimeValue (object, key) {
     return 0
   }
   let result = object[key]
-  if (typeof result == 'string') {
+  if (typeof result === 'string') {
     try {
       let time = Date.parse(new Date(result))
       return time
@@ -195,9 +195,9 @@ export function getParenthesesStr (text) {
  * @returns {boolean}
  */
 String.prototype.startWith = function (s) {
-  if (s == null || s == '' || this.length == 0 || s.length > this.length)
+  if (s === null || s === '' || this.length === 0 || s.length > this.length)
     return false
-  if (this.substr(0, s.length) == s)
+  if (this.substr(0, s.length) === s)
     return true
   else
     return false
@@ -210,9 +210,9 @@ String.prototype.startWith = function (s) {
  * @returns {boolean}
  */
 String.prototype.endWith = function (s) {
-  if (s == null || s == '' || this.length == 0 || s.length > this.length)
+  if (s === null || s === '' || this.length === 0 || s.length > this.length)
     return false
-  if (this.substring(this.length - s.length) == s)
+  if (this.substring(this.length - s.length) === s)
     return true
   else
     return false
@@ -225,7 +225,7 @@ String.prototype.endWith = function (s) {
  */
 String.prototype.isStrEquals = function () {
   let args = arguments
-  if (isObjNull(args) || args.length == 0) {
+  if (isObjNull(args) || args.length === 0) {
     return false
   } else {
     for (let i = 0; i < args.length; i++) {
@@ -444,7 +444,7 @@ export function randomNum (minNum, maxNum) {
 //解析url的search参数
 export function getSearchParams (searchStr) {
   let params = new Object()
-  if (!isObjEmpty(searchStr) && searchStr.indexOf('?') != -1) {
+  if (!isObjEmpty(searchStr) && searchStr.indexOf('?') !== -1) {
     searchStr = searchStr.substr(1)
     const searchArray = searchStr.split('&')
     for (let i = 0; i < searchArray.length; i++) {