xcycle.vue 27 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 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840
<template>
  <div class="innnerBox">
    <el-col :span="22">
      <el-form ref="form" label-width="80px" inline>
        <el-form-item label="任务名称">
          <span class="selectBox">
            <el-select
              filterable
              placeholder="请选择"
              :popper-append-to-body="false"
              v-model="conditions.task_id"
              @change="getSubTask"
            >
              <el-option
                v-for="item in taskList"
                :value="item.task_id"
                :key="item.task_id"
                :label="item.task_name"
              ></el-option>
            </el-select>
          </span>
        </el-form-item>
        <el-form-item label="视频名称">
          <span class="selectBox">
            <el-select
              filterable
              placeholder="请选择"
              :popper-append-to-body="false"
              v-model="conditions.subtask_id"
            >
              <el-option
                v-for="item in subTaskList"
                :value="item.subtask_id"
                :key="item.subtask_id"
                :label="item.subtask_name"
              ></el-option>
            </el-select>
          </span>
        </el-form-item>
        <!-- <el-form-item label="抓拍地点" >
						   <span class="inputBox">
							 <el-input placeholder="请输入抓拍地点" v-model="conditions.location_name"></el-input>
						   </span>
					  </el-form-item> -->
        <el-form-item label="检索对象">
          <span class="selectBox">
            <el-select
              filterable
              placeholder="请选择"
              :popper-append-to-body="false"
              v-model="conditions.event_type"
              @change="typeChange"
            >
              <el-option value="xcycle" label="非机动车"></el-option>
              <el-option value="pedestrian" label="行人"></el-option>
            </el-select>
          </span>
        </el-form-item>
        <el-form-item label="对象类型">
          <span class="selectBox">
            <el-select
              filterable
              placeholder="请选择"
              :popper-append-to-body="false"
              v-model="conditions.xcycle_type"
            >
              <el-option value="" label="全部"></el-option>
              <el-option
                value="motorcycle"
                label="摩托车"
                v-show="conditions.event_type == 'xcycle'"
              ></el-option>
              <el-option
                value="bicycle"
                label="自行车"
                v-show="conditions.event_type == 'xcycle'"
              ></el-option>
              <el-option
                value="tricycle"
                label="三轮车"
                v-show="conditions.event_type == 'xcycle'"
              ></el-option>
              <el-option
                value="aaa"
                label="行人"
                v-show="conditions.event_type == 'pedestrian'"
              ></el-option>
            </el-select>
          </span>
        </el-form-item>
        <el-form-item label="性别">
          <span class="selectBox">
            <el-select
              filterable
              placeholder="请选择"
              :popper-append-to-body="false"
              v-model="conditions.sex"
            >
              <el-option value="" label="全部"></el-option>
              <el-option value="1" label="男"></el-option>
              <el-option value="2" label="女"></el-option>
            </el-select>
          </span>
        </el-form-item>
        <el-form-item
          label="运营公司"
          v-show="conditions.event_type == 'xcycle'"
        >
          <span class="inputBox">
            <el-input
              placeholder="请输入公司名称"
              v-model="conditions.company"
            ></el-input>
          </span>
        </el-form-item>
        <el-form-item
          label="车牌号码"
          v-show="conditions.event_type == 'xcycle'"
        >
          <span class="inputBox">
            <el-input
              placeholder="请输入车牌号码"
              v-model="conditions.plate"
            ></el-input>
          </span>
        </el-form-item>
        <el-form-item
          label="是否带盔"
          v-show="conditions.event_type == 'xcycle'"
        >
          <span class="selectBox">
            <el-select
              filterable
              placeholder="请选择"
              :popper-append-to-body="false"
              v-model="conditions.with_hats"
            >
              <el-option value="" label="全部"></el-option>
              <el-option :value="0" :key="0" label="不确定"></el-option>
              <el-option :value="1" :key="1" label="带盔"></el-option>
              <el-option :value="2" :key="2" label="未带盔"></el-option>
            </el-select>
          </span>
        </el-form-item>
        <el-form-item
          label="是否带帽"
          v-show="conditions.event_type == 'pedestrian'"
        >
          <span class="selectBox">
            <el-select
              filterable
              placeholder="请选择"
              :popper-append-to-body="false"
              v-model="conditions.with_hats"
            >
              <el-option value="" label="全部"></el-option>
              <el-option :value="0" :key="0" label="不确定"></el-option>
              <el-option :value="1" :key="1" label="带帽"></el-option>
              <el-option :value="2" :key="2" label="不带帽"></el-option>
            </el-select>
          </span>
        </el-form-item>
        <el-form-item
          label="带口罩"
          v-show="conditions.event_type == 'pedestrian'"
        >
          <span class="selectBox">
            <el-select
              filterable
              placeholder="请选择"
              :popper-append-to-body="false"
              v-model="conditions.with_hats"
            >
              <el-option value="" label="全部"></el-option>
              <el-option :value="0" :key="0" label="不确定"></el-option>
              <el-option :value="1" :key="1" label="带口罩"></el-option>
              <el-option :value="2" :key="2" label="不带口罩"></el-option>
            </el-select>
          </span>
        </el-form-item>
        <el-form-item
          label="上身颜色"
          v-show="conditions.event_type == 'pedestrian'"
        >
          <span class="selectBox">
            <el-select
              filterable
              placeholder="请选择"
              :popper-append-to-body="false"
              v-model="conditions.upbodyColor"
            >
              <el-option value="" label="全部"></el-option>
              <el-option
                v-for="item in bodyColorList"
                :value="item.value"
                :key="item.value"
                :label="item.label"
              ></el-option>
            </el-select>
          </span>
        </el-form-item>
        <el-form-item
          label="下身颜色"
          v-show="conditions.event_type == 'pedestrian'"
        >
          <span class="selectBox">
            <el-select
              filterable
              placeholder="请选择"
              :popper-append-to-body="false"
              v-model="conditions.lobodyColor"
            >
              <el-option value="" label="全部"></el-option>
              <el-option
                v-for="item in bodyColorList"
                :value="item.value"
                :key="item.value"
                :label="item.label"
              ></el-option>
            </el-select>
          </span>
        </el-form-item>

        <el-form-item label="起始时间">
          <span class="dateBox">
            <el-date-picker
              v-model="dates"
              value-format="yyyy-MM-dd HH:mm:ss"
              :default-time="['00:00:00', '23:59:59']"
              type="datetimerange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            >
            </el-date-picker>
          </span>
        </el-form-item>
      </el-form>
    </el-col>
    <el-col :span="2">
      <div style="margin-bottom: 6px;padding-top: 3px;">
        <el-button type="primary" style="" @click="query" class="block"
          >查询</el-button
        >
        <el-button type="success" class="block compatibleBtn" @click="exportFun"
          >导出</el-button
        >
      </div>
      <div>
        <el-button type="success" class="block" @click="batchdel"
          >批量删除</el-button
        >
      </div>
    </el-col>
    <div style="">
      <div class="desplay-icon">
        <i class="el-icon-s-grid" @click="dataDisplay('list')"></i>
        <i class="el-icon-tickets" @click="dataDisplay('table')"></i>
      </div>
      <div v-if="displaystatus == 'table'">
      <el-table
        :data="formatterData"
        v-loading="loading"
        :height="tableHeight"
        stripe
        border
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" align="center" width="55">
        </el-table-column>
        <el-table-column
          prop="index"
          align="center"
          label="#"
          type="index"
          width="50"
        >
        </el-table-column>
        <el-table-column
          prop="xcycle_type_text"
          align="center"
          label="检测类型"
        >
        </el-table-column>
        <el-table-column prop="driver_face_sex" align="center" label="性别">
        </el-table-column>
        <el-table-column
          v-if="conditions.event_type == 'xcycle'"
          prop="driver_face_with_hats"
          align="center"
          label="是否带盔"
        >
        </el-table-column>
        <el-table-column
          v-if="conditions.event_type == 'pedestrian'"
          prop="driver_face_with_hats"
          align="center"
          label="是否带帽"
        >
        </el-table-column>
        <el-table-column
          v-if="conditions.event_type == 'pedestrian'"
          prop="driver_face_upbody_text"
          align="center"
          label="上身颜色"
        >
        </el-table-column>
        <el-table-column
          v-if="conditions.event_type == 'pedestrian'"
          prop="driver_face_lobody_text"
          align="center"
          label="下身颜色"
        >
        </el-table-column>
        <el-table-column
          v-if="conditions.event_type == 'xcycle'"
          prop="xcycle_plate_text"
          align="center"
          label="车牌号码"
        >
        </el-table-column>
        <el-table-column
          v-if="conditions.event_type == 'xcycle'"
          prop="company"
          align="center"
          label="运营公司"
        >
        </el-table-column>
        <el-table-column prop="shoot_date" align="center" label="抓拍时间">
          <template slot-scope="scope">
            <span>{{ scope.row.shoot_date }} {{ scope.row.shoot_time }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="location_name" align="center" label="抓拍地点">
        </el-table-column>
        <el-table-column align="center" label="操作">
          <template slot-scope="scope">
            <el-tooltip
              content="详情"
              placement="bottom"
              effect="light"
              :visible-arrow="false"
            >
              <span
                class="el-icon-info editIcon"
                @click="detailFun(scope.$index, scope.row)"
              ></span>
            </el-tooltip>
            <span class="tableSpanBorder"></span>
            <el-tooltip
              content="删除"
              placement="bottom"
              effect="light"
              :visible-arrow="false"
            >
              <span
                class="el-icon-delete  delIcon"
                @click="delFun(scope.$index, scope.row)"
              ></span>
            </el-tooltip>
          </template>
        </el-table-column>
      </el-table>
       </div>
       <div v-if="displaystatus == 'list'">
        <div class="listbox" :style="{'height':tableHeight}">
          <div v-for="(item, index) in formatterData" :key="index" class="listboxitem"  @click="detailFun(index,item)">
            <div class="imgbox">
                <img :src="item.pics[0].src_url" alt="">
            </div>
            <div class="displayinfo">
              <el-form>
               <el-form-item label="检测类型:">
                <span>{{ item.xcycle_type_text }}</span>
                </el-form-item>
                <el-form-item label="性别:">
                  <span>{{ item.driver_face_sex }}</span>
                </el-form-item>
                <el-form-item label="是否带头盔:"   v-if="item.event_type == 'xcycle'">
                  <span>{{ item.driver_face_with_hats }}</span>
                </el-form-item>
                <el-form-item label="是否带头盔:"   v-if="item.event_type == 'pedestrian'">
                  <span>{{ item.driver_face_with_hats }}</span>
                </el-form-item>
                <el-form-item label="运营公司:">
                  <span>{{ item.company }}</span>
                </el-form-item>
                <el-form-item label="经过日期:">
                  <span>{{
                    item.shoot_date ? item.shoot_date : ""
                  }} {{
                    item.shoot_time ? item.shoot_time : ""
                  }}</span>
                </el-form-item>
                <el-form-item label="经过地点:">
                  <span>{{ item.location_name }}</span>
                </el-form-item>
            </el-form>
            </div>
          </div>
        </div>
      </div>
      <div style="margin-top: 28px;">
        <el-pagination
          style="float: right;"
          background
          prev-text="上一页"
          next-text="下一页"
          :page-sizes="[30, 50, 100, 200]"
          layout="total, prev, pager, next,sizes, jumper"
          :current-page="page"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :total="total"
        >
        </el-pagination>
        <div style="clear: both;"></div>
      </div>
    </div>
    <el-dialog
      title="详情"
      top="12vh"
      :visible.sync="detailVisible"
      class="detailDialog"
      width="1000px"
    >
      <div style="position: relative;padding: 10px 20px;">
        <!-- <div class="leftArrow" @click="leftFun"><i class="el-icon-d-arrow-left"></i></div> -->
        <div class="detaiCon">
          <el-image style="width: 100%;" :src="this.detailImg">
            <div slot="error" class="image-slot">
              <img
                :src="carImg"
                alt=""
                style="width: 36%;display: block;margin: 0 auto;"
              />
            </div>
          </el-image>
          <el-form label-width="80px" inline>
            <el-form-item label="检测类型:">
              <span>{{ detailObj.xcycle_type_text }}</span>
            </el-form-item>
            <el-form-item label="经过地点:">
              <span>{{ detailObj.location_name }}</span>
            </el-form-item>
            <el-form-item label="经过日期:">
              <span>{{
                detailObj.shoot_date ? detailObj.shoot_date : ""
              }}</span>
            </el-form-item>
            <el-form-item label="经过时间:">
              <span>{{
                detailObj.shoot_time ? detailObj.shoot_time : ""
              }}</span>
            </el-form-item>

            <el-form-item label="身高:">
              <span>{{ detailObj.driver_height }}</span>
            </el-form-item>
            <el-form-item label="速度:">
              <span>{{ detailObj.location_speed }}</span>
            </el-form-item>
            <el-form-item label="性别:">
              <span>{{ detailObj.driver_face_sex }}</span>
            </el-form-item>
            <el-form-item label="运营公司:">
              <span>{{ detailObj.company }}</span>
            </el-form-item>
            <el-form-item label="上身颜色:">
              <span>{{ detailObj.driver_face_upbody_text }}</span>
            </el-form-item>
            <el-form-item label="下身颜色:">
              <span>{{ detailObj.driver_face_lobody_text }}</span>
            </el-form-item>
            <el-form-item label="戴帽子:">
              <span>{{ detailObj.driver_face_with_hats }}</span>
            </el-form-item>
            <el-form-item label="违法类型:">
              <span>{{ detailObj.illegalType }}</span>
            </el-form-item>
          </el-form>
        </div>
        <!-- <div class="rightArrow"  @click="rightFun"><i class="el-icon-d-arrow-right"></i></div> -->
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="danger" @click="detailDel" class="leftButton"
          >删 除</el-button
        >
        <el-button type="primary" @click="leftFun">上一条</el-button>
        <el-button type="primary" @click="rightFun">下一条</el-button>
        <el-button @click="detailVisible = false">关 闭</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    let start_dt = this.yesterDay();
    let end_dt = this.nowDay();
    return {
      detailObj: {},
      carImg: require("@/assets/img/home/defaultImg.png"),
      bodyColorList: this.$buildCode.getCodeList("车身颜色"),
      detailImg: "",
      detailVisible: false,
      loading: false,
      dates: [start_dt, end_dt],
      conditions: {
        start_dt: start_dt,
        end_dt: end_dt,
        event_type: "xcycle",
        subtask_id: "",
        task_id: "",
        xcycle_type: "",
        sex: "",
        company: "",
        with_hats: "",
        plate: "",
        upbodyColor: "",
        lobodyColor: ""
      },
      brandList: this.$buildCode.getCodeList("车辆品牌"),
      vehicleTypeList: this.$buildCode.getCodeList("车辆类型"),
      vehicleColorList: this.$buildCode.getCodeList("车身颜色"),
      tableData: [],
      formatterData: [],
      total: 0,
      page: 1,
      pageSize: 30,
      selectcheck: [],
      currentIndex: 0,
      taskList: [],
      displaystatus:'table',
      subTaskList: [],
      tableHeight: window.twoSearchTableHeight
    };
  },
  watch: {
    dates(val) {
      this.conditions.start_dt = val[0];
      this.conditions.end_dt = val[1];
    }
  },
  components: {},
  mounted() {
    this.getTaskList();
    this.getData();
  },
  methods: {
    indexFormatter(row, column, cellValue, index) {
      return index + (this.page - 1) * this.pageSize + 1;
    },
    dataDisplay(data){
      this.displaystatus = data
    },
    getTaskList() {
      this.$api.task
        .getTask({
          source_type: "pull_video_stream",
          task_type: "normal"
        })
        .then(res => {
          this.taskList = res.list_data;
          this.taskList.unshift({
            task_id: "",
            task_name: "全部"
          });
        });
    },
    getSubTask() {
      this.$api.task.getSubTask(this.conditions.task_id).then(res => {
        if (res.list_data == null) {
          this.subTaskList = [];
        } else {
          this.subTaskList = res.list_data;
        }
        this.subTaskList.unshift({
          subtask_id: "",
          subtask_name: "全部"
        });
        this.conditions.subtask_id = "";
      });
    },
    typeChange() {
      this.conditions.xcycle_type = "";
    },
    exportFun() {
      let url = "";
      if (this.conditions.event_type == "xcycle") {
        url =
          process.env.VUE_APP_URL +
          "/api/v1/traffic/events/export?s=" +
          Math.random() +
          "&event_type=" +
          this.conditions.event_type +
          "&event_dt__gte=" +
          this.$moment(this.conditions.start_dt)
            .utc()
            .format("YYYY-MM-DD HH:mm:ss") +
          "&event_dt__lt=" +
          this.$moment(this.conditions.end_dt)
            .utc()
            .format("YYYY-MM-DD HH:mm:ss") +
          "&xcycle_type=" +
          this.conditions.xcycle_type +
          "&sex=" +
          this.conditions.sex +
          "&task_id=" +
          this.conditions.task_id +
          "&subtask_id=" +
          this.conditions.subtask_id +
          "&company_like=" +
          this.conditions.company +
          "&with_hats=" +
          this.conditions.with_hats +
          "&plate_number__like=" +
          this.conditions.plate;
      } else {
        url =
          process.env.VUE_APP_URL +
          "/api/v1/traffic/events/export?s=" +
          Math.random() +
          "&event_type=" +
          this.conditions.event_type +
          "&event_dt__gte=" +
          this.$moment(this.conditions.start_dt)
            .utc()
            .format("YYYY-MM-DD HH:mm:ss") +
          "&event_dt__lt=" +
          this.$moment(this.conditions.end_dt)
            .utc()
            .format("YYYY-MM-DD HH:mm:ss") +
          "&sex=" +
          this.conditions.sex +
          "&task_id=" +
          this.conditions.task_id +
          "&subtask_id=" +
          this.conditions.subtask_id +
          "&with_hats=" +
          this.conditions.with_hats +
          "&upbodyColor=" +
          this.conditions.upbodyColor +
          "&lobodyColor=" +
          this.conditions.lobodyColor;
      }
      this.$logs.oplogs({},'serv_serarch',`行人非机动车导出`);
      window.open(encodeURI(url));
    },
    batchdel() {
      if (this.selectcheck.length == 0) {
        this.$message({
          message: "请选择至少一条记录",
          type: "warning"
        });
        return false;
      }

      this.$confirm("此操作将永久删除选中记录, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        this.$api.search
          .patchdel({
            event_unids: this.selectcheck
          })
          .then(res => {
            if (res.ecode == "200") {
              this.$message({
                type: "success",
                message: "删除成功!"
              });
              this.$logs.oplogs(res,'serv_serarch',`行人非机动车批量删除了${this.selectcheck.length}条`);
              this.getData();
            } else {
              this.$message.error("删除失败!");
            }
          });
      });
    },
    leftFun() {
      if (this.currentIndex - 1 < 0) {
        this.$message({
          message: "目前为第一条",
          type: "warning"
        });
        return false;
      }
      this.detailObj = this.formatterData[this.currentIndex - 1];
      this.currentIndex -= 1;
      this.getImg(this.detailObj.pics[0].pic_unid);
    },
    rightFun() {
      if (this.currentIndex == this.formatterData.length - 1) {
        this.$message({
          message: "目前为最后一条",
          type: "warning"
        });
        return false;
      }
      this.detailObj = this.formatterData[this.currentIndex + 1];
      this.currentIndex += 1;
      this.getImg(this.detailObj.pics[0].pic_unid);
    },
    handleSelectionChange(obj) {
      this.selectcheck = [];
      obj.forEach(item => {
        this.selectcheck.push(item.id);
      });
    },
    handleSizeChange(val) {
      this.pageSize = val;
      this.getData();
    },
    handleCurrentChange(val) {
      this.page = val;
      this.getData();
    },
    query() {
      this.page = 1;
      this.getData();
    },
    getData() {
      this.loading = true;
      this.formatterData = [];
      let offset = (this.page - 1) * this.pageSize;
      let search_params = {
        limit: this.pageSize,
        offset: offset,
        event_dt__gte: this.$moment(this.conditions.start_dt)
          .utc()
          .format("YYYY-MM-DD HH:mm:ss"),
        event_dt__lt: this.$moment(this.conditions.end_dt)
          .utc()
          .format("YYYY-MM-DD HH:mm:ss"),
        task_id: this.conditions.task_id,
        subtask_id: this.conditions.subtask_id,
        event_type: this.conditions.event_type,
        sex: this.conditions.sex,
        with_hats: this.conditions.with_hats
      };
      if (this.conditions.event_type == "xcycle") {
        search_params.xcycle_type = this.conditions.xcycle_type;
        search_params.company_like = this.conditions.company;
        search_params.plate_number__like = this.conditions.plate;
      } else {
        search_params.upbodyColor = this.conditions.upbodyColor;
        search_params.lobodyColor = this.conditions.lobodyColor;
      }
      this.$api.search
        .tableList(search_params)
        .then(res => {
          this.total = res.total_num;
          res.list_data.forEach((item, index) => {
            this.formatterData.push(this.$buildCode.init(item));
          });
          this.loading = false;
          this.$logs.oplogs(res,'serv_serarch',`行人非机动车查询`);
        })
        .catch(err => {});
    },
    getImg(unid) {
      this.$api.search
        .detailImg({}, unid)
        .then(res => {
          this.detailImg = res.pic_url ? res.pic_url : carImg;
        })
        .catch(e => {});
    },
    detailFun(index, row) {
      this.currentIndex = index;
      if (row.pics.length > 0) {
        this.detailObj = Object.assign({}, row);
        this.getImg(row.pics[0].pic_unid);
      }
      this.detailVisible = true;
    },
    delFun(index, row) {
      this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        this.$api.search
          .delVehicle({}, row.id)
          .then(res => {
            if (res.ecode == 200) {
              this.formatterData.splice(index);
              this.$message({
                type: "success",
                message: "删除成功!"
              });
              this.getData();
              this.$logs.oplogs(res,'serv_serarch',`行人非机动车删除`);
            } else {
              this.$message.error("删除失败!");
            }
          })
          .catch(e => {
            this.$message.error("删除失败!");
          });
      });
    },
    detailDel() {
      this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        this.$api.search
          .delVehicle({}, this.detailObj.id)
          .then(res => {
            if (res.ecode == 200) {
              this.formatterData.splice(this.currentIndex, 1);
              this.detailObj = Object.assign(
                {},
                this.formatterData[this.currentIndex]
              );
              this.getImg(
                this.formatterData[this.currentIndex].pics[0].pic_unid
              );
              this.$message({
                type: "success",
                message: "删除成功!"
              });
              this.$logs.oplogs(res,'serv_serarch',`行人非机动车删除`);
            } else {
              this.$message.error("删除失败!");
            }
          })
          .catch(e => {
            this.$message.error("删除失败!");
          });
      });
    }
  }
};
</script>
<style lang="scss" scoped></style>