|
@@ -95,6 +95,7 @@
|
|
-->
|
|
-->
|
|
<el-table
|
|
<el-table
|
|
:data="tableData"
|
|
:data="tableData"
|
|
|
|
+ :span-method="objectSpanMethod"
|
|
border
|
|
border
|
|
:header-cell-style="{background:'#eef1f6',color:'#606266', lineHeight: '30px'}"
|
|
:header-cell-style="{background:'#eef1f6',color:'#606266', lineHeight: '30px'}"
|
|
:cell-style="cellStyle"
|
|
:cell-style="cellStyle"
|
|
@@ -165,6 +166,7 @@
|
|
<el-table-column
|
|
<el-table-column
|
|
label="对象详情"
|
|
label="对象详情"
|
|
align="center"
|
|
align="center"
|
|
|
|
+ prop="btn"
|
|
>
|
|
>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
<el-button
|
|
@@ -185,7 +187,7 @@
|
|
<!-- @click="deleteObject(scope.$index, scope.row)">-->
|
|
<!-- @click="deleteObject(scope.$index, scope.row)">-->
|
|
<!-- </el-button>-->
|
|
<!-- </el-button>-->
|
|
<el-popconfirm
|
|
<el-popconfirm
|
|
- title="这是一段内容确定删除吗?"
|
|
|
|
|
|
+ title="确定删除吗?"
|
|
@onConfirm="deleteObject(scope.$index, scope.row)"
|
|
@onConfirm="deleteObject(scope.$index, scope.row)"
|
|
>
|
|
>
|
|
<el-button slot="reference" size="mini" icon="el-icon-delete"/>
|
|
<el-button slot="reference" size="mini" icon="el-icon-delete"/>
|
|
@@ -195,14 +197,14 @@
|
|
</el-table>
|
|
</el-table>
|
|
</section>
|
|
</section>
|
|
<!-- 分页 -->
|
|
<!-- 分页 -->
|
|
- <el-pagination
|
|
|
|
- @size-change="handleSizeChange"
|
|
|
|
- @current-change="handleCurrentChange"
|
|
|
|
- :current-page="currentPage"
|
|
|
|
- :page-sizes="pageSizes"
|
|
|
|
- :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"
|
|
|
|
- style="float:right;margin-top:10px;padding:2px 5px;">
|
|
|
|
- </el-pagination>
|
|
|
|
|
|
+<!-- <el-pagination-->
|
|
|
|
+<!-- @size-change="handleSizeChange"-->
|
|
|
|
+<!-- @current-change="handleCurrentChange"-->
|
|
|
|
+<!-- :current-page="currentPage"-->
|
|
|
|
+<!-- :page-sizes="pageSizes"-->
|
|
|
|
+<!-- :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"-->
|
|
|
|
+<!-- style="float:right;margin-top:10px;padding:2px 5px;">-->
|
|
|
|
+<!-- </el-pagination>-->
|
|
<exportExcel
|
|
<exportExcel
|
|
ref="export"
|
|
ref="export"
|
|
:values="values"
|
|
:values="values"
|
|
@@ -306,8 +308,10 @@
|
|
}],
|
|
}],
|
|
tableData: [],
|
|
tableData: [],
|
|
loading: false,
|
|
loading: false,
|
|
- needMergeArr: ['Name', 'LocalId', 'LocalName', 'CADID'],
|
|
|
|
|
|
+ needMergeArr: ['Name', 'LocalId', 'LocalName', 'CADID','btn'],
|
|
rowMergeArrs: {}
|
|
rowMergeArrs: {}
|
|
|
|
+ // needMergeArr: ['name', 'id'], // 有合并项的列
|
|
|
|
+ // rowMergeArrs: {}, // 包含需要一个或多个合并项信息的对象
|
|
}
|
|
}
|
|
},
|
|
},
|
|
components: {exportExcel, addRelationShip, editRelationShip},
|
|
components: {exportExcel, addRelationShip, editRelationShip},
|
|
@@ -335,10 +339,13 @@
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
// this.getSpanArr(this.tableData)
|
|
// this.getSpanArr(this.tableData)
|
|
- this.rowMergeArrs = this.rowMergeHandle(this.needMergeArr, this.tableData); // 处理数据
|
|
|
|
|
|
+
|
|
|
|
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ deepCopy(obj) {
|
|
|
|
+ return JSON.parse(JSON.stringify(obj))
|
|
|
|
+ },
|
|
init() {
|
|
init() {
|
|
this.loading = true
|
|
this.loading = true
|
|
let data = {
|
|
let data = {
|
|
@@ -350,27 +357,35 @@
|
|
};
|
|
};
|
|
relQuery(data, res => {
|
|
relQuery(data, res => {
|
|
this.filterTable(res)
|
|
this.filterTable(res)
|
|
- this.total = res.Total
|
|
|
|
|
|
+ // this.total = res.Total
|
|
this.loading = false
|
|
this.loading = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
filterTable(list) {
|
|
filterTable(list) {
|
|
- list.Content && list.Content.forEach(i => {
|
|
|
|
- i.ObjectInfo && i.ObjectInfo.forEach(j => {
|
|
|
|
- this.tableData.push({
|
|
|
|
- Name: i.Name,
|
|
|
|
- LocalName: i.LocalName,
|
|
|
|
- LocalId: i.LocalId,
|
|
|
|
- CADID: i.CADID,
|
|
|
|
- cName: j.Name,
|
|
|
|
- cLocalName: j.LocalName,
|
|
|
|
- cLocalId: j.LocalId,
|
|
|
|
- cCADID: j.CADID,
|
|
|
|
- Id: i.Id,
|
|
|
|
- cId: j.Id
|
|
|
|
|
|
+ let arr = []
|
|
|
|
+ if(list.Content.length) {
|
|
|
|
+ list.Content.forEach(i => {
|
|
|
|
+ i.ObjectInfo && i.ObjectInfo.forEach(j => {
|
|
|
|
+ arr.push({
|
|
|
|
+ Name: i.Name,
|
|
|
|
+ LocalName: i.LocalName,
|
|
|
|
+ LocalId: i.LocalId,
|
|
|
|
+ CADID: i.CADID,
|
|
|
|
+ cName: j.Name,
|
|
|
|
+ cLocalName: j.LocalName,
|
|
|
|
+ cLocalId: j.LocalId,
|
|
|
|
+ cCADID: j.CADID,
|
|
|
|
+ Id: i.Id,
|
|
|
|
+ cId: j.Id
|
|
|
|
+ })
|
|
})
|
|
})
|
|
})
|
|
})
|
|
- })
|
|
|
|
|
|
+ this.tableData = this.deepCopy(arr)
|
|
|
|
+ this.rowMergeArrs = this.rowMergeHandle(this.needMergeArr, this.tableData); // 处理数据
|
|
|
|
+ } else {
|
|
|
|
+ this.tableData = []
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
},
|
|
},
|
|
back() {
|
|
back() {
|
|
@@ -399,19 +414,23 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
relQuery(param, res => {
|
|
relQuery(param, res => {
|
|
|
|
+ this.filterTable(res)
|
|
console.log(res, '==object==')
|
|
console.log(res, '==object==')
|
|
})
|
|
})
|
|
},
|
|
},
|
|
addShip(index) {
|
|
addShip(index) {
|
|
|
|
+ let that = this
|
|
relAdd(index).then(res => {
|
|
relAdd(index).then(res => {
|
|
if (res.data.Result === "failure") {
|
|
if (res.data.Result === "failure") {
|
|
this.$message.error(res.data.Message);
|
|
this.$message.error(res.data.Message);
|
|
return false
|
|
return false
|
|
} else if (res.data.Result === "success") {
|
|
} else if (res.data.Result === "success") {
|
|
this.$message.success(res.data.Message);
|
|
this.$message.success(res.data.Message);
|
|
- this.$refs.addShipComponent.addShipDialog = false
|
|
|
|
this.init()
|
|
this.init()
|
|
-
|
|
|
|
|
|
+ that.$refs.addShipComponent.addShipDialog = false
|
|
|
|
+ that.$refs.addShipComponent.codeValue = ''
|
|
|
|
+ that.$refs.addShipComponent.ruleForm.codeList = [{value:''}]
|
|
|
|
+ that.$refs.addShipComponent.ruleForm.main = ''
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -450,45 +469,13 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // getSpanArr(data) {
|
|
|
|
- // for (let i = 0; i < data.length; i++) {
|
|
|
|
- // if (i === 0) {
|
|
|
|
- // this.spanArr.push(1);
|
|
|
|
- // this.pos = 0;
|
|
|
|
- //
|
|
|
|
- // } else {
|
|
|
|
- // if (
|
|
|
|
- // data[i].id === data[i - 1].id &&
|
|
|
|
- // data[i].name === data[i - 1].name &&
|
|
|
|
- // data[i].amount2 === data[i - 1].amount2 &&
|
|
|
|
- // data[i].amount1 === data[i - 1].amount1
|
|
|
|
- //
|
|
|
|
- // ) {
|
|
|
|
- // this.spanArr[this.pos] += 1;
|
|
|
|
- // this.spanArr.push(0);
|
|
|
|
- // } else {
|
|
|
|
- // this.spanArr.push(1);
|
|
|
|
- // this.pos = i;
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // objectSpanMethod({row, column, rowIndex, columnIndex}) {
|
|
|
|
- // if (columnIndex === 1 || columnIndex === 2 || columnIndex === 3) {
|
|
|
|
- // const _row = this.spanArr[rowIndex];
|
|
|
|
- // const _col = _row > 0 ? 1 : 0;
|
|
|
|
- // return {
|
|
|
|
- // rowspan: _row,
|
|
|
|
- // colspan: _col
|
|
|
|
- // };
|
|
|
|
- // }
|
|
|
|
- //
|
|
|
|
- // },
|
|
|
|
|
|
+
|
|
objectSpanMethod({row, column, rowIndex, columnIndex}) {
|
|
objectSpanMethod({row, column, rowIndex, columnIndex}) {
|
|
- if (column.property === 'Name') return this.mergeAction('Name', rowIndex, column)
|
|
|
|
- if (column.property === 'LocalName') return this.mergeAction('LocalName', rowIndex, column)
|
|
|
|
- if (column.property === 'LocalId') return this.mergeAction('LocalId', rowIndex, column)
|
|
|
|
- if (column.property === 'CADID') return this.mergeAction('CADID', rowIndex, column)
|
|
|
|
|
|
+ if (column.property === 'Name') return this.mergeAction('Name', rowIndex, column);
|
|
|
|
+ if (column.property === 'LocalId' && row.LocalId != undefined) return this.mergeAction('LocalId', rowIndex, column);
|
|
|
|
+ if (column.property === 'LocalName' && row.LocalName != undefined) return this.mergeAction('LocalName', rowIndex, column);
|
|
|
|
+ if (column.property === 'CADID' && row.CADID != undefined) return this.mergeAction('CADID', rowIndex, column);
|
|
|
|
+ if (column.property === 'btn') return this.mergeAction('Name', rowIndex, column);
|
|
},
|
|
},
|
|
mergeAction(val, rowIndex, colData) {
|
|
mergeAction(val, rowIndex, colData) {
|
|
let _row = this.rowMergeArrs[val].rowArr[rowIndex];
|
|
let _row = this.rowMergeArrs[val].rowArr[rowIndex];
|