-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from VisActor/7-feature-refactor-sparklines-spec
7 feature refactor sparklines spec
- Loading branch information
Showing
18 changed files
with
244 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import * as VTable from '../../src'; | ||
const Table_CONTAINER_DOM_ID = 'vTable'; | ||
const generatePersons = count => { | ||
return Array.from(new Array(count)).map((_, i) => ({ | ||
id: i + 1, | ||
email1: `${i + 1}@xxx.com`, | ||
name: `小明${i + 1}`, | ||
lastName: '王', | ||
date1: '2022年9月1日', | ||
tel: '000-0000-0000', | ||
sex: i % 2 === 0 ? 'boy' : 'girl', | ||
work: i % 2 === 0 ? 'back-end engineer' : 'front-end engineer', | ||
city: 'beijing' | ||
})); | ||
}; | ||
|
||
const records = generatePersons(1000000); | ||
const columns: VTable.ColumnsDefine = [ | ||
{ | ||
field: 'id', | ||
caption: 'ID', | ||
width: 120, | ||
sort: true | ||
}, | ||
{ | ||
field: 'email1', | ||
caption: 'email', | ||
width: 200, | ||
sort: true | ||
}, | ||
{ | ||
caption: 'full name', | ||
columns: [ | ||
{ | ||
field: 'name', | ||
caption: 'First Name', | ||
width: 200 | ||
}, | ||
{ | ||
field: 'name', | ||
caption: 'Last Name', | ||
width: 200 | ||
} | ||
] | ||
}, | ||
{ | ||
field: 'date1', | ||
caption: 'birthday', | ||
width: 200 | ||
}, | ||
{ | ||
field: 'sex', | ||
caption: 'sex', | ||
width: 100 | ||
}, | ||
{ | ||
field: 'tel', | ||
caption: 'telephone', | ||
width: 150 | ||
}, | ||
{ | ||
field: 'work', | ||
caption: 'job', | ||
width: 200 | ||
}, | ||
{ | ||
field: 'city', | ||
caption: 'city', | ||
width: 150 | ||
} | ||
]; | ||
const option = { | ||
parentElement: document.getElementById(Table_CONTAINER_DOM_ID), | ||
records, | ||
columns | ||
}; | ||
const tableInstance = new VTable.ListTable(option); | ||
window.tableInstance = tableInstance; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.