|
@@ -14,13 +14,12 @@
|
|
|
<div class="main"
|
|
|
:style="tableData && tableData.length?'height: calc(100% - 96px);':'height: calc(100% - 46px);'">
|
|
|
<el-table ref="multipleTable" :data="tableData" v-loading='loading' stripe height="100%"
|
|
|
- @selection-change="handleSelectionChange" :header-cell-style="headerStyle">
|
|
|
+ @selection-change="handleSelectionChange" :header-cell-style="headerStyle" :row-class-name="getRowClassName">
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
<el-table-column type="expand">
|
|
|
<template slot-scope="props">
|
|
|
<p v-if="props.row.ComponentCount && props.row.ComponentCount.length"
|
|
|
style="color:#99a9bf;line-height:32px;font-size:14px;">包含的部件:</p>
|
|
|
- <p v-else style="color:#99a9bf;line-height:32px;font-size:14px;">无部件信息</p>
|
|
|
<el-form label-position="left" label-width="auto" inline class="demo-table-expand"
|
|
|
v-if="props.row.ComponentCount && props.row.ComponentCount.length">
|
|
|
<el-form-item v-for="item in props.row.ComponentCount?props.row.ComponentCount:[]" :key="item.code"
|
|
@@ -267,6 +266,11 @@ export default {
|
|
|
}
|
|
|
return params
|
|
|
},
|
|
|
+ getRowClassName({row, rowIndex}){
|
|
|
+ if (!(row.ComponentCount && row.ComponentCount.length)) {
|
|
|
+ return 'row-expand-cover';
|
|
|
+ }
|
|
|
+ },
|
|
|
//选择的设备或部件
|
|
|
handleSelectionChange(val) {
|
|
|
this.multipleSelection = val;
|
|
@@ -347,6 +351,10 @@ export default {
|
|
|
color: #99a9bf;
|
|
|
}
|
|
|
|
|
|
+.row-expand-cover .el-table__expand-icon{
|
|
|
+ visibility:hidden;
|
|
|
+}
|
|
|
+
|
|
|
.demo-table-expand .el-form-item {
|
|
|
margin-right: 0;
|
|
|
margin-bottom: 0;
|