no message
Former-commit-id: 9593f54f182e94d413e0b4fc1fcd82a52a779178 Former-commit-id: fb046e79ef923ced449c8e313209963b7106bc9d Former-commit-id: 82dcc467d302e3b556b1c0dbcb43b6c0d29be11c
This commit is contained in:
@@ -17,25 +17,20 @@ function generateArray(table) {
|
|||||||
var rowspan = cell.getAttribute('rowspan');
|
var rowspan = cell.getAttribute('rowspan');
|
||||||
var cellValue = cell.innerText;
|
var cellValue = cell.innerText;
|
||||||
if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue;
|
if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue;
|
||||||
|
|
||||||
//Skip ranges
|
//Skip ranges
|
||||||
ranges.forEach(function (range) {
|
ranges.forEach(function (range) {
|
||||||
if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) {
|
if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) {
|
||||||
for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null);
|
for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//Handle Row Span
|
//Handle Row Span
|
||||||
if (rowspan || colspan) {
|
if (rowspan || colspan) {
|
||||||
rowspan = rowspan || 1;
|
rowspan = rowspan || 1;
|
||||||
colspan = colspan || 1;
|
colspan = colspan || 1;
|
||||||
ranges.push({s: {r: R, c: outRow.length}, e: {r: R + rowspan - 1, c: outRow.length + colspan - 1}});
|
ranges.push({s: {r: R, c: outRow.length}, e: {r: R + rowspan - 1, c: outRow.length + colspan - 1}});
|
||||||
}
|
};
|
||||||
;
|
|
||||||
|
|
||||||
//Handle Value
|
//Handle Value
|
||||||
outRow.push(cellValue !== "" ? cellValue : null);
|
outRow.push(cellValue !== "" ? cellValue : null);
|
||||||
|
|
||||||
//Handle Colspan
|
//Handle Colspan
|
||||||
if (colspan) for (var k = 0; k < colspan - 1; ++k) outRow.push(null);
|
if (colspan) for (var k = 0; k < colspan - 1; ++k) outRow.push(null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// 库
|
// 库
|
||||||
import Csv from './_csv'
|
import Csv from './_csv'
|
||||||
import ExportCsv from './_export-csv'
|
import ExportCsv from './_export-csv'
|
||||||
import * as excel from './_export2Excel'
|
import * as Excel from './_export2Excel'
|
||||||
export default {
|
export default {
|
||||||
install (Vue, options) {
|
install (Vue, options) {
|
||||||
Vue.prototype.$export = {
|
Vue.prototype.$export = {
|
||||||
@@ -29,7 +29,7 @@ export default {
|
|||||||
excel () {
|
excel () {
|
||||||
const tHeader = ['Id', 'Title', 'Author', 'Readings', 'Date']
|
const tHeader = ['Id', 'Title', 'Author', 'Readings', 'Date']
|
||||||
const data = []
|
const data = []
|
||||||
excel.export_json_to_excel(tHeader, data, 'demo')
|
Excel.export_json_to_excel(tHeader, data, 'demo')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user