<template>
  <a-card>
    <a-tabs v-if="leaderList.length > 0" v-model="activeKey">
      <a-tab-pane v-for="leader in leaderList" :key="leader.leaderAccount" :tab="leader.leaderName">
        <sd-data-table
          :ref="leader.leaderAccount"
          data-url="api/framework/v1/user-tasks/done/taskinfos"
          :columns="columns"
          :row-key="'instId'"
          :search-fields="['title']"
          :process-req="processReq"
        >
          <a
            slot="bt"
            slot-scope="text, record"
            target="_blank"
            rel="opener"
            @click="openTaskItem(record, 'todo')"
          >
            {{ text }}
          </a>
        </sd-data-table>
      </a-tab-pane>
    </a-tabs>
    <a-empty v-else />
  </a-card>
</template>

<script>
import TableColumnTypes from '@/common/services/table-column-types'
import components from './_import-components/sd-leaderdonelist-import'
import leaderOfficeMixins from './leader-office-mixins'
export default {
  name: 'SdLeaderdonelist',
  metaInfo: {
    title: '领导已批文件',
  },
  components,
  mixins: [leaderOfficeMixins],
  data() {
    return {
      columns: [
        {
          title: '业务类型',
          dataIndex: 'appCat',
        },
        {
          title: '标题',
          dataIndex: 'title',
          scopedSlots: { customRender: 'bt' },
        },
        {
          title: '办理时间',
          sdRender: TableColumnTypes.dateTime, // 特殊处理的数据类型，时间戳会自动调用sdDateFormat处理
          defaultSortOrder: 'descend', // 没有点击任何排序列时，默认的排序列
          dataIndex: 'processDate',
          width: '20%',
          sorter: true,
        },
      ],
    }
  },
}
</script>

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