import { checkVisual } from "@/views/event/components/details/mixins";
export default {
  mixins: [checkVisual],
  props: {
    tableData: {//数据
      type: Array,
      default: () => {
        return [{ name: '123', eventNumber: '手机', projectNumber: '专利数据库一', projectNumber1: [{ name: '事件一' }] },]
      }
    },
    queryParams: {//分页信息
      type: Object,
      default: () => {
        return {
          size: 10,
          current: 1,
        }
      }
    },
  },
  data() {
    return {
      // 项目的状态
      statusObj: {
        0: '开卷审核',
        1: '处理中',
        2: '已完成',
        3: '缺少资料',
        4: '取消',
      },
    }
  },
  computed: {

  },
  methods: {
    // 点击名称等事件
    handleItem(row, key) {
      if(row.state == 0){
        this.$message.warning('项目审核中')
        return
      }
      // 跳转详情页面
      this.$router.push({
        path: '/details',
        query: {
          id: row.id
        }
      })
    },
    //操作列事件
    handleCommand(option, row) {
      if (option == 'e') {//编辑
        this.action = {
          type: '2',
          id: row.id
        }
      }
      var isLast = false
      if (option == '1') {//删除
        this.action = {
          type: '1',
          id: row.id
        }
        if (this.tableData.length == 1) {
          isLast = true
        }
      }
      this.$emit('option', { option, row, isLast: isLast })
    },
  },
}