报表
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-04-15 10:49:13
|
||||
* @LastEditTime: 2024-06-20 20:46:53
|
||||
* @LastEditTime: 2024-06-21 15:18:20
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -57,8 +57,8 @@
|
||||
<el-button type="primary" size="small" plain @click="handleExport">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
|
||||
:table-data="tableData">
|
||||
<base-table :span-method="objectSpanMethod" :table-props="tableProps" :page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize" :table-data="tableData">
|
||||
</base-table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -86,7 +86,7 @@ export default {
|
||||
return {
|
||||
factoryList,
|
||||
factoryArray,
|
||||
|
||||
currentMenu:'邯郸',
|
||||
listQuery: {
|
||||
pageNo: 1,
|
||||
pageSize: 999,
|
||||
@@ -147,7 +147,7 @@ export default {
|
||||
otherProps:[],
|
||||
tableData: [],
|
||||
xAxis: [],
|
||||
currentMenu:null,
|
||||
// currentMenu:null,
|
||||
lineData: {},
|
||||
data: {}
|
||||
// proLineList: [],
|
||||
@@ -200,6 +200,35 @@ export default {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||
let spanOneArr = [], concatOne = 0;
|
||||
// let spanTwoArr = [], concatTwo = 0;
|
||||
|
||||
this.tableData.map((item, index) => {
|
||||
// console.log(inde);
|
||||
if (index === 0) {
|
||||
spanOneArr.push(1);
|
||||
} else {
|
||||
//第一列需合并相同内容的判断条件
|
||||
if (item.type === this.tableData[index - 1].type) {
|
||||
spanOneArr[concatOne] += 1;
|
||||
spanOneArr.push(0);
|
||||
} else {
|
||||
spanOneArr.push(1);
|
||||
concatOne = index;
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
if (columnIndex === 1) {
|
||||
const _row = spanOneArr[rowIndex];
|
||||
const _col = _row > 0 ? 1 : 0;
|
||||
return {
|
||||
rowspan: _row,
|
||||
colspan: _col
|
||||
}
|
||||
}
|
||||
},
|
||||
getYear(e) {
|
||||
if (this.listQuery.end - this.listQuery.start > 10 * 365 * 24 * 60 * 60 * 1000) {
|
||||
this.$message({
|
||||
@@ -288,7 +317,7 @@ export default {
|
||||
this.currentMenu === '邯郸' ? arr.push(1) : arr.push(2)
|
||||
this.listQuery.factory = arr
|
||||
const res = await getComprehensiveDataPage(this.listQuery)
|
||||
this.tableData = res.data.list
|
||||
// this.tableData = res.data.list
|
||||
let dataArr = [{
|
||||
type: '芯片',
|
||||
item: 'FTO投入',
|
||||
@@ -412,7 +441,7 @@ export default {
|
||||
// this.chartMsg.xData.push(ele.titleValue)
|
||||
this.otherProps.push({
|
||||
label: ele.titleValue,
|
||||
props: 'value' + i
|
||||
prop: 'value' + i
|
||||
})
|
||||
})
|
||||
console.log(this.otherProps)
|
||||
@@ -456,6 +485,7 @@ export default {
|
||||
// props: 'value' + index + 1,
|
||||
// })
|
||||
})
|
||||
console.log(dataArr);
|
||||
if (res.data.length === 0) {
|
||||
this.tableData = []
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user