el-table嵌套el-table

1、样式

<div class="table" style="display: block">

<el-table

ref="multipleTable"

:data="tableData"

tooltip-effect="dark"

style="width: 100%; border: 1px solid #21f3ef"

:border="true"

:row-class-name="tableRowClassName"

:header-cell-style="headerStyle"

:highlight-current-row="false"

height="800"

>

<el-table-column

prop="areaName"

label="景区名称"

width="260"

align="center"

>

</el-table-column>

<el-table-column

prop="dataTotal"

label="数据采集总量"

width="260"

align="center"

>

</el-table-column>

<el-table-column label="结构化数据总量" align="center" width="356">

<template slot-scope="scope">

<el-table

:data="scope.row.jiegou"

tooltip-effect="dark"

:header-cell-style="headerStyle2"

:highlight-current-row="false"

style="border: none"

class="customer-table"

>

<el-table-column

prop="PortraitCapture"

label="人像抓拍"

align="center"

>

</el-table-column>

<el-table-column

prop="CarSnapshot"

label="车辆抓拍"

align="center"

>

</el-table-column>

<template slot="append">

{{ scope.row.structuringTotal }}

</template>

</el-table>

</template>

</el-table-column>

<el-table-column width="700" label="非结构化数据总量" align="center">

<template slot-scope="scope">

<el-table

:data="scope.row.feijiegou"

tooltip-effect="dark"

:row-class-name="tableRowClassName"

:header-cell-style="headerStyle2"

:highlight-current-row="false"

class="customer-table"

>

<el-table-column

prop="person"

label="人员"

width="120"

align="center"

>

</el-table-column>

<el-table-column

prop="car"

label="车辆"

width="110"

align="center"

>

</el-table-column>

<el-table-column

prop="trade"

label="行业"

width="110"

align="center"

>

</el-table-column>

<el-table-column

prop="event"

label="按事件"

width="110"

align="center"

>

</el-table-column>

<el-table-column

prop="fireEquipment"

label="消防设备"

width="110"

align="center"

>

</el-table-column>

<el-table-column

prop="punishInfo"

label="处罚信息"

width="118"

align="center"

>

</el-table-column>

<template slot="append">

{{ scope.row.notStructuringTotal }}

</template>

</el-table>

</template>

</el-table-column>

</el-table>

</div>

2、接口

{

areaName: "",

carCount: '',

carPhotoCount: "",

dataTotal: "",

facePhotoCount: "",

notStructuringTotal: "",

scenicArchivesCount: "",

scenicFireCount: "",

scenicPersonCount: "",

scenicPlaceCount: "",

structuringTotal: "",

}

3、接口添加数组

statisticsTime(this.statisticsData).then((res) => {

console.log(res);

console.log(res.data.data.records);

let a = res.data.data.records;

let newArr = [];

a.map((item, index) => {

console.log(index);

newArr.push(

Object.assign(

item,

{

jiegou: [

{

PortraitCapture: item.facePhotoCount,

CarSnapshot: item.carPhotoCount,

},

],

},

{

feijiegou: [

{

person: item.scenicPersonCount,

car: item.carCount,

trade: item.scenicPlaceCount,

event: item.scenicArchivesCount,

fireEquipment: item.scenicFireCount,

punishInfo: item.scenicArchivesCount,

},

],

}

)

);

console.log(newArr);

});

this.tableData = newArr;

});

4、接口现在数据格式

{

areaName: "D",

carCount: 25,

carPhotoCount: 10,

dataTotal: 666,

facePhotoCount: 10,

jiegou: [{ PortraitCapture: 19, CarSnapshot: 20 }],

feijiegou: [

{

person: 11,

car: 11,

trade: 11,

event: 11,

fireEquipment: 11,

punishInfo: 11,

},

],

notStructuringTotal: 10,

scenicArchivesCount: 0,

scenicFireCount: 0,

scenicPersonCount: 0,

scenicPlaceCount: 0,

structuringTotal: 0,

},

5、清除bioageqiantaobiaoge

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值