liuyg
2021-07-20 eed39ea913dddfe6572f37de8c7de3f1523b6816
Merge branch 'master' of http://192.168.0.105:10010/r/zhba_regulatory
19 files modified
1 files deleted
5 files added
21449 ■■■■■ changed files
package-lock.json 17247 ●●●●● patch | view | raw | blame | history
public/img/bajgxt/bottomimg.png patch | view | raw | blame | history
public/img/bajgxt/leftbottom.png patch | view | raw | blame | history
public/img/bajgxt/lefttop.png patch | view | raw | blame | history
public/img/bajgxt/rightImg11.png patch | view | raw | blame | history
public/img/bajgxt/rightImg12.png patch | view | raw | blame | history
public/img/bajgxt/rightbottom.png patch | view | raw | blame | history
public/img/bajgxt/righttop.png patch | view | raw | blame | history
public/img/bajgxt/table.png patch | view | raw | blame | history
public/img/bajgxt/tabletitle.png patch | view | raw | blame | history
public/img/bajgxt/u1.png patch | view | raw | blame | history
public/img/bajgxt/u1618.png patch | view | raw | blame | history
src/api/index/index.js 6 ●●●● patch | view | raw | blame | history
src/api/system/user.js 181 ●●●● patch | view | raw | blame | history
src/router/views/index.js 39 ●●●●● patch | view | raw | blame | history
src/views/home/index.scss 96 ●●●●● patch | view | raw | blame | history
src/views/home/index.vue 477 ●●●●● patch | view | raw | blame | history
src/views/home/indexEchart.js 192 ●●●●● patch | view | raw | blame | history
src/views/management/idinformation.vue 184 ●●●●● patch | view | raw | blame | history
src/views/management/register.vue 1525 ●●●● patch | view | raw | blame | history
src/views/securityUnitOperation/economicAnalysis.vue 288 ●●●●● patch | view | raw | blame | history
src/views/securityUnitOperation/economicTable.vue 358 ●●●●● patch | view | raw | blame | history
src/views/securityUnitOperation/operationAnalysis.vue 165 ●●●● patch | view | raw | blame | history
src/views/securityUnitOperation/operationTable.vue 305 ●●●● patch | view | raw | blame | history
src/views/securityUnitOperation/securityEchart.js 386 ●●●● patch | view | raw | blame | history
package-lock.json
Diff too large
public/img/bajgxt/bottomimg.png
Binary files differ
public/img/bajgxt/leftbottom.png

public/img/bajgxt/lefttop.png

public/img/bajgxt/rightImg11.png
public/img/bajgxt/rightImg12.png
public/img/bajgxt/rightbottom.png

public/img/bajgxt/righttop.png

public/img/bajgxt/table.png

public/img/bajgxt/tabletitle.png

public/img/bajgxt/u1.png
public/img/bajgxt/u1618.png
src/api/index/index.js
@@ -2,20 +2,20 @@
// http://2h3f861221.wicp.vip:58646/information/SelectCount
export const securityTotal = () => {
  return request({
    url: "http://2h3f861221.wicp.vip:58646/information/SelectCount",
    url: "/api/information/SelectCount",
    method: "post"
  });
};
export const holderNum = () => {
  return request({
    url: "http://2h3f861221.wicp.vip:58646/information/SelectCounthold",
    url: "/api/information/SelectCounthold",
    method: "post"
  });
};
export const securityPer = () => {
    return request({
      url: "http://2h3f861221.wicp.vip:58646/performance/queryYearPer",
      url: "/api/performance/queryYearPer",
      method: "get"
    });
  };
src/api/system/user.js
@@ -1,120 +1,133 @@
import request from '@/router/axios';
export const getList = (current, size, params, deptId) => {
  return request({
    url: '/api/blade-user/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
      deptId,
    }
  })
    return request({
        url: '/api/blade-user/page',
        method: 'get',
        params: {
            ...params,
            current,
            size,
            deptId,
        }
    })
}
export const getListSecurity = (current, size, params, deptId) => {
    return request({
        url: '/api/blade-user/page-security',
        method: 'get',
        params: {
            ...params,
            current,
            size,
            deptId,
        }
    })
}
export const remove = (ids) => {
  return request({
    url: '/api/blade-user/remove',
    method: 'post',
    params: {
      ids,
    }
  })
    return request({
        url: '/api/blade-user/remove',
        method: 'post',
        params: {
            ids,
        }
    })
}
export const add = (row) => {
  return request({
    url: '/api/blade-user/submit',
    method: 'post',
    data: row
  })
    return request({
        url: '/api/blade-user/submit',
        method: 'post',
        data: row
    })
}
export const update = (row) => {
  return request({
    url: '/api/blade-user/update',
    method: 'post',
    data: row
  })
    return request({
        url: '/api/blade-user/update',
        method: 'post',
        data: row
    })
}
export const updatePlatform = (userId, userType, userExt) => {
  return request({
    url: '/api/blade-user/update-platform',
    method: 'post',
    params: {
      userId,
      userType,
      userExt,
    }
  })
    return request({
        url: '/api/blade-user/update-platform',
        method: 'post',
        params: {
            userId,
            userType,
            userExt,
        }
    })
}
export const getUser = (id) => {
  return request({
    url: '/api/blade-user/detail',
    method: 'get',
    params: {
      id,
    }
  })
    return request({
        url: '/api/blade-user/detail',
        method: 'get',
        params: {
            id,
        }
    })
}
export const getUserPlatform = (id) => {
  return request({
    url: '/api/blade-user/platform-detail',
    method: 'get',
    params: {
      id,
    }
  })
    return request({
        url: '/api/blade-user/platform-detail',
        method: 'get',
        params: {
            id,
        }
    })
}
export const getUserInfo = () => {
  return request({
    url: '/api/blade-user/info',
    method: 'get',
  })
    return request({
        url: '/api/blade-user/info',
        method: 'get',
    })
}
export const resetPassword = (userIds) => {
  return request({
    url: '/api/blade-user/reset-password',
    method: 'post',
    params: {
      userIds,
    }
  })
    return request({
        url: '/api/blade-user/reset-password',
        method: 'post',
        params: {
            userIds,
        }
    })
}
export const updatePassword = (oldPassword, newPassword, newPassword1) => {
  return request({
    url: '/api/blade-user/update-password',
    method: 'post',
    params: {
      oldPassword,
      newPassword,
      newPassword1,
    }
  })
    return request({
        url: '/api/blade-user/update-password',
        method: 'post',
        params: {
            oldPassword,
            newPassword,
            newPassword1,
        }
    })
}
export const updateInfo = (row) => {
  return request({
    url: '/api/blade-user/update-info',
    method: 'post',
    data: row
  })
    return request({
        url: '/api/blade-user/update-info',
        method: 'post',
        data: row
    })
}
export const grant = (userIds, roleIds) => {
  return request({
    url: '/api/blade-user/grant',
    method: 'post',
    params: {
      userIds,
      roleIds,
    }
  })
}
    return request({
        url: '/api/blade-user/grant',
        method: 'post',
        params: {
            userIds,
            roleIds,
        }
    })
}
src/router/views/index.js
@@ -230,6 +230,19 @@
                import ( /* webpackChunkName: "views" */ '@/views/management/peopleDetails')
        }]
    }, {
        path: '/management',
        redirect: '/management/idinformation',
        component: Layout,
        children: [{
            path: 'idinformation',
            name: '保安证件信息',
            meta: {
                i18n: 'index',
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/management/idinformation')
        }]
    },{
        path: '/securityCompany',
        redirect: '/securityCompany/index',
        component: Layout,
@@ -259,5 +272,31 @@
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/regulatoryInformation/index')
        }]
    }, {
        path: '/securityUnitOperation/operationTable',
        redirect: '/securityUnitOperation/operationTable/index',
        component: Layout,
        children: [{
            path: 'index',
            name: '公司运营情况智能分析详情表',
            meta: {
                i18n: 'index',
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/securityUnitOperation/operationTable')
        }]
    }, {
        path: '/securityUnitOperation/economicTable',
        redirect: '/securityUnitOperation/economicTable/index',
        component: Layout,
        children: [{
            path: 'index',
            name: '公司经济情况智能分析详情表',
            meta: {
                i18n: 'index',
            },
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/securityUnitOperation/economicTable')
        }]
    }
]
src/views/home/index.scss
@@ -12,7 +12,7 @@
    width: 100%;
    height: 77px;
    text-align: center;
    position: relative;
    // position: relative;
    span {
      font-family: "Arial Normal", "Arial", sans-serif;
      font-size: 36px;
@@ -20,20 +20,31 @@
      text-align: center;
      line-height: 77px;
    }
    span:nth-child(2) {
      position: absolute;
      margin-top: 22px;
      margin-left: 26%;
      font-size: 22px;
      cursor: pointer;
      &:hover {
        color: #90cef0;
      }
    }
    // span:nth-child(2) {
    //   position: absolute;
    //   margin-top: 22px;
    //   margin-left: 26%;
    //   font-size: 22px;
    //   cursor: pointer;
    //   &:hover {
    //     color: #90cef0;
    //   }
    // }
    img {
      position: absolute;
      margin-top: 22px;
      margin-left: 29%;
    }
  }
  .sub-title {
    float: right;
    color: #fff;
    margin-right: 52px;
    font-size: 17px;
    margin-top: -35px;
    cursor: pointer;
    &:hover {
      color: #90cef0;
    }
  }
  .side {
@@ -80,7 +91,7 @@
      }
    }
    .left2 {
      background: url("../../../public/img/bajgxt/left1.png") no-repeat;
      background: url("../../../public/img/bajgxt/rightImg.png") no-repeat;
      height: calc(40% - 25px);
      width: 100%;
      background-size: 100% 100%;
@@ -113,7 +124,7 @@
      }
    }
    .right3 {
      background: url("../../../public/img/bajgxt/left1.png") no-repeat;
      background: url("../../../public/img/bajgxt/rightImg.png") no-repeat;
      height: calc(40% - 25px);
      width: 100%;
      background-size: 100% 100%;
@@ -139,14 +150,28 @@
  }
  .title-pane1 {
    display: inline-flex;
    height: 44px;
    height: 41px;
    img {
      width: 30px;
      height: 30px;
      margin: 10px 10px 0px 10px;
      margin: 5.5px 10px 0px 10px;
    }
    span {
      line-height: 55px;
      line-height: 46px;
      color: #fff;
      font-size: 20px;
    }
  }
  .title-pane2 {
    display: inline-flex;
    height: 53px;
    img {
      width: 30px;
      height: 30px;
      margin: 11.5px 10px 0px 10px;
    }
    span {
      line-height: 53px;
      color: #fff;
      font-size: 20px;
    }
@@ -193,8 +218,8 @@
        width: 44px;
        height: 56px;
        position: absolute;
        margin-left: -6px;
        margin-top: -7px;
        margin-left: -7px;
        margin-top: -9px;
      }
      .leftbottom {
        background: url("../../../public/img/bajgxt/leftbottom.png") no-repeat;
@@ -202,8 +227,8 @@
        width: 44px;
        height: 56px;
        position: absolute;
        margin-left: -6px;
        margin-top: calc(40% - 88px);
        margin-left: -7px;
        margin-top: calc(40% - 66px);
      }
      .righttop {
        background: url("../../../public/img/bajgxt/righttop.png") no-repeat;
@@ -211,8 +236,8 @@
        width: 44px;
        height: 56px;
        position: absolute;
        margin-left: calc(100% - 39px);
        margin-top: -7px;
        margin-left: calc(100% - 37px);
        margin-top: -9px;
      }
      .rightbottom {
        background: url("../../../public/img/bajgxt/rightbottom.png") no-repeat;
@@ -220,16 +245,16 @@
        width: 44px;
        height: 56px;
        position: absolute;
        margin-left: calc(100% - 39px);
        margin-top: calc(40% - 88px);
        margin-left: calc(100% - 37px);
        margin-top: calc(40% - 66px);
      }
    }
  }
  .el-table {
    width: calc(100% - 40px);
    height: calc(100% - 70px);
    height: calc(100% - 65px);
    margin: 0px 20px 15px;
    top: 60px;
    top: 50px;
  }
  /deep/ .el-table--striped .el-table__body tr.el-table__row--striped td {
    background: #18458f;
@@ -241,6 +266,7 @@
  }
  /deep/ .el-table .cell {
    color: #fff;
    text-align: center;
  }
  /deep/ .el-table td,
  .el-table th.is-leaf {
@@ -258,7 +284,7 @@
    border-radius: 2px;
  }
  /deep/ .el-input {
    width: 94px;
    width: 138px;
  }
  /deep/ .el-select {
    line-height: 55px;
@@ -301,16 +327,17 @@
    }
  }
  .right-content {
    height: calc(100% - 44px);
    height: calc(100% - 41px);
    width: 100%;
  }
  .card-list {
    margin: 20px 60px;
    margin: 25px 60px 20px 90px;
    display: flex;
    height: 55px;
    line-height: 55px;
    img:first-child {
      height: 55px;
      z-index: 22;
    }
    img:nth-child(2) {
      position: absolute;
@@ -318,19 +345,24 @@
      width: 35px;
      height: 35px;
      margin-top: 9px;
      z-index: 22;
    }
    span:nth-child(3) {
    img:nth-child(3) {
      margin-left: -20px;
    }
    span:nth-child(4) {
      color: red;
      font-size: 30px;
      display: block;
      width: 71px;
      margin: 0px 20px;
      margin-left: -74px;
    }
    span:nth-child(4) {
    span:nth-child(5) {
      color: #7ff3f4;
      font-size: 18px;
      display: block;
      width: 129px;
      margin-left: 30px;
    }
  }
  .mapBtn,
src/views/home/index.vue
@@ -1,23 +1,21 @@
<template>
  <div class="bajgxt-home">
    <div class="head-title">
      <span>保安监管系统可视化平台</span>
      <!-- <img src="../../../public/img/bajgxt/linkimg.png"
                 @click.stop="goSystemHome"
                 title="进入系统" /> -->
      <span @click.stop="goSystemHome">进入系统</span>
      <span>智慧保安监管模块</span>
    </div>
    <span class='sub-title' @click.stop="goSystemHome">进入系统</span>
    <div class="content">
      <div class="left">
        <div class="left1">
          <!-- <img src="../../../public/img/bajgxt/line.jpg" /> -->
          <div class="title-pane">
            <img src="../../../public/img/bajgxt/icon1.png" />
            <span>业务对象统计--单位</span>
            <span>各辖区单位统计情况</span>
          </div>
          <div id="left1Echart"></div>
        </div>
        <div class="left2">
          <div class="title-pane1">
          <div class="title-pane2">
            <img src="../../../public/img/bajgxt/icon1.png" />
            <span>保安员持证情况</span>
          </div>
@@ -56,52 +54,43 @@
          <div class="leftbottom"></div>
          <div class="righttop"></div>
          <div class="rightbottom"></div>
          <el-table :data="tableData" stripe>
            <el-table-column type="index" label="序号" width="50">
            </el-table-column>
            <el-table-column
              v-if="curTableType === 'car'"
              prop="carNum"
              label="押运车辆车牌号"
              width="180"
            >
            </el-table-column>
            <el-table-column
              v-if="curTableType === 'peo'"
              prop="name"
              label="押运人员名称"
              width="180"
            >
            </el-table-column>
            <el-table-column
              v-if="curTableType === 'gun'"
              prop="number"
              label="枪支编号"
              width="180"
            >
            </el-table-column>
            <el-table-column prop="location" label="实时位置">
            </el-table-column>
            <el-table-column prop="company" label="所属公司"> </el-table-column>
            <el-table-column
              v-if="curTableType === 'car'"
              prop="linkman"
              label="联系人"
            >
            </el-table-column>
            <el-table-column
              v-if="curTableType === 'gun'"
              prop="linkman"
              label="负责人"
            >
            </el-table-column>
            <el-table-column prop="tel" label="联系电话"> </el-table-column>
            <el-table-column
              v-if="curTableType === 'peo'"
              prop="bz"
              label="备注"
            >
            </el-table-column>
          <el-table :data="tableData" stripe ref="indexTable">
            <template v-if="curTableType === 'car'">
              <el-table-column :key="curTableType"  type="index" label="序号" width="50">
              </el-table-column>
              <el-table-column :key="curTableType" prop="carNum" label="押运车辆车牌号" width="180">
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="location" label="实时位置">
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="company" label="所属公司">
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="linkman" label="联系人"> </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="tel" label="联系电话"> </el-table-column>
            </template>
            <template v-if="curTableType === 'peo'">
              <el-table-column :key="curTableType" type="index" label="序号" width="50">
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="name" label="押运人员名称" width="180">
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="location" label="实时位置">
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="company" label="所属公司">
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="tel" label="联系电话"> </el-table-column>
              <el-table-column :key="curTableType" prop="bz" label="备注"> </el-table-column>
            </template>
            <template v-if="curTableType === 'gun'">
              <el-table-column :key="curTableType" type="index" label="序号" width="50">
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="number" label="枪支编号" width="180">
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="location" label="实时位置">
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="company" label="所属公司">
              </el-table-column>
              <el-table-column :key="curTableType" show-overflow-tooltip prop="linkman" label="负责人"> </el-table-column>
              <el-table-column :key="curTableType" prop="tel" label="联系电话"> </el-table-column>
            </template>
          </el-table>
        </div>
      </div>
@@ -124,14 +113,16 @@
            <div class="card-list">
              <img src="../../../public/img/bajgxt/u4.png" />
              <img src="../../../public/img/bajgxt/u256.png" />
              <img src="../../../public/img/bajgxt/u1.png" />
              <span>45</span>
              <span>现实表现差</span>
            </div>
            <div class="card-list">
              <img src="../../../public/img/bajgxt/u4.png" />
              <img src="../../../public/img/bajgxt/u230.png" />
              <img src="../../../public/img/bajgxt/u1.png" />
              <span>76</span>
              <span>资格审查</span>
              <span>资格审查异常</span>
            </div>
          </div>
          <!-- <div class="card-text"> -->
@@ -158,12 +149,14 @@
            <div class="card-list">
              <img src="../../../public/img/bajgxt/u4.png" />
              <img src="../../../public/img/bajgxt/u235.png" />
              <img src="../../../public/img/bajgxt/u1.png" />
              <span>21</span>
              <span>未缴纳社保</span>
            </div>
            <div class="card-list">
              <img src="../../../public/img/bajgxt/u4.png" />
              <img src="../../../public/img/bajgxt/u251.png" />
              <img src="../../../public/img/bajgxt/u1.png" />
              <span>26</span>
              <span>未持证</span>
            </div>
@@ -175,7 +168,7 @@
          <!-- <div id="right2Echart"></div> -->
        </div>
        <div class="right3">
          <div class="title-pane1">
          <div class="title-pane2">
            <img src="../../../public/img/bajgxt/icon3.png" />
            <span>分局预警占比情况</span>
          </div>
@@ -191,17 +184,24 @@
import * as echarts from "echarts";
import optionJs from "./indexEchart";
import TileLayer from "ol/layer/Tile";
import { transform } from "ol/proj";
import XYZ from "ol/source/XYZ";
import { Map, View } from "ol";
import { Tile, Group } from "ol/layer";
import { OSM, TileJSON } from "ol/source";
import VectorLayer from "ol/layer/Vector";
import VectorSource from "ol/source/Vector";
import { Fill, Stroke, Circle, Style } from "ol/style";
import Feature from "ol/Feature.js";
import Point from "ol/geom/Point.js";
import { Fill, Stroke, Circle, Style, Icon } from "ol/style";
import GeoJSON from "ol/format/GeoJSON";
import axios from "../../router/axios";
import { securityTotal, holderNum, securityPer } from "../../api/index/index";
import car from "@/assets/img/car.png";
import peo from "@/assets/img/people.png";
import gun from "@/assets/img/gun.png";
export default {
  data() {
    return {
@@ -209,25 +209,53 @@
      curTableType: "car",
      tableData: [],
      value1: "1",
      carVectorLayer: null,
      peoVectorLayer: null,
      gunVectorLayer: null,
      options1: [
        {
          value: "1",
          label: "南昌市"
          label: "南昌市公安局"
        },
        {
          value: "2",
          label: "赣州市"
          label: "东湖分局"
        },
        {
          value: "3",
          label: "西湖分局"
        },
        {
          value: "4",
          label: "青云谱分局"
        },
        {
          value: "5",
          label: "青山湖分局"
        }
      ],
      value2: "1",
      options2: [
        {
          value: "1",
          label: "南昌市"
          label: "南昌市公安局"
        },
        {
          value: "2",
          label: "赣州市"
          label: "东湖分局"
        },
        {
          value: "3",
          label: "西湖分局"
        },
        {
          value: "4",
          label: "青云谱分局"
        },
        {
          value: "5",
          label: "青山湖分局"
        }
      ]
    };
@@ -273,197 +301,258 @@
    },
    getTableData(type) {
      this.carVectorLayer.getSource().clear();
      this.peoVectorLayer.getSource().clear();
      this.gunVectorLayer.getSource().clear();
      this.curTableType = type;
      let curLayer = null;
      let imgUrl = null;
      let geoData = [];
      if (type === "car") {
        curLayer = this.carVectorLayer;
        imgUrl = car;
        geoData = [
          [115.838082,28.716823],
          [115.91627,28.794341],
          [115.821984,28.658519],
          [115.870277,28.633159],
          [115.960539,28.678295],
          [115.981811,28.611852],
          [115.924894,28.738615],
          [115.876745,28.656364],
          [115.845412,28.652814],
          [115.940992,28.660548]
        ];
        this.tableData = [
          {
            carNum: "111111111111",
            location: "红谷滩",
            company: "公司",
            linkman: "小李",
            tel: "13999999999"
            carNum: "赣A2A232",
            location: "南昌市红谷滩区清远路与瑞金路交叉路口往北约90米",
            company: "江西省卫民保安服务有限公司",
            linkman: "李琳",
            tel: "18928374611"
          },
          {
            carNum: "111111111111",
            location: "红谷滩",
            company: "公司",
            linkman: "小李",
            tel: "13999999999"
            carNum: "赣BA6232",
            location: "顺外路1007",
            company: "南昌市公安局保安护卫公司",
            linkman: "王琦",
            tel: "13932743923"
          },
          {
            carNum: "111111111111",
            location: "红谷滩",
            company: "公司",
            linkman: "小李",
            tel: "13999999999"
            carNum: "赣A2B297",
            location: "南昌市高新区绿地玫瑰城南昌高新区101智慧大厦二楼",
            company: "江西高创保安服务技术有限公司",
            linkman: "李梦",
            tel: "13214561324"
          },
          {
            carNum: "111111111111",
            location: "红谷滩",
            company: "公司",
            linkman: "小李",
            tel: "13999999999"
            carNum: "赣B2E775",
            location: "江西省南昌市红谷滩区会展路莱蒙都会写字楼5A栋1110室",
            company: "江西海豹保安服务有限公司南昌分公司",
            linkman: "张强",
            tel: "13372889288"
          },
          {
            carNum: "111111111111",
            location: "红谷滩",
            company: "公司",
            linkman: "小李",
            tel: "13999999999"
            carNum: "赣BF9252",
            location: "南昌市西湖区广场南路恒茂国际华城西南侧约90米",
            company: "南昌县神州保安分公司长运中队",
            linkman: "赵青",
            tel: "18937281746"
          }
        ];
      } else if (type === "peo") {
        curLayer = this.peoVectorLayer;
        imgUrl = peo;
        geoData = [
          [115.8835,28.622126],
          [115.861222,28.61477],
          [115.861653,28.640514],
          [115.917133,28.611852],
          [115.923888,28.602593],
          [115.89658,28.59828],
          [115.863091,28.597645],
          [115.979224,28.666379],
          [115.958239,28.610584],
          [115.867115,28.631638]
        ];
        this.tableData = [
          {
            name: "小张",
            location: "红谷滩",
            company: "公司",
            tel: "13999999999",
            bz: "zzz"
            name: "张青",
            location: "江西省南昌市南昌县向阳路807号",
            company: "南昌市赣洪保安服务有限公司",
            tel: "19876223615",
            bz: ""
          },
          {
            name: "小张",
            location: "红谷滩",
            company: "公司",
            tel: "13999999999",
            bz: "zzz"
            name: "王桂林",
            location: "南昌市南昌县斗南路莲塘四小西南侧约150米",
            company: "江西天网保安公司",
            tel: "18723982376",
            bz: ""
          },
          {
            name: "小张",
            location: "红谷滩",
            company: "公司",
            tel: "13999999999",
            bz: "zzz"
            name: "王蒙",
            location: "丰和南大道2111号世茂新城A-12地块商业4-8号商业楼401室",
            company: "南昌赛夫保安服务有限公司",
            tel: "18909872345",
            bz: ""
          },
          {
            name: "小张",
            location: "红谷滩",
            company: "公司",
            tel: "13999999999",
            bz: "zzz"
            name: "李嘉",
            location: "新建大道463",
            company: "新建区公安局保安服务公司",
            tel: "13315276390",
            bz: ""
          },
          {
            name: "小张",
            location: "红谷滩",
            company: "公司",
            tel: "13999999999",
            bz: "zzz"
            name: "李林",
            location: "江西省南昌市青云谱区洪都南大道东50米凯旋国际大厦",
            company: "江西蓝盾保安服务有限公司",
            tel: "19108372654",
            bz: ""
          },
          {
            name: "小张",
            location: "红谷滩",
            company: "公司",
            tel: "13999999999",
            bz: "zzz"
            name: "张国庆",
            location: "江西省南昌市红谷滩区金融大街君成商厦1单元三楼",
            company: "华远卫士保安公司",
            tel: "13187234523",
            bz: ""
          }
        ];
      } else if (type === "gun") {
        curLayer = this.gunVectorLayer;
        imgUrl = gun;
        geoData = [
          [115.867115,28.631638],
          [115.867115,28.631638],
          [115.879548,28.713338],
          [115.904844,28.700032],
          [115.845628,28.679373],
          [115.831973,28.690654],
          [115.814726,28.660611],
          [115.868912,28.638168],
          [115.762121,28.632589],
          [115.78483,28.58794],
          [115.812139,28.655159]
        ];
        this.tableData = [
          {
            number: "Q1111",
            location: "红谷滩",
            company: "公司",
            number: "Q1311",
            location: "红谷滩新区唐宁街b座",
            company: "鹏盛保安服务有限公司",
            linkman: "张强",
            tel: "13782143412"
          },
          {
            number: "Q2111",
            location: "子安路89号银田大厦",
            company: "江西安泰保安服务有限公司",
            linkman: "张强",
            tel: "13999999999"
          },
          {
            number: "Q2141",
            location: "南昌市进贤县人民大道(豪景壹品)",
            company: "江西省天网保安服务有限公司进贤分公司",
            linkman: "张强",
            tel: "13999999999"
          },
          {
            number: "Q1321",
            location: "站前西路176号公交公司",
            company: "顺安保安服务有限公司",
            linkman: "张强",
            tel: "13999999999"
          },
          {
            number: "Q1111",
            location: "红谷滩",
            company: "公司",
            location: "南昌市西湖区八一大道长运大厦东侧约60米",
            company: "江西长运股份有限公司保安大队",
            linkman: "张强",
            tel: "13999999999"
          },
          {
            number: "Q1111",
            location: "红谷滩",
            company: "公司",
            number: "Q1331",
            location: "南昌市西湖区三眼井街南昌市第十八中学北侧约150米",
            company: "杭州振杰保安服务(江西分公司)",
            linkman: "张强",
            tel: "13999999999"
          },
          {
            number: "Q1111",
            location: "红谷滩",
            company: "公司",
            linkman: "张强",
            tel: "13999999999"
          },
          {
            number: "Q1111",
            location: "红谷滩",
            company: "公司",
            linkman: "张强",
            tel: "13999999999"
          },
          {
            number: "Q1111",
            location: "红谷滩",
            company: "公司",
            linkman: "张强",
            tel: "13999999999"
            tel: "13789233124"
          }
        ];
      }
      let features = [];
      let style = new Style({
        image: new Icon({
          src: imgUrl,
          opacity: 1,
          scale: 0.5
        })
      });
      geoData.forEach(item => {
        let carFeature = new Feature({
          geometry: new Point(item)
        });
        carFeature.setStyle(style);
        features.push(carFeature);
      });
      curLayer.getSource().addFeatures(features);
      let extent = curLayer.getSource().getExtent();
      this.map.getView().fit(extent, this.map.getSize());
      this.$nextTick(() => {
        this.$refs.indexTable.doLayout();
      });
    },
    initMap() {
      this.map = new Map({
        target: "map", // 对应页面里 id 为 map 的元素
        target: "map",
        layers: [
          // 图层
          // new Tile({
          //   source: new OSM()
          // })
          new Tile({
            source: new OSM() // 图层数据源
            zIndex: 4,
            title: "影像",
            source: new XYZ({
              url:
                "http://t3.tianditu.com/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0" // 行政区划
            })
          }),
          new Tile({
            zIndex: 5,
            title: "道路+中文注记",
            source: new XYZ({
              url:
                "http://t3.tianditu.com/DataServer?T=cta_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0" // 注记
            })
          })
        ],
        view: new View({
          // 地图视图
          projection: "EPSG:4326", // 坐标系,有EPSG:4326和EPSG:3857
          center: [115.892151, 28.676493], //坐标 厦门
          // minZoom: 10, // 地图缩放最小级别
          zoom: 11 //地图缩放级别
          projection: "EPSG:4326",
          center: [115.892151, 28.676493],
          zoom: 11
        })
      });
      var image = new Circle({
        radius: 5,
        fill: new Fill({
          color: "rgba(255, 0, 0, 1)"
        }),
        stroke: new Stroke({ color: "red", width: 1 })
      this.carVectorLayer = new VectorLayer({
        zIndex: 99,
        source: new VectorSource()
      });
      var styles = {
        Point: new Style({
          image: image
        })
      };
      axios.get("./nc.json").then(res => {
        let data = res.data.features;
        let vectorSource = new VectorSource({
          features: new GeoJSON().readFeatures(data)
        });
        let vectorLayer = new VectorLayer({
          source: vectorSource,
          style: styles
        });
        this.map.addLayer(vectorLayer);
      this.peoVectorLayer = new VectorLayer({
        zIndex: 99,
        source: new VectorSource()
      });
      // var center = new transform(
      //   [104.06667, 30.66667],
      //   "EPSG:4326",
      //   "EPSG:3857"
      // );
      // this.map = new Map({
      //   view: new View({
      //     center: center,
      //     zoom: 4
      //   }),
      //   target: "map"
      // });
      // var offlineMapLayer = new TileLayer({
      //   source: new XYZ({
      //     url: "./offlineMapTiles/{z}/{x}/{y}.png"
      //   })
      // });
      // this.map.addLayer(offlineMapLayer);
      this.gunVectorLayer = new VectorLayer({
        zIndex: 99,
        source: new VectorSource()
      });
      this.map.addLayer(this.carVectorLayer);
      this.map.addLayer(this.peoVectorLayer);
      this.map.addLayer(this.gunVectorLayer);
      this.getTableData("car");
    },
    goSystemHome() {
@@ -472,7 +561,7 @@
  },
  mounted() {
    this.initEchart();
    this.getTableData("car");
    // this.getTableData("car");
    this.initMap();
  }
};
src/views/home/indexEchart.js
@@ -19,15 +19,18 @@
      }
    },
    color: [
      "#516b91",
      "#59c4e6",
      "#93b7e3",
      "#a5e7f0",
      "#cbb0e3",
      "#91cc75",
      "#fac858",
      "#73c0de",
      "#3ba272",
      "#fc8452",
      "#9a60b4",
      "#3fb1e3",
      "#6be6c1",
      "#a0a7e6",
      "#c4ebad",
      "#96dee8"
      '#626c91',
      '#a0a7e6',
      '#c4ebad',
      '#96dee8'
    ],
    legend: {
      data: ["自招保安单位", "保安培训公司", "保安服务公司", "武装守押公司"],
@@ -47,6 +50,12 @@
      type: "value",
      axisLabel: {
        color: "#fff"
      },
      axisLine: {
        show: true
      },
      splitLine: {
        show: false
      }
    },
    yAxis: {
@@ -63,9 +72,6 @@
        stack: "total",
        barMinWidth: 20,
        barMaxWidth: 40,
        label: {
          show: true
        },
        emphasis: {
          focus: "series"
        },
@@ -75,9 +81,6 @@
        name: "保安培训公司",
        type: "bar",
        stack: "total",
        label: {
          show: true
        },
        emphasis: {
          focus: "series"
        },
@@ -87,9 +90,6 @@
        name: "保安服务公司",
        type: "bar",
        stack: "total",
        label: {
          show: true
        },
        emphasis: {
          focus: "series"
        },
@@ -99,9 +99,6 @@
        name: "武装守押公司",
        type: "bar",
        stack: "total",
        label: {
          show: true
        },
        emphasis: {
          focus: "series"
        },
@@ -128,15 +125,18 @@
      }
    },
    color: [
      "#516b91",
      "#59c4e6",
      "#93b7e3",
      "#a5e7f0",
      "#cbb0e3",
      "#91cc75",
      "#fac858",
      "#73c0de",
      "#3ba272",
      "#fc8452",
      "#9a60b4",
      "#3fb1e3",
      "#6be6c1",
      "#a0a7e6",
      "#c4ebad",
      "#96dee8"
      '#626c91',
      '#a0a7e6',
      '#c4ebad',
      '#96dee8'
    ],
    legend: {
      data: ["持证人数", "未持证人数"],
@@ -157,7 +157,13 @@
      axisLabel: {
        color: "#fff"
      },
      boundaryGap: [0, 0.01]
      boundaryGap: [0, 0.01],
      axisLine: {
        show: true
      },
      splitLine: {
        show: false
      }
    },
    yAxis: {
      type: "category",
@@ -174,9 +180,6 @@
        barMinWidth: 20,
        barMaxWidth: 40,
        stack: "total",
        label: {
          show: true
        },
        emphasis: {
          focus: "series"
        },
@@ -186,9 +189,6 @@
        name: "未持证人数",
        type: "bar",
        stack: "total",
        label: {
          show: true
        },
        emphasis: {
          focus: "series"
        },
@@ -226,15 +226,18 @@
      trigger: "axis"
    },
    color: [
      "#516b91",
      "#59c4e6",
      "#93b7e3",
      "#a5e7f0",
      "#cbb0e3",
      "#91cc75",
      "#fac858",
      "#73c0de",
      "#3ba272",
      "#fc8452",
      "#9a60b4",
      "#3fb1e3",
      "#6be6c1",
      "#a0a7e6",
      "#c4ebad",
      "#96dee8"
      '#626c91',
      '#a0a7e6',
      '#c4ebad',
      '#96dee8'
    ],
    legend: {
@@ -288,15 +291,18 @@
      trigger: "axis"
    },
    color: [
      "#516b91",
      "#59c4e6",
      "#93b7e3",
      "#a5e7f0",
      "#cbb0e3",
      "#91cc75",
      "#fac858",
      "#73c0de",
      "#3ba272",
      "#fc8452",
      "#9a60b4",
      "#3fb1e3",
      "#6be6c1",
      "#a0a7e6",
      "#c4ebad",
      "#96dee8"
      '#626c91',
      '#a0a7e6',
      '#c4ebad',
      '#96dee8'
    ],
    legend: {
@@ -349,7 +355,7 @@
  let data = [
    {
      name: "新建县",
      value: 754
      value: 154
    },
    {
      name: "安义县",
@@ -362,6 +368,34 @@
    {
      name: "西湖区",
      value: 200
    },
    {
      name: "东湖区",
      value: 250
    },
    {
      name: "经开区",
      value: 281
    },
    {
      name: "青云谱区",
      value: 320
    },
    {
      name: "高新区",
      value: 231
    },
    {
      name: "湾里区",
      value: 210
    },
    {
      name: "进贤县",
      value: 187
    },
    {
      name: "青山湖区",
      value: 190
    }
  ];
  // let arrName = getArrayValue(data, "name");
@@ -396,13 +430,13 @@
    };
    for (let i = 0; i < data.length; i++) {
      res.series.push({
        name: "学历",
        name: "分局预警占比",
        type: "pie",
        clockWise: true,
        z: 2,
        hoverAnimation: false,
        radius: [73 - i * 15 + "%", 68 - i * 15 + "%"],
        center: ["50%", "55%"],
        radius: [90 - i * 8 + "%", 85 - i * 8 + "%"],
        center: ["30%", "50%"],
        labelLine: {
          show: false
        },
@@ -443,32 +477,49 @@
      formatter: "{a}<br>{b}:{c}({d}%)"
    },
    color: [
      "#516b91",
      "#59c4e6",
      "#93b7e3",
      "#a5e7f0",
      "#cbb0e3",
      "#91cc75",
      "#fac858",
      "#73c0de",
      "#3ba272",
      "#fc8452",
      "#9a60b4",
      "#3fb1e3",
      "#6be6c1",
      "#a0a7e6",
      "#c4ebad",
      "#96dee8"
      '#626c91',
      '#a0a7e6',
      '#c4ebad',
      '#96dee8'
    ],
    legend: {
      bottom: "0%",
      right: "2%",
      top: "3%",
      //   icon: "circle",
      itemHeight: 10,
      show: true,
      data: ["新建县", "安义县", "红谷滩新区", "西湖区"],
      data: [
        "新建县",
        "安义县",
        "红谷滩新区",
        "西湖区",
        "东湖区",
        "经开区",
        "青云谱区",
        "高新区",
        "湾里区",
        "进贤县",
        "青山湖区"
      ],
      selectedMode: false,
      textStyle: {
        color: "#fff"
      }
      },
      orient: "vertical"
    },
    grid: {
      top: "16%",
      bottom: "55%",
      left: "50%",
      top: "5%",
      bottom: "50%",
      left: "30%",
      containLabel: false
    },
    yAxis: [
@@ -487,7 +538,7 @@
          inside: false,
          textStyle: {
            color: "#fff",
            fontSize: 15
            fontSize: 8
          },
          show: true
        },
@@ -503,7 +554,6 @@
  };
  return option;
}
export default {
  left1Data,
  left2Data,
src/views/management/idinformation.vue
New file
@@ -0,0 +1,184 @@
<template>
  <div>
    <div id="table">
      <span class="title">保安员证件信息</span>
      <table
        class="user-info-table"
        border="1px"
        align="center"
        cellspacing="0"
        cellpadding="10"
      >
        <tr class="user-info-tr">
          <td width="150px">姓名</td>
          <td width="150px">{{ data.realName }}</td>
          <td width="150px">身份证号</td>
          <td width="150px">{{ data.cardid }}</td>
          <td width="150px">性别</td>
          <td width="150px" v-if="data.sex == 1">男</td>
          <td width="150px" v-if="data.sex == 2">女</td>
          <td rowspan="4" align="center" width="150px" v-if="data.avatar == ''">
            照片
          </td>
          <td rowspan="4" align="center" width="150px" v-if="data.avatar != ''">
            <img :src="img" class="avatar" />
          </td>
        </tr>
        <tr class="user-info-tr">
          <td>手机号</td>
          <td>{{ data.phone }}</td>
          <td>出生日期</td>
          <td>{{ data.birthday }}</td>
          <td>名族</td>
          <td>{{ data.nation }}</td>
        </tr>
        <tr class="user-info-tr">
          <td>文化程度</td>
          <td v-if="data.education == 1">初中及以下</td>
          <td v-if="data.education == 2">高中/中技/中专</td>
          <td v-if="data.education == 3">大专</td>
          <td v-if="data.education == 4">本科</td>
          <td v-if="data.education == 5">硕士</td>
          <td v-if="data.education == 6">博士</td>
          <td>政治面貌</td>
          <td>{{ data.politicaloutlook }}</td>
          <td>身高</td>
          <td v-if="data.height == -1"></td>
          <td v-if="data.height != -1">{{ data.height }}</td>
        </tr>
        <tr class="user-info-tr">
          <td>婚姻状况</td>
          <td></td>
          <td>兵役情况</td>
          <td></td>
          <td>是否缴纳社保</td>
          <td></td>
        </tr>
        <tr class="user-info-tr">
          <td>是否在职</td>
          <td v-if="data.status == 1">是</td>
          <td v-if="data.status == 2">否</td>
          <td>保安单位</td>
          <td colspan="4">{{ data.deptName }}</td>
        </tr>
        <tr class="user-info-tr">
          <td colspan="2">户籍地省市县(区)</td>
          <td colspan="2">{{ data.nativeplace }}</td>
          <td>培训单位</td>
          <td colspan="2"></td>
        </tr>
        <tr class="user-info-tr">
          <td>户籍地详细地址</td>
          <td colspan="6">{{ data.address }}</td>
        </tr>
        <tr class="user-info-tr">
          <td>保安员证编号</td>
          <td colspan="2">{{ data.securitynumber }}</td>
          <td>职业等级</td>
          <td></td>
          <td>指纹撩印卡号</td>
          <td></td>
        </tr>
        <tr class="user-info-tr">
          <td>发证机关</td>
          <td colspan="2"></td>
          <td>发证日期</td>
          <td></td>
          <td>吊销机关</td>
          <td></td>
        </tr>
        <tr class="user-info-tr">
          <td>数据录入机关</td>
          <td colspan="2"></td>
          <td>数据录入地</td>
          <td colspan="3"></td>
        </tr>
        <tr class="user-info-tr">
          <td>签订合同日期</td>
          <td colspan="2"></td>
          <td>签订合同期限</td>
          <td colspan="3"></td>
        </tr>
      </table>
    </div>
  </div>
</template>
<script>
import table from "../util/table.vue";
export default {
  components: { table },
  data() {
    return {
      data: {},
      img: "",
    };
  },
  created() {
    this.data = this.$route.query;
    this.img = this.data.avatar;
    console.log(this.data, 111);
  },
  mounted() {
    var flag = false,
      i = 0,
      ind = null;
    this.$store.state.tags.tagList.forEach((item, index) => {
      if (item.label == "保安证件信息") {
        if (flag == false) {
          ind = index;
          flag = true;
        }
        i++;
      }
    });
    if (i > 1) {
      this.$store.state.tags.tagList.splice(ind, 1);
    }
  },
};
</script>
<style lang='scss' scoped>
#table {
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  .title {
    margin-top: 20px;
  }
  .user-info-table {
    margin-top: 30px;
    width: 70%;
    height: 60%;
    border: 1px solid #fff;
    // text-align: center;
    .user-info-tr {
      height: 50px;
      .avatar {
        width: 140px;
        height: 190px;
      }
    }
  }
}
.avatar {
  width: 140px;
  height: 190px;
}
</style>
src/views/management/register.vue
@@ -6,39 +6,43 @@
 * menu-name 保安员注册查询
 */
<template>
    <el-row>
        <el-col :span="5">
            <div class="box">
                <el-scrollbar>
                    <basic-container>
                        <avue-tree :option="treeOption"
                                   :data="treeData"
                                   @node-click="nodeClick" />
                    </basic-container>
                </el-scrollbar>
            </div>
        </el-col>
        <el-col :span="19">
            <basic-container>
                <avue-crud :option="option"
                           :search.sync="search"
                           :table-loading="loading"
                           :data="data"
                           ref="crud"
                           v-model="form"
                           :permission="permissionList"
                           @row-save="rowSave"
                           :before-open="beforeOpen"
                           :page.sync="page"
                           @search-change="searchChange"
                           @search-reset="searchReset"
                           @selection-change="selectionChange"
                           @current-change="currentChange"
                           @size-change="sizeChange"
                           @refresh-change="refreshChange"
                           @row-click="handleRowClick"
                           @on-load="onLoad">
                    <!-- <template slot-scope="{row}"
  <el-row>
    <el-col :span="5">
      <div class="box">
        <el-scrollbar>
          <basic-container>
            <avue-tree
              :option="treeOption"
              :data="treeData"
              @node-click="nodeClick"
            />
          </basic-container>
        </el-scrollbar>
      </div>
    </el-col>
    <el-col :span="19">
      <basic-container>
        <avue-crud
          :option="option"
          :search.sync="search"
          :table-loading="loading"
          :data="data"
          ref="crud"
          v-model="form"
          :permission="permissionList"
          @row-save="rowSave"
          :before-open="beforeOpen"
          :page.sync="page"
          @search-change="searchChange"
          @search-reset="searchReset"
          @selection-change="selectionChange"
          @current-change="currentChange"
          @size-change="sizeChange"
          @refresh-change="refreshChange"
          @row-click="handleRowClick"
          @on-load="onLoad"
        >
          <!-- <template slot-scope="{row}"
                              slot="tenantName">
                        <el-tag>{{row.tenantName}}</el-tag>
                    </template>
@@ -54,723 +58,800 @@
                              slot="userTypeName">
                        <el-tag>{{row.userTypeName}}</el-tag>
                    </template> -->
                    <template slot-scope="{type,size,row}"
                              slot="menu">
                        <el-button icon="icon-zhengjian"
                                   :size="size"
                                   :type="type"
                                   class="zhengJian-icon"
                                   @click.stop="handleCredentials(row)">证件吊销</el-button>
                    </template>
                </avue-crud>
                <el-dialog title="用户数据导入"
                           append-to-body
                           :visible.sync="excelBox"
                           width="555px">
                    <avue-form :option="excelOption"
                               v-model="excelForm"
                               :upload-after="uploadAfter">
                        <template slot="excelTemplate">
                            <el-button type="primary"
                                       @click="handleTemplate">
                                点击下载<i class="el-icon-download el-icon--right"></i>
                            </el-button>
                        </template>
                    </avue-form>
                </el-dialog>
            </basic-container>
        </el-col>
    </el-row>
          <template slot-scope="{ type, size, row }" slot="menu">
            <el-button
              :size="size"
              :type="type"
              class="zhengJian-icon"
              @click.stop="handleViewCredentials(row)"
              >查看证件</el-button
            >
            <el-button
              icon="icon-zhengjian"
              :size="size"
              :type="type"
              class="zhengJian-icon"
              @click.stop="handleCredentials(row)"
              >证件吊销</el-button
            >
          </template>
        </avue-crud>
        <el-dialog
          title="用户数据导入"
          append-to-body
          :visible.sync="excelBox"
          width="555px"
        >
          <avue-form
            :option="excelOption"
            v-model="excelForm"
            :upload-after="uploadAfter"
          >
            <template slot="excelTemplate">
              <el-button type="primary" @click="handleTemplate">
                点击下载<i class="el-icon-download el-icon--right"></i>
              </el-button>
            </template>
          </avue-form>
        </el-dialog>
      </basic-container>
    </el-col>
  </el-row>
</template>
<script>
import {
    getList,
    getUser,
    add,
    updateHold,
} from "@/api/management/user";
import { getDeptTree, getDeptLazyTree } from "@/api/system/dept";
import { getUser, add, updateHold } from "@/api/management/user";
import { getListSecurity } from "@/api/system/user";
import { getDeptLazyTree } from "@/api/Jurs/jurs";
// import { getDeptTree, getDeptLazyTree } from "@/api/system/dept";
import { getDeptTree } from "@/api/system/dept";
import { getRoleTree } from "@/api/system/role";
import { getPostList } from "@/api/system/post";
import { mapGetters } from "vuex";
import website from '@/config/website';
import { getToken } from '@/util/auth';
import website from "@/config/website";
import { getToken } from "@/util/auth";
export default {
    data () {
        const validatePass = (rule, value, callback) => {
            if (value === '') {
                callback(new Error('请输入密码'));
            } else {
                callback();
            }
        };
        const validatePass2 = (rule, value, callback) => {
            if (value === '') {
                callback(new Error('请再次输入密码'));
            } else if (value !== this.form.password) {
                callback(new Error('两次输入密码不一致!'));
            } else {
                callback();
            }
        };
        return {
            form: {},
            search: {},
            excelBox: false,
            initFlag: true,
            selectionList: [],
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0
            },
  data() {
    const validatePass = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请输入密码"));
      } else {
        callback();
      }
    };
    const validatePass2 = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请再次输入密码"));
      } else if (value !== this.form.password) {
        callback(new Error("两次输入密码不一致!"));
      } else {
        callback();
      }
    };
    return {
      form: {},
      search: {},
      excelBox: false,
      initFlag: true,
      selectionList: [],
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
            init: {
                roleTree: [],
                deptTree: [],
            },
      init: {
        roleTree: [],
        deptTree: [],
      },
            treeDeptId: '',
            treeData: [],
            treeOption: {
                nodeKey: 'id',
                lazy: true,
                treeLoad: function (node, resolve) {
                    const parentId = (node.level === 0) ? 0 : node.data.id;
                    getDeptLazyTree(parentId).then(res => {
                        resolve(res.data.data.map(item => {
                            return {
                                ...item,
                                leaf: !item.hasChildren
                            }
                        }))
                    });
                },
                addBtn: false,
                menu: false,
                size: 'small',
      treeDeptId: "",
      jurisdiction: "",
      treeData: [],
      treeOption: {
        nodeKey: "id",
        defaultExpandAll: true,
        lazy: true,
        treeLoad: function (node, resolve) {
          const parentId = node.level === 0 ? 0 : node.data.id;
          getDeptLazyTree(parentId).then((res) => {
            resolve(
              res.data.data.map((item) => {
                return {
                  ...item,
                  leaf: !item.hasChildren,
                };
              })
            );
          });
        },
        addBtn: false,
        menu: false,
        size: "small",
        props: {
          labelText: "标题",
          label: "title",
          value: "value",
          children: "children",
        },
      },
      option: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        selection: false,
        align: "center",
        height: "auto",
        calcHeight: 80,
        tip: false,
        searchShow: true,
        searchMenuSpan: 4,
        index: true,
        viewBtn: false,
        //dialogType: 'drawer',
        dialogClickModal: false,
        // 操作栏宽度
        menuWidth: 175,
        column: [
          {
            label: "保安姓名",
            prop: "realName",
            search: true,
            searchSpan: 5,
            display: false,
            width: 78,
          },
          {
            label: "性别",
            prop: "sex",
            type: "select",
            search: true,
            searchSpan: 4,
            searchLabelWidth: 50,
            dicData: [
              {
                label: "女",
                value: 2,
              },
              {
                label: "男",
                value: 1,
              },
            ],
            slot: true,
            display: false,
            width: 48,
          },
          {
            label: "保安公司",
            prop: "deptName",
            slot: true,
            display: false,
          },
          {
            label: "保安证编号",
            prop: "securitynumber",
            display: false,
          },
          {
            label: "身份证号",
            prop: "cardid",
            slot: true,
            display: false,
            width: 138,
          },
          {
            label: "联系方式",
            prop: "phone",
            slot: true,
            display: false,
            width: 92,
          },
          {
            label: "联系地址",
            prop: "address",
            slot: true,
            display: false,
          },
          {
            label: "入职时间",
            prop: "rtime",
            slot: true,
            display: false,
            width: 82,
          },
          {
            label: "所属角色",
            prop: "roleName",
            slot: true,
            display: false,
            width: 78,
          },
          {
            label: "所属辖区",
            prop: "jurisdiction",
            // multiple: true,
            type: "tree",
            dicUrl: "/api/jurisdiction/lazy-tree?parentId=0",
            props: {
              label: "title",
              value: "id",
            },
            checkStrictly: true,
            slot: true,
            rules: [
              {
                required: true,
                message: "请选择所属辖区",
                trigger: "click",
              },
            ],
          },
          {
            label: "是否在职",
            prop: "status",
            type: "select",
            search: true,
            searchSpan: 4,
            dicData: [
              {
                label: "否",
                value: 0,
              },
              {
                label: "是",
                value: 1,
              },
            ],
            slot: true,
            display: false,
            width: 78,
          },
          {
            label: "是否持证",
            prop: "hold",
            type: "select",
            search: true,
            searchSpan: 4,
            dicData: [
              {
                label: "是",
                value: "0",
              },
              {
                label: "否",
                value: "1",
              },
              {
                label: "已吊销",
                value: "2",
              },
            ],
            slot: true,
            display: false,
            width: 78,
          },
        ],
        group: [
          {
            label: "基础信息",
            prop: "baseInfo",
            icon: "el-icon-user-solid",
            column: [
              {
                label: "所属机构",
                prop: "tenantId",
                type: "tree",
                dicUrl: "/api/blade-system/tenant/select",
                props: {
                    labelText: '标题',
                    label: 'title',
                    value: 'value',
                    children: 'children'
                }
            },
            option: {
                // 操作栏多余按钮去除
                delBtn: false,
                editBtn: false,
                addBtn: false,
                selection: false,
                align: 'center',
                height: 'auto',
                calcHeight: 80,
                tip: false,
                searchShow: true,
                searchMenuSpan: 4,
                index: true,
                viewBtn: false,
                //dialogType: 'drawer',
                dialogClickModal: false,
                // 操作栏宽度
                menuWidth: 156,
                column: [
                    {
                        label: "保安姓名",
                        prop: "realName",
                        search: true,
                        searchSpan: 5,
                        display: false,
                        width: 78
                    },
                    {
                        label: "性别",
                        prop: "sex",
                        type: "select",
                        search: true,
                        searchSpan: 4,
                        searchLabelWidth: 50,
                        dicData: [{
                            label: '女',
                            value: 2
                        }, {
                            label: '男',
                            value: 1,
                        }],
                        slot: true,
                        display: false,
                        width: 48
                    },
                    {
                        label: "身份证号",
                        prop: "cardid",
                        slot: true,
                        display: false,
                        width: 138
                    },
                    {
                        label: "联系方式",
                        prop: "phone",
                        slot: true,
                        display: false,
                        width: 92
                    },
                    {
                        label: "联系地址",
                        prop: "address",
                        slot: true,
                        display: false
                    },
                    {
                        label: "入职时间",
                        prop: "rtime",
                        slot: true,
                        display: false,
                        width: 82
                    },
                    {
                        label: "所属角色",
                        prop: "roleName",
                        slot: true,
                        display: false,
                        width: 78
                    },
                    {
                        label: "所属公司",
                        prop: "deptName",
                        slot: true,
                        display: false
                    },
                    {
                        label: "所属辖区",
                        prop: "deptName",
                        slot: true,
                        display: false
                    },
                    {
                        label: "是否在职",
                        prop: "status",
                        type: "select",
                        search: true,
                        searchSpan: 4,
                        dicData: [{
                            label: '否',
                            value: 0
                        }, {
                            label: '是',
                            value: 1,
                        }],
                        slot: true,
                        display: false,
                        width: 78
                    },
                    {
                        label: "是否持证",
                        prop: "hold",
                        type: "select",
                        search: true,
                        searchSpan: 4,
                        dicData: [{
                            label: '是',
                            value: '0'
                        }, {
                            label: '否',
                            value: '1',
                        }, {
                            label: '已吊销',
                            value: '2',
                        }],
                        slot: true,
                        display: false,
                        width: 78
                    },
                  label: "tenantName",
                  value: "tenantId",
                },
                hide: !website.tenantMode,
                addDisplay: website.tenantMode,
                editDisplay: website.tenantMode,
                viewDisplay: website.tenantMode,
                rules: [
                  {
                    required: true,
                    message: "请输入所属机构",
                    trigger: "click",
                  },
                ],
                group: [
                    {
                        label: '基础信息',
                        prop: 'baseInfo',
                        icon: 'el-icon-user-solid',
                        column: [
                            {
                                label: "所属机构",
                                prop: "tenantId",
                                type: "tree",
                                dicUrl: "/api/blade-system/tenant/select",
                                props: {
                                    label: "tenantName",
                                    value: "tenantId"
                                },
                                hide: !website.tenantMode,
                                addDisplay: website.tenantMode,
                                editDisplay: website.tenantMode,
                                viewDisplay: website.tenantMode,
                                rules: [{
                                    required: true,
                                    message: "请输入所属机构",
                                    trigger: "click"
                                }],
                                span: 24,
                            },
                            {
                                label: "登录账号",
                                prop: "account",
                                rules: [{
                                    required: true,
                                    message: "请输入登录账号",
                                    trigger: "blur"
                                }],
                            },
                            {
                                label: "用户平台",
                                type: "select",
                                dicUrl: "/api/blade-system/dict/dictionary?code=user_type",
                                props: {
                                    label: "dictValue",
                                    value: "dictKey"
                                },
                                dataType: "number",
                                slot: true,
                                prop: "userType",
                                rules: [{
                                    required: true,
                                    message: "请选择用户平台",
                                    trigger: "blur"
                                }]
                            },
                            {
                                label: '密码',
                                prop: 'password',
                                hide: true,
                                editDisplay: false,
                                viewDisplay: false,
                                rules: [{ required: true, validator: validatePass, trigger: 'blur' }]
                            },
                            {
                                label: '确认密码',
                                prop: 'password2',
                                hide: true,
                                editDisplay: false,
                                viewDisplay: false,
                                rules: [{ required: true, validator: validatePass2, trigger: 'blur' }]
                            },
                        ]
                    },
                    {
                        label: '详细信息',
                        prop: 'detailInfo',
                        icon: 'el-icon-s-order',
                        column: [
                            {
                                label: "用户昵称",
                                prop: "name",
                                hide: true,
                                rules: [{
                                    required: true,
                                    message: "请输入用户昵称",
                                    trigger: "blur"
                                }]
                            },
                            {
                                label: "用户姓名",
                                prop: "realName",
                                rules: [{
                                    required: true,
                                    message: "请输入用户姓名",
                                    trigger: "blur"
                                }, {
                                    min: 2,
                                    max: 5,
                                    message: '姓名长度在2到5个字符'
                                }]
                            },
                            {
                                label: "手机号码",
                                prop: "phone",
                                overHidden: true
                            },
                            {
                                label: "电子邮箱",
                                prop: "email",
                                hide: true,
                                overHidden: true
                            },
                            {
                                label: "用户性别",
                                prop: "sex",
                                type: "select",
                                dicData: [
                                    {
                                        label: "男",
                                        value: 1
                                    },
                                    {
                                        label: "女",
                                        value: 2
                                    },
                                    {
                                        label: "未知",
                                        value: 3
                                    }
                                ],
                                hide: true
                            },
                            {
                                label: "用户生日",
                                type: "date",
                                prop: "birthday",
                                format: "yyyy-MM-dd hh:mm:ss",
                                valueFormat: "yyyy-MM-dd hh:mm:ss",
                                hide: true
                            },
                            {
                                label: "账号状态",
                                prop: "statusName",
                                hide: true,
                                display: false
                            }
                        ]
                    },
                    {
                        label: '职责信息',
                        prop: 'dutyInfo',
                        icon: 'el-icon-s-custom',
                        column: [
                            {
                                label: "用户编号",
                                prop: "code",
                            },
                            {
                                label: "所属角色",
                                prop: "roleId",
                                multiple: true,
                                type: "tree",
                                dicData: [],
                                props: {
                                    label: "title"
                                },
                                checkStrictly: true,
                                slot: true,
                                rules: [{
                                    required: true,
                                    message: "请选择所属角色",
                                    trigger: "click"
                                }]
                            },
                            {
                                label: "所属单位",
                                prop: "deptId",
                                type: "tree",
                                multiple: true,
                                dicData: [],
                                props: {
                                    label: "title"
                                },
                                checkStrictly: true,
                                slot: true,
                                rules: [{
                                    required: true,
                                    message: "请选择所属部门",
                                    trigger: "click"
                                }]
                            },
                            {
                                label: "所属岗位",
                                prop: "postId",
                                type: "tree",
                                multiple: true,
                                dicData: [],
                                props: {
                                    label: "postName",
                                    value: "id"
                                },
                                rules: [{
                                    required: true,
                                    message: "请选择所属岗位",
                                    trigger: "click"
                                }],
                            },
                        ]
                    },
                ]
                span: 24,
              },
              {
                label: "登录账号",
                prop: "account",
                rules: [
                  {
                    required: true,
                    message: "请输入登录账号",
                    trigger: "blur",
                  },
                ],
              },
              {
                label: "用户平台",
                type: "select",
                dicUrl: "/api/blade-system/dict/dictionary?code=user_type",
                props: {
                  label: "dictValue",
                  value: "dictKey",
                },
                dataType: "number",
                slot: true,
                prop: "userType",
                rules: [
                  {
                    required: true,
                    message: "请选择用户平台",
                    trigger: "blur",
                  },
                ],
              },
              {
                label: "密码",
                prop: "password",
                hide: true,
                editDisplay: false,
                viewDisplay: false,
                rules: [
                  { required: true, validator: validatePass, trigger: "blur" },
                ],
              },
              {
                label: "确认密码",
                prop: "password2",
                hide: true,
                editDisplay: false,
                viewDisplay: false,
                rules: [
                  { required: true, validator: validatePass2, trigger: "blur" },
                ],
              },
            ],
          },
          {
            label: "详细信息",
            prop: "detailInfo",
            icon: "el-icon-s-order",
            column: [
              {
                label: "用户昵称",
                prop: "name",
                hide: true,
                rules: [
                  {
                    required: true,
                    message: "请输入用户昵称",
                    trigger: "blur",
                  },
                ],
              },
              {
                label: "用户姓名",
                prop: "realName",
                rules: [
                  {
                    required: true,
                    message: "请输入用户姓名",
                    trigger: "blur",
                  },
                  {
                    min: 2,
                    max: 5,
                    message: "姓名长度在2到5个字符",
                  },
                ],
              },
              {
                label: "手机号码",
                prop: "phone",
                overHidden: true,
              },
              {
                label: "电子邮箱",
                prop: "email",
                hide: true,
                overHidden: true,
              },
              {
                label: "用户性别",
                prop: "sex",
                type: "select",
                dicData: [
                  {
                    label: "男",
                    value: 1,
                  },
                  {
                    label: "女",
                    value: 2,
                  },
                  {
                    label: "未知",
                    value: 3,
                  },
                ],
                hide: true,
              },
              {
                label: "用户生日",
                type: "date",
                prop: "birthday",
                format: "yyyy-MM-dd hh:mm:ss",
                valueFormat: "yyyy-MM-dd hh:mm:ss",
                hide: true,
              },
              {
                label: "账号状态",
                prop: "statusName",
                hide: true,
                display: false,
              },
            ],
          },
          {
            label: "职责信息",
            prop: "dutyInfo",
            icon: "el-icon-s-custom",
            column: [
              {
                label: "用户编号",
                prop: "code",
              },
              {
                label: "所属角色",
                prop: "roleId",
                multiple: true,
                type: "tree",
                dicData: [],
                props: {
                  label: "title",
                },
                checkStrictly: true,
                slot: true,
                rules: [
                  {
                    required: true,
                    message: "请选择所属角色",
                    trigger: "click",
                  },
                ],
              },
              {
                label: "所属单位",
                prop: "deptId",
                type: "tree",
                multiple: true,
                dicData: [],
                props: {
                  label: "title",
                },
                checkStrictly: true,
                slot: true,
                rules: [
                  {
                    required: true,
                    message: "请选择所属部门",
                    trigger: "click",
                  },
                ],
              },
              {
                label: "所属岗位",
                prop: "postId",
                type: "tree",
                multiple: true,
                dicData: [],
                props: {
                  label: "postName",
                  value: "id",
                },
                rules: [
                  {
                    required: true,
                    message: "请选择所属岗位",
                    trigger: "click",
                  },
                ],
              },
            ],
          },
        ],
      },
      data: [],
      platformQuery: {},
      platformSelectionList: [],
      excelForm: {},
      excelOption: {
        submitBtn: false,
        emptyBtn: false,
        column: [
          {
            label: "模板上传",
            prop: "excelFile",
            type: "upload",
            drag: true,
            loadText: "模板上传中,请稍等",
            span: 24,
            propsHttp: {
              res: "data",
            },
            data: [],
            platformQuery: {},
            platformSelectionList: [],
            excelForm: {},
            excelOption: {
                submitBtn: false,
                emptyBtn: false,
                column: [
                    {
                        label: '模板上传',
                        prop: 'excelFile',
                        type: 'upload',
                        drag: true,
                        loadText: '模板上传中,请稍等',
                        span: 24,
                        propsHttp: {
                            res: 'data'
                        },
                        tip: '请上传 .xls,.xlsx 标准格式文件',
                        action: "/api/blade-user/import-user"
                    },
                    {
                        label: "数据覆盖",
                        prop: "isCovered",
                        type: "switch",
                        align: "center",
                        width: 80,
                        dicData: [
                            {
                                label: "否",
                                value: 0
                            },
                            {
                                label: "是",
                                value: 1
                            }
                        ],
                        value: 0,
                        slot: true,
                        rules: [
                            {
                                required: true,
                                message: "请选择是否覆盖",
                                trigger: "blur"
                            }
                        ]
                    },
                    {
                        label: '模板下载',
                        prop: 'excelTemplate',
                        formslot: true,
                        span: 24,
                    }
                ]
            }
        };
            tip: "请上传 .xls,.xlsx 标准格式文件",
            action: "/api/blade-user/import-user",
          },
          {
            label: "数据覆盖",
            prop: "isCovered",
            type: "switch",
            align: "center",
            width: 80,
            dicData: [
              {
                label: "否",
                value: 0,
              },
              {
                label: "是",
                value: 1,
              },
            ],
            value: 0,
            slot: true,
            rules: [
              {
                required: true,
                message: "请选择是否覆盖",
                trigger: "blur",
              },
            ],
          },
          {
            label: "模板下载",
            prop: "excelTemplate",
            formslot: true,
            span: 24,
          },
        ],
      },
    };
  },
  watch: {
    "form.tenantId"() {
      if (this.form.tenantId !== "" && this.initFlag) {
        this.initData(this.form.tenantId);
      }
    },
    watch: {
        'form.tenantId' () {
            if (this.form.tenantId !== '' && this.initFlag) {
                this.initData(this.form.tenantId);
            }
        },
        'excelForm.isCovered' () {
            if (this.excelForm.isCovered !== '') {
                const column = this.findObject(this.excelOption.column, "excelFile");
                column.action = `/api/blade-user/import-user?isCovered=${this.excelForm.isCovered}`;
            }
        }
    "excelForm.isCovered"() {
      if (this.excelForm.isCovered !== "") {
        const column = this.findObject(this.excelOption.column, "excelFile");
        column.action = `/api/blade-user/import-user?isCovered=${this.excelForm.isCovered}`;
      }
    },
    computed: {
        ...mapGetters(["permission"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.user_add, false),
                viewBtn: this.vaildData(this.permission.user_view, false),
                delBtn: this.vaildData(this.permission.user_delete, false),
                editBtn: this.vaildData(this.permission.user_edit, false)
            };
        },
        ids () {
            let ids = [];
            this.selectionList.forEach(ele => {
                ids.push(ele.id);
            });
            return ids.join(",");
        },
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.user_add, false),
        viewBtn: this.vaildData(this.permission.user_view, false),
        delBtn: this.vaildData(this.permission.user_delete, false),
        editBtn: this.vaildData(this.permission.user_edit, false),
      };
    },
    mounted () {
        // 非租户模式默认加载管理组数据
        if (!website.tenantMode) {
            this.initData(website.tenantId);
        }
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
    methods: {
        nodeClick (data) {
            this.treeDeptId = data.id;
            this.page.currentPage = 1;
            this.onLoad(this.page);
        },
        initData (tenantId) {
            getRoleTree(tenantId).then(res => {
                const column = this.findObject(this.option.group, "roleId");
                column.dicData = res.data.data;
            });
            getDeptTree(tenantId).then(res => {
                const column = this.findObject(this.option.group, "deptId");
                column.dicData = res.data.data;
            });
            getPostList(tenantId).then(res => {
                const column = this.findObject(this.option.group, "postId");
                column.dicData = res.data.data;
            });
        },
        rowSave (row, done, loading) {
            row.deptId = row.deptId.join(",");
            row.roleId = row.roleId.join(",");
            row.postId = row.postId.join(",");
            add(row).then(() => {
                this.initFlag = false;
                this.onLoad(this.page);
                this.$message({
                    type: "success",
                    message: "操作成功!"
                });
                done();
            }, error => {
                window.console.log(error);
                loading();
            });
        },
        searchReset () {
            this.query = {};
            this.treeDeptId = '';
            this.onLoad(this.page);
        },
        searchChange (params, done) {
            this.query = params;
            this.page.currentPage = 1;
            this.onLoad(this.page, params);
            done();
        },
        selectionChange (list) {
            this.selectionList = list;
        },
        selectionClear () {
            this.selectionList = [];
            this.$refs.crud.toggleSelection();
        },
        uploadAfter (res, done, loading, column) {
            window.console.log(column);
            this.excelBox = false;
            this.refreshChange();
            done();
        },
        handleTemplate () {
            window.open(`/api/blade-user/export-template?${this.website.tokenHeader}=${getToken()}`);
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getUser(this.form.id).then(res => {
                    this.form = res.data.data;
                    if (this.form.hasOwnProperty("deptId")) {
                        this.form.deptId = this.form.deptId.split(",");
                    }
                    if (this.form.hasOwnProperty("roleId")) {
                        this.form.roleId = this.form.roleId.split(",");
                    }
                    if (this.form.hasOwnProperty("postId")) {
                        this.form.postId = this.form.postId.split(",");
                    }
                });
            }
            this.initFlag = true;
            done();
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage;
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize;
        },
        refreshChange () {
            this.onLoad(this.page, this.query);
        },
        onLoad (page, params = {}) {
            this.loading = true;
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
                const data = res.data.data;
                this.page.total = data.total;
                this.data = data.records;
                this.loading = false;
                this.selectionClear();
            });
        },
        platformSelectionClear () {
            this.platformSelectionList = [];
            this.$refs.platformCrud.toggleSelection();
        },
        // 行单击
        handleRowClick (row) {
            // delete (row["name"]);
            var obj = row
            obj["name"] = "保安详细资料"
            this.$router.push({
                path: `/management/index`,
                query: obj,
            });
        },
        // 证件吊销事件
        handleCredentials (row) {
            if (row.hold == 1) {
                this.$message({
                  type: 'info',
                    message: '证件未拥有!'
                });
            } else if (row.hold == 2) {
                this.$message({
                   type: 'info',
                    message: '证件已吊销!'
                });
            } else {
                this.$confirm('此操作将吊销该人员的证件, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    updateHold(2, row.cardid).then(res => {
                        console.log(res)
                        this.$message({
                            type: 'success',
                            message: '删除成功!'
                        });
                    })
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    });
                });
            }
        }
  },
  mounted() {
    // 非租户模式默认加载管理组数据
    if (!website.tenantMode) {
      this.initData(website.tenantId);
    }
  },
  methods: {
    nodeClick(data) {
      //   this.treeDeptId = data.id;
      this.jurisdiction = data.id;
      this.page.currentPage = 1;
      this.onLoad(this.page);
    },
    initData(tenantId) {
      getRoleTree(tenantId).then((res) => {
        const column = this.findObject(this.option.group, "roleId");
        column.dicData = res.data.data;
      });
      getDeptTree(tenantId).then((res) => {
        const column = this.findObject(this.option.group, "deptId");
        column.dicData = res.data.data;
      });
      getPostList(tenantId).then((res) => {
        const column = this.findObject(this.option.group, "postId");
        column.dicData = res.data.data;
      });
    },
    rowSave(row, done, loading) {
      row.deptId = row.deptId.join(",");
      row.roleId = row.roleId.join(",");
      row.postId = row.postId.join(",");
      add(row).then(
        () => {
          this.initFlag = false;
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    searchReset() {
      this.query = {};
      this.treeDeptId = "";
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    uploadAfter(res, done, loading, column) {
      window.console.log(column);
      this.excelBox = false;
      this.refreshChange();
      done();
    },
    handleTemplate() {
      window.open(
        `/api/blade-user/export-template?${
          this.website.tokenHeader
        }=${getToken()}`
      );
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getUser(this.form.id).then((res) => {
          this.form = res.data.data;
          if (this.form.hasOwnProperty("deptId")) {
            this.form.deptId = this.form.deptId.split(",");
          }
          if (this.form.hasOwnProperty("roleId")) {
            this.form.roleId = this.form.roleId.split(",");
          }
          if (this.form.hasOwnProperty("postId")) {
            this.form.postId = this.form.postId.split(",");
          }
        });
      }
      this.initFlag = true;
      done();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      params["jurisdiction"] = this.jurisdiction;
      getListSecurity(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
    platformSelectionClear() {
      this.platformSelectionList = [];
      this.$refs.platformCrud.toggleSelection();
    },
    // 行单击
    handleRowClick(row) {
      // delete (row["name"]);
      var obj = row;
      obj["name"] = "保安详细资料";
      this.$router.push({
        path: `/management/index`,
        query: obj,
      });
    },
    //证件查看
    handleViewCredentials(row) {
      var obj = row;
      obj["name"] = "保安证件信息";
      this.$router.push({
        path: `/management/idinformation`,
        query: obj,
      });
    },
    // 证件吊销事件
    handleCredentials(row) {
      if (row.hold == 1) {
        this.$message({
          type: "info",
          message: "证件未拥有!",
        });
      } else if (row.hold == 2) {
        this.$message({
          type: "info",
          message: "证件已吊销!",
        });
      } else {
        this.$confirm("此操作将吊销该人员的证件, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            updateHold(2, row.cardid).then((res) => {
              console.log(res);
              this.$message({
                type: "success",
                message: "删除成功!",
              });
            });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消删除",
            });
          });
      }
    },
  },
};
</script>
<style lang='scss' scoped>
.box {
    height: 800px;
  height: 800px;
}
.el-scrollbar {
    height: 100%;
  height: 100%;
}
.box .el-scrollbar__wrap {
    overflow: scroll;
  overflow: scroll;
}
</style>
src/views/securityUnitOperation/economicAnalysis.vue
@@ -1,7 +1,281 @@
/*
 * @Author: mikey.zhaopeng
 * @Date: 2021-07-17 00:19:50
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2021-07-17 00:20:31
  * @description:公司经济情况智能分析详情
 */
<template>
  <div class="page1">
    <el-row>
      <el-col :span="24">
        <div class="rowContent first-menu">
          <div class="rowTitle">
            <img src="../../../public/img/bajgxt/u1618.png" />
            <span>数据概览</span>
            <el-select class="select0" v-model="value0" placeholder="请选择">
              <el-option
                v-for="item in options0"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
            <el-select class="select1" v-model="value1" placeholder="请选择">
              <el-option
                v-for="item in options1"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
            <el-select class="select2" v-model="value2" placeholder="请选择">
              <el-option
                v-for="item in options2"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
            <el-button @click="toEconomicTable">进入数据统计表</el-button>
          </div>
          <div class="col-content">
            <div class="box-card">
              <span>社保缴纳人数</span>
              <span>11291</span>
              <span>较上月增加12人</span>
            </div>
            <div class="box-card">
              <span>社保缴纳总额(万)</span>
              <span>410</span>
              <span>较上月增加15万</span>
            </div>
            <div class="box-card">
              <span>公司派遣人数</span>
              <span>1121</span>
              <span>较上月增加13人</span>
            </div>
            <div class="box-card">
              <span>社保缴纳人数占比</span>
              <span>85%</span>
              <span>较上月上涨2%</span>
            </div>
          </div>
        </div>
      </el-col>
    </el-row>
    <el-row :gutter="20">
      <el-col :span="16">
        <div class="rowContent">
          <span class="span-title">社保缴纳</span>
          <div id="middleEchart1"></div>
        </div>
      </el-col>
      <el-col :span="8">
        <div class="rowContent">
          <span class="span-title">派遣人员占比</span>
          <div id="middleEchart2"></div>
        </div>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="24">
        <div class="rowContent">
          <span class="span-title">公司经济运转趋势</span>
          <div id="bottomEchart"></div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import * as echarts from "echarts";
import echartJs from "./securityEchart.js";
export default {
  data() {
    return {
      value1: "1",
      value2: "1",
       value0: "2012",
      options0: [
        {
          value: "2012",
          label: "2012年"
        },
        {
          value: "2011",
          label: "2011年"
        },
        {
          value: "2010",
          label: "2010年"
        },
        {
          value: "2009",
          label: "2009年"
        },
        {
          value: "2008",
          label: "2008年"
        },
        {
          value: "2007",
          label: "2007年"
        }
      ],
      options1: [
        {
          value: "1",
          label: "南昌市公安局"
        },
        {
          value: "2",
          label: "东湖分局"
        },
        {
          value: "3",
          label: "西湖分局"
        },
        {
          value: "4",
          label: "青云谱分局"
        },
        {
          value: "5",
          label: "青山湖分局"
        }
      ],
      options2: [
        {
          value: "1",
          label: "江西省永安保安服务有限公司"
        },
        {
          value: "2",
          label: "南昌市赣水保安服务有限公司"
        },
        {
          value: "3",
          label: "江西中业兴达保安服务有限公司"
        }
      ]
    };
  },
  methods: {
    setEchart() {
      let data = [];
      let bottomEchart = echarts.init(document.getElementById("bottomEchart"));
      bottomEchart.setOption(echartJs.bottomOption(data));
      let middleEchart1 = echarts.init(
        document.getElementById("middleEchart1")
      );
      middleEchart1.setOption(echartJs.economicMiddle(data));
      let middleEchart2 = echarts.init(
        document.getElementById("middleEchart2")
      );
      middleEchart2.setOption(echartJs.economicPieOption(data));
    },
    toEconomicTable() {
      this.$router.push({ path: "/securityUnitOperation/economicTable" });
    }
  },
  mounted() {
    this.setEchart();
  }
};
</script>
<style lang="scss" scoped>
.page1 {
  height: 100%;
  width: 100%;
}
#bottomEchart,
#middleEchart1,
#middleEchart2 {
  height: calc(100% - 40px);
  width: 100%;
}
.el-row:first-child {
  height: calc(40% - 80px);
  margin-bottom: 20px;
}
.el-row:nth-child(2) {
  margin-bottom: 20px;
}
.el-row:nth-child(2),
.el-row:nth-child(3) {
  height: 30%;
}
.el-col {
  height: 100%;
}
.rowContent {
  padding: 5px 20px 0px 10px;
  height: calc(100% - 5px);
  width: calc(100% - 30px);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0px 0px 1px #fff;
  .span-title {
    color: #fff;
    font-size: 17px;
    margin-left: 35px;
    font-weight: 600;
  }
}
.box-card {
  width: 150px;
  background: #00aaf1;
  height: 135px;
  text-align: center;
  margin-right: 66px;
  box-shadow: 5px 5px 5px rgba($color: #000, $alpha: 0.35);
  line-height: 40px;
}
.box-card span {
  display: block;
  width: 100%;
  color: #fff;
}
.box-card span:nth-child(2) {
  color: #06ffff;
  font-size: 34px;
}
.rowTitle {
  height: 40px;
  display: flex;
  line-height: 40px;
  img {
    width: 30px;
    height: 30px;
    margin-top: 5px;
  }
  span {
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    margin-left: 11px;
  }
  .select0 {
    position: absolute;
    right: 443px;
  }
  .select1 {
    position: absolute;
    right: 302px;
  }
  .select2 {
    position: absolute;
    right: 159px;
  }
  .el-button {
    position: absolute;
    right: 0px;
  }
  /deep/ .el-input__inner {
    width: 120px;
  }
}
.col-content {
  display: flex;
  margin-top: 15px;
  margin-left: 36px;
}
</style>
src/views/securityUnitOperation/economicTable.vue
@@ -1,7 +1,351 @@
/*
 * @Author: mikey.zhaopeng
 * @Date: 2021-07-17 00:19:50
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2021-07-17 00:20:33
  * @description:公司经济情况智能分析统计
 */
<template>
  <basic-container>
    <div class="operation-table">
      <el-row>
        <el-col>
          <span>时间范围:</span>
          <el-date-picker
            v-model="value2"
            type="daterange"
            align="right"
            unlink-panels
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            :picker-options="pickerOptions"
          >
          </el-date-picker>
          <span>类别:</span>
          <el-select v-model="typeValue" placeholder="请选择">
            <el-option
              v-for="item in typeOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
          <span>所属辖区:</span>
          <el-select v-model="subofficeValue" placeholder="请选择">
            <el-option
              v-for="item in subofficeOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
          <span>公司名称:</span>
          <el-input v-model="companyName"></el-input>
          <el-button>查询</el-button>
          <el-button>重置</el-button>
        </el-col>
      </el-row>
      <el-row>
        <el-col>
          <div class="table">
            <el-button @click="downExcel">下载</el-button>
            <avue-crud
              :option="tableOption"
              :data="tableData"
              :page.sync="tablePage"
              :permission="permissionList"
              :before-open="beforeOpen"
            >
            </avue-crud>
            <!-- <el-table id="table" :data="tableData" style="width: 100%">
            <el-table-column type="index" label="序号" width="50">
            </el-table-column>
            <el-table-column prop="company" label="公司名称" width="180">
            </el-table-column>
            <el-table-column prop="subOffice" label="所属分局" width="180">
            </el-table-column>
            <el-table-column prop="time" label="时间"> </el-table-column>
            <el-table-column prop="sbjnrs" label="社保缴纳人数">
            </el-table-column>
            <el-table-column prop="sbjnze" label="社保缴纳总额(万)">
            </el-table-column>
            <el-table-column prop="gspqrs" label="公司派遣人数">
            </el-table-column>
            <el-table-column prop="sbjnrszb" label="社保缴纳人数占比(%)">
            </el-table-column>
            <el-table-column prop="bz" label="备注"> </el-table-column>
          </el-table> -->
            <el-pagination
              background
              layout="prev, pager, next"
              :total="tableData.length"
            >
            </el-pagination>
          </div>
        </el-col>
      </el-row>
    </div>
  </basic-container>
</template>
<script>
import FileSaver from "file-saver";
import XLSX from "xlsx";
export default {
  name: "公司经济情况智能分析详情表",
  data() {
    return {
      pickerOptions: {
        shortcuts: [
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            }
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            }
          },
          {
            text: "最近三个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit("pick", [start, end]);
            }
          }
        ]
      },
      value1: "",
      value2: "",
      tableData: [
        {
          company: "江西省永安保安服务有限公司",
          subOffice: "南昌市公安局",
          time: "2021年6月",
          sbjnrs: "12200",
          sbjnze: "400",
          gspqrs: "110",
          sbjnrszb: "10",
          bz: ""
        },
        {
          company: "南昌市赣水保安服务有限公司",
          subOffice: "东湖分局",
          time: "2021年6月",
          sbjnrs: "12200",
          sbjnze: "400",
          gspqrs: "110",
          sbjnrszb: "10",
          bz: ""
        },
        {
          company: "江西中业兴达保安服务有限公司",
          subOffice: "西湖分局",
          time: "2021年6月",
          sbjnrs: "12200",
          sbjnze: "400",
          gspqrs: "110",
          sbjnrszb: "10",
          bz: ""
        }
      ],
      tablePage: {
        pageSize: 10,
        currentPage: 1,
        total: 0
      },
      tableOption: {
        lazy: true,
        tip: false,
        simplePage: true,
        searchShow: true,
        searchMenuSpan: 6,
        dialogWidth: "60%",
        tree: true,
        border: true,
        index: true,
        selection: true,
        viewBtn: false,
        editBtn: false,
        addBtn: false,
        delBtn: false,
        menuWidth: 150,
        dialogClickModal: false,
        column: [
          {
            label: "公司名称",
            prop: "company"
          },
          {
            label: "所属分局",
            prop: "subOffice"
          },
          {
            label: "时间",
            prop: "time"
          },
          {
            label: "社保缴纳人数",
            prop: "sbjnrs"
          },
          {
            label: "社保缴纳总额(万)",
            prop: "sbjnze"
          },
          {
            label: "公司派遣人数",
            prop: "gspqrs"
          },
          {
            label: "社保缴纳人数占比(%)",
            prop: "sbjnrszb"
          },
          {
            label: "备注",
            prop: "bz"
          }
        ]
      },
      typeValue: "0",
      typeOptions: [
        {
          value: "0",
          label: "全部"
        },
        {
          value: "1",
          label: "社保缴纳人数"
        },
        {
          value: "2",
          label: "社保缴纳总额"
        },
        {
          value: "3",
          label: "公司派遣人数"
        },
        {
          value: "4",
          label: "社保缴纳人数占比"
        }
      ],
      subofficeValue: "0",
      subofficeOptions: [
        {
          value: "0",
          label: "南昌市公安局"
        },
        {
          value: "2",
          label: "东湖分局"
        },
        {
          value: "3",
          label: "西湖分局"
        },
        {
          value: "4",
          label: "青云谱分局"
        },
        {
          value: "5",
          label: "青山湖分局"
        }
      ],
      companyName: ""
    };
  },
  methods: {
    downExcel() {
      let et = XLSX.utils.table_to_book(document.getElementById("table"));
      let etout = XLSX.write(et, {
        bookType: "xlsx",
        bookSST: true,
        type: "array"
      });
      try {
        FileSaver.saveAs(
          new Blob([etout], {
            type: "application/octet-stream"
          }),
          `表.xlsx`
        ); //导出的文件名
      } catch (e) {
        console.log(e, etout);
      }
      return etout;
    }
  },
  mounted() {}
};
</script>
<style lang="scss" scoped>
.operation-table {
  height: 100%;
  width: 100%;
  .el-row:first-child {
    height: 100px;
    margin-bottom: 20px;
    // background: rgba(255, 255, 255, 0.1);
    // box-shadow: 0px 0px 1px #fff;
    .el-col {
      padding: 20px;
      .el-date-editor {
        margin-right: 20px;
      }
      .el-select {
        width: 115px;
        margin-right: 20px;
      }
      .el-input {
        width: 115px;
        margin-right: 20px;
      }
      .el-button {
        width: 70px !important;
      }
    }
  }
  .el-row:nth-child(2) {
    height: calc(100% - 120px);
    // background: rgba(255, 255, 255, 0.1);
    // box-shadow: 0px 0px 1px #fff;
  }
  .el-col {
    height: 100%;
    span {
      color: #fff;
    }
  }
}
.table {
  padding: 20px;
  height: calc(100% - 40px);
  width: calc(100% - 40px);
  .el-button {
    width: 55px;
    height: 30px;
    padding: 0px;
    margin-left: calc(100% - 55px);
  }
}
/deep/ .el-table {
  width: 100%;
  height: calc(100% - 100px);
  margin: 10px 0px;
  .cell {
    color: #fff;
    text-align: center;
  }
}
.el-pagination {
  height: 40px;
  float: right;
}
</style>
src/views/securityUnitOperation/operationAnalysis.vue
@@ -4,8 +4,18 @@
      <el-col :span="24">
        <div class="rowContent first-menu">
          <div class="rowTitle">
            <img src="../../../public/img/bajgxt/u1618.png" />
            <span>数据概览</span>
            <el-button>进入数据统计表</el-button>
            <el-select class="select0" v-model="value0" placeholder="请选择">
              <el-option
                v-for="item in options0"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
            <el-select class="select1" v-model="value1" placeholder="请选择">
              <el-option
                v-for="item in options1"
@@ -24,43 +34,44 @@
              >
              </el-option>
            </el-select>
            <el-button @click="toOperationTable">进入数据统计表</el-button>
          </div>
          <div style="display: flex ;margin-top: 15px;">
          <div class="col-content">
            <div class="box-card">
              <span>总保安数</span>
              <span>500</span>
              <span>较上月上涨2%</span>
              <span>23708</span>
              <span>较上月增加123人</span>
            </div>
            <div class="box-card">
              <span>正常保安员</span>
              <span>500</span>
              <span>较上月上涨2%</span>
              <span>22176</span>
              <span>较上月增加13人</span>
            </div>
            <div class="box-card">
              <span>持证保安员</span>
              <span>500</span>
              <span>较上月上涨2%</span>
              <span>21003</span>
              <span>较上月增加31人</span>
            </div>
            <div class="box-card">
              <span>过考保安员</span>
              <span>500</span>
              <span>较上月上涨2%</span>
              <span>21003</span>
              <span>较上月增加31人</span>
            </div>
            <div class="box-card">
              <span>服务客户</span>
              <span>500</span>
              <span>较上月上涨2%</span>
              <span>56</span>
              <span>较上月增加34家</span>
            </div>
            <div class="box-card">
              <span>缴纳社保</span>
              <span>500</span>
              <span>较上月上涨2%</span>
              <span>23708</span>
              <span>较上月增加3人</span>
            </div>
            <div class="box-card">
              <span>保安派遣</span>
              <span>500</span>
              <span>较上月上涨2%</span>
              <span>12720</span>
              <span>较上月增加31人</span>
            </div>
          </div>
        </div>
@@ -68,15 +79,22 @@
    </el-row>
    <el-row :gutter="20">
      <el-col :span="16">
        <div class="rowContent" id="middleEchart1"></div>
        <div class="rowContent">
          <span class="span-title">保安类数据统计</span>
          <div id="middleEchart1"></div>
        </div>
      </el-col>
      <el-col :span="8">
        <div class="rowContent" id="middleEchart2"></div>
        <div class="rowContent">
          <span class="span-title">服务客户</span>
          <div id="middleEchart2"></div>
        </div>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="24">
        <div class="rowContent">
          <span class="span-title">公司运营趋势</span>
          <div id="bottomEchart"></div>
        </div>
      </el-col>
@@ -92,16 +110,67 @@
    return {
      value1: "1",
      value2: "1",
      value0: "2012",
      options0: [
        {
          value: "2012",
          label: "2012年"
        },
        {
          value: "2011",
          label: "2011年"
        },
        {
          value: "2010",
          label: "2010年"
        },
        {
          value: "2009",
          label: "2009年"
        },
        {
          value: "2008",
          label: "2008年"
        },
        {
          value: "2007",
          label: "2007年"
        }
      ],
      options1: [
        {
          value: "1",
          label: "南昌市"
          label: "南昌市公安局"
        },
        {
          value: "2",
          label: "东湖分局"
        },
        {
          value: "3",
          label: "西湖分局"
        },
        {
          value: "4",
          label: "青云谱分局"
        },
        {
          value: "5",
          label: "青山湖分局"
        }
      ],
      options2: [
        {
          value: "1",
          label: "保安公司"
          label: "江西省永安保安服务有限公司"
        },
        {
          value: "2",
          label: "南昌市赣水保安服务有限公司"
        },
        {
          value: "3",
          label: "江西中业兴达保安服务有限公司"
        }
      ]
    };
@@ -119,6 +188,9 @@
        document.getElementById("middleEchart2")
      );
      middleEchart2.setOption(echartJs.middleOption2(data));
    },
    toOperationTable() {
      this.$router.push({ path: "/securityUnitOperation/operationTable" });
    }
  },
  mounted() {
@@ -130,22 +202,12 @@
.page1 {
  height: 100%;
  width: 100%;
  /* background: #003688; */
}
#bottomEchart,
#middleEchart1,
#middleEchart2 {
  height: 100%;
  height: calc(100% - 40px);
  width: 100%;
}
.rowContent {
  height: 20%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0px 0px 1px #fff;
}
.first-menu {
  padding: 5px 20px 20px 20px;
  height: calc(100% - 25px) !important;
}
.el-row:first-child {
  height: calc(40% - 80px);
@@ -158,9 +220,21 @@
.el-row:nth-child(3) {
  height: 30%;
}
.el-col,
.rowContent {
.el-col {
  height: 100%;
}
.rowContent {
  padding: 5px 20px 0px 10px;
  height: calc(100% - 5px);
  width: calc(100% - 30px);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0px 0px 1px #fff;
  .span-title {
    color: #fff;
    font-size: 17px;
    margin-left: 35px;
    font-weight: 600;
  }
}
.box-card {
  width: 150px;
@@ -183,26 +257,41 @@
.rowTitle {
  height: 40px;
  display: flex;
  line-height: 40px;
  img {
    width: 30px;
    height: 30px;
    margin-top: 5px;
  }
  span {
    color: #fff;
    font-size: 25px;
    font-size: 17px;
    font-weight: 600;
    margin-right: 20px;
    margin-left: 11px;
  }
  .select0 {
    position: absolute;
    right: 443px;
  }
  .select1 {
    position: absolute;
    right: 140px;
    right: 302px;
  }
  .select2 {
    position: absolute;
    right: 0px;
    right: 159px;
  }
  .el-button {
    position: absolute;
    right: 300px;
    right: 0px;
  }
  /deep/ .el-input__inner {
    width: 120px;
  }
}
.col-content {
  display: flex;
  margin-top: 15px;
  margin-left: 36px;
}
</style>
src/views/securityUnitOperation/operationTable.vue
@@ -1,47 +1,223 @@
<template>
  <div class="table1">
    <div class="about">
      <el-button @click="downExcel">下载</el-button>
      <el-table id="table" :data="tableData" stripe style="width: 100%">
        <el-table-column prop="date" label="日期" width="180">
        </el-table-column>
        <el-table-column prop="name" label="姓名" width="180">
        </el-table-column>
        <el-table-column prop="address" label="地址"> </el-table-column>
      </el-table>
      <el-pagination background layout="prev, pager, next" :total="1000">
      </el-pagination>
    </div>
  <div class="operation-table">
    <el-row>
      <el-col>
        <span>时间范围:</span>
        <el-date-picker
          v-model="value2"
          type="daterange"
          align="right"
          unlink-panels
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :picker-options="pickerOptions"
        >
        </el-date-picker>
        <span>类别:</span>
        <el-select v-model="typeValue" placeholder="请选择">
          <el-option
            v-for="item in typeOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
        <span>所属辖区:</span>
        <el-select v-model="subofficeValue" placeholder="请选择">
          <el-option
            v-for="item in subofficeOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
        <span>公司名称:</span>
        <el-input v-model="companyName"></el-input>
        <el-button>查询</el-button>
        <el-button>重置</el-button>
      </el-col>
    </el-row>
    <el-row>
      <el-col>
        <div class="table">
          <el-button @click="downExcel">下载</el-button>
          <el-table id="table" :data="tableData" style="width: 100%">
            <el-table-column type="index" label="序号" width="50">
            </el-table-column>
            <el-table-column prop="company" label="公司名称" width="180">
            </el-table-column>
            <el-table-column prop="subOffice" label="所属分局" width="180">
            </el-table-column>
            <el-table-column prop="time" label="时间"> </el-table-column>
            <el-table-column prop="totalSec" label="总保安人数">
            </el-table-column>
            <el-table-column prop="normalSec" label="正常保安数">
            </el-table-column>
            <el-table-column prop="holderSec" label="持证保安数">
            </el-table-column>
            <el-table-column prop="sendSec" label="保安派遣数">
            </el-table-column>
            <el-table-column prop="passSec" label="过考保安数">
            </el-table-column>
            <el-table-column prop="unit" label="服务单位数"> </el-table-column>
            <el-table-column prop="socialSec" label="缴纳社保保安数">
            </el-table-column>
            <el-table-column prop="bz" label="备注"> </el-table-column>
          </el-table>
          <el-pagination
            background
            layout="prev, pager, next"
            :total="tableData.length"
          >
          </el-pagination>
        </div>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import FileSaver from "file-saver";
import XLSX from "xlsx";
export default {
  name: "公司运营情况智能分析详情表",
  data() {
    return {
      pickerOptions: {
        shortcuts: [
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            }
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            }
          },
          {
            text: "最近三个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit("pick", [start, end]);
            }
          }
        ]
      },
      value1: "",
      value2: "",
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
          company: "江西省永安保安服务有限公司",
          subOffice: "南昌市公安局",
          time: "2020年7月",
          totalSec: "1200",
          normalSec: "1150",
          holderSec: "1160",
          sendSec: "1000",
          passSec: "1180",
          unit: "50",
          socialSec: "1180",
          bz: ""
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1517 弄",
          company: "南昌市赣水保安服务有限公司",
          subOffice: "东湖分局",
          time: "2020年7月",
          totalSec: "1200",
          normalSec: "1150",
          holderSec: "1160",
          sendSec: "1000",
          passSec: "1180",
          unit: "50",
          socialSec: "1180",
          bz: ""
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1519 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1516 弄",
        },
          company: "江西中业兴达保安服务有限公司",
          subOffice: "西湖分局",
          time: "2020年7月",
          totalSec: "1200",
          normalSec: "1150",
          holderSec: "1160",
          sendSec: "1000",
          passSec: "1180",
          unit: "50",
          socialSec: "1180",
          bz: ""
        }
      ],
      typeValue: "0",
      typeOptions: [
        {
          value: "0",
          label: "全部"
        },
        {
          value: "1",
          label: "总保安人数"
        },
        {
          value: "2",
          label: "正常保安数"
        },
        {
          value: "3",
          label: "持证保安数"
        },
        {
          value: "4",
          label: "保安派遣数"
        },
        {
          value: "5",
          label: "过考保安数"
        },
        {
          value: "6",
          label: "服务单位数"
        },
        {
          value: "7",
          label: "缴纳社保保安数"
        }
      ],
      subofficeValue: "0",
      subofficeOptions: [
        {
          value: "0",
          label: "南昌市公安局"
        },
        {
          value: "2",
          label: "东湖分局"
        },
        {
          value: "3",
          label: "西湖分局"
        },
        {
          value: "4",
          label: "青云谱分局"
        },
        {
          value: "5",
          label: "青山湖分局"
        }
      ],
      companyName: ""
    };
  },
  methods: {
@@ -50,12 +226,12 @@
      let etout = XLSX.write(et, {
        bookType: "xlsx",
        bookSST: true,
        type: "array",
        type: "array"
      });
      try {
        FileSaver.saveAs(
          new Blob([etout], {
            type: "application/octet-stream",
            type: "application/octet-stream"
          }),
          `表.xlsx`
        ); //导出的文件名
@@ -63,15 +239,72 @@
        console.log(e, etout);
      }
      return etout;
    },
    }
  },
  mounted() {},
  mounted() {}
};
</script>
<style>
.table1 {
<style lang="scss" scoped>
.operation-table {
  height: 100%;
  width: 1005;
  display: none;
  width: 100%;
  .el-row:first-child {
    height: 100px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0px 0px 1px #fff;
    .el-col {
      padding: 20px;
      .el-date-editor {
        margin-right: 20px;
      }
      .el-select {
        width: 115px;
        margin-right: 20px;
      }
      .el-input {
        width: 115px;
        margin-right: 20px;
      }
      .el-button {
        width: 70px !important;
      }
    }
  }
  .el-row:nth-child(2) {
    height: calc(100% - 120px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0px 0px 1px #fff;
  }
  .el-col {
    height: 100%;
    span {
      color: #fff;
    }
  }
}
.table {
  padding: 20px;
  height: calc(100% - 40px);
  width: calc(100% - 40px);
  .el-button {
    width: 55px;
    height: 30px;
    padding: 0px;
    margin-left: calc(100% - 55px);
  }
}
/deep/ .el-table {
  width: 100%;
  height: calc(100% - 100px);
  margin: 10px 0px;
  .cell {
    color: #fff;
    text-align: center;
  }
}
.el-pagination {
  height: 40px;
  float: right;
}
</style>
src/views/securityUnitOperation/securityEchart.js
@@ -1,10 +1,42 @@
function bottomOption(data) {
  let option = {
    title: {
      text: "公司运营趋势",
    // title: {
    //   text: "公司运营趋势",
    //   textStyle: {
    //     color: "#fff"
    //   }
    // },
    color: [
      "#73c0de",
      "#fac858",
      "#91cc75",
      "#3ba272",
      "#fc8452",
      "#9a60b4",
      "#3fb1e3",
      "#6be6c1",
      "#626c91",
      "#a0a7e6",
      "#c4ebad",
      "#96dee8"
    ],
    grid: {
      top: "10%",
      left: "3%",
      right: "4%",
      bottom: "15%",
      containLabel: true
    },
    legend: {
      data: ["趋势"],
      bottom: "0%",
      textStyle: {
        color: "#fff"
      }
    },
    tooltip: {
      trigger: "item"
    },
    xAxis: {
      type: "category",
@@ -28,6 +60,7 @@
      ]
    },
    yAxis: {
      name: "(%)",
      type: "value",
      axisLabel: {
        color: "#fff"
@@ -35,7 +68,8 @@
    },
    series: [
      {
        data: [820, 932, 901, 934, 1290, 1330, 1320, 132, 1111, 321, 342, 134],
        name: "趋势",
        data: [10, 30, 20, 50, 10, 40, 32, 13, 21, 12, 25, 11],
        type: "line",
        smooth: true,
        areaStyle: {}
@@ -46,12 +80,12 @@
}
function middleOption1(data) {
  let option = {
    title: {
      text: "公司保安类数据对比",
      textStyle: {
        color: "#fff"
      }
    },
    // title: {
    //   text: "公司保安类数据对比",
    //   textStyle: {
    //     color: "#fff"
    //   }
    // },
    tooltip: {
      trigger: "axis"
    },
@@ -62,15 +96,216 @@
        "持证保安数",
        "过考保安数",
        "缴纳社保保安数",
        "缴纳社保数"
        "保安派遣"
      ],
      bottom: "2%",
      bottom: "0%",
      textStyle: {
        color: "#fff"
      }
    },
    color: [
      "#73c0de",
      "#fac858",
      "#91cc75",
      "#3ba272",
      "#fc8452",
      "#9a60b4",
      "#3fb1e3",
      "#6be6c1",
      "#626c91",
      "#a0a7e6",
      "#c4ebad",
      "#96dee8"
    ],
    grid: {
      top: "10%",
      left: "3%",
      right: "2%",
      bottom: "15%",
      containLabel: true
    },
    xAxis: {
      type: "category",
      boundaryGap: true,
      axisLabel: {
        color: "#fff"
      },
      data: [
        "一月",
        "二月",
        "三月",
        "四月",
        "五月",
        "六月",
        "七月",
        "八月",
        "九月",
        "十月",
        "十一月",
        "十二月"
      ]
    },
    yAxis: {
      type: "value",
      axisLabel: {
        color: "#fff"
      }
    },
    series: [
      {
        name: "总保安数",
        type: "bar",
        barWidth: 9,
        data: [120, 132, 101, 134, 90, 230, 210, 214, 123, 22, 132, 321]
      },
      {
        name: "正常保安数",
        type: "bar",
        barWidth: 9,
        data: [220, 182, 191, 234, 290, 330, 310, 111, 222, 132, 143, 123]
      },
      {
        name: "持证保安数",
        type: "bar",
        barWidth: 9,
        data: [150, 232, 201, 154, 190, 330, 410, 132, 111, 222, 132, 43]
      },
      {
        name: "过考保安数",
        type: "bar",
        barWidth: 9,
        data: [320, 332, 301, 334, 390, 330, 320, 233, 123, 432, 122, 11]
      },
      {
        name: "缴纳社保保安数",
        type: "bar",
        barWidth: 9,
        data: [120, 132, 101, 134, 120, 130, 132, 222, 111, 123, 341, 123]
      },
      {
        name: "保安派遣",
        type: "bar",
        barWidth: 9,
        data: [120, 132, 101, 134, 1210, 130, 120, 22, 123, 33, 21, 13]
      }
    ]
  };
  return option;
}
function middleOption2(data) {
  let option = {
    // title: {
    //   text: "服务客户",
    //   textStyle: {
    //     color: "#fff"
    //   }
    // },
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "shadow"
      }
    },
    legend: {
      data: ["客户数"],
      bottom: "0%",
      textStyle: {
        color: "#fff"
      }
    },
    color: [
      "#73c0de",
      "#fac858",
      "#91cc75",
      "#3ba272",
      "#fc8452",
      "#9a60b4",
      "#3fb1e3",
      "#6be6c1",
      "#626c91",
      "#a0a7e6",
      "#c4ebad",
      "#96dee8"
    ],
    grid: {
      top: "10%",
      left: "10%",
      right: "2%",
      bottom: "22%",
      containLabel: false
    },
    xAxis: {
      type: "category",
      boundaryGap: true,
      axisLabel: {
        color: "#fff",
        interval: 0
      },
      data: [
        "一月",
        "二月",
        "三月",
        "四月",
        "五月",
        "六月",
        "七月",
        "八月",
        "九月",
        "十月",
        "十一月",
        "十二月"
      ]
    },
    yAxis: {
      type: "value",
      axisLabel: {
        color: "#fff"
      }
    },
    series: [
      {
        name: "客户数",
        type: "bar",
        data: [231, 123, 441, 123, 321, 333, 111, 221, 332, 442, 132, 51]
      }
    ]
  };
  return option;
}
function economicMiddle(data) {
  let option = {
    tooltip: {
      trigger: "axis"
    },
    legend: {
      data: ["缴纳社保人数", "公司派遣人数"],
      bottom: "0%",
      textStyle: {
        color: "#fff"
      }
    },
    color: [
      "#73c0de",
      "#fac858",
      "#91cc75",
      "#3ba272",
      "#fc8452",
      "#9a60b4",
      "#3fb1e3",
      "#6be6c1",
      "#626c91",
      "#a0a7e6",
      "#c4ebad",
      "#96dee8"
    ],
    grid: {
      top: "10%",
      left: "5%",
      right: "4%",
      bottom: "15%",
      containLabel: true
@@ -104,104 +339,81 @@
    },
    series: [
      {
        name: "总保安数",
        name: "缴纳社保人数",
        type: "line",
        stack: "总量",
        data: [120, 132, 101, 134, 90, 230, 210, 214, 123, 22, 132, 321]
      },
      {
        name: "正常保安数",
        name: "公司派遣人数",
        type: "line",
        stack: "总量",
        data: [220, 182, 191, 234, 290, 330, 310, 111, 222, 132, 143, 123]
      },
      {
        name: "持证保安数",
        type: "line",
        stack: "总量",
        data: [150, 232, 201, 154, 190, 330, 410, 132, 111, 222, 132, 43]
      },
      {
        name: "过考保安数",
        type: "line",
        stack: "总量",
        data: [320, 332, 301, 334, 390, 330, 320, 233, 123, 432, 122, 11]
      },
      {
        name: "缴纳社保保安数",
        type: "line",
        stack: "总量",
        data: [120, 132, 101, 134, 120, 130, 132, 222, 111, 123, 341, 123]
      },
      {
        name: "缴纳社保数",
        type: "line",
        stack: "总量",
        data: [120, 132, 101, 134, 1210, 130, 120, 22, 123, 33, 21, 13]
      }
    ]
  };
  return option;
}
function middleOption2(data) {
function economicPieOption() {
  let title = "总";
  let total = "111";
  let option = {
    title: {
      text: "服务客户",
      textStyle: {
        color: "#fff"
    title: [
      {
        text: "{name|" + title + "}\n{val|" + total + "}",
        top: "center",
        left: "center",
        textStyle: {
          rich: {
            name: {
              fontSize: 14,
              fontWeight: "normal",
              color: "#fff",
              padding: [10, 0]
            },
            val: {
              fontSize: 20,
              fontWeight: "bold",
              color: "#fff"
            }
          }
        }
      }
    },
    ],
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "shadow"
      }
      trigger: "item"
    },
    legend: {
      data: ["客户数"],
      bottom: "5%",
      bottom: "0%",
      left: "center",
      textStyle: {
        color: "#fff"
      }
    },
    grid: {
      left: "3%",
      right: "4%",
      bottom: "7%",
      containLabel: true
    },
    xAxis: {
      type: "value",
      boundaryGap: [0, 0.01],
      axisLabel: {
        color: "#fff"
      }
    },
    yAxis: {
      type: "category",
      axisLabel: {
        color: "#fff"
      },
      data: [
        "一月",
        "二月",
        "三月",
        "四月",
        "五月",
        "六月",
        "七月",
        "八月",
        "九月",
        "十月",
        "十一月",
        "十二月"
      ]
    },
    color: [
      "#73c0de",
      "#fac858",
      "#91cc75",
      "#3ba272",
      "#fc8452",
      "#9a60b4",
      "#3fb1e3",
      "#6be6c1",
      "#626c91",
      "#a0a7e6",
      "#c4ebad",
      "#96dee8"
    ],
    series: [
      {
        name: "2011年",
        type: "bar",
        data: [231, 123, 441, 123, 321, 333, 111, 221, 332, 442, 132, 51]
        name: "人员分布",
        type: "pie",
        radius: ["40%", "70%"],
        data: [
          { value: 1048, name: "已派遣人数" },
          { value: 735, name: "未派遣人" }
        ]
      }
    ]
  };
@@ -211,5 +423,7 @@
export default {
  bottomOption,
  middleOption1,
  middleOption2
  middleOption2,
  economicMiddle,
  economicPieOption
};