Skip to content

Commit 7969b6d

Browse files
committed
refine code
1 parent 3488930 commit 7969b6d

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Diff for: src/router/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ const ErrorLog = _import('errlog/index');
4646

4747
/* excel */
4848
const ExcelDownload = _import('excel/index');
49-
const SelectExcelDownload = _import('excel/excel2');
49+
const SelectExcelDownload = _import('excel/selectExcel');
5050

5151
/* theme */
5252
const Theme = _import('theme/index');
5353

54-
/* example*/
54+
/* example */
5555
const TableLayout = _import('example/table/index');
5656
const DynamicTable = _import('example/table/dynamictable');
5757
const Table = _import('example/table/table');

Diff for: src/views/excel/excel2.vue renamed to src/views/excel/selectExcel.vue

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
<template>
22
<div class="app-container">
33
<el-button style='margin-bottom:20px;float:right' type="primary" icon="document" @click="handleDownload">导出excel</el-button>
4-
<el-table :data="list" v-loading.body="listLoading" element-loading-text="拼命加载中" border fit highlight-current-row
5-
@selection-change="handleSelectionChange" ref="multipleTable">
4+
5+
<el-table :data="list" v-loading.body="listLoading" element-loading-text="拼命加载中" border fit highlight-current-row @selection-change="handleSelectionChange" ref="multipleTable">
66
<el-table-column type="selection" align="center"></el-table-column>
7+
78
<el-table-column align="center" label='ID' width="95">
89
<template scope="scope">
910
{{scope.$index}}
1011
</template>
1112
</el-table-column>
13+
1214
<el-table-column label="文章标题">
1315
<template scope="scope">
1416
{{scope.row.title}}
@@ -20,11 +22,13 @@
2022
<span>{{scope.row.author}}</span>
2123
</template>
2224
</el-table-column>
25+
2326
<el-table-column label="阅读数" width="105" align="center">
2427
<template scope="scope">
2528
{{scope.row.pageviews}}
2629
</template>
2730
</el-table-column>
31+
2832
<el-table-column align="center" prop="created_at" label="发布时间" width="200">
2933
<template scope="scope">
3034
<i class="el-icon-time"></i>
@@ -35,6 +39,7 @@
3539
</div>
3640
</template>
3741

42+
3843
<script>
3944
import { getList } from 'api/article';
4045
@@ -62,9 +67,7 @@
6267
},
6368
handleDownload() {
6469
require.ensure([], () => {
65-
const {
66-
export_json_to_excel
67-
} = require('vendor/Export2Excel');
70+
const { export_json_to_excel } = require('vendor/Export2Excel');
6871
const tHeader = ['序号', '文章标题', '作者', '阅读数', '发布时间'];
6972
const filterVal = ['id', 'title', 'author', 'pageviews', 'display_time'];
7073
const list = this.multipleSelection;
@@ -78,4 +81,4 @@
7881
}
7982
}
8083
};
81-
</script>
84+
</script>

0 commit comments

Comments
 (0)