Browse Source

uas手机版
调整应用item组件

RaoMeng 5 years ago
parent
commit
b8ea5e3beb

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

@@ -5,7 +5,7 @@
 
 import React, { Component } from 'react'
 import './common-func.less'
-import FuncTltle from './FuncTltle'
+import FuncTitle from './FuncTitle'
 import { isObjEmpty } from '../../../utils/common.util'
 import FuncItem from './FuncItem'
 
@@ -26,7 +26,7 @@ export default class FuncGroup extends Component {
   }
 
   render () {
-    let { funcGroup, line, onRightClick, onFuncClick } = this.props
+    let { funcGroup, line, onRightClick, onFuncClick, operation, rightIcon } = this.props
     let funcItems = []
     if (!isObjEmpty(funcGroup.funcList)) {
       funcGroup.funcList.forEach((funcItem, funcIndex) => {
@@ -34,6 +34,7 @@ export default class FuncGroup extends Component {
           <FuncItem
             funcObj={funcItem}
             line={line}
+            operation={operation || funcItem.operation}
             onFuncClick={onFuncClick}
             key={funcIndex}/>,
         )
@@ -45,7 +46,9 @@ export default class FuncGroup extends Component {
         style={{
           overflowX: 'hidden',
         }}>
-        <FuncTltle funcTitle={funcGroup} onRightClick={onRightClick}/>
+        <FuncTitle funcTitle={funcGroup}
+                   rightIcon={rightIcon || funcGroup.rightIcon}
+                   onRightClick={onRightClick}/>
         <div
           style={{
             marginRight: line ? '-1px' : '0px',

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

@@ -25,7 +25,7 @@ export default class FuncItem extends Component {
   }
 
   render () {
-    const { funcObj } = this.props
+    const { funcObj, operation } = this.props
 
     return (
       isObjEmpty(funcObj) ?
@@ -39,8 +39,8 @@ export default class FuncItem extends Component {
             <span className='func-func-text'>{funcObj.name}</span>
           </div>
           {
-            funcObj.operation && <Icon
-              type={funcObj.operation}
+            operation && <Icon
+              type={operation}
               className='func-operation-icon'
               onClick={this.onOperationClick}
             />

+ 6 - 6
uas-office-web/uas-mobile/src/components/common/func/FuncTltle.jsx → uas-office-web/uas-mobile/src/components/common/func/FuncTitle.jsx

@@ -7,7 +7,7 @@ import React, { Component } from 'react'
 import './common-func.less'
 import { Icon } from 'antd-mobile'
 
-export default class FuncTltle extends Component {
+export default class FuncTitle extends Component {
 
   constructor () {
     super()
@@ -24,19 +24,19 @@ export default class FuncTltle extends Component {
   }
 
   render () {
-    let { funcTitle } = this.props
+    let { funcTitle, leftIcon, rightIcon } = this.props
     return (
       <div className='func-group-layout'>
         {
-          funcTitle.leftIcon &&
-          <Icon className='func-group-icon' type={funcTitle.leftIcon}/>
+          leftIcon &&
+          <Icon className='func-group-icon' type={leftIcon}/>
         }
         <span className='func-group-text'>{funcTitle.groupText}</span>
         {
-          funcTitle.rightIcon &&
+          rightIcon &&
           <Icon
             className='func-group-icon'
-            type={funcTitle.rightIcon}
+            type={rightIcon}
             onClick={this.onRightClick}/>
         }
       </div>

+ 1 - 1
uas-office-web/uas-mobile/src/configs/theme.config.less

@@ -6,7 +6,7 @@
 /***********************大小、距离************************/
 @com-page-padding: 16px; // 页面内边距
 @com-list-item-padding: 10px; //默认列表item内边距
-@com-operation-icon-size: 18px; //应用item操作icon大小
+@com-operation-icon-size: 16px; //应用item操作icon大小
 @com-button-height: 38px; //全局按钮高度
 @com-button-fontsize: 16px; //全局按钮文字大小
 

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

@@ -5,7 +5,7 @@
 
 import React, { Component } from 'react'
 import { connect } from 'react-redux'
-import FuncTltle from '../../../components/common/func/FuncTltle'
+import FuncTitle from '../../../components/common/func/FuncTitle'
 import MainHeader from '../../../components/common/mainHeader/MainHeader'
 import './main-root.less'
 import { withRouter } from 'react-router-dom'
@@ -41,11 +41,11 @@ class MainRoot extends Component {
         </div>
         {/* 首页看板展示 */}
         <div className="main-kanban">
-          <FuncTltle
+          <FuncTitle
             funcTitle={{
               groupText: '数据看板',
-              rightIcon: 'uas-edit',
             }}
+            rightIcon='uas-edit'
             onRightClick={this.onKanbanManage}/>
         </div>
       </div>

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

@@ -31,7 +31,6 @@ class ReportRoot extends Component {
   render () {
     let funcGroup = {
       groupText: '销售管理',
-      rightIcon: 'uas-edit',
       funcList: [
         { name: '报表' },
         { name: '报表' },
@@ -43,7 +42,6 @@ class ReportRoot extends Component {
     }
     let funcGroup1 = {
       groupText: '采购管理',
-      rightIcon: 'uas-edit',
       funcList: [
         { name: '报表', operation: FUNC_OPERATION_CANCEL },
         { name: '报表', operation: FUNC_OPERATION_ADD },

+ 3 - 1
uas-office-web/uas-mobile/src/pages/private/oftenFunc/OftenFuncGrid.jsx

@@ -24,6 +24,7 @@ class OftenFuncGrid extends Component {
   }
 
   render () {
+    const { operation, rightIcon } = this.props
     let oftenFunc = {
       groupText: '常用',
       funcList: [
@@ -40,10 +41,11 @@ class OftenFuncGrid extends Component {
       ],
     }
 
-    oftenFunc.rightIcon = this.props.rightIcon
     return (
       <FuncGroup
         funcGroup={oftenFunc}
+        operation={operation}
+        rightIcon={rightIcon}
         onRightClick={this.onOftenManage}
       />
     )

+ 1 - 2
uas-office-web/uas-mobile/src/pages/private/oftenFunc/OftenFuncManage.jsx

@@ -33,7 +33,6 @@ class OftenFuncManage extends Component {
   render () {
     let funcGroup = {
       groupText: '采购管理',
-      rightIcon: 'uas-edit',
       funcList: [
         { name: '报表', operation: FUNC_OPERATION_ADD },
         { name: '报表', operation: FUNC_OPERATION_ADD },
@@ -46,7 +45,7 @@ class OftenFuncManage extends Component {
     return (
       <div className='often-func-root'>
         <div className='often-func-header'>
-          <OftenFuncGrid/>
+          <OftenFuncGrid operation={FUNC_OPERATION_CANCEL}/>
         </div>
         <div className='often-func-all-list'>
           <FuncGroup