1、模板

<JNPF-column  :stripe="true" :data="data" height="100%">
                        <el-table-column prop="label" label="危险度" align="center" />
                        <el-table-column  
                            v-for="(item, index) in dataSource"
                            :key="index"
                            :label="item.deptName"
                            align="center"
                            >
                            <template slot-scope="scope">
                                <span > {{ (scope.row.option[index]) }} </span>
                            </template>
                        </el-table-column>
                </JNPF-column>

2、传值

getStatus() {
        this.listLoading = true
        getTicketStastic(this.query).then(res => {
                if (res.code == 200) {
                    let data = res.data
                    //遍历取出所有的状态类型
                    let arr = []
                    data[0].ticketStatusLabel.forEach((item,index) => {
                        let obj = {
                            label:""
                        }
                        obj.label = item.label
                        arr.push(obj)      
                    })
                    this.formatData2 = arr  
                    this.formatData2.forEach((item,index) => {
                            let arr2 =[] 
                            data.forEach((subItem,subIndex) => {
                                arr2.push(subItem.ticketStatusLabel[index].value)
                            })
                            this.formatData2[index]['option'] = arr2
                        })
                    this.formatData2 = arr  
                    this.$refs.ticketStatic.init(this.formatData2,data)
                     this.listLoading=false;
                }   
            }).catch(err=>{
              this.listLoading=false;
            })
      }

Logo

欢迎加入 MCP 技术社区!与志同道合者携手前行,一同解锁 MCP 技术的无限可能!

更多推荐