@@ -48086,21 +48086,61 @@
48086
48086
48087
48087
48088
48088
methods: {
48089
+ exportData: function exportData(config) {
48090
+ var dataTable = this.$refs.table1;
48091
+ var table = dataTable.$children.filter(function (t) {
48092
+ return t.$el._prevClass.indexOf('el-table') !== -1;
48093
+ })[0];
48094
+ var data = dataTable.data;
48095
+ var columns = this.getColumns(table);
48096
+ var fields = columns.map(function (t) {
48097
+ return t.prop;
48098
+ });
48099
+ var fieldNames = columns.map(function (t) {
48100
+ return t.label;
48101
+ });
48102
+ if (config.filtered) {
48103
+ data = dataTable.tableData;
48104
+ }
48105
+ (0, _CsvExport2.default)(data, fields, fieldNames, config.fileName);
48106
+ },
48107
+ getColumns: function getColumns(tableEl) {
48108
+ var _this = this;
48109
+
48110
+ var arr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
48111
+
48112
+ if (!tableEl.$children.length) {
48113
+ return;
48114
+ }
48115
+ tableEl.$children.forEach(function (data) {
48116
+ if (!data.$children.length && data.prop) {
48117
+ arr.push(data);
48118
+ } else {
48119
+ _this.getColumns(data, arr);
48120
+ }
48121
+ });
48122
+ return arr;
48123
+ },
48089
48124
getActionsDef: function getActionsDef() {
48090
48125
var self = this;
48091
48126
return {
48092
48127
width: 5,
48093
48128
def: [{
48094
- name: 'new ',
48129
+ name: '导出原始数据 ',
48095
48130
handler: function handler() {
48096
- self.$message('new clicked');
48131
+ self.exportData({
48132
+ fileName: '原始数据'
48133
+ });
48097
48134
},
48098
48135
48099
- icon: 'plus '
48136
+ icon: 'upload '
48100
48137
}, {
48101
- name: 'import ',
48138
+ name: '导出排序和过滤后的数据 ',
48102
48139
handler: function handler() {
48103
- self.$message('import clicked');
48140
+ self.exportData({
48141
+ fileName: '排序和过滤后的数据',
48142
+ filtered: true
48143
+ });
48104
48144
},
48105
48145
48106
48146
icon: 'upload'
48150
48190
}];
48151
48191
},
48152
48192
getExportActionsDef: function getExportActionsDef() {
48153
- var _this = this;
48193
+ var _this2 = this;
48154
48194
48155
48195
var columns = ['room_no', 'cellphone', 'flow_no', 'state'];
48156
48196
var columnNames = ['房号', '电话号码', '订单号', '状态'];
@@ -48160,13 +48200,13 @@
48160
48200
def: [{
48161
48201
name: 'export all',
48162
48202
handler: function handler() {
48163
- (0, _CsvExport2.default)(_this .tableData1, columns, columnNames, '所有数据');
48203
+ (0, _CsvExport2.default)(_this2 .tableData1, columns, columnNames, '所有数据');
48164
48204
},
48165
48205
icon: 'plus'
48166
48206
}, {
48167
48207
name: 'export filtered',
48168
48208
handler: function handler() {
48169
- (0, _CsvExport2.default)(_this .filteredData, columns, columnNames, '过滤后的数据');
48209
+ (0, _CsvExport2.default)(_this2 .filteredData, columns, columnNames, '过滤后的数据');
48170
48210
},
48171
48211
icon: 'upload'
48172
48212
}]
48339
48379
return [];
48340
48380
}
48341
48381
},
48382
+ border: {
48383
+ type: Boolean,
48384
+ default: function _default() {
48385
+ return true;
48386
+ }
48387
+ },
48388
+ stripe: {
48389
+ type: Boolean,
48390
+ default: function _default() {
48391
+ return true;
48392
+ }
48393
+ },
48342
48394
actionsDef: {
48343
48395
type: Object,
48344
48396
default: function _default() {
49349
49401
},
49350
49402
attrs: {
49351
49403
"data": _vm.curTableData,
49352
- "border": " border" ,
49404
+ "border": _vm. border,
49353
49405
"fit": "fit",
49354
- "stripe": " stripe"
49406
+ "stripe": _vm. stripe
49355
49407
},
49356
49408
on: {
49357
49409
"sort-change": _vm.handleSort,
55631
55683
/* script */
55632
55684
__webpack_require__(156),
55633
55685
/* template */
55634
- __webpack_require__(157 ),
55686
+ __webpack_require__(158 ),
55635
55687
/* scopeId */
55636
55688
null,
55637
55689
/* cssModules */
55701
55753
55702
55754
var _CsvExport2 = _interopRequireDefault(_CsvExport);
55703
55755
55756
+ var _en = __webpack_require__(157);
55757
+
55758
+ var _en2 = _interopRequireDefault(_en);
55759
+
55760
+ var _locale = __webpack_require__(25);
55761
+
55762
+ var _locale2 = _interopRequireDefault(_locale);
55763
+
55704
55764
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
55705
55765
55766
+ _locale2.default.use(_en2.default);
55767
+
55706
55768
exports.default = {
55707
55769
name: 'app',
55708
55770
components: {
@@ -55855,6 +55917,108 @@
55855
55917
55856
55918
/***/ },
55857
55919
/* 157 */
55920
+ /***/ function(module, exports) {
55921
+
55922
+ 'use strict';
55923
+
55924
+ exports.__esModule = true;
55925
+ exports.default = {
55926
+ el: {
55927
+ colorpicker: {
55928
+ confirm: 'OK',
55929
+ clear: 'Clear'
55930
+ },
55931
+ datepicker: {
55932
+ now: 'Now',
55933
+ today: 'Today',
55934
+ cancel: 'Cancel',
55935
+ clear: 'Clear',
55936
+ confirm: 'OK',
55937
+ selectDate: 'Select date',
55938
+ selectTime: 'Select time',
55939
+ startDate: 'Start Date',
55940
+ startTime: 'Start Time',
55941
+ endDate: 'End Date',
55942
+ endTime: 'End Time',
55943
+ year: '',
55944
+ month1: 'Jan',
55945
+ month2: 'Feb',
55946
+ month3: 'Mar',
55947
+ month4: 'Apr',
55948
+ month5: 'May',
55949
+ month6: 'Jun',
55950
+ month7: 'Jul',
55951
+ month8: 'Aug',
55952
+ month9: 'Sep',
55953
+ month10: 'Oct',
55954
+ month11: 'Nov',
55955
+ month12: 'Dec',
55956
+ // week: 'week',
55957
+ weeks: {
55958
+ sun: 'Sun',
55959
+ mon: 'Mon',
55960
+ tue: 'Tue',
55961
+ wed: 'Wed',
55962
+ thu: 'Thu',
55963
+ fri: 'Fri',
55964
+ sat: 'Sat'
55965
+ },
55966
+ months: {
55967
+ jan: 'Jan',
55968
+ feb: 'Feb',
55969
+ mar: 'Mar',
55970
+ apr: 'Apr',
55971
+ may: 'May',
55972
+ jun: 'Jun',
55973
+ jul: 'Jul',
55974
+ aug: 'Aug',
55975
+ sep: 'Sep',
55976
+ oct: 'Oct',
55977
+ nov: 'Nov',
55978
+ dec: 'Dec'
55979
+ }
55980
+ },
55981
+ select: {
55982
+ loading: 'Loading',
55983
+ noMatch: 'No matching data',
55984
+ noData: 'No data',
55985
+ placeholder: 'Select'
55986
+ },
55987
+ cascader: {
55988
+ noMatch: 'No matching data',
55989
+ placeholder: 'Select'
55990
+ },
55991
+ pagination: {
55992
+ goto: 'Go to',
55993
+ pagesize: '/page',
55994
+ total: 'Total {total}',
55995
+ pageClassifier: ''
55996
+ },
55997
+ messagebox: {
55998
+ title: 'Message',
55999
+ confirm: 'OK',
56000
+ cancel: 'Cancel',
56001
+ error: 'Illegal input'
56002
+ },
56003
+ upload: {
56004
+ delete: 'Delete',
56005
+ preview: 'Preview',
56006
+ continue: 'Continue'
56007
+ },
56008
+ table: {
56009
+ emptyText: 'No Data',
56010
+ confirmFilter: 'Confirm',
56011
+ resetFilter: 'Reset',
56012
+ clearFilter: 'All'
56013
+ },
56014
+ tree: {
56015
+ emptyText: 'No Data'
56016
+ }
56017
+ }
56018
+ };
56019
+
56020
+ /***/ },
56021
+ /* 158 */
55858
56022
/***/ function(module, exports) {
55859
56023
55860
56024
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
0 commit comments