<template>
  <div class="advance">
    <div class="advance__head flex">
      <div class="flex-wrap interfaceLog_head_time">
        <div class="manageTitle">高级查询</div>
        <div class="interfaceLog_head_time_start mr10">
          <el-date-picker
            v-model="timeStart"
            size="small"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择开始日期时间"
          />
        </div>
        <div class="interfaceLog_head_time_end">
          <el-date-picker
            v-model="timeEnd"
            size="small"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择结束日期时间"
          />
        </div>
      </div>
      <Search
        ref="search"
        :isTitle="false"
        :isSlot="true"
        @getSearchData="getSearchData"
        @clearSearchData="clearSearchData"
      >
        <div class="flex-wrap">
          <button
            class="btnAn"
            @click="gjFlag = true"
          >高级查询</button>
          <!-- <div
            class="setting"
            @click="show"
          /> -->
        </div>
      </Search>
    </div>
    <!--表格-->
    <div
      v-loading="loading"
      element-loading-text="拼命加载中"
      element-loading-spinner="el-icon-loading"
      element-loading-background="rgba(0, 0, 0, 0.8)"
      class="advance__table"
    >
      <!-- <el-table ref="table" max-height="100%" show-summary class="table" :data="tableData" border stripe height="calc(100vh - 155px)" style="width: 100%">
        <el-table-column v-for="(item, index) in tableColsCopy" :prop="item.statCode" :label="item.statName" :key="index">
        </el-table-column>
      </el-table> -->
      <el-table
        ref="table"
        max-height="100%"
        class="table"
        :data="tableData"
        border
        stripe
        height="calc(100vh - 155px)"
        style="width: 100%"
        show-summary
        :cell-class-name="cellClass"
        @cell-click="cellClick"
        :summary-method="summaryRow(tableData.length)"
        :span-method="arraySpanMethod"
      >
        <!-- <el-table-column
          prop="index"
          label="序号"
          :width="50"
        /> -->
        <el-table-column
          prop="FlightNO"
          label="航班号"
          :filters="FlightNOItem"
          :filter-method="filterHandler"
        >
          <!-- <template slot-scope="scope">
            <el-button
              size="mini"
              @click="flightClickHandler(scope.row)"
            >{{ scope.row.FlightNO }}</el-button>
          </template> -->
        </el-table-column>
        <el-table-column
          prop="FlightDate"
          label="航班日期"
          :filters="FlightDateItem"
          :filter-method="filterHandler"
        />
        <el-table-column
          prop="DepartureTime"
          label="起飞时间"
        />
        <el-table-column
          prop="SourceAirport"
          label="起飞站"
          :filters="SourceAirportItem"
          :filter-method="filterHandler"
        />
        <el-table-column
          prop="TargetAirport"
          label="目的地"
          :filters="TargetAirportItem"
          :filter-method="filterHandler"
        />
        <el-table-column
          prop="PassengerNameUpcase"
          label="旅客姓名"
          :filters="PassengerNameUpcaseItem"
          :filter-method="filterHandler"
        />
        <el-table-column
          prop="BagSN"
          label="行李牌号"
          sortable
          width="130"
        >
          <!-- <template slot-scope="scope">
            <el-button
              size="mini"
              @click="baggageClickHandler(scope.row)"
            >{{ scope.row.BagSN }}</el-button>
          </template> -->
        </el-table-column>
        <el-table-column
          prop="SpecialType"
          label="特殊行李类型"
          :filters="SpecialTypeItem"
          :filter-method="filterHandler"
        />

        <el-table-column
          label="删除"
          prop="deleted"
          :filters="deletedItem"
          :filter-method="filterHandler"
        >
          <!-- <template slot-scope="scope">
            <div>{{ scope.row.deleted == "DEL" ? 1 : 0 }}</div>
          </template> -->
        </el-table-column>
        <el-table-column
          label="激活"
          prop="activated"
          :filters="activatedItem"
          :filter-method="filterHandler"
        >
        </el-table-column>
        <el-table-column
          prop="BagWeight"
          label="重量"
        />
        <el-table-column
          prop="latestStatus"
          label="最新状态"
          :filters="latestStatusItem"
          :filter-method="filterHandler"
        />
        <el-table-column
          prop="bagLocation"
          label="最新位置"
          :filters="bagLocationItem"
          :filter-method="filterHandler"
        />
        <el-table-column
          prop="U_Device_ID"
          label="容器编号"
          :filters="U_Device_IDItem"
          :filter-method="filterHandler"
        />
        <el-table-column
          prop="PreFlightNONotNull"
          label="中转进航班"
          :filters="PreFlightNONotNullItem"
          :filter-method="filterHandler"
        />
        <el-table-column
          prop="PreFlightNONull"
          label="中转出航班"
          :filters="PreFlightNONullItem"
          :filter-method="filterHandler"
        />
      </el-table>
    </div>
    <!--列设置-->
    <Dialog :flag="rowFlag">
      <div class="rowDialog">
        <div class="title">列设置</div>
        <div class="content">
          <el-checkbox-group v-model="checkList">
            <el-row :gutter="20">
              <el-col
                v-for="(item, index) in tableCols"
                :key="index"
                class="ck"
                :span="6"
              >
                <el-checkbox :label="item">{{ item.statName }}</el-checkbox>
              </el-col>
            </el-row>
          </el-checkbox-group>
        </div>
        <div class="foot right t30">
          <el-button
            size="medium"
            class="r24"
            type="primary"
            @click="onCheck"
          >确定</el-button>
          <el-button
            size="medium"
            @click="close"
          >取消</el-button>
        </div>
      </div>
    </Dialog>
    <!--高级查询-->
    <Dialog
      width="852px"
      :flag="gjFlag"
    >
      <div class="rowDialog">
        <div class="title">高级查询</div>
        <div class="content">
          <el-form
            ref="form"
            :model="form"
            :rules="rules"
            label-width="100px"
          >
            <el-row :gutter="20">
              <el-col :span="16">
                <el-form-item
                  label="航班日期"
                  prop="time"
                >
                  <el-date-picker
                    v-model="form.time"
                    size="small"
                    type="daterange"
                    value-format="yyyy-MM-dd"
                    start-placeholder="开始日期"
                    end-placeholder="结束日期"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="当前状态">
                  <el-input
                    v-model="form.status"
                    size="small"
                  />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item
                  label="航班号"
                  prop="flightNumber"
                >
                  <el-input
                    v-model="form.flightNumber"
                    size="small"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="起飞站">
                  <el-input
                    v-model="form.station"
                    size="small"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="目的地">
                  <el-input
                    v-model="form.destination"
                    size="small"
                  />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="行李牌号">
                  <el-input
                    v-model="form.grade"
                    size="small"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="特殊行李类型">
                  <el-input
                    v-model="form.type"
                    size="small"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="容器编号">
                  <el-input
                    v-model="form.U_Device_ID"
                    size="small"
                  />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="旅客姓名">
                  <el-input
                    v-model="form.name"
                    size="small"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="PNR">
                  <el-input
                    v-model="form.pnr"
                    size="small"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="值机序号">
                  <el-input
                    v-model="form.check"
                    size="small"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="中转进航班">
                  <el-input
                    v-model="form.transferArrival"
                    size="small"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="中转出航班">
                  <el-input
                    v-model="form.transferDeparture"
                    size="small"
                  />
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <div class="foot right t30">
          <el-button
            size="medium"
            class="r24"
            type="primary"
            @click="onCheckGj"
          >确定</el-button>
          <el-button
            size="medium"
            @click="closeCheckGj"
          >取消</el-button>
        </div>
      </div>
    </Dialog>
  </div>
</template>

<script>
import Search from '@/layout/components/Search'
import Dialog from '@/layout/components/Dialog'
import { advancedInquiry, getQuery } from '@/api/flight'
import { parseTime } from '@/utils/index'
export default {
  name: 'Advance',
  components: { Search, Dialog },
  data() {
    return {
      loading: false,
      rowFlag: false,
      gjFlag: false,
      tableData: [
        // {
        //   FlightNO: '',
        //   FlightDate: '',
        //   SourceAirport: '',
        //   TargetAirport: '',
        //   PassengerNameUpcase: '',
        //   BagSN: '',
        //   SpecialType: '',
        //   checkIn: '',
        //   deleted: '',
        //   activated: '',
        //   BagWeight: '',
        //   latestStatus: '',
        //   bagLocation: '',
        //   TransferFlightNO: ''
        // }
      ],
      tableColsCopy: [],
      checkList: [],
      tableCols: [],
      timeStart: parseTime(new Date(), '{y}-{m}-{d}'),
      timeEnd: parseTime(new Date(), '{y}-{m}-{d}'),
      form: {
        time: '',
        status: '',
        flightNumber: '',
        destination: '',
        station: '',
        grade: '',
        type: '',
        U_Device_ID: '',
        name: '',
        pnr: '',
        check: '',
        transferArrival:'',
        transferDeparture:''
      },
      dataContent: [],
      rules: {
        // 机器信息表单验证
        // flightNumber: [
        //   { required: true, message: "请输入有效航班号", trigger: "blur" },
        // ],
      },
      PassengerNameUpcaseItem: [],
      FlightNOItem: [],
      FlightDateItem: [],
      SourceAirportItem: [],
      TargetAirportItem: [],
      SpecialTypeItem: [],
      checkInItem: [],
      deletedItem: [],
      activatedItem: [],
      latestStatusItem: [],
      bagLocationItem: [],
      PreFlightNONotNullItem: [],
      PreFlightNONullItem: [],
      PreFlightNONullItem:[],
      U_Device_IDItem:[],
      spanArr:[],
      contactDot: 0,
    }
  },
  created() {
    // 参数顺序   【航班开始日期，航班结束日期，航班号，航班号，行李牌号，行李牌号，起飞站，起飞站，目的站，目的站，特殊行李类型，特殊 行李类型，旅客姓名大写拼音，旅客姓名大写拼音，pnr,pnr,值机号，值机号】
    // const dataContent = [this.timeStart, this.timeEnd]
    // for (let i = 0; i < 18; i++) {
    //   dataContent.push(null)
    // }
    // this.statItemsQueryByStatMain(dataContent);
  },
  mounted() {
    document.querySelector('.interfaceLog_head_time_start .el-input__prefix i').remove()
    document.querySelector('.interfaceLog_head_time_start .el-input__prefix').innerHTML = '开始：'
    document.querySelector('.interfaceLog_head_time_end .el-input__prefix i').remove()
    document.querySelector('.interfaceLog_head_time_end .el-input__prefix').innerHTML = '结束：'
    const { FlightNO, FlightDate,name,grade,startDate,endDate,station,destination ,UDeviceID,transferArrival,transferDeparture} = this.$route.query
    if (FlightNO && FlightDate) {
      this.$router.replace(this.$route.path)
      const parsedTime = parseTime(new Date(FlightDate), '{y}-{m}-{d}')
      this.timeStart = this.timeEnd = parsedTime
      this.$refs['search'].setSearch(FlightNO)
    }
    if(startDate&&endDate){
      this.timeStart = startDate;
      this.timeEnd = endDate;
      this.form['time'] = [startDate,endDate];
    }

    if(name&&station){
      this.form['name'] = name;
      this.form['station'] = station
      this.onCheckGj()
    }

    if(grade&&station){
      this.form['grade'] = grade;
      this.form['station'] = station
      this.onCheckGj()
    }

    if(FlightNO&&station){
      this.form['flightNumber'] = FlightNO;
      this.form['station'] = station
      this.onCheckGj()
    }

    if(name&&destination){
      this.form['name'] = name;
      this.form['destination'] = destination
      this.onCheckGj()
    }

    if(grade&&destination){
      this.form['grade'] = grade;
      this.form['destination'] = destination
      this.onCheckGj()
    }

    if(FlightNO&&destination){
      this.form['flightNumber'] = FlightNO;
      this.form['destination'] = destination
      this.onCheckGj()
    }
    if(UDeviceID&&FlightNO){
      this.form['flightNumber'] = FlightNO;
      this.form['U_Device_ID'] = UDeviceID
      this.onCheckGj()
    }
    if(transferArrival&&FlightNO){
      this.form['flightNumber'] = FlightNO;
      this.form['transferArrival'] = transferArrival
      this.onCheckGj()
    }
    if(transferDeparture&&FlightNO){
      this.form['flightNumber'] = FlightNO;
      this.form['transferDeparture'] = transferDeparture
      this.onCheckGj()
    }
  },
  updated() {
    // table数据更新
    this.$nextTick(() => {
      this.$refs.table.doLayout()
    })
  },
  methods: {
    arraySpanMethod({ row, column, rowIndex, columnIndex }) {
      for (let i = 0; i < 5; i++) {
        if (columnIndex === i) {
          const _row = this.spanArr[rowIndex];
          const _col = _row > 0 ? 1 : 0;
          return {
            rowspan: _row,
            colspan: _col,
          };
        }
      }
    },
    cellClass(row, column, rowIndex, columnIndex){
      if (row.column.property == "FlightNO"||row.column.property == "TransferFlightNO"||row.column.property == "BagSN") {
        return "clickCell"
      }
    },
    cellClick(row, column, cell, event) {
      if (column.property == "FlightNO") {
        this.$router.push({ path: "/advance/flightView", query: row });
      }
      if (column.property == "TransferFlightNO") {
        let row2 = this._.cloneDeep(row);
        row2.FlightNO = row2.TransferFlightNO
        this.$router.push({ path: "/advance/flightView", query: row2 });
      }
      if (column.property == "BagSN") {
        this.$router.push({ path: '/advance/baggageView', query: row })
      }
    },
    // 查询
    getSearchData(val) {
      this.form = {
        time: '',
        status: '',
        flightNumber: '',
        destination: '',
        station: '',
        grade: '',
        type: '',
        U_Device_ID: '',
        name: '',
        pnr: '',
        check: '',
        transferArrival:'',
        transferDeparture:''
      }
      if (this.timeStart == '' || this.timeEnd == '' || val == '') {
        this.$message.error('请先输入完整查询信息')
      } else {
        // let searchData = {dataContent:[this.timeStart,this.timeEnd,val]}
        this.form['time'] = [this.timeStart, this.timeEnd, val]
        let az = /^[a-zA-Z]+$/
        let azNum = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]*$/
        let top2 = /^[a-zA-Z]{2}\w*$/
        let num = /^[0-9]+$/
        // 纯字母则为旅客姓名
        if (az.test(val)) {
          this.form['name'] = val
          this.onCheckGj()
        }
        // 字母加数字且前两位为字母则为航班号
        else if (azNum.test(val) && top2.test(val)) {
          this.form['flightNumber'] = val
          this.onCheckGj()
        }
        // 纯数字且位数等于10则为行李牌号
        else if (num.test(val) && num.length == 10) {
          this.form['grade'] = val
          this.onCheckGj()
        } else {
          this.$message.error('请先输入有效查询信息如航班号、旅客姓名首字母、行李牌号')
        }
        // this.sempleQueryByStatMain(searchData)
      }
    },
    // 清除查询
    clearSearchData() {
      this.tableData = []
    },
    // 列设置-确定
    onCheck() {
      this.tableColsCopy = _.cloneDeep(this.checkList)
      const datas = _.sortBy(this.tableColsCopy, o => o.showOrder)
      this.tableColsCopy = datas
      this.tableCopy = this.checkList
      this.rowFlag = false
    },
    // 弹框展开
    show() {
      this.tableCopy = this.checkList
      this.rowFlag = true
    },
    // 弹框关闭
    close() {
      this.rowFlag = false
      this.checkList = this.tableCopy
      this.tableColsCopy = _.cloneDeep(this.checkList)
    },
    // 高级查询-确定
    onCheckGj() {
      // 参数顺序   【航班开始日期，航班结束日期，航班号，航班号，行李牌号，行李牌号，起飞站，起飞站，目的站，目的站，特殊行李类型，特殊 行李类型，旅客姓名大写拼音，旅客姓名大写拼音，pnr,pnr,值机号，值机号】
      this.dataContent = []
      this.dataContent = []
      const { time, status, flightNumber, destination, station, grade, type, U_Device_ID, name, pnr, check,transferArrival,transferDeparture} = this.form
      if (time && time.length) {
        this.dataContent.push(time[0])
        this.dataContent.push(time[1])
        if (
          (status == '') & (flightNumber == '') &&
          destination == '' &&
          station == '' &&
          grade == '' &&
          type == '' &&
          U_Device_ID == '' &&
          name == '' &&
          pnr == '' &&
          check == ''&&
          transferArrival == ''&&
          transferDeparture == ''
        ) {
          this.$message.error('请先输入查询信息')
        } else {
          this.setDataContent(status)
          this.setDataContent(flightNumber)
          this.setDataContent(grade)
          this.setDataContent(station)
          this.setDataContent(destination)
          this.setDataContent(type)
          this.setDataContent(name)
          this.setDataContent(pnr)
          this.setDataContent(check)
          this.setDataContent(transferArrival)
          this.setDataContent(transferDeparture)
          this.setDataContent(U_Device_ID)
          this.statItemsQueryByStatMain(this.dataContent)
          this.gjFlag = false
        }
      } else {
        this.$message.error('请先选择要查询的时间')
      }
    },
    closeCheckGj() {
      this.form = {}
      this.$refs['form'].resetFields()
      this.gjFlag = false
    },
    setDataContent(target) {
      if (target) {
        target = target.trim()
        this.dataContent.push(target)
        this.dataContent.push(target)
      } else {
        this.dataContent.push(null)
        this.dataContent.push(null)
      }
    },
    // 表格行点击处理
    // flightClickHandler(row) {
    //   this.$router.push({ path: '/advance/flightView', query: row })
    // },
    // baggageClickHandler(row) {
    //   this.$router.push({ path: '/advance/baggageView', query: row })
    // },
    // 数据查询
    async statItemsQueryByStatMain(dataContent) {
      try {
        const res = await getQuery({
          id: 30,
          dataContent
        })
        if (res.code == 0) {
          this.tableData = this._.sortBy(res.returnData, [
            "FlightNO",
            "FlightDate",
          ]);
          this.spanArr = [];
          let contactDot = this.contactDot;
          this.tableData.forEach((item, index) => {
            item.index = index;
            (item['deleted'] === 'DEL') || (item['deleted'] = '')
            if(item.activated =='I'){
              item.activated = "未激活"
            }
            else{
              item.activated = "激活"
            }
            if (index === 0) {
              this.spanArr.push(1);
            } else {
              if (item.FlightNO === this.tableData[index - 1].FlightNO&&item.FlightDate === this.tableData[index - 1].FlightDate) {
                this.spanArr[contactDot] += 1;
                this.spanArr.push(0);
              } else {
                this.spanArr.push(1);
                contactDot = index;
              }
            }
          });
          this.getTableFilterItem()
        } else {
          this.$message.error(res.message)
        }
      } catch (error) {
        console.log('出错了', error)
      }
    },
    // 简单查询 废弃
    async sempleQueryByStatMain(dataContent) {
      try {
        const res = await getQuery({
          id: 31,
          dataContent
        })
        if (res.code == 0) {
          this.tableData = res.returnData
        } else {
          this.$message.error(res.message)
        }
      } catch (error) {
        console.log('出错了', error)
      }
    },
    filterHandler(value, row, column) {
      const property = column['property']
      return row[property] === value
    },
    getTableFilterItem() {
      let PassengerNameUpcaseItemArr = [],
        FlightNOItemArr = [],
        FlightDateItemArr = [],
        SourceAirportItemArr = [],
        TargetAirportItemArr = [],
        SpecialTypeItemArr = [],
        checkInItemArr = [],
        deletedItemArr = [],
        activatedItemArr = [],
        latestStatusItemArr = [],
        bagLocationItemArr = [],
        PreFlightNONotNullItemArr = [],
        PreFlightNONullItemArr = [],
        U_Device_IDItemArr=[]

      this.PassengerNameUpcaseItem.length = 0
      this.FlightNOItem.length = 0
      this.FlightDateItem.length = 0
      this.SourceAirportItem.length = 0
      this.TargetAirportItem.length = 0
      this.SpecialTypeItem.length = 0
      this.checkInItem.length = 0
      this.deletedItem.length = 0
      this.activatedItem.length = 0
      this.latestStatusItem.length = 0
      this.bagLocationItem.length = 0
      this.PreFlightNONotNullItem.length = 0
      this.PreFlightNONullItem.length = 0
      this.U_Device_IDItem.length = 0

      this.tableData.forEach(item => {
        if (PassengerNameUpcaseItemArr.indexOf(item.PassengerNameUpcase) == -1 && item.PassengerNameUpcase != ''&& item.PassengerNameUpcase != null) {
          PassengerNameUpcaseItemArr.push(item.PassengerNameUpcase)
          this.PassengerNameUpcaseItem.push({
            text: item.PassengerNameUpcase,
            value: item.PassengerNameUpcase
          })
        }
        if (FlightNOItemArr.indexOf(item.FlightNO) == -1 && item.FlightNO != ''&& item.FlightNO != null) {
          FlightNOItemArr.push(item.FlightNO)
          this.FlightNOItem.push({
            text: item.FlightNO,
            value: item.FlightNO
          })
        }

        if (FlightDateItemArr.indexOf(item.FlightDate) == -1 && item.FlightDate != ''&& item.FlightDate != null) {
          FlightDateItemArr.push(item.FlightDate)
          this.FlightDateItem.push({
            text: item.FlightDate,
            value: item.FlightDate
          })
        }
        if (SourceAirportItemArr.indexOf(item.SourceAirport) == -1 && item.SourceAirport != ''&& item.SourceAirport != null) {
          SourceAirportItemArr.push(item.SourceAirport)
          this.SourceAirportItem.push({
            text: item.SourceAirport,
            value: item.SourceAirport
          })
        }
        if (TargetAirportItemArr.indexOf(item.TargetAirport) == -1 && item.TargetAirport != ''&& item.TargetAirport != null) {
          TargetAirportItemArr.push(item.TargetAirport)
          this.TargetAirportItem.push({
            text: item.TargetAirport,
            value: item.TargetAirport
          })
        }
        if (SpecialTypeItemArr.indexOf(item.SpecialType) == -1 && item.SpecialType != ''&& item.SpecialType != null) {
          SpecialTypeItemArr.push(item.SpecialType)
          this.SpecialTypeItem.push({
            text: item.SpecialType,
            value: item.SpecialType
          })
        }

        if (checkInItemArr.indexOf(item.checkIn) == -1 && item.checkIn != ''&& item.checkIn != null) {
          checkInItemArr.push(item.checkIn)
          this.checkInItem.push({
            text: item.checkIn,
            value: item.checkIn
          })
        }
        if (deletedItemArr.indexOf(item.deleted) == -1 && item.deleted != ''&& item.deleted != null) {
          deletedItemArr.push(item.deleted)
          this.deletedItem.push({
            text: item.deleted,
            value: item.deleted
          })
        }
        if (activatedItemArr.indexOf(item.activated) == -1 && item.activated != ''&& item.activated != null) {
          activatedItemArr.push(item.activated)
          this.activatedItem.push({
            text: item.activated,
            value: item.activated
          })
        }
        if (latestStatusItemArr.indexOf(item.latestStatus) == -1 && item.latestStatus != ''&& item.latestStatus != null) {
          latestStatusItemArr.push(item.latestStatus)
          this.latestStatusItem.push({
            text: item.latestStatus,
            value: item.latestStatus
          })
        }
        if (bagLocationItemArr.indexOf(item.bagLocation) == -1 && item.bagLocation != ''&& item.bagLocation != null) {
          bagLocationItemArr.push(item.bagLocation)
          this.bagLocationItem.push({
            text: item.bagLocation,
            value: item.bagLocation
          })
        }
        if (PreFlightNONotNullItemArr.indexOf(item.PreFlightNONotNull) == -1 && item.PreFlightNONotNull != ''&& item.PreFlightNONotNull != null) {
          PreFlightNONotNullItemArr.push(item.PreFlightNONotNull)
          this.PreFlightNONotNullItem.push({
            text: item.PreFlightNONotNull,
            value: item.PreFlightNONotNull
          })
        }
        if (PreFlightNONullItemArr.indexOf(item.PreFlightNONull) == -1 && item.PreFlightNONull != ''&& item.PreFlightNONull != null) {
          PreFlightNONullItemArr.push(item.PreFlightNONull)
          this.PreFlightNONullItem.push({
            text: item.PreFlightNONull,
            value: item.PreFlightNONull
          })
        }
        if (U_Device_IDItemArr.indexOf(item.U_Device_ID) == -1 && item.U_Device_ID != ''&& item.U_Device_ID != null) {
          U_Device_IDItemArr.push(item.U_Device_ID)
          this.U_Device_IDItem.push({
            text: item.U_Device_ID,
            value: item.U_Device_ID
          })
        }
      })
    },

    // 统计行数
    summaryRow(num) {
      return function () {
        return ['合计', `共${num}件`]
      }
    }

    //   //导航栏筛选开始
    //   getTableFilterItem(){
    //     console.log(this.tableData);
    //     let arr = []
    //     this.tableData.forEach(item=>{
    //       if(arr.indexOf(item.PassengerNameUpcase)==-1){
    //         arr.push(item.PassengerNameUpcase)
    //       }
    //     })
    //     this.allOptionsObj.PassengerNameUpcase = arr;
    //   },
    //   filterData(e, type) {
    //     this.showFilterTool = false;
    //     this.$nextTick(() => {
    //       this.seachType = type;
    //       this.filterToolTop = e.pageY;
    //       this.filterToolLeft = e.pageX;
    //       this.showFilterTool = true;
    //     });
    //   },
    //   closeTool() {
    //     this.showFilterTool = false;
    //   },
    //   saveSeach(data) {
    //     console.log(data);
    //     this.seachData = data;
    //     this.closeTool();
    //   },
    //   closeSearch() {
    //     this.showAdd = false;
    //   },
    //   saveBatch(data) {
    //     // 查询条件
    //     console.log(data);
    //   },
    //   //导航栏筛选结束
  }
}
</script>

<style lang="scss" scoped>
.advance {
  padding: 8px;
  &__head {
    line-height: 32px;
    margin-top: 8px;
    margin-bottom: 16px;
    .setting {
      height: 32px;
      width: 32px;
      cursor: pointer;
      background-size: 100% 100%;
      background: url('../../../assets/departure/ic_setting.png') no-repeat;
      margin-left: 12px;
      position: relative;
      top: 2px;
    }
    .mr10 {
      margin-right: 10px;
    }
    ::v-deep .interfaceLog_head_time {
      .el-input__prefix {
        left: 10px;
        color: #101116;
      }
      .el-input--prefix .el-input__inner {
        padding-left: 50px;
      }
    }
  }
}
.advance__table {
  width: 100%;
  ::v-deep .table {
    width: 100%;
    .cell {
      padding: 0;
      text-align: center;
      font-size: 14px;
      font-family: Helvetica, "Microsoft YaHei";
      letter-spacing: 0;
    }
    .clickCell{
        cursor: pointer;
        color: #2d7cff;
      }
    .el-table__header-wrapper {
      .cell {
        font-weight: bold;
        color: #101116;
      }

      .has-gutter {
        tr {
          .bgl-huang {
            background: #fcf0b1;
          }
        }
      }
    }

    .el-table__body-wrapper {
      tr.bgl-hui {
        background: #d2d6df;
        td {
          background: #d2d6df;
        }
        &.redBorder {
          position: relative;
          &::after {
            content: "";
            position: absolute;
            left: 0;
            bottom: 0;
            width: 100%;
            height: 2px;
            background: #e83f82;
          }
        }
      }
    }
  }
}
.el-table tbody tr:hover>td {
  background-color:red!important;
}

.el-table__body tr.hover-row.current-row>td,.el-table__body tr.hover-row.el-table__row--striped.current-row>td,.el-table__body tr.hover-row.el-table__row--striped>td,.el-table__body tr.hover-row>td{
    background-color:red
}
</style>
