资源地址:han-link.cn/6271.html
#工业#
https://blog.csdn.net/u013558749/article/details/82257168 (element-ui 实现行合并)
https://www.cnblogs.com/guwufeiyang/p/12850088.html (合并后样式的处理)
合并后样式
[
{
"processId": "1499255834195238914",
"currentProcessInfoId": "1499255834245570561",
"flowType": "01",
"userName": "xxx",
"itcode": "xxx",
"pernr": "xxx",
"approveStatus": "01",
"dimensionName": "重点-测试",
"dimensionTag": "1499255834195238914重点-测试",
"nature": "01",
"name": "1212",
"statusRemark": "1212",
"scoreStand": "1212",
"source": "1212",
"weight": 0.3,
"status": "Y",
"remark": "-",
"index": 1,
"rowIndex": 0
},
{
"processId": "1499255834195238914",
"currentProcessInfoId": "1499255834245570561",
"flowType": "01",
"userName": "xxx",
"itcode": "xxx",
"pernr": "xxx",
"approveStatus": "01",
"dimensionName": "日常-测试",
"dimensionTag": "1499255834195238914日常-测试",
"nature": "01",
"name": "TEST",
"statusRemark": "100",
"scoreStand": "100",
"source": "100",
"weight": 0.3,
"status": "Y",
"remark": "-",
"index": 1,
"rowIndex": 1
},
{
"processId": "1499255834195238914",
"currentProcessInfoId": "1499255834245570561",
"flowType": "01",
"userName": "xxx",
"itcode": "xxx",
"pernr": "xxx",
"approveStatus": "01",
"dimensionName": "日常-测试",
"dimensionTag": "1499255834195238914日常-测试",
"nature": "01",
"name": "12",
"statusRemark": "12",
"scoreStand": "12",
"source": "12",
"weight": 0.3,
"status": "Y",
"remark": "-",
"index": 1,
"rowIndex": 2
},
{
"processId": "1499255834195238914",
"currentProcessInfoId": "1499255834245570561",
"flowType": "01",
"userName": "xxx",
"itcode": "xxx",
"pernr": "xxx",
"approveStatus": "01",
"dimensionName": "管理指标",
"dimensionTag": "1499255834195238914管理指标",
"nature": "02",
"name": "12",
"statusRemark": "12",
"scoreStand": "12",
"source": "12",
"weight": 0.1,
"status": "Y",
"remark": "-",
"index": 1,
"rowIndex": 3
},
{
"processId": "1499255834996350977",
"currentProcessInfoId": null,
"flowType": "02",
"userName": "xxx",
"itcode": "xxx",
"pernr": "xxx",
"approveStatus": "00",
"dimensionName": "重点-测试",
"dimensionTag": "1499255834996350977重点-测试",
"nature": "01",
"name": "1212",
"statusRemark": "1212",
"scoreStand": "1212",
"source": "1212",
"weight": 0.3,
"status": "-",
"remark": "-",
"index": 2,
"rowIndex": 4
},
{
"processId": "1499255834996350977",
"currentProcessInfoId": null,
"flowType": "02",
"userName": "xxx",
"itcode": "xxx",
"pernr": "xxx",
"approveStatus": "00",
"dimensionName": "日常-测试",
"dimensionTag": "1499255834996350977日常-测试",
"nature": "01",
"name": "TEST",
"statusRemark": "100",
"scoreStand": "100",
"source": "100",
"weight": 0.3,
"status": "-",
"remark": "-",
"index": 2,
"rowIndex": 5
},
{
"processId": "1499255834996350977",
"currentProcessInfoId": null,
"flowType": "02",
"userName": "xxx",
"itcode": "xxx",
"pernr": "xxx",
"approveStatus": "00",
"dimensionName": "日常-测试",
"dimensionTag": "1499255834996350977日常-测试",
"nature": "01",
"name": "12",
"statusRemark": "12",
"scoreStand": "12",
"source": "12",
"weight": 0.3,
"status": "-",
"remark": "-",
"index": 2,
"rowIndex": 6
},
{
"processId": "1499255834996350977",
"currentProcessInfoId": null,
"flowType": "02",
"userName": "xxx",
"itcode": "xxx",
"pernr": "xxx",
"approveStatus": "00",
"dimensionName": "管理指标",
"dimensionTag": "1499255834996350977管理指标",
"nature": "02",
"name": "12",
"statusRemark": "12",
"scoreStand": "12",
"source": "12",
"weight": 0.1,
"status": "-",
"remark": "-",
"index": 2,
"rowIndex": 7
}
]
// 按照dimensionTag合并行
getDimensionNumber() {
this.dimensionIndexArr=[]
let DimensionObj={}
this.dataList.forEach((element, index)=> {
element.rowIndex=index
if (DimensionObj[element.dimensionTag]) {
DimensionObj[element.dimensionTag].push(index)
} else {
DimensionObj[element.dimensionTag]=[]
DimensionObj[element.dimensionTag].push(index)
}
})
for (let k in DimensionObj) {
if (DimensionObj[k].length > 1) {
this.dimensionIndexArr.push(DimensionObj[k])
}
}
},
// 按照processId合并行
getRecordNumber() {
this.recordIndexArr=[]
let OrderObj={}
this.dataList.forEach((element, index)=> {
element.rowIndex=index
if (OrderObj[element.processId]) {
OrderObj[element.processId].push(index)
} else {
OrderObj[element.processId]=[]
OrderObj[element.processId].push(index)
}
})
for (let k in OrderObj) {
if (OrderObj[k].length > 1) {
this.recordIndexArr.push(OrderObj[k])
}
}
},
objectSpanMethod({row, column, rowIndex, columnIndex}) {
if (columnIndex===0 || columnIndex===1 || columnIndex >=9) {
for (let i=0; i < this.recordIndexArr.length; i++) {
let element=this.recordIndexArr[i]
for (let j=0; j < element.length; j++) {
let item=element[j]
if (rowIndex==item) {
if (j==0) {
return {
rowspan: element.length,
colspan: 1
}
} else if (j !=0) {
return {
rowspan: 0,
colspan: 0
}
}
}
}
}
}
if (columnIndex===2) {
for (let i=0; i < this.dimensionIndexArr.length; i++) {
let element=this.dimensionIndexArr[i]
for (let j=0; j < element.length; j++) {
let item=element[j]
if (rowIndex==item) {
if (j==0) {
return {
rowspan: element.length,
colspan: 1
}
} else if (j !=0) {
return {
rowspan: 0,
colspan: 0
}
}
}
}
}
}
},
样式错乱
<el-table
ref="table"
v-loading="dataListLoading"
:data="dataList"
border
:span-method="objectSpanMethod"
:row-class-name="tableRowClassName"
@cell-mouse-enter="cellMouseEnter"
@cell-mouse-leave="cellMouseLeave"
style="width: 100%;margin-top: 16px"
>
.......
</el-table>
tableRowClassName({row, rowIndex}) {
let arr=this.hoverOrderArr
for (let i=0; i < arr.length; i++) {
if (rowIndex===arr[i]) {
return 'success-row'
}
}
},
cellMouseEnter(row, column, cell, event) {
this.rowIndex=row.rowIndex
this.hoverOrderArr=[]
this.recordIndexArr.forEach((element)=> {
if (element.indexOf(this.rowIndex) >=0) {
this.hoverOrderArr=element
}
})
},
cellMouseLeave(row, column, cell, event) {
this.rowIndex='-1'
this.hoverOrderArr=[]
},
<style scoped>
/deep/ .el-table .success-row {
background: #ecf4fe;
}
</style>
、在计算机桌面的Wps演示图标上双击鼠标左键,将其打开运行。如图所示;
2、在打开的Wps演示程序窗口,打开“插入”菜单选项卡,并点击插入工具栏中的“公式”选项按钮。如图所示;
3、点击公式选项后,会打开“公式编辑器”对话框。如图所示;
4、在公式编辑器对话框中,选择一个四行一列的矩阵。如图所示;
5、接着在编辑器中输入文字信息,不要按回车键换行,可以利用tab键换行。如图所示;
6、4行文字输入完成,鼠标点击右侧,在输入右边的文字。如图所示:
7、文字输入好以后,关闭公式编辑器,输入的内容就会自动显示在Wps演示中。如图所示;
*请认真填写需求信息,我们会在24小时内与您取得联系。