<template>
    <div>
        <el-row :gutter="12">
            <el-col :span="6" v-for="(item,itemIndex) in data" :key="itemIndex">
                <el-card shadow="always" style="background:white;box-shadow:2px 2px 10px #909090">
                <p style="font-size:18px"><b> <el-link type="primary" style="font-size:18px;font-weight:bolder" @click="tableName(item)">{{item.name}}</el-link></b> </p>
                <div class="fun" style="color:blue;display:flex;justify-content: flex-end;">
                    <span style="margin-right: 10px;"  @click="handleEdit(item)">编辑</span>
                    <el-dropdown @command="handleCommand($event, item)" trigger="click">
                      <span class="el-dropdown-link">
                        <i class="el-icon-more" style="font-size: 16px;"></i>
                      </span>
                      <el-dropdown-menu slot="dropdown" class="text-align_center" >
                        <el-dropdown-item command="1" v-if="[2,3].includes(item.status)">导出报告</el-dropdown-item>
                        <el-dropdown-item command="2" v-if="[2,3].includes(item.status)">报告文档</el-dropdown-item>
                        <el-dropdown-item command="3" v-if="[1,2].includes(item.status)">自定义字段</el-dropdown-item>
                        <el-dropdown-item command="4" v-if="[2,3].includes(item.status)&& item.type != 4">任务分配</el-dropdown-item>
                        <el-dropdown-item command="5" v-if="[1].includes(item.status) || (item.type == 4&& [1,2,3].includes(item.status))">{{!([3,4].includes(item.type))?'拆分特征':'产品信息录入'}}</el-dropdown-item>
                        <el-dropdown-item command="6" v-if="[2,3].includes(item.status)&& item.type != 4">导入 </el-dropdown-item>
                        <el-dropdown-item command="7" divided style="color: red;">删除 </el-dropdown-item>
                        <!-- <el-dropdown-item command="0">分享</el-dropdown-item> -->
                        <!-- <el-dropdown-item command="1">导出报告</el-dropdown-item>
                        <el-dropdown-item command="2">报告文档</el-dropdown-item>
                        <el-dropdown-item command="3">自定义字段</el-dropdown-item>
                        <el-dropdown-item command="4">任务分配</el-dropdown-item>
                        <el-dropdown-item command="5">拆分特征</el-dropdown-item>
                        <el-dropdown-item command="6">导入 </el-dropdown-item>
                        <el-dropdown-item command="7" divided style="color: red;">删除 </el-dropdown-item> -->
                      </el-dropdown-menu>
                    </el-dropdown>         
                </div>
                <p><span style="font-weight:bolder">标的专利/产品：</span> 
                  <span v-if="item.type == 3">{{item.signPatentNo}}</span>
                 <el-link type="primary" v-else style="font-size:16px" @click="toPatentDetails(item.signPatentNo,item)">{{item.signPatentNo}}</el-link> </p>
                <!-- <p><span style="font-weight:bolder">调查类型：</span> <span v-if="item.itFlag">{{item.itFlag[0]}}
                    <span v-if="item.itFlag.length>1">
                          <el-tooltip class="item" effect="light"  placement="top">
                            <div slot="content"><span v-for="name in item.itFlag">{{name}}&nbsp;&nbsp;</span></div>
                        <span><img src="./img/更多.png" style="width:18px;vertical-align:bottom"/></span> 
                     </el-tooltip>
                    </span></span> </p> -->
                <p><span style="font-weight:bolder">应用场景：</span> <span v-if="item.scenarioNames">{{item.scenarioNames[0]}}
                    <span v-if="item.scenarioNames.length>1">
                        <el-tooltip class="item" effect="light"  placement="top">
                      <div slot="content"><span v-for="name in item.scenarioNames">{{name }}&nbsp;&nbsp;</span></div>
                      <span><img src="./img/更多.png" style="width:18px;vertical-align:bottom"/></span> 
                      </el-tooltip>
                      </span>
                    </span> 
                </p>
                <p><span style="font-weight:bolder">创建人：</span>  <span>{{item.createPersonName}}</span> </p>
                <p><span style="font-weight:bolder">负责人：</span>  <span>{{item.personName}}</span> </p>
                <p><span style="font-weight:bolder">客户：</span>  <span>{{item.clientName}}</span> </p>
                <p><span style="font-weight:bolder">技术/产品：</span>  <span>{{item.proTec}}</span> </p>
                <p><span style="font-weight:bolder">状态：</span>  <span>{{state[item.status]}}</span> </p>
                </el-card>
            </el-col> 
        </el-row>
    </div>
</template>

<script>
import { PatentDetails } from '@/views/components/common/mixins';
export default {
  props: ['data', 'params', 'state'],
  mixins:[PatentDetails],
  data() {
    return {

    }
  },
  methods:{
    tableName(row) {//点击名称进入标的专利详情
      this.$emit('getRow',row)
    },
    //按钮功能
    handleCommand(command, row) {
      this.$emit('option', { option: command, row })
    },
    //编辑
    handleEdit(row) {
      this.$emit('option', { option: 'e', row })
    },
  }
}
</script>

<style lang="scss" scoped>
.fun span {
  cursor: pointer;
}
.el-dropdown-menu__item{
  height:26px;
}
.el-dropdown-menu__item--divided:before{
 height: 0px;
}
</style>