From f9f3fe537fadd3a5a77895d41e5e4a8862d7aa17 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 29 五月 2020 13:34:28 +0800
Subject: [PATCH] 2020-05-29

---
 src/tabviews/commontable/index.scss          |    7 +
 src/tabviews/subtable/index.scss             |    3 +
 src/components/sidemenu/config.jsx           |   29 +++++++++
 src/tabviews/subtable/index.jsx              |    6 +-
 src/tabviews/subtabtable/index.jsx           |    2 
 src/utils/asyncSpinComponent.jsx             |   32 ++++++++++
 src/tabviews/commontable/index.jsx           |   10 +-
 src/tabviews/subtabtable/index.scss          |   46 +++++++++++++++
 src/tabviews/zshare/chartcomponent/index.jsx |   40 ++++++++++++
 9 files changed, 162 insertions(+), 13 deletions(-)

diff --git a/src/components/sidemenu/config.jsx b/src/components/sidemenu/config.jsx
index 79b6584..5551f1a 100644
--- a/src/components/sidemenu/config.jsx
+++ b/src/components/sidemenu/config.jsx
@@ -150,6 +150,35 @@
       text: '澶栭儴鎺ュ彛'
     }]
   }, {
+    MenuID: 'systemManageViewCommunication',
+    text: '閫氫俊',
+    PageParam: {Icon: 'folder'},
+    children: [{
+      src: '',
+      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
+      type: 'ManageTable',
+      MenuID: '1589782279158ngr675kk3oksin35sul',
+      MenuNo: 'bd_msn_emailM',
+      MenuName: '閭欢鏈嶅姟鍣�',
+      text: '閭欢鏈嶅姟鍣�'
+    }, {
+      src: '',
+      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
+      type: 'ManageTable',
+      MenuID: '1589788042787ffdt9hle4s45k9r1nvs',
+      MenuNo: 'bd_msn_email_tempM',
+      MenuName: '閭欢妯℃澘',
+      text: '閭欢妯℃澘'
+    }, {
+      src: '',
+      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
+      type: 'ManageTable',
+      MenuID: '15900310928174dro07ihfckghpb5h13',
+      MenuNo: 'bd_msn_sms_tempM',
+      MenuName: '澶т簬鐭俊妯℃澘',
+      text: '澶т簬鐭俊妯℃澘'
+    }]
+  }, {
     MenuID: 'systemManageViewParam',
     text: '绯荤粺鍙傛暟',
     PageParam: {Icon: 'folder'},
diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index fd4843d..9d3881e 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -10,7 +10,7 @@
 import enUS from '@/locales/en-US/main.js'
 import Utils from '@/utils/utils.js'
 import asyncComponent from '@/utils/asyncComponent'
-import asyncLoadComponent from '@/utils/asyncLoadComponent'
+import asyncSpinComponent from '@/utils/asyncSpinComponent'
 import {refreshTabView, modifyTabview} from '@/store/action'
 
 import MainTable from '@/tabviews/zshare/normalTable'
@@ -18,13 +18,13 @@
 import NotFount from '@/components/404'
 import './index.scss'
 
-const MainAction = asyncLoadComponent(() => import('@/tabviews/zshare/actionList'))
+const MainAction = asyncSpinComponent(() => import('@/tabviews/zshare/actionList'))
 const VerifyCard = asyncComponent(() => import('@/tabviews/zshare/verifycard'))
-const SubTable = asyncComponent(() => import('@/tabviews/subtable'))
+const SubTable = asyncSpinComponent(() => import('@/tabviews/subtable'))
 const SubTabTable = asyncComponent(() => import('@/tabviews/subtabtable'))
 const FormTab = asyncComponent(() => import('@/tabviews/formtab'))
-const CardComponent = asyncComponent(() => import('@/tabviews/zshare/cardcomponent'))
-const ChartComponent = asyncComponent(() => import('@/tabviews/zshare/chartcomponent'))
+const CardComponent = asyncSpinComponent(() => import('@/tabviews/zshare/cardcomponent'))
+const ChartComponent = asyncSpinComponent(() => import('@/tabviews/zshare/chartcomponent'))
 
 const { TabPane } = Tabs
 const { TreeNode } = Tree
diff --git a/src/tabviews/commontable/index.scss b/src/tabviews/commontable/index.scss
index ba9539a..6ee9a17 100644
--- a/src/tabviews/commontable/index.scss
+++ b/src/tabviews/commontable/index.scss
@@ -20,9 +20,9 @@
     }
   }
   > .ant-spin {
-    position: fixed;
+    position: absolute;
     z-index: 10;
-    left: calc(50vw - 22px);
+    left: calc(50% - 22px);
     top: calc(50vh - 70px);
   }
   > .ant-card {
@@ -109,6 +109,9 @@
         }
       }
     }
+    >.ant-col {
+      min-height: 100px;
+    }
     .chart-title {
       position: relative;
       color: rgba(0, 0, 0, 0.65);
diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx
index f90bfef..c11b488 100644
--- a/src/tabviews/subtable/index.jsx
+++ b/src/tabviews/subtable/index.jsx
@@ -16,7 +16,7 @@
 import SubTable from '@/tabviews/zshare/normalTable'
 import SubSearch from '@/tabviews/zshare/topSearch'
 import asyncComponent from '@/utils/asyncComponent'
-import asyncLoadComponent from '@/utils/asyncLoadComponent'
+import asyncSpinComponent from '@/utils/asyncSpinComponent'
 import NotFount from '@/components/404'
 
 import './index.scss'
@@ -24,7 +24,7 @@
 const { TabPane } = Tabs
 const SubAction = asyncComponent(() => import('@/tabviews/zshare/actionList'))
 const CardComponent = asyncComponent(() => import('@/tabviews/zshare/cardcomponent'))
-const SubTabTable = asyncLoadComponent(() => import('@/tabviews/subtabtable'))
+const SubTabTable = asyncSpinComponent(() => import('@/tabviews/subtabtable'))
 
 class SubTabViewTable extends Component {
   static propTpyes = {
@@ -942,7 +942,7 @@
 
     return (
       <div className="subtable" id={'subtable' + this.props.MenuID}>
-        {loadingview && <Spin size="large" />}
+        {loadingview && <Spin />}
         {searchlist && searchlist.length > 0 ?
           <SubSearch
             refreshdata={this.refreshbysearch}
diff --git a/src/tabviews/subtable/index.scss b/src/tabviews/subtable/index.scss
index afdcea7..b99b92c 100644
--- a/src/tabviews/subtable/index.scss
+++ b/src/tabviews/subtable/index.scss
@@ -33,6 +33,9 @@
         }
       }
     }
+    >.ant-col {
+      min-height: 100px;
+    }
     .chart-title {
       position: relative;
       color: rgba(0, 0, 0, 0.65);
diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx
index d304fe3..7a408ca 100644
--- a/src/tabviews/subtabtable/index.jsx
+++ b/src/tabviews/subtabtable/index.jsx
@@ -722,7 +722,7 @@
 
     return (
       <div className="subtabtable" id={'subtabtable' + this.props.MenuID}>
-        {loadingview && <Spin size="large" />}
+        {loadingview && <Spin />}
         {searchlist && searchlist.length > 0 ?
           <SubSearch
             refreshdata={this.refreshbysearch}
diff --git a/src/tabviews/subtabtable/index.scss b/src/tabviews/subtabtable/index.scss
index 4334c75..12f42fe 100644
--- a/src/tabviews/subtabtable/index.scss
+++ b/src/tabviews/subtabtable/index.scss
@@ -29,4 +29,50 @@
     left: calc(50% - 22px);
     top: 100px;
   }
+  > .chart-view {
+    position: relative;
+    >.ant-tabs {
+      .ant-tabs-bar {
+        position: relative;
+        z-index: 1;
+        top: -10px;
+        margin: 0;
+        border: 0;
+        .ant-tabs-nav-scroll {
+          text-align: right;
+          padding-right: 0px;
+          .ant-tabs-ink-bar {
+            display: none!important;
+          }
+          .ant-tabs-tab {
+            padding: 6px 5px;
+            margin-right: 5px;
+          }
+        }
+      }
+    }
+    >.ant-col {
+      min-height: 100px;
+    }
+    .chart-title {
+      position: relative;
+      color: rgba(0, 0, 0, 0.65);
+      font-weight: 400;
+      font-size: 16px;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      overflow: hidden;
+      margin: 0;
+      padding: 5px 10px;
+      float: left;
+      max-width: 50%;
+    }
+    .chart-table.chart-title {
+      position: absolute;
+      top: 0px;
+    }
+    .canvas {
+      clear: both;
+    }
+  }
 }
diff --git a/src/tabviews/zshare/chartcomponent/index.jsx b/src/tabviews/zshare/chartcomponent/index.jsx
index 3891a05..4837e12 100644
--- a/src/tabviews/zshare/chartcomponent/index.jsx
+++ b/src/tabviews/zshare/chartcomponent/index.jsx
@@ -181,8 +181,8 @@
       _data = [..._mdata.values()]
     }
 
-    if (plot.correction && plot.chartType === 'bar' && plot.enabled !== 'true' && _data.length > 0 && _data.length < plot.correction) {
-      if (plot.customs && plot.customs.filter(cell => cell.chartType !== 'bar').length === 0) {
+    if (plot.correction && plot.chartType === 'bar' && _data.length > 0 && _data.length < plot.correction) {
+      if (plot.enabled !== 'true' || (plot.customs && plot.customs.filter(cell => cell.chartType !== 'bar').length === 0)) {
         let _num = plot.correction - _data.length
         for (let i = 0; i < _num; i++) {
           let _val = Array( i + 2 ).join(' ')
@@ -429,6 +429,18 @@
       nice: true
     })
 
+    // 鍧愭爣杞存牸寮忓寲
+    chart.axis(plot.Xaxis, {
+      label: {
+        formatter: (val) => {
+          if (!val || /^\s*$/.test(val)) return val
+          let _val = `${val}`
+          if (_val.length <= 10) return val
+          return _val.substring(0, 5) + '...'
+        }
+      }
+    })
+
     if (!plot.legend || plot.legend === 'hidden') {
       chart.legend(false)
     } else {
@@ -540,6 +552,18 @@
         range: [0.05, 0.95]
       })
     }
+    
+    // 鍧愭爣杞存牸寮忓寲
+    chart.axis(plot.Xaxis, {
+      label: {
+        formatter: (val) => {
+          if (!val || /^\s*$/.test(val)) return val
+          let _val = `${val}`
+          if (_val.length <= 10) return val
+          return _val.substring(0, 5) + '...'
+        }
+      }
+    })
 
     if (!plot.legend || plot.legend === 'hidden') {
       chart.legend(false)
@@ -693,6 +717,18 @@
       nice: true
     })
 
+    // 鍧愭爣杞存牸寮忓寲
+    chart.axis(plot.Xaxis, {
+      label: {
+        formatter: (val) => {
+          if (!val || /^\s*$/.test(val)) return val
+          let _val = `${val}`
+          if (_val.length <= 10) return val
+          return _val.substring(0, 5) + '...'
+        }
+      }
+    })
+
     if (!plot.legend || plot.legend === 'hidden') {
       chart.legend(false)
     } else {
diff --git a/src/utils/asyncSpinComponent.jsx b/src/utils/asyncSpinComponent.jsx
new file mode 100644
index 0000000..d9be073
--- /dev/null
+++ b/src/utils/asyncSpinComponent.jsx
@@ -0,0 +1,32 @@
+import React, {Component} from 'react'
+import { Spin } from 'antd'
+
+/**
+ * @description 寮傛鍔犺浇妯″潡
+ * @param {*} importComponent
+ */
+export default function asyncComponent(importComponent) {
+  return class extends Component {
+    constructor(props) {
+      super(props)
+
+      this.state = {
+        component: null
+      }
+    }
+
+    async componentDidMount() {
+      const {default: component} = await importComponent()
+
+      this.setState({component})
+    }
+
+    render() {
+      const C = this.state.component
+
+      return C ?
+        <C {...this.props} /> :
+        <div style={{textAlign: 'center', minHeight: 50, lineHeight: '50px'}}><Spin/></div>
+    }
+  }
+}
\ No newline at end of file

--
Gitblit v1.8.0