修改bug
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-04-18 15:07:53
|
||||
* @LastEditTime: 2024-04-23 16:42:58
|
||||
* @LastEditTime: 2024-04-24 09:58:07
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<el-table show-summary :header-cell-style="{
|
||||
<el-table :header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266'
|
||||
}" class="baseTable" :max-height="tableH" id="exportTable" :data="tableData" style="width: 100%"
|
||||
:span-method="objectSpanMethod">
|
||||
<el-table-column v-for="item in tableProps" :prop="item.prop" :label="item.label" align="center">
|
||||
}" class="baseTable" border id="exportTable" :data="tableData" style="width: 100%" :span-method="objectSpanMethod">
|
||||
<el-table-column :width="item.width" v-for="item in tableProps" :prop="item.prop" :label="item.label"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
||||
@@ -49,11 +49,13 @@ const tableProps = [
|
||||
// },
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线'
|
||||
label: '产线',
|
||||
width:'150',
|
||||
},
|
||||
{
|
||||
prop: 'dataType',
|
||||
label: ''
|
||||
label: '',
|
||||
width: '150',
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
@@ -69,7 +71,7 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'rate',
|
||||
label: '占比',
|
||||
label: '占比%',
|
||||
// filter: (val) => val == false ? '不合格' : '合格',
|
||||
},
|
||||
// {
|
||||
@@ -121,7 +123,7 @@ export default {
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
// format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: "timestamp",
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
@@ -179,34 +181,6 @@ export default {
|
||||
console.log(res)
|
||||
this.formConfig[1].selectOptions = res.data
|
||||
},
|
||||
getSummaries(param) {
|
||||
console.log(columns)
|
||||
|
||||
const { columns, data } = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计';
|
||||
return;
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
sums[index] += ' ';
|
||||
} else {
|
||||
sums[index] = '-';
|
||||
}
|
||||
});
|
||||
|
||||
return sums;
|
||||
},
|
||||
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||
let spanOneArr = [], concatOne = 0;
|
||||
let spanTwoArr = [], concatTwo = 0;
|
||||
@@ -276,7 +250,7 @@ export default {
|
||||
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
||||
new Blob([wbout], { type: "application/octet-stream" }),
|
||||
//设置导出文件名称
|
||||
"原片各线堆垛表.xlsx"
|
||||
"原片各线优化切割堆垛表.xlsx"
|
||||
);
|
||||
} catch (e) {
|
||||
if (typeof console !== "undefined") console.log(e, wbout);
|
||||
@@ -319,7 +293,7 @@ export default {
|
||||
type: ele.type,
|
||||
pieces: ele.pieces,
|
||||
area: ele.area,
|
||||
rate: ele.rate
|
||||
rate: (ele.rate * 100).toFixed(2)
|
||||
// useNum: ele.useNum,
|
||||
// num: ele.num,
|
||||
// size: typeof (ele.size)
|
||||
@@ -412,13 +386,14 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.baseTable .el-table__body tr.current-row>td.el-table__cell {
|
||||
<style scoped>
|
||||
::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell {
|
||||
background-color: #EAF1FC;
|
||||
}
|
||||
|
||||
.baseTable .el-table .el-table__cell {
|
||||
::v-deep .baseTable .el-table .el-table__cell {
|
||||
padding: 0;
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user