<template>
  <div class="mytable">
    <vxe-grid
      id="id2"
      ref="xGrid2"
      border
      resizable
      keep-source
      :align="'center'"
      :height="height"
      :auto-resize="true"
      :columns="tableColumn"
      :data="list"
      :custom-config="{ storage: true }"
      :cell-style="cellStyle"
      highlight-current-row
      highlight-hover-row
      show-overflow
      :scroll-y="{enabled: true}"
    >
    </vxe-grid>
  </div>
</template>

<script>
export default {
  name:'Third',
  props:{
    queryParam:Object,
    list:{
      type:Array,
      default:[]
    },
    height:{
      type:Number,
      default:500,
    }
  },
  data(){
    return {
      tableColumn: [
        {type: 'seq', width: 60, title: '序号', fixed: "left"},
        {
          field: 'dcCh', title: '船号', width: 100,
          filters: [{
            data: {
              checks: [],
              sVal: '',
              sMenu: '',
              fType1: '',
              fVal1: '',
              fMode: 'and',
              fType2: '',
              fVal2: ''
            }
          }],
          filterRender: {name: 'FilterCombination',}
        },
        {
          field: 'dcPl', title: '批量', width: 100,
          filters: [{
            data: {
              checks: [],
              sVal: '',
              sMenu: '',
              fType1: '',
              fVal1: '',
              fMode: 'and',
              fType2: '',
              fVal2: ''
            }
          }],
          filterRender: {name: 'FilterCombination',}
        },
        {
          field: 'dcFd', title: '分段', width: 100,
          filters: [{
            data: {
              checks: [],
              sVal: '',
              sMenu: '',
              fType1: '',
              fVal1: '',
              fMode: 'and',
              fType2: '',
              fVal2: ''
            }
          }],
          filterRender: {name: 'FilterCombination',}
        },
        {
          field: 'xzjsq', title: 'a=批量表（钢加小组结束）', width: 180,
          filters: [{
            data: {
              checks: [],
              sVal: '',
              sMenu: '',
              fType1: '',
              fVal1: '',
              fMode: 'and',
              fType2: '',
              fVal2: ''
            }
          }],
          filterRender: {name: 'FilterCombination',}
        },
        {
          field: 'xzglxq', title: 'b=钢料滚动需求（小组）', width: 180,
          filters: [{
            data: {
              checks: [],
              sVal: '',
              sMenu: '',
              fType1: '',
              fVal1: '',
              fMode: 'and',
              fType2: '',
              fVal2: ''
            }
          }],
          filterRender: {name: 'FilterCombin ation',}
        },
        {
          field: 'xzcz', title: 'b-a=时间差(小组)', width: 180,
          filters: [{
            data: {
              checks: [],
              sVal: '',
              sMenu: '',
              fType1: '',
              fVal1: '',
              fMode: 'and',
              fType2: '',
              fVal2: ''
            }
          }],
          filterRender: {name: 'FilterCombination',}
        },
        {
          field: 'dzjsq', title: 'c=批量表（钢加大组结束）', width: 180,
          filters: [{
            data: {
              checks: [],
              sVal: '',
              sMenu: '',
              fType1: '',
              fVal1: '',
              fMode: 'and',
              fType2: '',
              fVal2: ''
            }
          }],
          filterRender: {name: 'FilterCombination',}
        },
        {
          field: 'dzglxq', title: 'd=钢料滚动需求（大组）', width: 180,
          filters: [{
            data: {
              checks: [],
              sVal: '',
              sMenu: '',
              fType1: '',
              fVal1: '',
              fMode: 'and',
              fType2: '',
              fVal2: ''
            }
          }],
          filterRender: {name: 'FilterCombination',}
        },
        {
          field: 'dzcz', title: 'd-c=时间差(大组)', width: 180,
          filters: [{
            data: {
              checks: [],
              sVal: '',
              sMenu: '',
              fType1: '',
              fVal1: '',
              fMode: 'and',
              fType2: '',
              fVal2: ''
            }
          }],
          filterRender: {name: 'FilterCombination',}
        },
      ],
    }
  },
  methods:{
    cellStyle({row, column, rowIndex, columnIndex}) {
      let fields = ['tlt_zl', 'jsq_dz_pc', 'jsq_xz_pc', 'tzxqq', 'tlt_sl', 'hx_cd', 'qg_cd', 'gcxqq'];
      if (fields.includes(column.property)) {
        return {
          color: '#CC8B04',
          cursor: 'pointer'
        }
      }
    },
  }
}
</script>
