浏览代码

调整首页

sunjh 6 年之前
父节点
当前提交
9e9f31030b
共有 3 个文件被更改,包括 119 次插入3 次删除
  1. 103 2
      src/components/Home.vue
  2. 14 1
      src/js/generalService.js
  3. 2 0
      src/js/index.js

+ 103 - 2
src/components/Home.vue

@@ -13,6 +13,87 @@
       </el-carousel>
     </div>
     <div class="home-body-wrap">
+      <div class="title h2">系统统计信息</div>
+      <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
+        <el-col :span="5" type="flex" align="middle" justify="center">
+          <el-card class="box-card" shadow="hover" style="margin-right: 10px">
+            <div slot="header" class="clearfix">
+              <span style="font-size: 30px;color: #0b2e13"><i class="el-icon-user"></i></span>
+            </div>
+            <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
+              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px">{{statisticsData.userNum}}</span>
+              </el-col>
+              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 12px;"
+                                                                                          type="success"
+                                                                                          :underline="false">系统注册用户数</el-link></span>
+              </el-col>
+            </el-row>
+          </el-card>
+        </el-col>
+        <el-col :span="5" type="flex" align="middle" justify="center">
+          <el-card class="box-card" shadow="hover" style="margin-right: 10px">
+            <div slot="header" class="clearfix">
+              <span style="font-size: 30px;color: #0b2e13"><i class="el-icon-user"></i></span>
+            </div>
+            <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
+              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px">{{statisticsData.userNum}}</span>
+              </el-col>
+              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 12px;"
+                                                                                          type="success"
+                                                                                          :underline="false">系统注册用户数</el-link></span>
+              </el-col>
+            </el-row>
+          </el-card>
+        </el-col>
+        <!--<el-col :span="4">{{project.id}}</el-col>-->
+        <el-col :span="5" type="flex" align="middle" justify="center">
+          <el-card class="box-card" shadow="hover" style="margin-right: 10px">
+            <div slot="header" class="clearfix">
+              <span style="font-size: 30px;color: #0b2e13"><i class="el-icon-user"></i></span>
+            </div>
+            <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
+              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px">{{statisticsData.userNum}}</span>
+              </el-col>
+              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 12px;"
+                                                                                          type="success"
+                                                                                          :underline="false">系统注册用户数</el-link></span>
+              </el-col>
+            </el-row>
+          </el-card>
+        </el-col>
+        <el-col :span="5" type="flex" align="middle" justify="center">
+          <el-card class="box-card" shadow="hover" style="margin-right: 10px">
+            <div slot="header" class="clearfix">
+              <span style="font-size: 30px;color: #0b2e13"><i class="el-icon-user"></i></span>
+            </div>
+            <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
+              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px">{{statisticsData.userNum}}</span>
+              </el-col>
+              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 12px;"
+                                                                                          type="success"
+                                                                                          :underline="false">系统注册用户数</el-link></span>
+              </el-col>
+            </el-row>
+          </el-card>
+        </el-col>
+        <el-col :span="5" type="flex" align="middle" justify="center">
+          <el-card class="box-card" shadow="hover" style="margin-right: 10px">
+            <div slot="header" class="clearfix">
+              <span style="font-size: 30px;color: #0b2e13"><i class="el-icon-user"></i></span>
+            </div>
+            <el-row type="flex" align="middle" justify="center" style="font-size: 14px;">
+              <el-col :span="18" type="flex" align="middle" justify="start"><span style="font-size: 50px">{{statisticsData.userNum}}</span>
+              </el-col>
+              <el-col :span="20" type="flex" align="bottom" justify="end"><span> <el-link style="font-size: 12px;"
+                                                                                          type="success"
+                                                                                          :underline="false">系统注册用户数</el-link></span>
+              </el-col>
+            </el-row>
+          </el-card>
+        </el-col>
+      </el-row>
+    </div>
+    <div class="home-body-wrap">
       <div class="home-block">
         <div class="title">
           热门任务
@@ -51,7 +132,7 @@ import PersonRank from '@/components/PersonRank'
 import Http from '@/js/http.js'
 import Apis from '@/js/api.js'
 import {notify} from '@/constants/index'
-import {defaultValue, getRolesPermissions, storageGet} from '@/js/index'
+import {defaultValue, getIndexStatisticsInfo, getRolesPermissions, storageGet} from '@/js/index'
 
 export default {
   name: 'Home',
@@ -65,7 +146,14 @@ export default {
       institutionRank: [],
       personRank: [],
       imgList: [],
-      rolesPermissions: {}
+      rolesPermissions: {},
+      statisticsData: {
+        userNum: 100,
+        agencyNum: 200,
+        deviceNum: 345,
+        projectNum: 23,
+        taskNum: 123
+      }
     }
   },
   mounted () {
@@ -120,6 +208,19 @@ export default {
     },
     hideLoading () {
       this.loading = false
+    },
+    getStatisticsData () {
+      getIndexStatisticsInfo().then((res) => {
+        this.statisticsData = res
+      }).catch((error) => {
+        notify('error', '统计数据加载失败')
+      })
+    },
+    getStatisticsDataSuccess () {
+
+    },
+    getStatisticsDataFail () {
+
     }
   },
   created: function () {

+ 14 - 1
src/js/generalService.js

@@ -149,6 +149,19 @@ Date.prototype.Format = function (fmt) {
   return fmt
 }
 export const getFormalTimeFromDate = (date) => {
-  return date.Format("yyyy-MM-dd hh:mm:ss");
+  return date.Format('yyyy-MM-dd hh:mm:ss')
 }
 
+//
+export const getIndexStatisticsInfo = () => {
+  const data = {
+    userNum: 100,
+    agencyNum: 200,
+    deviceNum: 345,
+    projectNum: 23,
+    taskNum: 123
+  }
+  return new Promise((resolve) => {
+    resolve(data)
+  })
+}

+ 2 - 0
src/js/index.js

@@ -57,6 +57,7 @@ import {
   getAllServiceTypes,
   getFormalTimeFromDate,
   getGreenChannelAddProjectExcelTemplateFile,
+  getIndexStatisticsInfo,
   getProvinceCodeByProvinceName,
   getProvinceNameByProvinceCode,
   getUserIdentity,
@@ -210,6 +211,7 @@ export {
   //保存数据到本地
   storageSave,
   getFormalTimeFromDate,
+  getIndexStatisticsInfo
 }
 
 export const defaultValue = {