import { checkVisual } from "@/views/home/components/mixins";
export default{
    mixins:[checkVisual],
    props:{
        tableData:{
            default:()=>{
                return []
            }
        },
        projectId:{},
        params:{
            default:()=>{
                return {}
            }
        },
        show:{
            default:false
        }
    },  
    computed:{
        dictMessage() {
          var a = JSON.parse(JSON.stringify(this.$store.state.dictMessage.dictMessage))
          if(a.REPORT_TYPE){
            a.REPORT_TYPE.forEach(item=>{
              if(['0','1','2'].includes(item.dictChildValue)){
                item.permission = 'invalid'
              }else if(item.dictChildValue == 3){
                item.permission = 'FTO'
              }else if(item.dictChildValue == 4){
                item.permission = 'tort'
              }else if(item.dictChildValue == 5){
                item.permission = 'avoidDesign'
              }else if (item.dictChildValue == 7) {
                item.permission = 'reInvalid'
              }
            })
          }
          if(a.REPORT_TYPE){
            a.REPORT_TYPE.push(
                {
                    dictChildValue:'w',
                    dictChildLabel:'专利挖掘',
                    permission : 'reInvalid'
                },
                {
                    dictChildValue:'e',
                    dictChildLabel:'其他',
                    permission : 'reInvalid'
                }
            )
          }
          
          return a
        },
    },
    methods: {
        // 取消与专题库的关联
        handleDelete(row) {
            this.$emit('option', { option:'cancel', row })
        },
        //操作列事件
        handleCommand(option,row){
            this.$emit('option', { option, row })
        },
        //新增报告
        handleAnalyse(type,row) {
            this.$emit('option', { option:'addReport', row, type })
        },
        //编辑事件
        handleEdit(row){
            this.$emit('option', { option:'edit', row })
        }
    },
}