export default {
  data() {
    return {
       // 回避设计栏位
       columnList: [
        {
          name: "回避设计方向(可粘贴图片)",
          type: "String",
          value: "direction",
        },
      ],
      // 数据源
      tableData: [],
      // 回避设计总体方案
      wholeContent: '',
    }
  },
  mounted() {
    this.getList()
  },
  methods: {
    getList(split={splitType:'1',splitBy:'2'},ifReSplit=false) {
      let params = {
        ifReSplit: ifReSplit,
        projectId: Number(this.projectId),
        ...split,//拆分条件
      }
      this.$api.getAvoidDesign(params).then(res => {
        if (res.code == 200) { 
          this.wholeContent=res.data.wholeContent
          if (res.data.avoidDesignRightVOS.length > 0) {
            var data = []
            res.data.avoidDesignRightVOS.forEach(RightVosItem => {
              if (RightVosItem.avoidDesignVOS.length > 0) {
                RightVosItem.avoidDesignVOS.forEach(FeaturesItem => {
                  FeaturesItem.pRightName = RightVosItem.rightName
                  FeaturesItem.pSignPatentNo = RightVosItem.signPatentNo
                  FeaturesItem.pPatentNo = RightVosItem.patentNo
                  FeaturesItem.pContentOut = RightVosItem.contentOut
                  FeaturesItem.pContent = RightVosItem.content
                  FeaturesItem.pProjectId = RightVosItem.projectId
                  FeaturesItem.pType = RightVosItem.type
                  FeaturesItem.pSort = RightVosItem.sort
                  this.hasOwn(FeaturesItem)
                  data.push(FeaturesItem)
                })
              }
            })
            this.tableData = data
          }
        }
      })
    },
    hasOwn(item) {
      if (!item.hasOwnProperty("explainText")) {
        item.explainText = ''
      }
      if (!item.hasOwnProperty("direction")) {
        item.direction = ''
      }
    },
  },
}