index.vue 16.4 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556
<template>
  <div>
    <div class="pass_content_left">
      <el-form :inline="true" class="demo-form-inline" size="small">
        <el-form-item>
          <el-select class="commone_w" v-model="valueHpzl" clearable placeholder="号牌种类">
            <el-option
              v-for="item in optionsHpzl"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item>
          <el-select
            class="commone_w"
            v-model="valuePoint"
            clearable
            filterable
            placeholder="请选择采集点"
          >
            <el-option
              v-for="item in optionsPoint"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item>
          <el-select class="commone_w" v-model="valueXscd" clearable placeholder="行驶车道">
            <el-option
              v-for="item in optionsXscd"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item>
          <el-select class="commone_w" v-model="valueXsfx" clearable placeholder="行驶方向">
            <el-option
              v-for="item in optionsXsfx"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item>
          <el-date-picker
            v-model="value2"
            type="datetime"
            class="commone_w"
            format=" yyyy-MM-dd HH:mm:ss"

            placeholder="开始时间"
            align="right"
          ></el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-date-picker
            v-model="value3"
            type="datetime"
            class="commone_w"
            format=" yyyy-MM-dd HH:mm:ss"

            placeholder="结束时间"
            align="right"
          ></el-date-picker>
        </el-form-item>

        <el-form-item>
          <el-input placeholder="号牌号码"  v-model="whphm"  style="width:120px;"></el-input>
        </el-form-item>
        <el-button size="small" type="primary" @click="searchKakouList">查询</el-button>
      </el-form>

      <div class="table_m_type">
        <el-table
          v-loading="loading_status"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          @row-click="openRowDetails"
          ref="passTable"
          :data="tableData"
          :row-class-name="tableRowClassName"
          tooltip-effect="dark"
          :height="tableHeight"
          style="width: 100%;"
          :default-sort="{prop: 'date', order: 'descending'}"
        >
          <el-table-column label="号牌号码" prop="carNo" width="120px" sortable>
            <template slot-scope="scope">{{ scope.row.carNo }}</template>
          </el-table-column>
          <el-table-column label="号牌种类" prop="carType" width="120px" :formatter="formatHpzl"></el-table-column>

          <el-table-column label="过车时间" prop="watchTime" width="160px" sortable>
            <template slot-scope="scope">{{ scope.row.watchTime }}</template>
          </el-table-column>

          <el-table-column prop="addName" label="采集地点" show-overflow-tooltip></el-table-column>

          <el-table-column prop="carRoad" label="行驶车道" :formatter="formatXscd"></el-table-column>

          <el-table-column prop="direction" label="行驶方向" :formatter="formatXsfx"></el-table-column>

          <el-table-column prop="nid" v-if="false" label="NID" width="0"></el-table-column>

          <el-table-column label="操作">
            <template slot-scope="scope">
              <el-button size="mini" type="info" @click="showIllInfo(scope.$index, scope.row)">详情</el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>

      <div class="mt5 paa_fy">
        <el-pagination
          size="small"
          background
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          @prev-click="handlePagePrevClick"
          @next-click="handlePageNextclick"
          :page-sizes="pageSizes"
          :page-size="pageSize"
          layout="total, sizes, prev, pager, next"
          :total="pageTotal"
        ></el-pagination>
      </div>
    </div>

    <div class="pass_content_right">
      <div class="right_img">
        <vue-photo-zoom-pro :url="showPassInfo.pass_img" style="width:100%;height:100%;"></vue-photo-zoom-pro>
      </div>

      <div class="aduit-title ml5 mt10">
        <span class="title">卡口信息</span>
      </div>

      <el-col :span="10" class="ml5 mt5">
        <el-col :span="6" class="aduit-label">采集地点:</el-col>
        <el-col :span="18" class="aduit-info">{{showPassInfo.pass_addname}}</el-col>
      </el-col>

      <el-col :span="10" class="ml5 mt5">
        <el-col :span="6" class="aduit-label">号牌号码:</el-col>
        <el-col :span="10" class="aduit-info">
          <el-input class="audit_plate_1" v-model="showPassInfo.pass_hphm"></el-input>
        </el-col>
      </el-col>

      <el-col :span="10" class="ml5 mt5">
        <el-col :span="6" class="aduit-label">号牌种类:</el-col>
        <el-col :span="18" class="aduit-info">{{showPassInfo.pass_hpzl}}</el-col>
      </el-col>

      <el-col :span="10" class="ml5 mt5">
        <el-col :span="6" class="aduit-label">行驶车道:</el-col>
        <el-col :span="18" class="aduit-info">{{showPassInfo.pass_xscd}}</el-col>
      </el-col>

      <el-col :span="10" class="ml5 mt5">
        <el-col :span="6" class="aduit-label">行驶方向:</el-col>
        <el-col :span="18" class="aduit-info">{{showPassInfo.pass_xsfx}}</el-col>
      </el-col>

      <el-col :span="10" class="ml5 mt5">
        <el-col :span="6" class="aduit-label">采集时间:</el-col>
        <el-col :span="18" class="aduit-info">{{showPassInfo.pass_time}}</el-col>
      </el-col>
      <el-col :span="10" class="ml5 mt5">
        <el-col :span="6" class="aduit-label">采集设备:</el-col>
        <el-col :span="18" class="aduit-info">{{showPassInfo.pass_device}}</el-col>
      </el-col>

      <el-col :span="10" class="ml5 mt5">
        <el-col :span="6" class="aduit-label">地点编号:</el-col>
        <el-col :span="18" class="aduit-info">{{showPassInfo.pass_addcode}}</el-col>
      </el-col>
    </div>
  </div>
</template>
<script>

export default {
  data() {
    return {
      //ico: 'R0lGODlhWAAfAJEAAAAAAP////8AAGZmZiH5BAAHAP8ALAAAAABYAB8AAALfhI+py+0PX5i02ouz3rxn44XiSHJgiaYqdq7uK7bwTFtyjcN3zqd7D4wBgkTSr4i87AQCCrPCfFoG1IGIWqtabUOLNPCVfgNY8rZTzp4py+Yk7B6nL9pp3T6f3O3KLrQJ6OYlqLdGUTaHuKZYwcjHdfEUOEh4aGiW4Vi4acnZeNkGBlb5Ror5mbmVqLrISgfq9zcqO4uxmup5enuKChk56RRHqKnbmktMnDvxI1kZRbpnmZccXTittXaUtB2gzY3k/U0ULg5EXs5zjo6jvk7T7q4TGz8+T28eka+/zx9RAAA7',
      loading_status:false,
      tableHeight: "30",
      showPassInfo: {
        pass_xsfx: "",
        pass_time: "",
        pass_device: "",
        pass_xscd: "",
        pass_hpzl: "",
        pass_hphm: "",
        pass_addname: "",
        pass_img: "",
        pass_addcode: ""
      },

      optionsHpzl: [], //号牌种类
      valueHpzl: "",
      optionsXscd: [], //车道
      valueXscd: "",
      optionsXsfx: [],
      valueXsfx: "",

      /**  -------分页组件-------- */
      pageSizes: [10, 20, 200, 1000],
      pageTotal: 0,
      pageSize: 10,
      currentPage4: 2,
      pageNumber: 1,
      /**------------------------- */
      tableData: [],

      value2: "",
      value3: "",
      optionsPoint: [],
      valuePoint: "",
      whphm:""
    };
  },
  methods: {
    tableRowClassName({ row, rowIndex }) {
      //把每一行的索引放进row
      row.index = rowIndex;
    },
    onRowClick(row, event, column) {
      //行点击消除new标记
      var index = row.index;
      var deleteIndex = Array.indexOf(this.showIndexArr, index);
      if (deleteIndex != -1) {
        this.showIndexArr.splice(deleteIndex, 1);
      }
    },

    openRowDetails(row, column, event) {
      this.showIllInfo(row.index, row);
    },
    //---查看详情页
    showIllInfo(index, row) {
      debugger;
      var clxxData = this.tableData[index];
      this.showPassInfo.pass_xsfx = this.GCOMMON.formatterInfo(
        clxxData.direction,
        this.optionsXsfx
      );
      this.showPassInfo.pass_time = clxxData.watchTime;
      this.showPassInfo.pass_device = clxxData.deviceNo;
      this.showPassInfo.pass_xscd = this.GCOMMON.formatterInfoChangInt(
        clxxData.carRoad,
        this.optionsXscd
      );
      this.showPassInfo.pass_hpzl = this.GCOMMON.formatterInfo(
        clxxData.carType,
        this.optionsHpzl
      );
      this.showPassInfo.pass_hphm = clxxData.carNo;
      this.showPassInfo.pass_addname = clxxData.addName;
      //this.showPassInfo.pass_img = clxxData.picurl1;
      //this.getImageBase64(clxxData.picurl1);
      //---图片判断下,如果是http格式的,那么我们直接访问
      //this.showPassInfo.pass_img = "http://192.168.0.101:8089/image/1.jpg"
      //--方式二--如果是ftp的图片,可以通过流返回
      this.showPassInfo.pass_img = this.GCOMMON.imgPathAnalysis(this.$API_VideoImg_URL,clxxData.picurl1);
      //---方式三
      //this.getImageBase64("ftp://cyl:cyl@192.168.0.101:21/image/12.jpg");

      this.showPassInfo.pass_addcode = clxxData.addNo;
    },

getImageBase64(imgpath) {

  let requestParam = JSON.stringify({
        str1: imgpath
      });

      this.axios
        .post(this.$API_SERVICE_URL + "/image/getImgBase64", requestParam,{
          headers: {
            "Content-Type": "application/json;charset=utf-8" //头部信息
          }
        })
        .then(response => {
          debugger;
          let flaga = response.data.res_flag;
          if (flaga == "1") {
            this.showPassInfo.pass_img = response.data.base64;
          } else {
            this.$message({
              type: "warning",
              message: "图片加载异常"
            });
          }
        })
        .catch(error => {
          console.log(error);
        });
    }
,



    /**------------ 下面的是用于格式化table中数据的 --------------*/
    formatXsfx(row, column, cellValue, index) {
      return this.GCOMMON.formatterInfo(row.direction, this.optionsXsfx);
    },
    formatXscd(row, column, cellValue, index) {
      return this.GCOMMON.formatterInfoChangInt(row.carRoad, this.optionsXscd);
    },
    formatHpzl(row, column, cellValue, index) {
      return this.GCOMMON.formatterInfo(row.carType, this.optionsHpzl);
    },
    /** ------------------------------end------------------------ */

    /**
     * 初始化加载界面枚举信息
     */
    initEnumType() {
      let requestParam = JSON.stringify({
        flag: "2",
        enumtypeids: [
          {
            170: "optionsHpzl"
          },
          {
            151: "optionsXscd"
          },
          {
            149: "optionsXsfx"
          }
        ]
      });
      this.axios
        .post(this.$API_SERVICE_URL + "/enumtype/getEnumInfo", requestParam, {
          headers: {
            "Content-Type": "application/json;charset=utf-8" //头部信息
          }
        })
        .then(response => {
          debugger;
          let flaga = response.data.res_flag;
          if (flaga == "1") {
            this.optionsHpzl = response.data.optionsHpzl;
            this.optionsXscd = response.data.optionsXscd;
            this.optionsXsfx = response.data.optionsXsfx;
          } else {
            this.$message({
              type: "warning",
              message: "初始化枚举信息异常"
            });
          }
        })
        .catch(error => {
          console.log(error);
        });
    },

    // 修改table header的背景色
    tableHeaderColor({ row, column, rowIndex, columnIndex }) {
      if (rowIndex === 0) {
        return "background-color:#2C2C4B;color: #fff;font-weight: 500;border:1px solid #153B5D;text-align:center;";
      }
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },

    /** 分页组件方法 */
    //--改变每页显示的数量
    handleSizeChange(val) {
      this.pageSize = val;
      this.searchKakouList();
    },
    handleCurrentChange(val) {
      this.pageNumber = val;
      this.searchKakouList();
    },
    handlePagePrevClick(val) {
      this.pageNumber = val;
      this.searchKakouList();
    },
    handlePageNextClick(val) {
      this.pageNumber = val;
      this.searchKakouList();
    },
    /** --------------*/
    initGetMountPoint() {
      // let requestParam = JSON.stringify({
      //   remapname: "optionsWfxw"
      // });

      this.axios
        .post(this.$API_SERVICE_URL + "/mountpoint/getAllPoint", {
          headers: {
            "Content-Type": "application/json;charset=utf-8" //头部信息
          }
        })
        .then(response => {
          debugger;
          let flaga = response.data.res_flag;
          if (flaga == "1") {
            this.optionsPoint = response.data.pointList;
          } else {
            this.$message({
              type: "warning",
              message: "初始化安装点信息异常"
            });
          }
        })
        .catch(error => {
          console.log(error);
        });
    },
    /**
     * 违法信息表查询
     */
    searchKakouList() {
      this.loading_status = true;
      this.tableData = [];
      let requestParam = JSON.stringify({
        pageNumber: this.pageNumber,
        pageSize: this.pageSize,
        //------
        hpzl: this.valueHpzl,
        pointcode: this.valuePoint,
        carxscd: this.valueXscd,
        starttime: this.value2!=""?this.GCOMMON.formatDate(this.value2,'yyyy-MM-dd hh:mm:ss'):"",
        endtime: this.value3!=""?this.GCOMMON.formatDate(this.value3,'yyyy-MM-dd hh:mm:ss'):"",
        hphm: this.whphm,
        direction:this.valueXsfx

      });
      this.axios
        .post(this.$API_SERVICE_URL + "/kakoumgr/getKkList", requestParam, {
          headers: {
            "Content-Type": "application/json;charset=utf-8" //头部信息
          }
        })
        .then(response => {
          debugger;
          let flaga = response.data.res_flag;
          if (flaga == "1") {
            this.tableData = response.data.passList;
            this.pageTotal = response.data.pageTotal;
          } else {
            //this.publicShowMessage("warning", "分配异常");
          }
        })
        .catch(error => {
          console.log(error);
        });
        this.loading_status = false;
    }
  },

  mounted() {

    const loading = this.$loading({
          lock: true,
          text: 'Loading',
          spinner: 'el-icon-loading',
          background: 'rgba(0, 0, 0, 0.7)'
        });

    this.value2 = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0, 0, 0);
    this.value3= new Date();

    this.initGetMountPoint();
    this.$nextTick(function() {
      this.tableHeight =
        window.innerHeight - this.$refs.passTable.$el.offsetTop - 45;

      // 监听窗口大小变化
      let self = this;
      window.onresize = function() {
        self.tableHeight =
          window.innerHeight - self.$refs.passTable.$el.offsetTop - 45;
      };
    });
    this.initEnumType();
    //---关闭loading
    this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
      loading.close();
    });
  }
};
</script>
<style lang="stylus" scoped>
.commone_w {
  /* 设置时间框同其他框一样的宽度 */
  width: 200px;
}

.pass_content_right {
  float: left;
  width: 690px;
  height: 500px;
  margin-left: 5px;
}

.pass_content_left {
  float: left;
  width: -webkit-calc(100% - 700px);
  height: 100%;
}

.right_img {
  float: left;
  width: 57%;
  height: 54%;
  border: 1px solid #2C485A;
  margin-left: 1px;
}

.audit_plate_1 {
  background-color: #DED8D8;
  font-size: 18px;
}

.pass_car_mc {
  border: 1px solid blue;
  margin-left: 5px;
}

.aduit-title {
  float: left;
  width: 40%;
  margin-bottom: 5px;
  border-bottom: 1px solid rgba(184, 178, 178, 0.2);
  font-size: 18px;
  letter-spacing: 1px;
  font-family: 'Helvetica';
  color: #c7c7c7;

  .title {
    padding: 0px 4px 0px 0;
    border-bottom: 3px solid #009688;
  }

  .paa_fy {
    float: left;
  }
}
</style>