Browse Source

uas手机版
报表icon

RaoMeng 5 years ago
parent
commit
632ec1a458

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

@@ -70,10 +70,20 @@ class FuncItem extends Component {
         onClick={this.onFuncClick.bind(this)}>
         <div className='func-func-layout'>
           {
-            funcObj.img ? <img className='func-func-icon'
-                               src={funcObj.img}/> : <Icon
-              className='func-func-icon'
-              type={funcObj.icon || 'uas-func-default'}/>
+            funcObj.iconColor ?
+              <div
+                className='func-func-icon'
+                style={{
+                  fontSize: 14,
+                  borderRadius: 4,
+                  background: funcObj.iconColor,
+                  color: 'white',
+                }}
+              >{funcObj.name ? funcObj.name.substr(0, 1) : ''}</div> :
+              funcObj.img ? <img className='func-func-icon'
+                                 src={funcObj.img}/> : <Icon
+                className='func-func-icon'
+                type={funcObj.icon || 'uas-func-default'}/>
           }
 
           <span

+ 2 - 0
uas-office-web/uas-mobile/src/components/common/func/common-func.less

@@ -109,6 +109,8 @@
     width: 28px;
     height: 28px;
     font-size: 28px;
+    line-height: 28px;
+    text-align: center;
   }
 
   .func-func-text {

+ 15 - 5
uas-office-web/uas-mobile/src/components/private/report/ReportSearchItem.jsx

@@ -30,12 +30,22 @@ export default class ReportSearchItem extends Component {
         className='report-search-item-root'
         onClick={this.onSubItemClick}>
         {
-          reportObj.img ?
-            <img src={reportObj.img}
-                 className='report-search-item-img'/> :
-            <Icon
+          reportObj.iconColor ?
+            <div
               className='report-search-item-img'
-              type={reportObj.icon || 'uas-func-default'}/>
+              style={{
+                fontSize: 15,
+                borderRadius: 4,
+                background: reportObj.iconColor,
+                color: 'white',
+              }}
+            >{reportObj.name ? reportObj.name.substr(0, 1) : ''}</div> :
+            reportObj.img ?
+              <img src={reportObj.img}
+                   className='report-search-item-img'/> :
+              <Icon
+                className='report-search-item-img'
+                type={reportObj.icon || 'uas-func-default'}/>
         }
 
         <span className='report-search-item-name'>{reportObj.name}</span>

+ 2 - 0
uas-office-web/uas-mobile/src/components/private/report/comp-report.less

@@ -7,6 +7,8 @@
   .report-search-item-img {
     width: 36px;
     height: 36px;
+    text-align: center;
+    line-height: 36px;
   }
 
   .report-search-item-name {

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

@@ -50,9 +50,9 @@ const TaskTodoDetail = PageLoadable(
 
 /**************************************************报表**************************************************/
 const ReportSearch = PageLoadable(
-  import(/* webpackChunkName:'tasktodo' */'@/pages/private/report/ReportSearch'))
+  import(/* webpackChunkName:'report' */'@/pages/private/report/ReportSearch'))
 const ReportList = PageLoadable(
-  import(/* webpackChunkName:'tasktodo' */'@/pages/private/report/ReportList'))
+  import(/* webpackChunkName:'report' */'@/pages/private/report/ReportList'))
 
 /**************************************************应用**************************************************/
 const OftenFuncManage = PageLoadable(

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

@@ -60,6 +60,7 @@ export const analysisReportList = (response) => {
               groupIndex: reportFuncGroupList.length,
               childIndex: childIndex,
               funcType: FUNC_TYPE_REPORT,
+              iconColor: iconColors[groupIndex % iconColors.length],
             })
           })
           reportFuncGroup.funcList = reportFuncList
@@ -73,3 +74,7 @@ export const analysisReportList = (response) => {
     reportFuncGroupList,
   })
 }
+
+const iconColors = [
+  '#2f95dd', '#9b7dc9', '#de935b', '#f57474', '#8bd67f', '#68d2c9',
+]