解决导出不全等问题

This commit is contained in:
庞东林
2021-12-14 20:25:50 +08:00
parent d37d3a7230
commit 5a30d9ca4c
12 changed files with 81 additions and 20 deletions

View File

@@ -6,7 +6,6 @@
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/> <search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
<!-- 表格 --> <!-- 表格 -->
<ele-pro-table <ele-pro-table
v-model:selection="selectionList"
ref="table" ref="table"
:loading="loading" :loading="loading"
:datasource="datasource" :datasource="datasource"
@@ -145,7 +144,7 @@ export default {
const arr = []; const arr = [];
const th = columns.map((item) => item.title); const th = columns.map((item) => item.title);
arr.push(th); arr.push(th);
this.data.forEach((d) => { this.datasource.forEach((d) => {
const td = columns.map((item) => d[item.dataIndex]); const td = columns.map((item) => d[item.dataIndex]);
arr.push(td); arr.push(td);
}); });

View File

@@ -6,7 +6,6 @@
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/> <search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
<!-- 表格 --> <!-- 表格 -->
<ele-pro-table <ele-pro-table
v-model:selection="selectionList"
ref="table" ref="table"
:datasource="datasource" :datasource="datasource"
:columns="columns" :columns="columns"
@@ -60,6 +59,13 @@ export default {
selection: [], selection: [],
// 表格列配置 // 表格列配置
columns: [ columns: [
{
key: 'index',
dataIndex: 'index',
width: 48,
align: 'center',
customRender: ({index}) => index + 1
},
{title: "监测时间", dataIndex: "monitorTime", sorter: true,}, {title: "监测时间", dataIndex: "monitorTime", sorter: true,},
{title: "类别", dataIndex: "type", sorter: true,}, {title: "类别", dataIndex: "type", sorter: true,},
{title: "点位名称", dataIndex: "pointName", sorter: true,}, {title: "点位名称", dataIndex: "pointName", sorter: true,},
@@ -125,7 +131,7 @@ export default {
const arr = []; const arr = [];
const th = columns.map((item) => item.title); const th = columns.map((item) => item.title);
arr.push(th); arr.push(th);
this.data.forEach((d) => { this.datasource.forEach((d) => {
const td = columns.map((item) => d[item.dataIndex]); const td = columns.map((item) => d[item.dataIndex]);
arr.push(td); arr.push(td);
}); });

View File

@@ -6,7 +6,6 @@
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/> <search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
<!-- 表格 --> <!-- 表格 -->
<ele-pro-table <ele-pro-table
v-model:selection="selectionList"
ref="table" ref="table"
:datasource="datasource" :datasource="datasource"
:columns="columns" :columns="columns"
@@ -61,6 +60,13 @@ export default {
selection: [], selection: [],
// 表格列配置 // 表格列配置
columns: [ columns: [
{
key: 'index',
dataIndex: 'index',
width: 48,
align: 'center',
customRender: ({index}) => index + 1
},
{title: "监测时间", dataIndex: "monitorTime", sorter: true,}, {title: "监测时间", dataIndex: "monitorTime", sorter: true,},
{title: "类别", dataIndex: "type", sorter: true,}, {title: "类别", dataIndex: "type", sorter: true,},
{title: "点位名称", dataIndex: "pointName", sorter: true,}, {title: "点位名称", dataIndex: "pointName", sorter: true,},
@@ -129,7 +135,7 @@ export default {
const arr = []; const arr = [];
const th = columns.map((item) => item.title); const th = columns.map((item) => item.title);
arr.push(th); arr.push(th);
this.data.forEach((d) => { this.datasource.forEach((d) => {
const td = columns.map((item) => d[item.dataIndex]); const td = columns.map((item) => d[item.dataIndex]);
arr.push(td); arr.push(td);
}); });

View File

@@ -6,7 +6,6 @@
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/> <search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
<!-- 表格 --> <!-- 表格 -->
<ele-pro-table <ele-pro-table
v-model:selection="selectionList"
ref="table" ref="table"
:datasource="datasource" :datasource="datasource"
:columns="columns" :columns="columns"
@@ -187,6 +186,13 @@ export default {
}) })
} }
this.columns = [ this.columns = [
{
key: 'index',
dataIndex: 'index',
width: 48,
align: 'center',
customRender: ({index}) => index + 1
},
{ title: "类别", dataIndex: "type", sorter: true }, { title: "类别", dataIndex: "type", sorter: true },
{ title: "点位名称", dataIndex: "pointName", sorter: true}, { title: "点位名称", dataIndex: "pointName", sorter: true},
...addCloumns ...addCloumns
@@ -237,7 +243,7 @@ export default {
arr.push(th1) arr.push(th1)
arr.push(th2) arr.push(th2)
this.data.forEach((d) => { this.datasource.forEach((d) => {
const td = this.sColumns.map((item) => d[item.dataIndex]); const td = this.sColumns.map((item) => d[item.dataIndex]);
arr.push(td); arr.push(td);
}); });

View File

@@ -24,6 +24,13 @@ const innerFilterColumns = [
] ]
const innerTableColumns = [ const innerTableColumns = [
{
key: 'index',
dataIndex: 'index',
width: 48,
align: 'center',
customRender: ({index}) => index + 1
},
{title: "监测时间", dataIndex: "monitorTime", sorter: true,}, {title: "监测时间", dataIndex: "monitorTime", sorter: true,},
{title: "断面名称", dataIndex: "pointName", sorter: true,}, {title: "断面名称", dataIndex: "pointName", sorter: true,},
{title: "水温(℃)", dataIndex: "waterTemperature", sorter: true,}, {title: "水温(℃)", dataIndex: "waterTemperature", sorter: true,},
@@ -53,6 +60,13 @@ const innerTableColumns = [
]; ];
const averageTableColumns = [ const averageTableColumns = [
{
key: 'index',
dataIndex: 'index',
width: 48,
align: 'center',
customRender: ({index}) => index + 1
},
{title: "监测时间", dataIndex: "monitorTime", sorter: true,}, {title: "监测时间", dataIndex: "monitorTime", sorter: true,},
{title: "断面名称", dataIndex: "pointName", sorter: true,}, {title: "断面名称", dataIndex: "pointName", sorter: true,},
{title: "水温(℃)", dataIndex: "waterTemperature", sorter: true,}, {title: "水温(℃)", dataIndex: "waterTemperature", sorter: true,},

View File

@@ -6,12 +6,12 @@
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/> <search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
<!-- 表格 --> <!-- 表格 -->
<ele-pro-table <ele-pro-table
v-model:selection="selectionList"
ref="table" ref="table"
:datasource="datasource" :datasource="datasource"
:columns="columns" :columns="columns"
:loading="loading" :loading="loading"
:where="where" :where="where"
row-key="lakeLibraryInnerCityId"
:scroll="{ x: 'max-content' }" :scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)" @done="(d) => (data = d.data)"
> >
@@ -156,7 +156,7 @@ export default {
const arr = []; const arr = [];
const th = columns.map((item) => item.title); const th = columns.map((item) => item.title);
arr.push(th); arr.push(th);
this.data.forEach((d) => { this.datasource.forEach((d) => {
const td = columns.map((item) => d[item.dataIndex]); const td = columns.map((item) => d[item.dataIndex]);
arr.push(td); arr.push(td);
}); });

View File

@@ -6,7 +6,6 @@
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/> <search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
<!-- 表格 --> <!-- 表格 -->
<ele-pro-table <ele-pro-table
v-model:selection="selectionList"
ref="table" ref="table"
:loading="loading" :loading="loading"
:datasource="datasource" :datasource="datasource"
@@ -144,7 +143,7 @@ export default {
const arr = []; const arr = [];
const th = columns.map((item) => item.title); const th = columns.map((item) => item.title);
arr.push(th); arr.push(th);
this.data.forEach((d) => { this.datasource.forEach((d) => {
const td = columns.map((item) => d[item.dataIndex]); const td = columns.map((item) => d[item.dataIndex]);
arr.push(td); arr.push(td);
}); });

View File

@@ -6,7 +6,6 @@
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/> <search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
<!-- 表格 --> <!-- 表格 -->
<ele-pro-table <ele-pro-table
v-model:selection="selectionList"
ref="table" ref="table"
:datasource="datasource" :datasource="datasource"
:columns="columns" :columns="columns"
@@ -61,6 +60,13 @@ export default {
selection: [], selection: [],
// 表格列配置 // 表格列配置
columns: [ columns: [
{
key: 'index',
dataIndex: 'index',
width: 48,
align: 'center',
customRender: ({index}) => index + 1
},
{title: "监测时间", dataIndex: "monitorTime", sorter: true,}, {title: "监测时间", dataIndex: "monitorTime", sorter: true,},
{title: "类别", dataIndex: "type", sorter: true,}, {title: "类别", dataIndex: "type", sorter: true,},
{title: "点位名称", dataIndex: "pointName", sorter: true,}, {title: "点位名称", dataIndex: "pointName", sorter: true,},
@@ -126,7 +132,7 @@ export default {
const arr = []; const arr = [];
const th = columns.map((item) => item.title); const th = columns.map((item) => item.title);
arr.push(th); arr.push(th);
this.data.forEach((d) => { this.datasource.forEach((d) => {
const td = columns.map((item) => d[item.dataIndex]); const td = columns.map((item) => d[item.dataIndex]);
arr.push(td); arr.push(td);
}); });

View File

@@ -6,7 +6,6 @@
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/> <search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
<!-- 表格 --> <!-- 表格 -->
<ele-pro-table <ele-pro-table
v-model:selection="selectionList"
ref="table" ref="table"
:datasource="datasource" :datasource="datasource"
:columns="columns" :columns="columns"
@@ -61,6 +60,13 @@ export default {
selection: [], selection: [],
// 表格列配置 // 表格列配置
columns: [ columns: [
{
key: 'index',
dataIndex: 'index',
width: 48,
align: 'center',
customRender: ({index}) => index + 1
},
{title: "监测时间", dataIndex: "monitorTime", sorter: true,}, {title: "监测时间", dataIndex: "monitorTime", sorter: true,},
{title: "类别", dataIndex: "type", sorter: true,}, {title: "类别", dataIndex: "type", sorter: true,},
{title: "点位名称", dataIndex: "pointName", sorter: true,}, {title: "点位名称", dataIndex: "pointName", sorter: true,},
@@ -129,7 +135,7 @@ export default {
const arr = []; const arr = [];
const th = columns.map((item) => item.title); const th = columns.map((item) => item.title);
arr.push(th); arr.push(th);
this.data.forEach((d) => { this.datasource.forEach((d) => {
const td = columns.map((item) => d[item.dataIndex]); const td = columns.map((item) => d[item.dataIndex]);
arr.push(td); arr.push(td);
}); });

View File

@@ -6,7 +6,6 @@
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/> <search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
<!-- 表格 --> <!-- 表格 -->
<ele-pro-table <ele-pro-table
v-model:selection="selectionList"
ref="table" ref="table"
:datasource="datasource" :datasource="datasource"
:columns="columns" :columns="columns"
@@ -187,6 +186,13 @@ export default {
}) })
} }
this.columns = [ this.columns = [
{
key: 'index',
dataIndex: 'index',
width: 48,
align: 'center',
customRender: ({index}) => index + 1
},
{ title: "类别", dataIndex: "type", sorter: true }, { title: "类别", dataIndex: "type", sorter: true },
{ title: "点位名称", dataIndex: "pointName", sorter: true}, { title: "点位名称", dataIndex: "pointName", sorter: true},
...addCloumns ...addCloumns
@@ -237,7 +243,7 @@ export default {
arr.push(th1) arr.push(th1)
arr.push(th2) arr.push(th2)
this.data.forEach((d) => { this.datasource.forEach((d) => {
const td = this.sColumns.map((item) => d[item.dataIndex]); const td = this.sColumns.map((item) => d[item.dataIndex]);
arr.push(td); arr.push(td);
}); });

View File

@@ -24,6 +24,13 @@ const innerFilterColumns = [
] ]
const innerTableColumns = [ const innerTableColumns = [
{
key: 'index',
dataIndex: 'index',
width: 48,
align: 'center',
customRender: ({index}) => index + 1
},
{title: "监测时间", dataIndex: "monitorTime", sorter: true,}, {title: "监测时间", dataIndex: "monitorTime", sorter: true,},
{title: "断面名称", dataIndex: "pointName", sorter: true,}, {title: "断面名称", dataIndex: "pointName", sorter: true,},
{title: "水温(℃)", dataIndex: "waterTemperature", sorter: true,}, {title: "水温(℃)", dataIndex: "waterTemperature", sorter: true,},
@@ -53,6 +60,13 @@ const innerTableColumns = [
]; ];
const averageTableColumns = [ const averageTableColumns = [
{
key: 'index',
dataIndex: 'index',
width: 48,
align: 'center',
customRender: ({index}) => index + 1
},
{title: "监测时间", dataIndex: "monitorTime", sorter: true,}, {title: "监测时间", dataIndex: "monitorTime", sorter: true,},
{title: "断面名称", dataIndex: "pointName", sorter: true,}, {title: "断面名称", dataIndex: "pointName", sorter: true,},
{title: "水温(℃)", dataIndex: "waterTemperature", sorter: true,}, {title: "水温(℃)", dataIndex: "waterTemperature", sorter: true,},

View File

@@ -6,7 +6,6 @@
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/> <search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
<!-- 表格 --> <!-- 表格 -->
<ele-pro-table <ele-pro-table
v-model:selection="selectionList"
ref="table" ref="table"
row-key="lakeLibrarySpecialId" row-key="lakeLibrarySpecialId"
:datasource="datasource" :datasource="datasource"
@@ -157,7 +156,7 @@ export default {
const arr = []; const arr = [];
const th = columns.map((item) => item.title); const th = columns.map((item) => item.title);
arr.push(th); arr.push(th);
this.data.forEach((d) => { this.datasource.forEach((d) => {
const td = columns.map((item) => d[item.dataIndex]); const td = columns.map((item) => d[item.dataIndex]);
arr.push(td); arr.push(td);
}); });