<template>
  <div>
     <MyTable
        :tableData="pageData.tableData"
        :tableColumn="pageData.tableColumn"
        :tableHeight="pageData.tableHeight"
        :key="pageData.keyCount"
        :fixed ="false"
        :tableConfiger="pageData.tableConfiger"
        :controlsWidth="pageData.controlsWidth">
        <template #controls="{ row }">
          <el-link size="small" type="primary" @click="addEdit('detail', row)">详情</el-link>
        </template>
      </MyTable>
  </div>
</template>

<script setup>
import { qcckGet } from "@/api/qcckApi.js";
import MyTable from "@/components/aboutTable/MyTable.vue";
import { onMounted, reactive , ref} from "vue";
const pageData = reactive({
  tableData: [],
  keyCount: 0,
  tableConfiger: {
    rowHieght: 61,
    showSelectType: "null",
    loading: false
  },
  total: 0,
  pageConfiger: {
    pageSize: 20,
    pageCurrent: 1
  },
  tableHeight:143,
  controlsWidth: 52,
  tableColumn: [
    { label: "号码类型", prop: "hmlx",width:'70px',showOverflowTooltip:true  },
    { label: "号码", prop: "hm",width:'120px',showOverflowTooltip:true},
    { label: "线索数", prop: "glxss",width:'70px',showOverflowTooltip:true},
    { label: "指令数", prop: "glzls" ,width:'70px',showOverflowTooltip:true},
  ]
});

const searchData = ref({})
onMounted(()=>{
  getDate()
})

const init = (val) =>{
  searchData.value = val;
  getDate()
}

function getDate (){
  let params = { ...searchData.value }
  delete params.dateRange;
  pageData.pageConfiger.loading = true;
  qcckGet(params,'/mosty-gsxt/tbGsxtZdqt/getRdhm').then(res=>{
    pageData.tableData = res || [];
    pageData.pageConfiger.loading = false;
  }).catch(()=>{
    pageData.pageConfiger.loading = false;
  })
}

defineExpose({init})

</script>

<style lang="scss" scoped>
::v-deep  .el-table .cell{
    padding: 0;
}

::v-deep .el-table th.el-table__cell{
    background: rgba(239, 245, 247,1) !important;
}
</style>