js stitching for loop, stitching a tag jump

js stitching for loop, stitching a tag jump

// for (let i=0;i<attributeName.length;i++){
//     attributeList.push({name:a[i],pams:v.lastRecode[`v${i+1}`]})
// }
// attributeList是数组
let pamsList = ``
attributeList.forEach((item, index) => {
pamsList += `<tr>
<th align="center">${index+1}</th>
<th align="center">${item.name}</th>
<th align="center">${item.pams}</th>
<th align="center">正常</th>
</tr>`
})

let inner = `
<img style='float:right;margin:0 10px 22px' id='imgDemo' src=${this.banner} width='139' height='104'/>
设备名称:<a href='../#/bkqy/resultQuery?routerDetal=${details}' >${v.equipmentName || ''}</a>
<p>站点名称:${v.siteName || ''}</p>
<p>采集参数:${v.attributeName || ''}</p>
<p>设备状态:<span style="color: #30DA74">正常</span></p>
<p>地址:${v.address || '无'}</p>
<table width="380" border="1" style="border-collapse: collapse;">
<tr>
<th align="center">序号</th>
<th align="center">采集类型</th>
<th align="center">上次数值</th>
<th align="center">状态</th>
</tr>${pamsList} // pamsList是for循环出来的表格 
</table>
`

 

Guess you like

Origin blog.csdn.net/qq706352062/article/details/111478529