Administrator
2022-01-12 21c7375b7b38ebf2c8a2ca8fbf6fe9fb4f28250f
src/views/securityAnalysis/index.vue
@@ -2,14 +2,28 @@
  <div class="securityAnalysis">
    <!-- securityAnalysis -->
    <div class="securityAnalysisleft">
      <div class="examine" ref="ech1">
      <!-- 保安员审查情况统计
        <div>饼图</div> -->
      <!-- </div> -->
      <div class="examinesBtn" v-if="examineBtnVisiable">
        <el-radio-group v-model="tabPosition" style="margin-bottom: 30px" size="small" @change="handleClick">
          <el-radio-button label="1">保安员审查情况统计</el-radio-button>
          <el-radio-button label="2">企业登录预警情况统计</el-radio-button>
        </el-radio-group>
      </div>
        <div id="ech1" class="examines"  ref="ech1" style="visibility:visible;z-index:666">
        </div>
        <div id="ech1s" class="examiness"  ref="ech1s" style="visibility:hidden;z-index:333">
        </div>
        <!-- 保安员审查情况统计
        <div>饼图</div> -->
      </div>
      <div class="certificate" ref="ech2">
        <!-- 保安员持证情况统计
        <div>饼图</div> -->
      </div>
      <!-- <div class="czbut"></div> -->
    </div>
    <div class="securityAnalysiscenter">
      <div class="examination" ref="ech3">
@@ -23,7 +37,7 @@
    </div>
    <div class="securityAnalysisright">
      <div class="dispatchSecurity" ref="ech5">
        <!-- 保安派遣情况统计
        <!-- 保安员年龄分布情况统计
        <div>饼图</div> -->
      </div>
      <div class="socialSecurity" ref="ech6">
@@ -31,34 +45,176 @@
        <div>饼图</div> -->
      </div>
    </div>
    <div>
      <el-dialog
        width="80%"
        :title="titles"
        append-to-body
        :visible.sync="dialogVisible"
        lock-scroll="false"
        top="1vh"
        center
      >
        <situation
          :card="{ deptId: deptid, jurisdiction: jurisdiction }"
          v-if="sees == 1"
        >
          <!-- 保安员审查情况统计 -->
        </situation>
        <loginRecord
          :card="{ jurisdiction: jurisdiction }"
          v-if="sees == 7"
        >
          <!-- 保安员审查情况统计 -->
        </loginRecord>
        <certificate
          :card="{ deptId: deptid, jurisdiction: jurisdiction }"
          v-if="sees == 2"
        >
          <!-- 保安员持证情况统计 -->
        </certificate>
        <examination
          :card="{ deptid: deptid, jurisdiction: jurisdiction }"
          v-if="sees == 3"
        >
          <!-- 保安员考试情况统计 -->
        </examination>
        <dispatch
          :card="{ deptId: deptid, jurisdiction: jurisdiction }"
          v-if="sees == 4"
        >
          <!-- 派遣服务单位 注意deptId  I为大写 -->
        </dispatch>
        <assignment
          :card="{ deptid: deptid, jurisdiction: jurisdiction }"
          v-if="sees == 5"
        >
          <!-- 保安派遣情况 -->
        </assignment>
        <socialSecurity
          :card="{ deptid: deptid, jurisdiction: jurisdiction }"
          :reself="dialogVisible"
          v-if="sees == 6"
        >
          <!-- 社保缴纳情况 -->
        </socialSecurity>
      </el-dialog>
    </div>
  </div>
</template>
<script>
import {
  getinformationselectExtype, //保安员审查情况统计
  getinformationselectHold, //保安员持证
  getinformationselectDis, //派遣服务单位
  getinformationstatistics, //保安员考试情况统计
  getinformationselectDisp, //保安派遣数量
  getExamStatisInfo, //保安员考试情况统计
  getinformationselectDisp, //保安派遣情况
  getAgeStatistics, //保安员年龄分布情况
  getinformationselectSoil, //社保缴纳情况统计
  getEducationStatistics,
  getLoginDataStatistics
} from "@/api/securityAnalysis/securityAnalysis";
import { lang } from "moment";
import { mapState } from "vuex";
import { getRoleDetail } from "@/api/system/role";
import certificate from "./child/certificate.vue";
import examination from "./child/examination.vue";
import situation from "./child/situation.vue";
import loginRecord from "./child/loginRecord.vue";
import dispatch from "./child/dispatch.vue";
import assignment from "./child/assignment.vue";
import socialSecurity from "./child/socialSecurity.vue";
export default {
  components: {
    certificate,
    examination,
    situation,
    dispatch,
    assignment,
    socialSecurity,
    loginRecord
  },
  data() {
    return {
      EC1: "", //保安员审查情况统计 // 饼图
      EC1s: "", //登录预警统计 // 饼图
      EC2: "", //保安员持证情况统计 // 饼图
      EC3: "", //保安员考试情况统计 // 堆叠面积图
      EC4: "", //派遣服务单位统计 // 柱状图
      EC5: "", //保安派遣情况统计 // 饼图
      EC6: "", //社保缴纳情况统计 // 饼图
      deptid: "1412222599212257282",
      deptid: "",
      oneVisiable:true,
      examineBtnVisiable:true,
      jurisdiction: "",
      tabPosition: 1,
      examinetionTitle:"保安员审查情况统计",
      examine1: [],
      dialogVisible: false,
      titles: "",
      sees: "",
      colors: ["#29C093", "#F34A4A"], //[正常,异常];
    };
  },
  computed: {
    ...mapState({
      userInfo: (state) => state.user.userInfo,
    }),
    ids1() {
      let ids1 = [];
      this.selectionList1.forEach((ele) => {
        ids1.push(ele.id);
      });
      return ids1.join(",");
    },
    ids2() {
      let ids2 = [];
      this.selectionList2.forEach((ele) => {
        ids2.push(ele.id);
      });
      return ids2.join(",");
    },
  },
  watch: {
    dialogVisible() {
      if (this.dialogVisible == false && this.sees == "1") {
        this.getEC1(this.tabPosition);
      }
      if (this.dialogVisible == false && this.sees == "2") {
        this.getEC2();
      }
      if (this.dialogVisible == false && this.sees == "3") {
        this.getEC3();
      }
      if (this.dialogVisible == false && this.sees == "4") {
        this.getEC4();
      }
      if (this.dialogVisible == false && this.sees == "5") {
        this.getEC5();
      }
      if (this.dialogVisible == false && this.sees == "6") {
        this.getEC6();
      }
    },
  },
  methods: {
    //tab 切换
    handleClick(val){
      if(val==1){
        document.getElementById("ech1").style.visibility = "visible";
        document.getElementById("ech1s").style.visibility = "hidden";
      }else{
        document.getElementById("ech1").style.visibility = "hidden";
        document.getElementById("ech1s").style.visibility = "visible";
      }
      this.tabPosition = val;
      this.getEC1(val);
    },
    creatOurEcharts() {
      this.EC1 = echarts.init(this.$refs.ech1);
      this.EC1s = echarts.init(this.$refs.ech1s);
      this.EC2 = echarts.init(this.$refs.ech2);
      this.EC3 = echarts.init(this.$refs.ech3);
      this.EC4 = echarts.init(this.$refs.ech4);
@@ -66,126 +222,148 @@
      this.EC6 = echarts.init(this.$refs.ech6);
      this.biginOUREC();
    },
    getEC1() {
      var that = this;
      getinformationselectExtype(this.deptid).then((res) => {
        // console.log(res);
        var a = res.data.data[0];
        var d = [
    changedata(a, ok, no, okmsg, nomsg) {
      var d = [];
      if (a.length != 0) {
        var yes = 0,
          not = 0;
        for (var k in a) {
          yes += a[k][ok];
          not += a[k][no];
        }
        d = [
          {
            value: a.bzc,
            name: "未审核",
            value: yes,
            name: okmsg,
          },
          {
            value: a.zc,
            name: "已审核",
            value: not,
            name: nomsg,
          },
        ];
        that.setEC1(d);
      });
    },
    setEC1(d) {
      var option, data;
      if (d) {
        data = d;
      } else {
        data = [
          { value: 1048, name: "搜索引擎" },
          { value: 735, name: "直接访问" },
          { value: 580, name: "邮件营销" },
          { value: 484, name: "联盟广告" },
          { value: 300, name: "视频广告" },
        d = [
          {
            value: 0,
            name: okmsg,
          },
          {
            value: 0,
            name: nomsg,
          },
        ];
      }
      // console.log(data);
      option = {
        title: {
          text: "保安员审查情况统计",
          // subtext: "纯属虚构",
          left: "center",
        },
        tooltip: {
          trigger: "item",
        },
        legend: {
          orient: "vertical",
          left: "left",
        },
        series: [
          {
            // name: "访问来源",
            type: "pie",
            radius: "50%",
            // data: data,
            data: [
              { value: 1, name: "在逃人员" },
              { value: 3, name: "吸毒人员" },
              { value: 10, name: "刑释解教人员" },
              { value: 5, name: "社会闲散青少年" },
              { value: 11, name: "艾滋病人" },
              { value: 26, name: "其他人员" },
            ],
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: "rgba(0, 0, 0, 0.5)",
              },
      // console.log(d, ok, no);
      return d;
    },
    getTime() {
      var data = new Date();
      var time = data.toLocaleString().slice(0, 9);
      return time;
    },
    GetPercent(num, total) {
      num = parseFloat(num);
      total = parseFloat(total);
      if (isNaN(num) || isNaN(total)) {
        return "-";
      }
      return total <= 0
        ? "0%"
        : Math.round((num / total) * 10000) / 100.0 + "%";
    },
    gettoolbox(title, titles, id) {
      var that = this;
      return {
        show: true,
        itemSize: 25,
        top: 20,
        right: 20,
        feature: {
          myTool1: {
            show: true,
            title: "点击查看详情",
            icon: "image://http://223.82.109.183:2080/img/table.png",
            onclick: function () {
              that.dialogVisible = true;
              that.sees = id;
              that.titles = titles;
            },
          },
        ],
        },
      };
      this.EC1.setOption(option);
    },
    getEC2() {
      var that = this;
      getinformationselectHold(this.deptid).then((res) => {
        var a = res.data.data[0];
        console.log(res);
        var d = [
          {
            value: a.wcz,
            name: "未持证",
          },
          {
            value: a.cz,
            name: "持证",
          },
        ];
        that.setEC2(d);
      });
    },
    setEC2(d) {
      var option;
      var option, data;
      if (d) {
        data = d;
      } else {
        data = [
          { value: 1048, name: "搜索引擎" },
          { value: 735, name: "直接访问" },
          { value: 580, name: "邮件营销" },
          { value: 484, name: "联盟广告" },
          { value: 300, name: "视频广告" },
        ];
    setColor(d, color) {
      for (var k in d) {
        var itemStyle = {
          color: color[k],
        };
        d[k]["itemStyle"] = itemStyle;
      }
      // console.log(data);
      console.log(d);
      return d;
    },
    getEC1(tab) {
      var that = this;
      if(tab==1){
        getinformationselectExtype(this.deptid, this.jurisdiction)
        .then((res) => {
          var a = res.data.data;
          var b = that.changedata(a, "zc", "bzc", "情况正常", "情况异常");
          that.setEC1(b);
        })
        .catch((res) => {
          var b = that.changedata([], "zc", "bzc", "情况正常", "情况异常");
          that.setEC1(b);
        });
      }
      if(tab==2){
        getLoginDataStatistics(this.jurisdiction).then((res)=>{
          var b = res.data.data;
          var data = [
            {
              value:b[0],
              name:"近7天登录企业数"
            },
            {
              value:b[1],
              name:"近7天未登录企业数"
            }
          ]
          that.setEC1s(data);
        })
      }
    },
    setEC1(d) {
      this.examine1 = [
        {
          title: "审查时间:",
          value: this.getTime(),
        },
        {
          title: "问题保安员人数:",
          value: d[1].value + "人",
        },
        {
          title: "问题保安员比例:",
          value: this.GetPercent(+d[1].value, +d[0].value + +d[1].value),
        },
      ];
      var option, data;
      data = this.setColor(d, this.colors);
      option = {
        title: {
          text: "保安员持证情况统计",
          // subtext: "纯属虚构",
          text: this.examinetionTitle,
          top: 25,
          left: "center",
        },
        tooltip: {
          trigger: "item",
        },
        legend: {
          orient: "vertical",
          left: "left",
          x: "center",
          y: "90%",
        },
        toolbox: this.gettoolbox("审查情况查询", "保安员审查情况明细", 1),
        series: [
          {
            // name: "访问来源",
@@ -199,6 +377,122 @@
                shadowColor: "rgba(0, 0, 0, 0.5)",
              },
            },
            label: {
              formatter: "{name|{b}}\n({d}%)",
              rich: {
                time: {
                  fontSize: 10,
                  color: "#999",
                },
              },
            },
          },
        ],
      };
      this.EC1.setOption(option);
    },
    //登录情况统计
    setEC1s(d) {
      var option,data;
      data = this.setColor(d, this.colors);
      option = {
        title: {
          text: "",
          top: 25,
          left: "center",
        },
        tooltip: {
          trigger: "item",
        },
        legend: {
          x: "center",
          y: "90%",
        },
        toolbox: this.gettoolbox("登录情况查询", "企业登录情况明细", 7),
        series: [
          {
            type: "pie",
            radius: "50%",
            data: data,
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: "rgba(0, 0, 0, 0.5)",
              },
            },
            label: {
              formatter: "{name|{b}}\n({d}%)",
              rich: {
                time: {
                  fontSize: 10,
                  color: "#999",
                },
              },
            },
          },
        ],
      };
      this.EC1s.setOption(option);
    },
    getEC2() {
      var that = this;
      getinformationselectHold(this.deptid, this.jurisdiction)
        .then((res) => {
          var a = res.data.data;
          var b = that.changedata(a, "cz", "wcz", "持证", "未持证");
          that.setEC2(b);
        })
        .catch((res) => {
          var b = that.changedata([], "cz", "wcz", "持证", "未持证");
          that.setEC2(b);
        });
    },
    setEC2(data) {
      var option;
      var that = this;
      data = this.setColor(data, this.colors);
      // console.log(data, "持证");
      option = {
        title: {
          text: "保安员持证情况统计",
          // subtext: "纯属虚构",
          top: 25,
          left: "center",
        },
        tooltip: {
          trigger: "item",
        },
        legend: {
          // orient: "vertical",
          // left: "left", x: "center",
          x: "center",
          y: "83%",
        },
        toolbox: this.gettoolbox("持证情况查询", "保安员持证情况明细", 2),
        series: [
          {
            // name: "访问来源",
            type: "pie",
            radius: "50%",
            data: data,
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: "rgba(0, 0, 0, 0.5)",
              },
            },
            label: {
              formatter: "{name|{b}}\n({d}%)",
              rich: {
                time: {
                  fontSize: 10,
                  color: "#999",
                },
              },
            },
          },
        ],
      };
@@ -206,27 +500,53 @@
      this.EC2.setOption(option);
    },
    getEC3() {
      var that = this;
      getinformationstatistics(this.deptid).then((res) => {
        var a = res.data.data,
          s = [],
          l = [];
        console.log(a); // 0 :理论 1:实操
        for (var k in a[0]) {
          l.push(a[0][k]);
          s.push(a[1][k]);
        }
        this.setEC3(s, l);
      getExamStatisInfo(this.deptid, this.jurisdiction).then((res) => {
        this.setEC3(res.data.data);
      });
    },
    setEC3(s, l) {
      var xd = [],
        sd = [],
        ld = [];
      for (var i = 0; i < 100; i++) {
        xd.push(i + "分");
      }
      console.log(sd);
    //考试数据统计
    setEC3(data) {
      //获取年份
      const seriesdata = [];
      data.forEach((item) => {
        if (item.type == 1) {
          seriesdata.push({
            name: item.name + "-合格人数",
            type: "bar",
            stack: item.name,
            emphasis: {
              focus: "series",
            },
            data: item.examSocreStatis,
          });
        }
        if (item.type == 2) {
          seriesdata.push({
            name: item.name + "-不合格人数",
            type: "bar",
            stack: item.name,
            emphasis: {
              focus: "series",
            },
            data: item.examSocreStatis,
          });
        }
      });
      var datetime = [
              "1月",
              "2月",
              "3月",
              "4月",
              "5月",
              "6月",
              "7月",
              "8月",
              "9月",
              "10月",
              "11月",
              "12月",
            ]
      //echarts 图表数据
      var option = {
        title: {
          text: "保安员考试情况统计",
@@ -236,42 +556,28 @@
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "cross",
            label: {
              backgroundColor: "#6a7985",
            },
            type: "shadow",
          },
          // formatter(params) {
          //   console.log(params);
          //   var str = "";
          //   for (var x in params) {
          //     str += params[x].axisValue + ":" + params[x].data + "/n";
          //   }
          //   return str;
          // },
          formatter:
            "<span>实操成绩</span>({b0}) :  {c0}<span>人</span><br /><span>理论成绩</span>({b1}) :  {c1}<span>人</span>",
        },
        color: ["#91CD76", "#EF6667"],
        legend: {
          data: ["实操成绩", "理论成绩"],
          data: ["a", "b"],
          icon: "circle",
          itemWidth: 10,
          itemHeight: 10,
          itemGap: 20,
        },
        toolbox: {
          feature: {
            saveAsImage: {},
          },
        },
        toolbox: this.gettoolbox("考试情况查询", "保安员考试情况明细", 3),
        grid: {
          left: "3%",
          right: "5%",
          right: "4%",
          bottom: "3%",
          containLabel: true,
        },
        xAxis: [
          {
            type: "category",
            boundaryGap: false,
            // data: ["0~60分", "60~80分", "80~90分", "90~100分"],
            data: xd,
            data: datetime
          },
        ],
        yAxis: [
@@ -279,80 +585,69 @@
            type: "value",
          },
        ],
        series: [
          {
            name: "实操成绩",
            type: "line",
            stack: "总量",
            areaStyle: {},
            emphasis: {
              focus: "series",
            },
            // data: [1, 2, 3, 1],
            data: [
              1, 0, 0, 0, 3, 2, 1, 0, 4, 0, 5, 0, 4, 0, 0, 9, 7, 0, 2, 0, 5, 0,
              0, 0, 7, 9, 0, 0, 7, 0, 5, 0, 7, 1, 0, 9, 2, 0, 0, 0, 3, 0, 0, 0,
              7, 9, 0, 0, 7, 0, 5, 0, 7, 24, 2, 9, 7, 37, 0, 3, 5, 0, 0, 0, 7,
              9, 1, 0, 7, 0, 5, 4, 2, 0, 0, 9, 7, 35, 0, 0, 3, 0, 0, 12, 7, 9,
              0, 0, 7, 0, 2, 0, 7, 0, 0, 9, 7, 0, 0, 1,
            ],
            // data: s,
          },
          {
            name: "理论成绩",
            type: "line",
            stack: "总量",
            areaStyle: {},
            emphasis: {
              focus: "series",
            },
            data: [
              4, 0, 5, 0, 7, 3, 2, 9, 7, 1, 0, 3, 5, 0, 9, 7, 0, 2, 0, 0, 7, 0,
              2, 0, 7, 0, 0, 9, 5, 0, 0, 0, 7, 9, 0, 0, 7, 0, 5, 0, 7, 1, 0, 9,
              2, 0, 0, 50, 3, 0, 30, 0, 7, 9, 0, 20, 7, 40, 0, 0, 0, 7, 9, 1, 0,
              7, 0, 5, 4, 2, 0, 0, 9, 7, 35, 0, 0, 3, 0, 0, 12, 7, 9, 0, 7, 0,
              0, 11, 0, 0, 0, 3, 2, 1, 0, 4, 0, 5, 0, 3,
            ],
            // data: l,
          },
        ],
        series: seriesdata,
      };
      this.EC3.setOption(option);
    },
    getEC4() {
      var date = new Date();
      var nowYear = date.getFullYear();
      var that = this;
      getinformationselectDis(this.deptid).then((res) => {
        var a = res.data.data,
          xd = [],
          d = [];
        // console.log(a);
        for (var k in a) {
          xd.push(a[k].name);
          d.push(a[k].num);
      getinformationselectDis(this.deptid, this.jurisdiction).then((res) => {
        var a = res.data,
          d = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
        var setNum = (start, end, i) => {
          // console.log(start, end, i);
          for (let a = +start - 1; a < +end; a++) {
            ++d[a];
          }
        };
        for (var k = 0; k < a.length; k++) {
          var overYear = a[k].end_time.slice(0, 4);
          var overMout = a[k].end_time.slice(5, 7);
          var bigYear = a[k].start_time.slice(0, 4);
          var bigMout = a[k].start_time.slice(5, 7);
          if (overYear > nowYear) {
            if (bigYear < nowYear) {
              setNum(1, 12, k);
            } else if (bigYear == nowYear) {
              setNum(+bigMout, 12, k);
            }
          } else if (overYear == nowYear) {
            if (bigYear < nowYear) {
              setNum(1, +overMout, k);
            } else if (bigYear == nowYear) {
              setNum(+bigMout, +overMout, k);
            }
          }
        }
        that.setEC4(d, xd);
        that.setEC4(d);
      });
    },
    setEC4(d, xd) {
    setEC4(data) {
      var xxd = [
          "一月",
          "二月",
          "三月",
          "四月",
          "五月",
          "六月",
          "七月",
          "八月",
          "九月",
          "十月",
          "一月",
          "二月",
        ],
        dd = [120, 200, 150, 80, 70, 110, 130, 120, 200, 150, 80, 70];
        "1月",
        "2月",
        "3月",
        "4月",
        "5月",
        "6月",
        "7月",
        "8月",
        "9月",
        "10月",
        "11月",
        "12月",
      ];
      var date = new Date();
      var d = date.getFullYear();
      // console.log(d);
      var option = {
        title: {
          text: "派遣服务单位统计",
          top: 20,
          left: "center",
        },
        xAxis: {
@@ -360,16 +655,17 @@
          data: xxd,
          // data: xd,
        },
        toolbox: this.gettoolbox("派遣单位查询", "派遣服务单位明细", 4),
        yAxis: {
          type: "value",
        },
        tooltip: {
          trigger: "item",
          formatter: d + "年{b} : {c} 个",
        },
        series: [
          {
            data: dd,
            // data: d,
            data: data,
            type: "bar",
          },
        ],
@@ -378,57 +674,59 @@
    },
    getEC5() {
      var that = this;
      getinformationselectDisp(this.deptid).then((res) => {
        var a = res.data.data,
          d = [];
        // console.log(a);
        for (var k in a) {
          d.push({
            value: a[k].num,
            name: a[k].real_name,
          });
        }
        that.setEC5(d);
      });
      getAgeStatistics(this.deptid, this.jurisdiction)
        .then((res) => {
          var data = res.data.data;
          var a = [
            {
              value:data[0],
              name:"18-30周岁"
            },
            {
              value:data[1],
              name:"30-45周岁"
            },
            {
              value:data[2],
              name:"45-60周岁"
            },
          ]
          console.log(a, "111111");
          this.setEC5(a);
        });
    },
    setEC5(d) {
      var option;
      // d = this.setColor(d, this.colors);
      option = {
        title: {
          text: "保安派遣情况统计",
          text: "保安员年龄分布情况统计",
          // subtext: "纯属虚构",
          top: 25,
          left: "center",
        },
        tooltip: {
          trigger: "item",
        },
        toolbox: this.gettoolbox("保安员年龄分布情况查询", "保安员年龄分布情况明细", 5),
        legend: {
          orient: "vertical",
          left: "left",
          x: "center",
          y: "90%",
        },
        series: [
          {
            // name: "访问来源",
            type: "pie",
            radius: "50%",
            // data: d,
            data: [
              {
                value: 4,
                name: "未派遣",
              },
              {
                value: 3,
                name: "已派遣",
              },
            ],
            data: d,
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: "rgba(0, 0, 0, 0.5)",
              },
            },
            label: {
              formatter: "{b}\n({d}%)",
            },
          },
        ],
@@ -438,38 +736,30 @@
    },
    getEC6() {
      var that = this;
      getinformationselectSoil(this.deptid).then((res) => {
        var a = res.data.data[0];
        // console.log(a);
        var d = [
          {
            value: a.nmuwj,
            name: "未缴纳社保",
          },
          {
            value: a.numj,
            name: "已缴纳社保",
          },
        ];
        that.setEC6(d);
      });
      getEducationStatistics(this.deptid, this.jurisdiction)
        .then((res) => {
          var a = res.data.data;
          that.setEC6(a);
        });
    },
    setEC6(d) {
      var option;
      // d = this.setColor(d, this.colors);
      option = {
        title: {
          text: "社保缴纳情况统计",
          // subtext: "纯属虚构",
          text: "保安员学历分布情况统计",
          top: 25,
          left: "center",
        },
        tooltip: {
          trigger: "item",
        },
        toolbox: this.gettoolbox("保安员学历分布情况查询", "保安员学历分布情况明细", 6),
        legend: {
          orient: "vertical",
          left: "left",
          // orient: "vertical",
          // left: "left",
          x: "center",
          y: "83%",
        },
        series: [
          {
@@ -484,6 +774,19 @@
                shadowColor: "rgba(0, 0, 0, 0.5)",
              },
            },
            label: {
              // alignTo: "edge",
              formatter: "{name|{b}}\n({d}%)",
              // minMargin: 5,
              // edgeDistance: 10,
              // lineHeight: 15,
              rich: {
                time: {
                  fontSize: 10,
                  color: "#999",
                },
              },
            },
          },
        ],
      };
@@ -491,7 +794,7 @@
      this.EC6.setOption(option);
    },
    biginOUREC() {
      this.getEC1();
      this.getEC1(1);
      this.getEC2();
      this.getEC3();
      this.getEC4();
@@ -505,17 +808,38 @@
      // this.setEC6();
    },
  },
  created(){
    if(this.userInfo.role_name == "保安公司管理员" || this.userInfo.role_name == "分公司管理员"){
      this.examinetionTitle = "保安员审查情况统计";
      this.examineBtnVisiable = false;
    }else {
      this.examinetionTitle = "";
    }
  },
  mounted() {
    this.$nextTick(() => {
      this.creatOurEcharts();
      var roleIds = this.userInfo.role_id.split(",");
      roleIds.forEach((roleId) => {
        getRoleDetail(roleId).then((res) => {
          var roleAlias = res.data.data.roleAlias;
          var roleName = res.data.data.roleName;
          if (roleName != "保安公司管理员" && roleName != "分公司管理员") {
            this.deptid = "";
            this.jurisdiction = this.userInfo.jurisdiction;
          } else {
            this.deptid = this.userInfo.dept_id;
            this.jurisdiction = "";
          }
          this.creatOurEcharts();
        });
      });
    });
    // console.log(echarts);
  },
};
</script>
<style lang="scss">
$widths: 30%;
$widths: 20%;
.securityAnalysis {
  width: 100%;
  height: 100%;
@@ -528,7 +852,8 @@
  .securityAnalysiscenter,
  .securityAnalysisright {
    // border: 1px solid #000;
    width: 30%;
    position: relative;
    width: 29%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
@@ -539,8 +864,6 @@
  .securityAnalysiscenter {
    width: 40% !important;
  }
  .examine,
  .certificate,
  .examination,
  .dispatchUnit,
  .dispatchSecurity,
@@ -551,6 +874,55 @@
    box-sizing: border-box;
    background-color: #fff;
  }
  .certificate{
    position: relative;
    width: 100%;
    height: 49%;
    top: 13.30rem;
    box-sizing: border-box;
    background-color: #fff;
  }
  .examinesBtn{
    position: absolute;
    top: 1.5rem;
    z-index: 999;
    left: 8rem;
  }
  .examines{
    position: absolute;
    top: 0.25rem;
    width: 100%;
    height: 49%;
    box-sizing: border-box;
    background-color: #fff;
  }
  .examiness{
    position: absolute;
    top: 0.25rem;
    width: 100%;
    height: 49%;
    box-sizing: border-box;
    background-color: #fff;
  }
  // .examines {
  //   width: 100%;
  //   height: 49%;
  //   display: flex;
  //   align-items: center;
  //   background-color: #fff;
  // }
  // .examine {
  //   width: 100%;
  //   height: 100%;
  // }
  // .examine1 {
  //   width: 200px;
  //   div {
  //     margin-bottom: 10px;
  //   }
  // }
  // .securityAnalysisleft {
  //   width: $widths;
  // }