<template>
  <div :class="$style.searchdiv">
    <a-card :class="$style.reporttablecardxm">
      <sd-data-table
        ref="dataTable"
        :defultpagination-pagesize="10"
        :columns="columns"
        :row-key="(record) => record.id"
        data-url="api/xcoa-mobile/v1/iam-page/businessList"
        :process-req="processReq"
        :process-res="processRes"
      >
        <div slot="action" slot-scope="text, record">
          <a @click="openCubeUrl(record)">{{ text }}</a>
        </div>
      </sd-data-table>
    </a-card>
  </div>
</template>

<script>
import moment from 'moment'
import components from './_import-components/cube-false-sales-import'

export default {
  name: 'CubeFalseSales',
  metaInfo: {
    title: '虚假销售图谱清单',
  },
  components,
  data() {
    return {
      pagination: {
        pageSize: 10,
        total: 100,
      },
      tableData: [], // 列表数据
      columns: [
        {
          title: '序号',
          dataIndex: 'sortNum',
          width: '80px',
          customRender: (text, record, index) => `${index + 1}`,
        },
        {
          title: '业务员',
          dataIndex: 'userName',
        },
        {
          title: '出生年月',
          dataIndex: 'birthDay',
          customRender: (text, record, index) => moment(text).format('YYYY-MM-DD'),
        },
        {
          title: '职务',
          dataIndex: 'duties',
        },
        {
          title: '异常数量',
          dataIndex: 'outlierNums',
        },
        {
          title: '备注',
          dataIndex: 'remarks',
        },
        {
          title: '操作',
          dataIndex: 'action',
          scopedSlots: { customRender: 'action' },
        },
      ],
    }
  },
  methods: {
    // 打开cube页面
    openCubeUrl(record) {
      window.open(record.url)
    },
    // 处理请求
    processReq(req) {
      req.data.formId = 'iamCubeContract'
      req.data.pageId = 'cube/contract/iamCubeContract'
      return req
    },
    // 处理响应
    processRes(res) {
      res.totalSize = 14
      res.data = [
        {
          action: '查看',
          birthDay: '1988/5/5',
          duties: '高级销售员',
          id: '1',
          outlierNums: '4',
          remarks: '各保单的投保人电话存在关联关系',
          sortNum: '',
          userName: '梁小文',
          url:
            'http://10.104.32.32:3000/projects/76/knowledgeGraph/o/audit-atlas?access_token=3KHnadZ0xoleluVp48mYz6EYPI37OJ',
        },
        {
          action: '查看',
          birthDay: '1998/7/19',
          duties: '初级销售员',
          id: '2',
          outlierNums: '无异常',
          remarks: '',
          sortNum: '',
          userName: '吴越',
          url:
            'http://10.104.32.32:3000/projects/77/knowledgeGraph/o/audit-atlas?access_token=3KHnadZ0xoleluVp48mYz6EYPI37OJ',
        },
        {
          action: '查看',
          birthDay: '1998/2/23',
          duties: '初级销售员',
          id: '3',
          outlierNums: '3',
          remarks: '各保单的投保人地址存在关联关系',
          sortNum: '',
          userName: '李克乾',
          url:
            'http://10.104.32.32:3000/projects/78/knowledgeGraph/o/audit-atlas?access_token=3KHnadZ0xoleluVp48mYz6EYPI37OJ',
        },
        {
          action: '查看',
          birthDay: '1997/3/25',
          duties: '初级销售员',
          id: '4',
          outlierNums: '无异常',
          remarks: '',
          sortNum: '',
          userName: '郑丽丽',
        },
        {
          action: '查看',
          birthDay: '1987/7/13',
          duties: '高级销售员',
          id: '5',
          outlierNums: '无异常',
          remarks: '',
          sortNum: '',
          userName: '孙铭启',
        },
        {
          action: '查看',
          birthDay: '1993/8/31',
          duties: '初级销售员',
          id: '6',
          outlierNums: '无异常',
          remarks: '',
          sortNum: '',
          userName: '董成鹏',
        },
        {
          action: '查看',
          birthDay: '1996/1/2',
          duties: '初级销售员',
          id: '7',
          outlierNums: '无异常',
          remarks: '',
          sortNum: '',
          userName: '李小平',
        },
        {
          action: '查看',
          birthDay: '1990/8/28',
          duties: '初级销售员',
          id: '8',
          outlierNums: '无异常',
          remarks: '',
          sortNum: '',
          userName: '吴明月',
        },
        {
          action: '查看',
          birthDay: '1981/5/1',
          duties: '高级销售员',
          id: '9',
          outlierNums: '无异常',
          remarks: '',
          sortNum: '',
          userName: '于胜',
        },
        {
          action: '查看',
          birthDay: '1993/1/25',
          duties: '初级销售员',
          id: '10',
          outlierNums: '无异常',
          remarks: '',
          sortNum: '',
          userName: '陈世同',
        },
        {
          action: '查看',
          birthDay: '1976/9/12',
          duties: '高级销售员',
          id: '11',
          outlierNums: '无异常',
          remarks: '',
          sortNum: '',
          userName: '张腾飞',
        },
        {
          action: '查看',
          birthDay: '1998/2/19',
          duties: '初级销售员',
          id: '12',
          outlierNums: '1',
          remarks: '各保单的投保人电话存在关联关系',
          sortNum: '',
          userName: '贾勇勇',
        },
        {
          action: '查看',
          birthDay: '1999/9/8',
          duties: '初级销售员',
          id: '13',
          outlierNums: '无异常',
          remarks: '',
          sortNum: '',
          userName: '焦才名',
        },
        {
          action: '查看',
          birthDay: '1976/5/12',
          duties: '高级销售员',
          id: '14',
          outlierNums: '无异常',
          remarks: '',
          sortNum: '',
          userName: '杨凯',
        },
      ]
      return res
    },
  },
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
</style>
