liuyg
2021-11-19 0855c8cef2f2f414cf9a84285421fdcdd5bc6310
src/views/home/index.vue
@@ -20,7 +20,7 @@
          </div>
          <div class="leftEchartTitle leftEchartTitle2">
            <div class="block1"></div>
            <span>保安培训公司</span>
            <span>保安培训学校</span>
            <span>{{ leftData.px }}</span>
            <span>个</span>
          </div>
@@ -239,7 +239,7 @@
            <avue-input-tree
              default-expand-all
              v-model="value1"
              placeholder="请选择内容"
              placeholder="南昌市公安局"
              type="tree"
              :dic="options1"
              :props="props"
@@ -391,7 +391,13 @@
    >
      <el-table :data="gridData.data">
        <template v-if="gridData.type === 'zg'">
          <el-table-column :key="gridData.type" type="index"> </el-table-column>
          <el-table-column
            label="序号"
            width="50"
            :key="gridData.type"
            type="index"
          >
          </el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="realName"
@@ -463,7 +469,13 @@
          ></el-table-column>
        </template>
        <template v-if="gridData.type === 'wg'">
          <el-table-column :key="gridData.type" type="index"> </el-table-column>
          <el-table-column
            label="序号"
            width="50"
            :key="gridData.type"
            type="index"
          >
          </el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="enterpriseName"
@@ -490,7 +502,8 @@
            label="持证率"
            :show-overflow-tooltip="true"
            width="150"
          ></el-table-column>
          >
          </el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="sbnum"
@@ -507,7 +520,13 @@
          ></el-table-column>
        </template>
        <template v-if="gridData.type === 'jy'">
          <el-table-column :key="gridData.type" type="index"> </el-table-column>
          <el-table-column
            label="序号"
            width="50"
            :key="gridData.type"
            type="index"
          >
          </el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="enterpriseName"
@@ -558,7 +577,13 @@
          ></el-table-column>
        </template>
        <template v-if="gridData.type === 'ym'">
          <el-table-column :key="gridData.type" type="index"> </el-table-column>
          <el-table-column
            label="序号"
            width="50"
            :key="gridData.type"
            type="index"
          >
          </el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="enterpriseName"
@@ -593,7 +618,13 @@
          >gridData
        </template>
        <template v-if="gridData.type === 'jg'">
          <el-table-column :key="gridData.type" type="index"> </el-table-column>
          <el-table-column
            label="序号"
            width="50"
            :key="gridData.type"
            type="index"
          >
          </el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="enterpriseName"
@@ -628,6 +659,34 @@
            label="处罚时间"
            :show-overflow-tooltip="true"
            width="100"
          ></el-table-column>
        </template>
        <template v-if="gridData.type === 'ywdx_gs'">
          <el-table-column
            label="序号"
            width="50"
            :key="gridData.type"
            type="index"
          >
          </el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="enterprisename"
            label="保安公司名称"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="stats"
            label="保安公司类型"
            :formatter="companyFormatter"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            :key="gridData.type"
            prop="jurisdictionName"
            label="所属辖区"
            :show-overflow-tooltip="true"
          ></el-table-column>
        </template>
      </el-table>
@@ -683,7 +742,8 @@
  selectJy,
  selectWg,
  punishList,
  lazyTrees
  lazyTrees,
  getSecurityUnitInfoPage
} from "../../api/index/index";
import car from "@/assets/img/car.png";
@@ -767,7 +827,8 @@
      //   value: "departmentid"
      // },
      node1: {}, //选中的记录
      node2: {}
      node2: {},
      params: null
    };
  },
  computed: {
@@ -823,7 +884,39 @@
        return "责令停业";
      }
    },
    shoeDialog1(type) {
      this.gridData.data = [];
      this.gridData.total = 0;
      this.gridData.current = 1;
      this.gridData.type = type;
      this.showDialogTable(type);
    },
    showDialogTable(type) {
      let param = this.params;
      this.dialogTableVisible = true;
      this.dialogloading = true;
      if (type === "ywdx_gs") {
        this.gridData.title = param.name + "保安公司统计";
        if (param.name) {
          let arr = this.options1[0].children.filter(
            a => a.title === param.name
          );
          if (arr[0] && arr[0].id) {
            getSecurityUnitInfoPage({
              jurisdiction: arr[0].id,
              current: this.gridData.current,
              size: 10
            }).then(res => {
              if (res.data.code === 200) {
                this.gridData.data = res.data.data.records;
                this.gridData.total = res.data.data.total;
              }
              this.dialogloading = false;
            });
          }
        }
      }
    },
    // 左侧表的接口返回数据
    initEchart() {
      securityTotal().then(res => {
@@ -835,6 +928,10 @@
            );
          }
          this.echarts.left1Echart.setOption(optionJs.left1Data(securityData));
          this.echarts.left1Echart.on("click", params => {
            this.params = params;
            this.shoeDialog1("ywdx_gs");
          });
        } else {
          this.$message.error(res.msg);
        }
@@ -1031,56 +1128,6 @@
      });
    },
    initMap() {
      this.map = new Map({
        target: "map",
        layers: [
          // new Tile({
          //   source: new OSM()
          // })
          new Tile({
            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",
          center: [115.892151, 28.676493],
          zoom: 10
        })
      });
      this.carVectorLayer = new VectorLayer({
        zIndex: 99,
        source: new VectorSource()
      });
      this.peoVectorLayer = new VectorLayer({
        zIndex: 99,
        source: new VectorSource()
      });
      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(0);
    },
    // 获取辖区列表
    getOfficeData() {
      lazyTrees().then(res => {
@@ -1111,7 +1158,8 @@
        this.gridData.title = "资格异常人员清单";
        this.getQualificationPages(1);
      } else if (type === "wg") {
        this.gridData.title = "违规经营公司清单(持证人数低于50%、缴纳社保人数低于50%)";
        this.gridData.title =
          "违规经营公司清单(持证人数低于50%、缴纳社保人数低于50%)";
        this.getWgTable();
      } else if (type === "jy") {
        this.gridData.title = "经营不善公司清单(服务对象数量为0)";
@@ -1129,13 +1177,13 @@
        let czl = 0;
        if (Number(item.cznum) !== 0 && Number(item.znum) !== 0) {
          czl =
            ((Number(item.cznum) / Number(item.znum)) * 100).toFixed(4) + "%";
            ((Number(item.cznum) / Number(item.znum)) * 100).toFixed(2) + "%";
        }
        item["czl"] = czl;
        let sbl = 0;
        if (Number(item.sbnum) !== 0 && Number(item.znum) !== 0) {
          czl =
            ((Number(item.sbnum) / Number(item.znum)) * 100).toFixed(4) + "%";
            ((Number(item.sbnum) / Number(item.znum)) * 100).toFixed(2) + "%";
        }
        item["sbl"] = sbl;
      });
@@ -1147,13 +1195,13 @@
        let pql = 0;
        if (Number(item.painum) !== 0 && Number(item.znum) !== 0) {
          pql =
            ((Number(item.painum) / Number(item.znum)) * 100).toFixed(4) + "%";
            ((Number(item.painum) / Number(item.znum)) * 100).toFixed(2) + "%";
        }
        item["pql"] = pql;
        let pjpqrs = 0;
        if (Number(item.painum) !== 0 && Number(item.fwnum) !== 0) {
          pjpqrs =
            ((Number(item.painum) / Number(item.fwnum)) * 100).toFixed(4) + "%";
            ((Number(item.painum) / Number(item.fwnum)) * 100).toFixed(2) + "%";
        }
        item["pjpqrs"] = pjpqrs;
      });
@@ -1201,6 +1249,8 @@
        );
      } else if (this.gridData.type === "jg") {
        this.getPunishList(page);
      } else if (this.gridData.type === "ywdx_gs") {
        this.showDialogTable(this.gridData.type);
      }
    },
    getQualificationPages(page) {