export default {
    data() {
        return {
            //展示图片
            showImg:false,
            //图片地址
            imgSrc:'',
        }
    },
    methods: {
        // 进入产品类别分类架构（与产品架构一致）
        toFramework(row,val) {
            var form = {
                name:row.name,
                id:row.id,
                categoryId:row.categoryId,
                type:val,
            }
            let router = this.$router.resolve({
                path: '/frameworkIndex',
                query: {
                    row: JSON.stringify(form),
                }
            })
            window.open(router.href, '_blank')
        },
        /**
         * 营销数据趋势图
         * @param {Object} row 
         * @param {Number} val 
         */
        showTrend(row, val) {//val为数据类型，1为产品类别，2为产品
            const router = this.$router.resolve({
                path: '/chartIndex',
                query: {
                    id: row.id,
                    type: val,
                    name: row.name
                }
            })
            window.open(router.href, '_blank');
        },
         // 进入商品化专利
        toCommodity(row) {
            let router = this.$router.resolve({
                path: '/commodity',
                query: {
                    productId:row.id,
                    productName:row.name,
                }
            })
            window.open(router.href,'_blank')
        },
        
        //预览图片
        checkImage(row){
            if(!row.systemFileList || row.systemFileList.length == 0){
                this.$message.error('暂无图片可预览')
                return false
            }
            this.imgSrc = this.$commonJS.checkViewer(row.systemFileList[0].guid)
            this.showImg = true
        },
        //关闭预览图片
        closeViewer(){
            this.showImg = false
        },
        //专利布局可视化
        MindIndex(row,type){
            const router = this.$router.resolve({
                path: '/MindIndex',
                query: {
                    id: row.id,
                    type: type,
                }
            })
            window.open(router.href, '_blank');
        },
    },
}