Browse Source

完善后台首页

李书文 1 year ago
parent
commit
ee55b3480b

+ 2 - 2
src/layout/components/Navbar.vue

@@ -242,8 +242,8 @@ export default {
           color: white;
           width: auto;
           .nickName {
-            text-align: center;
-            height: 10px;
+            text-align: left;
+            height: 15px;
             margin-top: -7px;
             margin-bottom: 5px;
 

+ 205 - 486
src/views/GATHER/index.vue

@@ -1,143 +1,53 @@
 <template>
   <div class="app-container">
-    <el-form
-      :model="queryParams"
-      ref="queryForm"
-      size="small"
-      :inline="true"
-      v-show="showSearch"
-      label-width="100px"
-    >
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
       <el-form-item label="数据类型" prop="type">
-        <el-select
-          v-model="queryParams.type"
-          placeholder="请选择数据类型"
-          clearable
-          filterable
-        >
-          <el-option
-            v-for="dict in typeList"
-            :key="dict.value + 'typeList'"
-            :label="dict.label"
-            :value="dict.value"
-          />
+        <el-select v-model="queryParams.type" placeholder="请选择数据类型" clearable filterable class="se">
+          <el-option v-for="dict in typeList" :key="dict.value + 'typeList'" :label="dict.label" :value="dict.value" />
         </el-select>
       </el-form-item>
       <el-form-item label="采集状态" prop="collStatus">
-        <el-select
-          v-model="queryParams.collStatus"
-          placeholder="请选择采集状态"
-          clearable
-          filterable
-        >
-          <el-option
-            v-for="dict in collStatus"
-            :key="dict.value + 'collStatus'"
-            :label="dict.label"
-            :value="dict.value"
-          />
+        <el-select v-model="queryParams.collStatus" placeholder="请选择采集状态" clearable filterable class="se">
+          <el-option v-for="dict in collStatus" :key="dict.value + 'collStatus'" :label="dict.label" :value="dict.value" />
         </el-select>
       </el-form-item>
       <el-form-item label="上报状态" prop="reportStatus">
-        <el-select
-          v-model="queryParams.reportStatus"
-          placeholder="请选择上报状态"
-          clearable
-          filterable
-        >
-          <el-option
-            v-for="dict in reportStatus"
-            :key="dict.value + 'reportStatus'"
-            :label="dict.label"
-            :value="dict.value"
-          />
+        <el-select v-model="queryParams.reportStatus" placeholder="请选择上报状态" clearable filterable class="se">
+          <el-option v-for="dict in reportStatus" :key="dict.value + 'reportStatus'" :label="dict.label" :value="dict.value" />
         </el-select>
       </el-form-item>
       <el-form-item label="审核状态" prop="approveStatus">
-        <el-select
-          v-model="queryParams.approveStatus"
-          placeholder="请选择审核状态"
-          clearable
-          filterable
-        >
-          <el-option
-            v-for="dict in approveStatus"
-            :key="dict.value + 'approveStatus'"
-            :label="dict.label"
-            :value="dict.value"
-          />
+        <el-select v-model="queryParams.approveStatus" placeholder="请选择审核状态" clearable filterable class="se">
+          <el-option v-for="dict in approveStatus" :key="dict.value + 'approveStatus'" :label="dict.label" :value="dict.value" />
         </el-select>
       </el-form-item>
-	   <el-form-item label="年度" prop="acname">
-        <el-input v-model="queryParams.year" placeholder="请输入年度"></el-input>
+      <el-form-item label="年度" prop="year">
+        <el-date-picker v-model="queryParams.year" type="year" format="yyyy" value-format="yyyy" placeholder="选择年度" class="se"></el-date-picker>
+      </el-form-item>
+      <el-form-item label="月份" prop="month">
+        <el-date-picker v-model="queryParams.month" type="month" format="MM" value-format="MM" placeholder="选择月份" class="se"></el-date-picker>
       </el-form-item>
-	   <el-form-item label="月份" prop="acname">
-        <el-input v-model="queryParams.month" placeholder="请输入月份"></el-input>
-      </el-form-item>	  
       <el-form-item>
-        <el-button
-          type="primary"
-          icon="el-icon-search"
-          size="mini"
-          @click="handleQuery"
-          >搜索</el-button
-        >
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
-          >重置</el-button
-        >
+        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
-        <el-button type="success" plain size="mini" @click="openUpload = true"
-          >导入</el-button
-        >
-
-        <!-- <el-upload
-          :show-file-list="false"
-          :http-request="httprequest"
-          :before-upload="uploadFile"
-          class="upload-demo"
-          action="#"
-          :auto-upload="true"
-          :on-change="handleChange"
-          :file-list="fileList"
-        >
-          <el-button type="success" plain size="mini">导入</el-button>
-        </el-upload> -->
+        <el-button type="success" @click="openUpload = true">导入</el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-button
-          plain
-          size="mini"
-          @click="handleDownload()"
-          :disabled="radio === '' ? true : false"
-          >下载导入模板</el-button
-        >
+        <el-button @click="handleDownload()" :title="radio === '' ? '请先选择下面对应的单位模板' : ''" :disabled="radio === '' ? true : false">下载导入模板</el-button>
       </el-col>
-      <right-toolbar
-        :showSearch.sync="showSearch"
-        @queryTable="getList"
-      ></right-toolbar>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table
-      
-      :data="GATHERList"
-      @selection-change="handleSelectionChange"
-      @row-click="showRow"
-    >
+    <el-table :data="GATHERList" @selection-change="handleSelectionChange" @row-click="showRow">
       <!-- @current-change="handleCurrentChange" -->
       <el-table-column label="选择" fixed="left" width="70" center>
         <template scope="scope">
-          <el-radio
-            class="radio"
-            v-model="radio"
-            :label="scope.$index"
-            @change.native="getCurrentRow(scope.row)"
-            >{{ "" }}</el-radio
-          >
+          <el-radio class="radio" v-model="radio" :label="scope.$index" @change.native="getCurrentRow(scope.row)">{{ '' }}</el-radio>
         </template>
       </el-table-column>
       <!-- <el-table-column type="selection" width="55" align="center" /> -->
@@ -156,7 +66,7 @@
         <template slot-scope="scope">
           {{ scope.row.year }}
         </template>
-      </el-table-column>	  
+      </el-table-column>
       <el-table-column label="月份" align="center" prop="month">
         <template slot-scope="scope">
           {{ scope.row.month }}
@@ -174,7 +84,7 @@
           <span v-if="scope.row.reportStatus == 1">已上报</span>
         </template>
       </el-table-column>
-      <el-table-column label="上报人" align="center" prop="reportName" width="110"/>
+      <el-table-column label="上报人" align="center" prop="reportName" width="110" />
       <el-table-column label="上报时间" align="center" prop="createTime" width="100" />
 
       <el-table-column label="审核状态" align="center" prop="approveStatus">
@@ -185,11 +95,7 @@
           <span v-if="scope.row.approveStatus == 3">审核拒绝</span>
         </template>
       </el-table-column>
-      <el-table-column
-        label="操作"
-        align="center"
-        class-name="small-padding fixed-width"
-      >
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <!-- <el-button
             style="margin: 0 2px"
@@ -198,182 +104,60 @@
             @click="handleDownload(scope.row)"
             >下载导入模板</el-button
           > -->
-          <el-button
-            style="margin: 0 2px"
-            v-if="scope.row.collStatus == 0"
-            size="mini"
-            type="text"
-            @click="handleUpdate(scope.row)"
-            >录入</el-button
-          >
+          <el-button style="margin: 0 2px" v-if="scope.row.collStatus == 0" size="mini" type="text" @click="handleUpdate(scope.row)">录入</el-button>
           <template v-if="scope.row.reportStatus == 0 && scope.row.collStatus == 1">
-          <el-popconfirm
-            title="确定上报吗?"
-            @confirm="handleReport(scope.row)"
-          >
-            <el-button
-              style="margin: 0 2px"
-              
-              size="mini"
-              slot="reference"
-              type="text"
-              >上报</el-button
-            >
+            <el-popconfirm title="确定上报吗?" @confirm="handleReport(scope.row)">
+              <el-button style="margin: 0 2px" size="mini" slot="reference" type="text">上报</el-button>
+            </el-popconfirm>
+          </template>
+          <el-popconfirm title="确定提交吗?" @confirm="handleApprove(scope.row)">
+            <el-button style="margin: 0 2px" v-if="scope.row.approveStatus == 0 && scope.row.collStatus == 1" size="mini" type="text" slot="reference">提交审核</el-button>
           </el-popconfirm>
-        </template>
-          <el-popconfirm
-            title="确定提交吗?"
-            @confirm="handleApprove(scope.row)"
-          >
-            <el-button
-              style="margin: 0 2px"
-              v-if="scope.row.approveStatus == 0 && scope.row.collStatus == 1"
-              size="mini"
-              type="text"
-              slot="reference"
-              >提交审核</el-button
-            >
-          </el-popconfirm>
-          <el-button
-            style="margin: 0 2px"
-            v-if="scope.row.collStatus == 1"
-            size="mini"
-            type="text"
-            @click="handleDetail(scope.row, 0)"
-            >查看</el-button
-          >
+          <el-button style="margin: 0 2px" v-if="scope.row.collStatus == 1" size="mini" type="text" @click="handleDetail(scope.row, 0)">查看</el-button>
 
-          <el-button
-            style="margin: 0 2px"
-            v-if="
-              scope.row.collStatus == 1 &&
-              scope.row.reportStatus == 0 &&
-              scope.row.approveStatus == 0
-            "
-            size="mini"
-            type="text"
-            @click="handleDetail(scope.row, 1)"
-            >修改</el-button
-          >
+          <el-button style="margin: 0 2px" v-if="scope.row.collStatus == 1 && scope.row.reportStatus == 0 && scope.row.approveStatus == 0" size="mini" type="text" @click="handleDetail(scope.row, 1)">修改</el-button>
         </template>
       </el-table-column>
     </el-table>
 
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
 
     <!-- 上传文件对话框 -->
-    <el-dialog
-      center
-      title="导入"
-      :visible.sync="openUpload"
-      width="50%"
-      append-to-body
-    >
-      <el-form
-        ref="uploadForm"
-        :model="uploadForm"
-        :rules="rules"
-        label-width="120px"
-      >
+    <el-dialog center title="导入" :visible.sync="openUpload" width="50%" append-to-body>
+      <el-form ref="uploadForm" :model="uploadForm" :rules="rules" label-width="120px">
         <el-form-item label="数据类型" prop="type">
-          <el-select
-            v-model="uploadForm.type"
-            placeholder="请选择数据类型"
-            clearable
-            filterable
-          >
-            <el-option
-              v-for="dict in typeList"
-              :key="dict.value + 'typeList'"
-              :label="dict.label"
-              :value="dict.value"
-            />
+          <el-select v-model="uploadForm.type" placeholder="请选择数据类型" clearable filterable>
+            <el-option v-for="dict in typeList" :key="dict.value + 'typeList'" :label="dict.label" :value="dict.value" />
           </el-select>
         </el-form-item>
-
         <el-form-item label="文件" prop="linkUrl" v-show="uploadForm.type">
-          <el-upload
-            class="upload-demo"
-            ref="upload"
-            action="#"
-            :http-request="httprequest"
-            :before-upload="uploadFile"
-            :file-list="fileList"
-            :auto-upload="false"
-            :limit="1"
-          >
-            <el-button slot="trigger" size="small" type="primary"
-              >选取文件</el-button
-            >
+          <el-upload class="upload-demo" ref="upload" action="#" :http-request="httprequest" :before-upload="uploadFile" :file-list="fileList" :auto-upload="false" :limit="1">
+            <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
           </el-upload>
-          <!-- <el-upload
-            :http-request="httprequest"
-            :before-upload="uploadFile"
-            :limit="1"
-            class="upload-demo"
-            action="#"
-            :auto-upload="true"
-            :on-change="handleChange"
-            :file-list="fileList"
-          >
-            <el-button size="small" type="primary">点击上传</el-button>
-          </el-upload> -->
         </el-form-item>
+        <div class="tips-text">
+          <span class="tit">提示</span>
+          <p>1.请先下载对应单位名称模板;</p>
+          <p>2.上传前,请先检查数据的完整性;</p>
+        </div>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitUpload">导 入</el-button>
         <el-button @click="cancel">取 消</el-button>
-        <!-- <el-button @click="cancel">取 消</el-button> -->
       </div>
     </el-dialog>
 
     <!-- 录入数据采集对话框 -->
-    <el-dialog
-      center
-      :title="title"
-      :visible.sync="open"
-      width="50%"
-      append-to-body
-    >
-      <el-tabs
-        v-if="this.form.type == 0"
-        v-model="activeName"
-        type="border-card"
-        @tab-click="handleClick"
-      >
-        <el-tab-pane
-          v-for="(item, index) in tabList"
-          :key="index + 'tabs'"
-          :label="item.normName"
-          :name="item.normName"
-        >
-          <el-form   
-            v-for="(listItem, listIndex) in form.feeLists" 
-            :key=" index + listIndex + listItem.normId"
-            :rules='validatorList(listItem.normfeeName)'
-            :model="listItem"
-            :ref="'form' + listIndex"
-            >
+    <el-dialog center :title="title" :visible.sync="open" width="50%" append-to-body>
+      <el-tabs v-if="this.form.type == 0" v-model="activeName" type="border-card" @tab-click="handleClick">
+        <el-tab-pane v-for="(item, index) in tabList" :key="index + 'tabs'" :label="item.normName" :name="item.normName">
+          <el-form v-for="(listItem, listIndex) in form.feeLists" :key="index + listIndex + listItem.normId" :rules="validatorList(listItem.normfeeName)" :model="listItem" :ref="'form' + listIndex">
             <!-- :rules="rules" ref="form" -->
-            <el-form-item
-              :key="listItem.normfeeId"
-              :label="listItem.normfeeName"
-              v-if="listItem.normId == item.normId"
-              prop="collCalue"
-            >
+            <el-form-item :key="listItem.normfeeId" :label="listItem.normfeeName" v-if="listItem.normId == item.normId" prop="collCalue">
               <!-- 这里科研失败!想动态绑定校验规则的 -->
               <!-- :prop="listItem.normfeeId" -->
               <!-- :rules="rules.listItem.normfeeId" -->
-              <el-input
-                v-model="listItem.collCalue"
-                :placeholder="'请输入' + listItem.normfeeName"
-              ></el-input>
+              <el-input v-model="listItem.collCalue" :placeholder="'请输入' + listItem.normfeeName"></el-input>
             </el-form-item>
           </el-form>
 
@@ -392,30 +176,17 @@
           </el-form> -->
         </el-tab-pane>
       </el-tabs>
-     <template  v-else-if="this.form.type == 1">
-      <el-form
-        v-for="(listItem, listIndex) in form.feeLists"
-        :model="listItem"
-        :ref="'form' + listIndex"
-        :rules="rules"
-      >
-        <!-- :rules="rules" ref="form" -->
-        <el-form-item
-          :key="listItem.normfeeId"
-          :label="listItem.normfeeName"
-          prop="collCalue"
-          
-        >
-          <!-- 这里科研失败!想动态绑定校验规则的 -->
-          <!-- :prop="listItem.normfeeId" -->
-          <!-- :rules="rules.listItem.normfeeId" -->
-          <el-input
-            v-model="listItem.collCalue"
-            :placeholder="'请输入' + listItem.normfeeName" 
-          ></el-input>
-        </el-form-item>
-      </el-form>
-    </template>
+      <template v-else-if="this.form.type == 1">
+        <el-form v-for="(listItem, listIndex) in form.feeLists" :model="listItem" :ref="'form' + listIndex" :rules="rules">
+          <!-- :rules="rules" ref="form" -->
+          <el-form-item :key="listItem.normfeeId" :label="listItem.normfeeName" prop="collCalue">
+            <!-- 这里科研失败!想动态绑定校验规则的 -->
+            <!-- :prop="listItem.normfeeId" -->
+            <!-- :rules="rules.listItem.normfeeId" -->
+            <el-input v-model="listItem.collCalue" :placeholder="'请输入' + listItem.normfeeName"></el-input>
+          </el-form-item>
+        </el-form>
+      </template>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm('add')">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
@@ -424,46 +195,16 @@
     </el-dialog>
 
     <!-- 查看或修改 -->
-    <el-dialog
-      center
-      :title="title"
-      :visible.sync="openDetail"
-      width="50%"
-      append-to-body
-    >
-      <el-tabs
-        v-if="this.form.type == 0"
-        v-model="activeName"
-        type="border-card"
-        @tab-click="handleClick"
-      >
-        <el-tab-pane
-          v-for="(item, index) in tabList"
-          :key="index + 'tabs'"
-          :label="item.normName"
-          :name="item.normName"
-        >
-          <el-form 
-            v-for="(listItem, listIndex) in form.feeLists"
-            :model="listItem"
-            :ref="'form' + listIndex"
-            :rules="rules"
-            >
+    <el-dialog center :title="title" :visible.sync="openDetail" width="50%" append-to-body>
+      <el-tabs v-if="this.form.type == 0" v-model="activeName" type="border-card" @tab-click="handleClick">
+        <el-tab-pane v-for="(item, index) in tabList" :key="index + 'tabs'" :label="item.normName" :name="item.normName">
+          <el-form v-for="(listItem, listIndex) in form.feeLists" :model="listItem" :ref="'form' + listIndex" :rules="rules">
             <!-- :rules="rules" ref="form" -->
-            <el-form-item
-              prop="collCalue"
-              :key="listItem.normfeeId"
-              :label="listItem.normfeeName"
-              v-if="listItem.normId == item.normId"
-            >
+            <el-form-item prop="collCalue" :key="listItem.normfeeId" :label="listItem.normfeeName" v-if="listItem.normId == item.normId">
               <!-- 这里科研失败!想动态绑定校验规则的 -->
               <!-- :prop="listItem.normfeeId" -->
               <!-- :rules="rules.listItem.normfeeId" -->
-              <el-input
-                :disabled="!edit"
-                v-model="listItem.collCalue"
-                :placeholder="'请输入' + listItem.normfeeName"
-              ></el-input>
+              <el-input :disabled="!edit" v-model="listItem.collCalue" :placeholder="'请输入' + listItem.normfeeName"></el-input>
             </el-form-item>
           </el-form>
 
@@ -483,30 +224,17 @@
         </el-tab-pane>
       </el-tabs>
 
-      <el-form
-        :model="form"
-        v-else-if="this.form.type == 1"
-      >
+      <el-form :model="form" v-else-if="this.form.type == 1">
         <!-- :rules="rules" ref="form" -->
-        <el-form-item
-          v-for="(listItem, listIndex) in form.feeLists"
-          :key="listItem.normfeeId"
-          :label="listItem.normfeeName"
-        >
+        <el-form-item v-for="(listItem, listIndex) in form.feeLists" :key="listItem.normfeeId" :label="listItem.normfeeName">
           <!-- 这里科研失败!想动态绑定校验规则的 -->
           <!-- :prop="listItem.normfeeId" -->
           <!-- :rules="rules.listItem.normfeeId" -->
-          <el-input
-            :disabled="!edit"
-            v-model="listItem.collCalue"
-            :placeholder="'请输入' + listItem.normfeeName"
-          ></el-input>
+          <el-input :disabled="!edit" v-model="listItem.collCalue" :placeholder="'请输入' + listItem.normfeeName"></el-input>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm('edit')" v-if="edit"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="submitForm('edit')" v-if="edit">确 定</el-button>
         <el-button type="primary" @click="cancel">返 回</el-button>
       </div>
     </el-dialog>
@@ -514,52 +242,40 @@
 </template>
 
 <script>
-import {
-  listGATHER,
-  getGATHER,
-  delGATHER,
-  addGATHER,
-  updateGATHER,
-  getInfoByColl,
-  approve,
-  report,
-  download,
-  upload,
-} from "@/api/portal/GATHER/GATHER.js";
-import { saveAs } from "file-saver";
-import { getToken } from "@/utils/auth";
-import axios from "axios";
+import { listGATHER, getGATHER, delGATHER, addGATHER, updateGATHER, getInfoByColl, approve, report, download, upload } from '@/api/portal/GATHER/GATHER.js';
+import { saveAs } from 'file-saver';
+import { getToken } from '@/utils/auth';
+import axios from 'axios';
 
 export default {
-  name: "GATHER",
+  name: 'GATHER',
   data() {
-    
     return {
       edit: Boolean, //false 查看  true修改
       tabList: [],
       feeLists: [],
-      activeName: "",
+      activeName: '',
       //数据类型(0=量化指标数据,1=月报表数据)
       typeList: [
-        { label: "量化指标数据", value: "0" },
-        { label: "月报表数据", value: "1" },
+        { label: '量化指标数据', value: '0' },
+        { label: '月报表数据', value: '1' }
       ],
       //采集状态(0=未采集,1=已采集)
       collStatus: [
-        { label: "未采集", value: "0" },
-        { label: "已采集", value: "1" },
+        { label: '未采集', value: '0' },
+        { label: '已采集', value: '1' }
       ],
       //上报状态(0=未上报,=1已上报)
       reportStatus: [
-        { label: "未上报", value: "0" },
-        { label: "已上报", value: "1" },
+        { label: '未上报', value: '0' },
+        { label: '已上报', value: '1' }
       ],
       //审核状态(0=未审核,1审核中,2=审核通过,3=审核拒绝)
       approveStatus: [
-        { label: "未审核", value: "0" },
-        { label: "审核中", value: "1" },
-        { label: "审核通过", value: "2" },
-        { label: "审核拒绝", value: "3" },
+        { label: '未审核', value: '0' },
+        { label: '审核中', value: '1' },
+        { label: '审核通过', value: '2' },
+        { label: '审核拒绝', value: '3' }
       ],
       // 根路径
       baseURL: process.env.VUE_APP_BASE_API,
@@ -578,7 +294,7 @@ export default {
       // 数据采集表格数据
       GATHERList: [],
       // 弹出层标题
-      title: "",
+      title: '',
       // 是否显示弹出层
       open: false,
       openDetail: false,
@@ -594,85 +310,88 @@ export default {
         delFlag: null,
         deptId: null,
         type: null,
+        year: null,
         month: null,
         collStatus: null,
         reportStatus: null,
-        approveStatus: null,
+        approveStatus: null
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
         // id: [{ required: true, message: "$comment不能为空", trigger: "blur" }],
-        collCalue: [{ required: true, message: "不能为空", trigger: "blur" },
-                    { trigger: "blur", validator: this.validatorFloatNum }
-                    ]
-      },
-      rulesOne: {
-        
+        collCalue: [
+          { required: true, message: '不能为空', trigger: 'blur' },
+          { trigger: 'blur', validator: this.validatorFloatNum }
+        ]
       },
+      rulesOne: {},
 
       //设置文件名字
-      setFileName: "",
-      radio: "",
+      setFileName: '',
+      radio: '',
       rowData: {},
       fileList: [],
       uploadForm: {},
-      openUpload: false,
+      openUpload: false
     };
   },
   created() {
     this.getList();
   },
   methods: {
-    validatorNum(rule, value, callback) {
-
-    },
+    validatorNum(rule, value, callback) {},
     validatorFloatNum(rule, value, callback) {
       let reg = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g;
       if (!reg.test(value)) {
-                callback(new Error('请输入数字和正确格式的数字'));
-            }else if(value.split(".").length > 2) {
-	             callback(new Error("请输入正确格式的数字")); //防止输入多个小数点
-	          }else if (value.indexOf(".") != -1 && value.split('.')[1].length > 2) {
-               callback(new Error('最多只能输入两位小数')) //小数点后两位
-            }else {
-              callback()
-            }
+        callback(new Error('请输入数字和正确格式的数字'));
+      } else if (value.split('.').length > 2) {
+        callback(new Error('请输入正确格式的数字')); //防止输入多个小数点
+      } else if (value.indexOf('.') != -1 && value.split('.')[1].length > 2) {
+        callback(new Error('最多只能输入两位小数')); //小数点后两位
+      } else {
+        callback();
+      }
     },
     validatorNum(rule, value, callback) {
       let reg = /^[+]?(0|([1-9]\d*))(\.\d+)?$/g;
       if (!reg.test(value)) {
-                callback(new Error('请输入正数和正确格式的数字'));
-            }else if(value.split(".").length > 2) {
-	             callback(new Error("请输入正确格式的数字")); //防止输入多个小数点
-	          }else if (value.indexOf(".") != -1 && value.split('.')[1].length > 2) {
-               callback(new Error('最多只能输入两位小数')) //小数点后两位
-            }else {
-              callback()
-            }
+        callback(new Error('请输入正数和正确格式的数字'));
+      } else if (value.split('.').length > 2) {
+        callback(new Error('请输入正确格式的数字')); //防止输入多个小数点
+      } else if (value.indexOf('.') != -1 && value.split('.')[1].length > 2) {
+        callback(new Error('最多只能输入两位小数')); //小数点后两位
+      } else {
+        callback();
+      }
     },
     validatorList(name) {
-       if(typeof name != 'string') return
+      if (typeof name != 'string') return;
 
-       if(name.includes('增幅') || name.includes('验收率') || name.includes('开发率') || name.includes('比重')) {
-        return { collCalue: [
-                 { required: true, message: "不能为空", trigger: "blur" },
-                 {trigger: "blur", validator: this.validatorFloatNum }]
-                }
-
-       }
-       if(name == '期末单位面积企业从业人员' ||  name == '活跃企业数'  || name == '期末企业从业人员') {
-        return { collCalue: [
-          { required: true, message: "不能为空", trigger: "blur" },
-          {pattern: /^[1-9]\d*$/, message: "请输入正整数",trigger: "blur"}]
-         }
-       }else {
-        return { collCalue: [
-          { required: true, message: "不能为空", trigger: "blur" },
-          {trigger: "blur", validator: this.validatorNum }]
-         }
-       }
+      if (name.includes('增幅') || name.includes('验收率') || name.includes('开发率') || name.includes('比重')) {
+        return {
+          collCalue: [
+            { required: true, message: '不能为空', trigger: 'blur' },
+            { trigger: 'blur', validator: this.validatorFloatNum }
+          ]
+        };
+      }
+      if (name == '期末单位面积企业从业人员' || name == '活跃企业数' || name == '期末企业从业人员') {
+        return {
+          collCalue: [
+            { required: true, message: '不能为空', trigger: 'blur' },
+            { pattern: /^[1-9]\d*$/, message: '请输入正整数', trigger: 'blur' }
+          ]
+        };
+      } else {
+        return {
+          collCalue: [
+            { required: true, message: '不能为空', trigger: 'blur' },
+            { trigger: 'blur', validator: this.validatorNum }
+          ]
+        };
+      }
     },
     submitUpload() {
       this.$refs.upload.submit();
@@ -683,7 +402,7 @@ export default {
     },
     handleCurrentChange(val, index) {
       this.currentRow = val;
-      this.$emit("data", val.pkg);
+      this.$emit('data', val.pkg);
     },
     handleChange(file, fileList) {
       this.fileList = fileList.slice(-3);
@@ -696,26 +415,27 @@ export default {
     //导入
     uploadFile(file) {
       let formData = new FormData();
-      formData.append("file", file);
-      formData.append("type", this.uploadForm.type);
-      upload(formData)
-      this.cancel()
-      this.openUpload = false
+      formData.append('file', file);
+      formData.append('type', this.uploadForm.type);
+      upload(formData).then(res => {
+        this.$modal.msgSuccess('上传采集附件成功!');
+        this.getList();
+        this.cancel();
+        this.openUpload = false;
+      });
     },
     //下载模板
     handleDownload() {
       let row = this.rowData;
       axios({
-        url: process.env.VUE_APP_BASE_API + "/gather/download/" + row.id,
-        method: "get",
-        responseType: "blob",
+        url: process.env.VUE_APP_BASE_API + '/gather/download/' + row.id,
+        method: 'get',
+        responseType: 'blob',
         headers: {
-          Authorization: "Bearer " + getToken(),
-        },
-      }).then((res) => {
-        const temp = res.headers["content-disposition"]
-          .split(";")[1]
-          .split("filename=")[1];
+          Authorization: 'Bearer ' + getToken()
+        }
+      }).then(res => {
+        const temp = res.headers['content-disposition'].split(';')[1].split('filename=')[1];
         const fileName = decodeURIComponent(temp);
         const blob = new Blob([res.data]);
         saveAs(blob, fileName);
@@ -724,15 +444,15 @@ export default {
     },
     //上报
     handleReport(data) {
-      report(data).then((res) => {
-        this.$modal.msgSuccess("上报成功");
+      report(data).then(res => {
+        this.$modal.msgSuccess('上报成功');
         this.getList();
       });
     },
     //提交审核
     handleApprove(data) {
-      this.$modal.msgSuccess("提交审核成功");
-      approve(data).then((res) => {
+      this.$modal.msgSuccess('提交审核成功');
+      approve(data).then(res => {
         this.getList();
       });
     },
@@ -741,7 +461,7 @@ export default {
     /** 查询数据采集列表 */
     getList() {
       this.loading = true;
-      listGATHER(this.queryParams).then((response) => {
+      listGATHER(this.queryParams).then(response => {
         this.GATHERList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -762,15 +482,15 @@ export default {
         deptId: null,
         type: null,
         month: null,
-        collStatus: "0",
-        reportStatus: "0",
-        approveStatus: "0",
+        collStatus: '0',
+        reportStatus: '0',
+        approveStatus: '0'
       };
       this.uploadForm = {
-        type: "",
+        type: ''
       };
       this.fileList = [];
-      this.resetForm("form");
+      this.resetForm('form');
     },
     /** 搜索按钮操作 */
     handleQuery() {
@@ -779,12 +499,12 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
+      this.resetForm('queryForm');
       this.handleQuery();
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.id);
+      this.ids = selection.map(item => item.id);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
@@ -793,7 +513,7 @@ export default {
       this.reset();
       this.open = true;
       this.openDetail = true;
-      this.title = "添加数据采集";
+      this.title = '添加数据采集';
     },
     /** 录入按钮操作 */
     handleUpdate(row) {
@@ -801,11 +521,11 @@ export default {
       this.tabList = [];
       this.form = [];
       const id = row.id || this.ids;
-      getInfoByColl(id).then((response) => {
+      getInfoByColl(id).then(response => {
         //深拷贝,而不是拷贝地址
         this.form = JSON.parse(JSON.stringify(response.data));
         this.open = true;
-        this.title = "数据录入";
+        this.title = '数据录入';
         //深拷贝,而不是拷贝地址
         this.tabList = JSON.parse(JSON.stringify(response.data.feeLists));
         let dataList = response.data.feeLists;
@@ -859,11 +579,11 @@ export default {
       this.tabList = [];
       this.form = [];
       const id = row.id || this.ids;
-      getGATHER(id).then((response) => {
+      getGATHER(id).then(response => {
         //深拷贝,而不是拷贝地址
         this.form = JSON.parse(JSON.stringify(response.data));
         this.openDetail = true;
-        this.title = "数据查看";
+        this.title = '数据查看';
         //深拷贝,而不是拷贝地址
         this.tabList = JSON.parse(JSON.stringify(response.data.feeLists));
         let dataList = response.data.feeLists;
@@ -923,39 +643,38 @@ export default {
       //   }
       // }
       // 验证表单
-      let p = []
+      let p = [];
       p = this.form.feeLists.map((item, index) => {
         return new Promise((resolve, reject) => {
-          this.$refs['form' + index][0].validate((valid) => {
+          this.$refs['form' + index][0].validate(valid => {
             if (valid) {
-                  resolve() //完成态
-                } else {
-                  reject() //已失败
-                }
-          })
-        }) 
-        
-      })
-      Promise.all(p).then(() => {
-        if (type == "add") {
-        addGATHER(this.form).then((response) => {
-          this.$modal.msgSuccess("录入成功");
-          this.open = false;
-          this.getList();
-        });
-      } else if (type == "edit") {
-        updateGATHER(this.form).then((response) => {
-          this.$modal.msgSuccess("修改成功");
-          this.openDetail = false;
-          this.getList();
+              resolve(); //完成态
+            } else {
+              reject(); //已失败
+            }
+          });
         });
-      }
-      }).catch((err) => {
-          console.log(err)
-          this.$message.error('请检查是否有必填项未输入!')
+      });
+      Promise.all(p)
+        .then(() => {
+          if (type == 'add') {
+            addGATHER(this.form).then(response => {
+              this.$modal.msgSuccess('录入成功');
+              this.open = false;
+              this.getList();
+            });
+          } else if (type == 'edit') {
+            updateGATHER(this.form).then(response => {
+              this.$modal.msgSuccess('修改成功');
+              this.openDetail = false;
+              this.getList();
+            });
+          }
         })
-
-      
+        .catch(err => {
+          console.log(err);
+          this.$message.error('请检查是否有必填项未输入!');
+        });
     },
     /** 删除按钮操作 */
     handleDelete(row) {
@@ -967,20 +686,20 @@ export default {
         })
         .then(() => {
           this.getList();
-          this.$modal.msgSuccess("删除成功");
+          this.$modal.msgSuccess('删除成功');
         })
         .catch(() => {});
     },
     /** 导出按钮操作 */
     handleExport() {
       this.download(
-        "business/GATHER/export",
+        'business/GATHER/export',
         {
-          ...this.queryParams,
+          ...this.queryParams
         },
         `GATHER_${new Date().getTime()}.xlsx`
       );
-    },
-  },
+    }
+  }
 };
 </script>

+ 5 - 1
src/views/dashboard/BarChart.vue

@@ -27,6 +27,10 @@ export default {
     height: {
       type: String,
       default: '310px'
+    },
+    tag: {
+      type: String,
+      default: '人'
     }
   },
   data() {
@@ -77,7 +81,7 @@ export default {
           axisPointer: {
             type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
           },
-          formatter: '{b} : {c}'
+          formatter: '{b} : {c}' + this.tag
         },
         grid: {
           top: '13%',

+ 27 - 23
src/views/dashboard/PieChart.vue

@@ -52,6 +52,9 @@ export default {
     this.$nextTick(() => {
       this.initChart();
     });
+    window.addEventListener('resize', () => {
+      this.chart.resize();
+    });
   },
   beforeDestroy() {
     if (!this.chart) {
@@ -74,40 +77,41 @@ export default {
           trigger: 'item',
           formatter: '{b} : {d}%'
         },
-        color:['#fddb78','#2561ef','#3ed59f','#fa746b','#666ee8'],
+        color: ['#76a1ff', '#1d8ae5', '#1665c2', '#8ecbfa', '#a9cffe'],
         legend: {
-          left: 'center',
-          bottom: '0%',
-           itemGap: 15,
+          orient: 'vertical',
+          top: '18%',
+          x: 'left',
+          itemWidth: 12,
+          itemGap: 16,
+          icon: 'circle',
           textStyle: {
-            fontSize: '14',
-            color: '#545555'
+            color: '#545555',
+            fontSize: 14
+          },
+          formatter: function (name) {
+            let total = 0;
+            for (let i = 0; i < data.length; i++) {
+              total += data[i].value;
+            }
+            for (let i = 0; i < data.length; i++) {
+              if (data[i].name === name) {
+                let percent = ((data[i].value / total) * 100).toFixed(2); // 计算百分比并保留两位小数
+                return name + ' (' + data[i].value + '亿,' + percent + '%)';
+              }
+            }
           }
         },
         series: [
           {
             type: 'pie',
             radius: ['40%', '57%'],
-            center: ['55%', '35%'],
+            center: ['70%', '45%'],
             data: data,
             show: true,
             label: {
-              position: 'center',
-              formatter: function (params) {
-                return '{a|进出口总值}\n\n' + 1000;
-              },
-              rich: {
-                a: {
-                  color: 'gray',
-                  fontSize: 14,
-                  lineHeight: 20
-                },
-                b: {
-                  color: '#FFA500',
-                  fontSize: 20,
-                  fontWeight: 'bold',
-                  lineHeight: 30
-                }
+              normal: {
+                show: false
               }
             }
           }

+ 218 - 140
src/views/index.vue

@@ -2,131 +2,74 @@
   <div class="dashboard-editor-container">
     <div class="mtitle">
       早上好,管理员!
-      <iframe allowtransparency="true" frameborder="0" width="180" height="36" scrolling="no" style="padding-top:10px;"
-      						src="//tianqi.2345.com/plugin/widget/index.htm?s=3&z=2&t=0&v=0&d=2&bd=0&k=&f=#545555&ltf=#545555&htf=ffffff&q=1&e=1&a=1&c=72036&w=180&h=36&align=center"></iframe>
-      </div>
-<!--    <div class="cbox">-->
-<!--      <div class="ctitle">各保税区综合评分概况</div>-->
-<!--      <div class="rows">-->
-<!--        <div class="row">-->
-<!--          <div class="out">-->
-<!--            <div class="int">-->
-<!--              <span class="icon" style="background-color: rgba(37, 97, 239, 1)">&#xe6e0;</span>-->
-<!--              <div class="num">80</div>-->
-<!--              <div class="desc">南宁综合保税区</div>-->
-<!--            </div>-->
-<!--          </div>-->
-<!--        </div>-->
-<!--        <div class="row">-->
-<!--          <div class="out">-->
-<!--            <div class="int">-->
-<!--              <span class="icon" style="background-color: rgba(102, 110, 232, 1)">&#xe6e0;</span>-->
-<!--              <div class="num">80</div>-->
-<!--              <div class="desc">钦州综合保税区</div>-->
-<!--            </div>-->
-<!--          </div>-->
-<!--        </div>-->
-<!--        <div class="row">-->
-<!--          <div class="out">-->
-<!--            <div class="int">-->
-<!--              <span class="icon" style="background-color: rgba(61, 212, 167, 1)">&#xe6e0;</span>-->
-<!--              <div class="num">80</div>-->
-<!--              <div class="desc">北海综合保税区</div>-->
-<!--            </div>-->
-<!--          </div>-->
-<!--        </div>-->
-<!--        <div class="row">-->
-<!--          <div class="out">-->
-<!--            <div class="int">-->
-<!--              <span class="icon" style="background-color: rgba(250, 116, 107, 1)">&#xe6e0;</span>-->
-<!--              <div class="num">80</div>-->
-<!--              <div class="desc">凭祥综合保税区</div>-->
-<!--            </div>-->
-<!--          </div>-->
-<!--        </div>-->
-<!--        <div class="row">-->
-<!--          <div class="out">-->
-<!--            <div class="int">-->
-<!--              <span class="icon" style="background-color: rgba(253, 219, 120, 1)">&#xe6e0;</span>-->
-<!--              <div class="num">80</div>-->
-<!--              <div class="desc">梧州综合保税区</div>-->
-<!--            </div>-->
-<!--          </div>-->
-<!--        </div>-->
-<!--      </div>-->
-<!--    </div>-->
+      <iframe
+        allowtransparency="true"
+        frameborder="0"
+        width="180"
+        height="36"
+        scrolling="no"
+        style="padding-top: 10px"
+        src="//tianqi.2345.com/plugin/widget/index.htm?s=3&z=2&t=0&v=0&d=2&bd=0&k=&f=#545555&ltf=#545555&htf=ffffff&q=1&e=1&a=1&c=72036&w=180&h=36&align=center"
+      ></iframe>
+    </div>
+    <!--    <div class="cbox">-->
+    <!--      <div class="ctitle">各保税区综合评分概况</div>-->
+    <!--      <div class="rows">-->
+    <!--        <div class="row">-->
+    <!--          <div class="out">-->
+    <!--            <div class="int">-->
+    <!--              <span class="icon" style="background-color: rgba(37, 97, 239, 1)">&#xe6e0;</span>-->
+    <!--              <div class="num">80</div>-->
+    <!--              <div class="desc">南宁综合保税区</div>-->
+    <!--            </div>-->
+    <!--          </div>-->
+    <!--        </div>-->
+    <!--        <div class="row">-->
+    <!--          <div class="out">-->
+    <!--            <div class="int">-->
+    <!--              <span class="icon" style="background-color: rgba(102, 110, 232, 1)">&#xe6e0;</span>-->
+    <!--              <div class="num">80</div>-->
+    <!--              <div class="desc">钦州综合保税区</div>-->
+    <!--            </div>-->
+    <!--          </div>-->
+    <!--        </div>-->
+    <!--        <div class="row">-->
+    <!--          <div class="out">-->
+    <!--            <div class="int">-->
+    <!--              <span class="icon" style="background-color: rgba(61, 212, 167, 1)">&#xe6e0;</span>-->
+    <!--              <div class="num">80</div>-->
+    <!--              <div class="desc">北海综合保税区</div>-->
+    <!--            </div>-->
+    <!--          </div>-->
+    <!--        </div>-->
+    <!--        <div class="row">-->
+    <!--          <div class="out">-->
+    <!--            <div class="int">-->
+    <!--              <span class="icon" style="background-color: rgba(250, 116, 107, 1)">&#xe6e0;</span>-->
+    <!--              <div class="num">80</div>-->
+    <!--              <div class="desc">凭祥综合保税区</div>-->
+    <!--            </div>-->
+    <!--          </div>-->
+    <!--        </div>-->
+    <!--        <div class="row">-->
+    <!--          <div class="out">-->
+    <!--            <div class="int">-->
+    <!--              <span class="icon" style="background-color: rgba(253, 219, 120, 1)">&#xe6e0;</span>-->
+    <!--              <div class="num">80</div>-->
+    <!--              <div class="desc">梧州综合保税区</div>-->
+    <!--            </div>-->
+    <!--          </div>-->
+    <!--        </div>-->
+    <!--      </div>-->
+    <!--    </div>-->
     <div class="row" style="width: 40%; float: left; margin-top: 15px">
       <div class="cbox">
         <div class="lable">快捷入口</div>
-        <div class="menu">
-          <div class="out">
-            <div class="int">
-              <div class="icon" style="background-color: rgba(255, 199, 28, 0.2); color: #fddb78">&#xe679;</div>
-              <div class="desc">数据采集</div>
-            </div>
-          </div>
-        </div>
-        <div class="menu">
-          <div class="out">
-            <div class="int">
-              <div class="icon" style="background-color: rgba(61, 212, 167, 0.2); color: #3fd4a8">&#xe616;</div>
-              <div class="desc">权限管理</div>
-            </div>
-          </div>
-        </div>
-        <div class="menu">
-          <div class="out">
-            <div class="int">
-              <div class="icon" style="background-color: rgba(255, 199, 28, 0.2); color: #fddb78">&#xe634;</div>
-              <div class="desc">质量管理</div>
-            </div>
-          </div>
-        </div>
-        <div class="menu">
-          <div class="out">
-            <div class="int">
-              <div class="icon" style="background-color: rgba(250, 116, 107, 0.2); color: #fa7c74">&#xe6d2;</div>
-              <div class="desc">全景展示</div>
-            </div>
-          </div>
-        </div>
-        <div class="menu">
-          <div class="out">
-            <div class="int">
-              <div class="icon" style="background-color: rgba(37, 97, 239, 0.2); color: #2561ef">&#xe6b2;</div>
-              <div class="desc">数据接口</div>
-            </div>
-          </div>
-        </div>
-        <div class="menu">
-          <div class="out">
-            <div class="int">
-              <div class="icon" style="background-color: rgba(61, 212, 167, 0.2); color: #3fd4a8">&#xe611;</div>
-              <div class="desc">移动端</div>
-            </div>
-          </div>
-        </div>
-        <div class="menu">
-          <div class="out">
-            <div class="int">
-              <div class="icon" style="background-color: rgba(108, 118, 244, 0.2); color: #707af4">&#xe600;</div>
-              <div class="desc">指标度量管理</div>
-            </div>
-          </div>
-        </div>
-        <div class="menu">
+        <div class="menu" v-for="(item, index) in topMenus" @click="handleSelect(item)">
           <div class="out">
             <div class="int">
-              <div class="icon" style="background-color: rgba(61, 212, 167, 0.2); color: #3fd4a8">&#xe607;</div>
-              <div class="desc">门户网站</div>
-            </div>
-          </div>
-        </div>
-        <div class="menu">
-          <div class="out">
-            <div class="int">
-              <div class="icon" style="background-color: rgba(255, 199, 28, 0.2); color: #fddb78">&#xe628;</div>
-              <div class="desc">统计查询</div>
+              <div class="icon"><svg-icon :icon-class="item.meta.icon" /></div>
+              <div class="desc omit">{{ item.meta.title }}</div>
             </div>
           </div>
         </div>
@@ -134,32 +77,65 @@
     </div>
     <div class="row" style="width: 60%; float: left; margin-top: 15px; padding-left: 20px">
       <div class="cbox">
-        <div class="lable">经营总收入</div>
-        <BarChart :chartData="chartData.bar" style="width: 100%"></BarChart>
+        <div class="lable">2023年广西综合保税区进出口总值(亿元)</div>
+        <BarChart :chartData="chartData.bar" tag="(亿元)" style="width: 100%"></BarChart>
       </div>
     </div>
-    <div class="row" style="width: 25%; float: left; margin-top: 15px">
+    <div class="row" style="width: 25%; float: left;margin-top: 15px">
       <div class="cbox">
-        <div class="lable">进出口总值</div>
-        <PieChart :chartData="chartData.pie"></PieChart>
+        <div class="lable">各综合保税区进出口总值占比(%)</div>
+        <PieChart
+          :chartData="[
+            { name: '凭祥', value: 716.33 },
+            { name: '钦州', value: 265.73 },
+            { name: '南宁', value: 215.48 },
+            { name: '北海', value: 34.49 },
+            { name: '梧州', value: 0 }
+          ]"
+        ></PieChart>
       </div>
     </div>
-    <div class="row" style="width: 25%; float: left; padding-left: 15px; margin-top: 15px">
+    <div class="row" style="width: 25%; float: left;padding-left: 15px; margin-top: 15px">
       <div class="cbox">
-        <div class="lable">加工贸易进出口值</div>
-        <PieChart :chartData="chartData.pie"></PieChart>
+        <div class="lable">各综合保税区加工贸易进出口值占比(%)</div>
+        <PieChart
+          :chartData="[
+            { name: '南宁', value: 140.09 },
+            { name: '北海', value: 31.17 },
+            { name: '梧州', value: 0.3 },
+            { name: '钦州', value: 10.06 },
+            { name: '凭祥', value: '2' }
+          ]"
+          tag="亿"
+        ></PieChart>
       </div>
     </div>
     <div class="row" style="width: 25%; float: left; padding-left: 15px; margin-top: 15px">
       <div class="cbox">
-        <div class="lable">物流货物进出口值</div>
-        <PieChart :chartData="chartData.pie"></PieChart>
+        <div class="lable">各综合保税区物流货物进出口值占比(%)</div>
+        <PieChart
+          :chartData="[
+            { name: '南宁', value: 28.82 },
+            { name: '北海', value: 0.91 },
+            { name: '梧州', value: 1 },
+            { name: '钦州', value: 227.36 },
+            { name: '凭祥', value: 708.94 }
+          ]"
+        ></PieChart>
       </div>
     </div>
     <div class="row" style="width: 25%; float: left; padding-left: 15px; margin-top: 15px">
       <div class="cbox">
-        <div class="lable">互市交易值</div>
-        <PieChart :chartData="chartData.pie"></PieChart>
+        <div class="lable">各综合保税区一般贸易进出口值占比(%)</div>
+        <PieChart
+          :chartData="[
+            { name: '南宁', value: 46.55 },
+            { name: '北海', value: 2.39 },
+            { name: '梧州', value: 2 },
+            { name: '钦州', value: 28.3 },
+            { name: '凭祥', value: 7.2 }
+          ]"
+        ></PieChart>
       </div>
     </div>
   </div>
@@ -171,6 +147,7 @@ import LineChart from './dashboard/LineChart';
 import RaddarChart from './dashboard/RaddarChart';
 import PieChart from './dashboard/PieChart';
 import BarChart from './dashboard/BarChart';
+import { constantRoutes } from '@/router';
 export default {
   name: 'Index',
   components: {
@@ -184,11 +161,11 @@ export default {
     return {
       chartData: {
         bar: [
-          { name: '凭祥', value: '1' },
-          { name: '钦州', value: '3' },
-          { name: '南宁', value: '6' },
-          { name: '北海', value: '7' },
-          { name: '梧州', value: '3' },
+          { name: '凭祥', value: 716.33 },
+          { name: '钦州', value: 265.73 },
+          { name: '南宁', value: 215.48 },
+          { name: '北海', value: 34.49 },
+          { name: '梧州', value: 0 }
         ],
         pie: [
           { name: '南宁保税区', value: '1' },
@@ -200,7 +177,105 @@ export default {
       }
     };
   },
-  methods: {}
+  computed: {
+    theme() {
+      return this.$store.state.settings.theme;
+    },
+    // 顶部显示菜单
+    topMenus() {
+      let topMenus = [];
+      this.routers.map(menu => {
+        if (menu.hidden !== true) {
+          // 兼容顶部栏一级菜单内部跳转
+          if (menu.path === '/') {
+            topMenus.push(menu.children[0]);
+          } else {
+            topMenus.push(menu);
+          }
+        }
+      });
+      return topMenus.slice(0, 9);
+    },
+    // 所有的路由信息
+    routers() {
+      return this.$store.state.permission.topbarRouters;
+    },
+    // 设置子路由
+    childrenMenus() {
+      var childrenMenus = [];
+      this.routers.map(router => {
+        for (var item in router.children) {
+          if (router.children[item].parentPath === undefined) {
+            if (router.path === '/') {
+              router.children[item].path = '/' + router.children[item].path;
+            } else {
+              if (!this.ishttp(router.children[item].path)) {
+                router.children[item].path = router.path + '/' + router.children[item].path;
+              }
+            }
+            router.children[item].parentPath = router.path;
+          }
+          childrenMenus.push(router.children[item]);
+        }
+      });
+      return constantRoutes.concat(childrenMenus);
+    },
+    // 默认激活的菜单
+    activeMenu() {
+      const path = this.$route.path;
+      let activePath = path;
+      if (path !== undefined && path.lastIndexOf('/') > 0 && hideList.indexOf(path) === -1) {
+        const tmpPath = path.substring(1, path.length);
+        activePath = '/' + tmpPath.substring(0, tmpPath.indexOf('/'));
+        this.$store.dispatch('app/toggleSideBarHide', false);
+      } else if (!this.$route.children) {
+        activePath = path;
+        this.$store.dispatch('app/toggleSideBarHide', true);
+      }
+      this.activeRoutes(activePath);
+      return activePath;
+    }
+  },
+  methods: {
+    // 菜单选择事件
+    handleSelect(item) {
+      this.isShowMenu = false;
+      this.currentIndex = item.path;
+      let key = item.path;
+      const route = this.routers.find(item => item.path === key);
+      if (this.ishttp(key)) {
+        // http(s):// 路径新窗口打开
+        window.open(key, '_blank');
+      } else if (!route || !route.children) {
+        // 没有子路由路径内部打开
+        this.$router.push({ path: key });
+        this.$store.dispatch('app/toggleSideBarHide', true);
+      } else {
+        // 显示左侧联动菜单
+        this.activeRoutes(key);
+        this.$store.dispatch('app/toggleSideBarHide', false);
+      }
+      this.$emit('showHamBurger');
+      this.$emit('closeMenuHandler');
+    },
+    // 当前激活的路由
+    activeRoutes(key) {
+      var routes = [];
+      if (this.childrenMenus && this.childrenMenus.length > 0) {
+        this.childrenMenus.map(item => {
+          if (key == item.parentPath || (key == 'index' && '' == item.path)) {
+            routes.push(item);
+          }
+        });
+      }
+      if (routes.length > 0) {
+        this.$store.commit('SET_SIDEBAR_ROUTERS', routes);
+      }
+    },
+    ishttp(url) {
+      return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1;
+    }
+  }
 };
 </script>
 
@@ -271,14 +346,17 @@ export default {
         .int {
           padding: 10px 10px 0px 10px;
           text-align: center;
+          cursor: pointer;
           .icon {
             width: 45px;
             height: 45px;
             color: white;
             border-radius: 12px;
             margin: 0 auto;
-            font-size: 25px;
-            line-height: 42px;
+            font-size: 23px;
+            line-height: 45px;
+            background-color: rgb(37, 97, 239);
+            color: white;
           }
           .desc {
             color: #545555;