|
@@ -612,6 +612,49 @@ export default {
|
|
|
sheet['!cols'] = columnWidths.map(width => ({
|
|
|
wch: width + 2
|
|
|
}))
|
|
|
+ const borderStyle = {
|
|
|
+ style: 'medium',
|
|
|
+ color: {
|
|
|
+ rgb: 'FFFFFF'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const reg = /^[A-Z]+([\d]+$)/
|
|
|
+ for (const key in sheet) {
|
|
|
+ const match = reg.test(key)
|
|
|
+ if (match) {
|
|
|
+ const columnIndex = reg.exec(key)[1]
|
|
|
+ let cellStyle = {
|
|
|
+ alignment: {
|
|
|
+ horizontal: 'center',
|
|
|
+ vertical: 'center'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (Number(columnIndex) === 1) {
|
|
|
+ cellStyle = {
|
|
|
+ ...cellStyle,
|
|
|
+ border: {
|
|
|
+ top: borderStyle,
|
|
|
+ right: borderStyle,
|
|
|
+ bottom: borderStyle,
|
|
|
+ left: borderStyle
|
|
|
+ },
|
|
|
+ font: {
|
|
|
+ color: {
|
|
|
+ rgb: 'FFFFFF'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fill: {
|
|
|
+ fgColor: {
|
|
|
+ rgb: '3366FF'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sheet[key].s = cellStyle
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // console.log(sheet)
|
|
|
+ // return
|
|
|
const workBook = XLSX.utils.book_new()
|
|
|
XLSX.utils.book_append_sheet(workBook, sheet, '扫描节点与位置分析')
|
|
|
const tableWrite = XLSX_STYLE.write(workBook, {
|