From a1cc5c76776773d7eb9152470d1559bd156b4501 Mon Sep 17 00:00:00 2001 From: Maoqiang Zheng Date: Mon, 8 Oct 2018 17:36:24 +0800 Subject: [PATCH] restructured --- methodsBackUp.txt | 262 ++++++++++ src/assets/methodTool.ts | 67 +++ src/assets/templateInitialData.ts | 25 +- .../reportTemplate/ReportTemplate.vue | 458 +++++++----------- temdata.txt | 256 ---------- 5 files changed, 520 insertions(+), 548 deletions(-) create mode 100644 methodsBackUp.txt create mode 100644 src/assets/methodTool.ts delete mode 100644 temdata.txt diff --git a/methodsBackUp.txt b/methodsBackUp.txt new file mode 100644 index 0000000..e4a6f6b --- /dev/null +++ b/methodsBackUp.txt @@ -0,0 +1,262 @@ +// back up of redo and undo methods + +在computed 属性下的 redo 和undo + computed: { + rows(): any { + if (!isUpdateInfos) { + isUpdateInfos = true; + return this.infos; + } + // undo的时候 给this.infos 从新赋值之后 所有user input 都感知不到。 + for (const row of this.infos) { + for (const cellKey in row.cells) { + if (row.cells[cellKey].cellId === this.selectedCell) { + row.cells.splice(Number(cellKey), 1, { + cellId: this.selectedCell, + title: this.inputTitle, + colspan: this.inputColspan, + height: this.inputHeight, + textAlign: this.textAlign, + fontSize: this.fontSize, + fontStyle: this.fontStyle, + }); + } + } + } + // will not add to recordHistory if this.info is update by redo/undo button + if ( + isundoOrRedoClick === false && + this.recordHistory[this.recordHistory.length - 1] !== + JSON.stringify(this.infos) + ) { + this.recordHistory.push(JSON.stringify(this.infos)); + } else { + isundoOrRedoClick = false; + } + return this.infos; + }, + }, + + + undoHandler(): void { + if (undoRodoPointer === -1) { + undoRodoPointer = this.recordHistory.length - 1; + } + // this is to avoid JSON error on console log + if (undoRodoPointer === 0) { + return; + } + this.infos = JSON.parse(this.recordHistory[(undoRodoPointer -= 1)]); + isundoOrRedoClick = true; + isUpdateInfos = false; + }, + redoHandler() { + if (undoRodoPointer === -1) { + undoRodoPointer = this.recordHistory.length - 1; + } + // this is to avoid JSON error on console log + + if (undoRodoPointer === this.recordHistory.length - 1) { + return; + } + this.infos = JSON.parse(this.recordHistory[(undoRodoPointer += 1)]); + isundoOrRedoClick = true; + isUpdateInfos = false; + }, + //----------------------------------------------------------------------------- importdata函数备份----------------------------------------- + importData() { + const addOrderTitle = () => { + let foundMatchedString = false; + for (const row of this.infos) { + for (const cell of row.cells) { + for (const dataKey in data) { + if (dataKey === cell.title) { + foundMatchedString = true; + cell.title = this.data[dataKey]; + } + } + } + } + return foundMatchedString; + }; + const addBanCaiHeader = (board: any) => { + for (const row of this.infos) { + for (const cell of row.cells) { + if (board.hasOwnProperty(cell.title)) { + cell.title = board[cell.title]; + } + } + } + }; + const addBanCaiBody = (board: any) => { + const banCaiRowsHolder = []; + let index = 0; + for (const orderInfoDetails of board.boardInfos) { + const banCaiCellsHolder = []; + for (const eachDetail of Object.keys(orderInfoDetails)) { + // eachDetail === 每一条板材的信息 + for (const row of this.infos) { + for (const cell of row.cells) { + if (eachDetail === cell.title) { + index = this.infos.indexOf(row); + banCaiCellsHolder.push({ + cellId: (cellId += 1), + title: orderInfoDetails[eachDetail], + colspan: cell.colspan, + height: 30, + textAlign: 'center', + fontSize: 16, + fontStyle: 'normal', + }); + } + } + } + } + banCaiRowsHolder.push({ + rowId: (rowId += 1), + rowTitle: rowId.toString(), + cells: banCaiCellsHolder, + }); + } + + for (const banCaiRow of banCaiRowsHolder) { + if (banCaiRow.cells.length !== 0) { + this.infos.splice( + index + 1 + banCaiRowsHolder.indexOf(banCaiRow), + 0, + banCaiRow, + ); + } + } + if (index) { + this.infos.splice(index, 1); // 删除matched 的字段 + } + }; + const copyBanCaiHeader = () => { + const matchedRowIndexHolder = []; + const boardInfosKeysHolder = []; + for (const boardHeaderKey of Object.keys(data.boards[0])) { + if (boardInfosKeysHolder.indexOf(boardHeaderKey) === -1) { + boardInfosKeysHolder.push(boardHeaderKey); + } + } + for (const boardHeaderKey of Object.keys( + data.boards[0].boardInfos[0], + )) { + if (boardInfosKeysHolder.indexOf(boardHeaderKey) === -1) { + boardInfosKeysHolder.push(boardHeaderKey); + } + } + for (const row of this.infos) { + for (const cell of row.cells) { + if ( + boardInfosKeysHolder.indexOf(cell.title) !== -1 || + boardInfosKeysHolder.indexOf(cell.title.toString().slice(3)) !== + -1 + ) { + if ( + matchedRowIndexHolder.indexOf(this.infos.indexOf(row)) === -1 + ) { + matchedRowIndexHolder.push(this.infos.indexOf(row)); + } + break; + } + } + } + + const matchedRowHolder = []; + + for ( + let index = 0; + index <= matchedRowIndexHolder[matchedRowIndexHolder.length - 1]; + index += 1 + ) { + if ( + index >= matchedRowIndexHolder[0] && + index <= matchedRowIndexHolder[matchedRowIndexHolder.length - 1] + ) { + const matchedRow = JSON.parse(JSON.stringify(this.infos[index])); + matchedRow.rowId = ++rowId; + for (const cell of matchedRow.cells) { + cell.cellId = ++cellId; + } + matchedRowHolder.push(matchedRow); + } + } + return matchedRowHolder; + }; + const pasteBanCaiHeader = ( + items: Array<{ + rowId: number; + rowTitle: string; + cells: Array<{ + cellId: number; + title: string; + colspan: number; + height: number; + textAlign: string; + fontSize: number; + fontStyle: string; + }>; + }>, + ) => { + for (const item of items) { + for (const row of this.infos) { + if (row.cells.length === 0) { + this.infos.splice(this.infos.indexOf(row), 1, item); + break; + } + } + } + }; + const addSubTotal = ( + boardInfos: Array<{ + houseName: string; + closetName: string; + boardNo: string; + boardName: string; + length: number; + width: number; + thickness: number; + quantity: number; + area: number; + mutation: string; + shape: string; + direction: string; + stripe: string; + boardAddOn: string; + }>, + ) => { + let amountHolder = 0; + + for (const row of this.infos) { + for (const cell of row.cells) { + if (cell.title === 'subquantity') { + for (const eachBoardInfo of boardInfos) { + for (const detail in eachBoardInfo) { + if (detail === cell.title.slice(3)) { + amountHolder += eachBoardInfo[detail]; + } + } + } + cell.title = amountHolder.toString(); + } + } + } + }; + if (addOrderTitle()) { + addOrderTitle(); + for (const board of data.boards) { + const x = copyBanCaiHeader(); // 复制板材表头备用 + addBanCaiHeader(board); // 添加板材表头 + addBanCaiBody(board); // 添加板材表身 + addSubTotal(board.boardInfos); // 添加 小计 + // 添加 板材内的每一条信息 + if (data.boards.indexOf(board) !== data.boards.length - 1) { + pasteBanCaiHeader(x); + } + } + } else { + alert('没有找到匹配的orderTitle 字段'); + } + }, \ No newline at end of file diff --git a/src/assets/methodTool.ts b/src/assets/methodTool.ts new file mode 100644 index 0000000..278d64f --- /dev/null +++ b/src/assets/methodTool.ts @@ -0,0 +1,67 @@ +const Tool = { + addRow: (that, rowId) => { + if (that.selectedRow) { + for (const index in that.infos) { + if (that.selectedRow === that.infos[index].rowId) { + that.infos.splice(Number(index), 0, { + rowId: rowId, + rowTitle: rowId.toString(), + cells: [], + }); + that.selectedRow = 0; + break; + } + } + } else { + that.infos.push({ + rowId: (rowId += 1), + rowTitle: rowId.toString(), + cells: [], + }); + } + }, + deleteRow: (that) => { + if (!that.selectedRow) { + return alert('请选择要删除行'); + } + that.infos = that.infos.filter((item) => item.rowId !== that.selectedRow); + that.selectedRow = 0; + }, + addCell: (that, cellId) => { + if (!that.selectedRow) { + return alert('请选择要添加单元的行'); + } + for (const row of that.infos) { + if (that.selectedRow === row.rowId) { + row.cells.push({ + cellId: cellId, + title: '列' + cellId, + colspan: 0, + height: 30, + textAlign: 'center', + fontSize: 16, + fontStyle: 'normal', + }); + } + } + }, + + deleteCell: (that) => { + // 9000 is initial cell Id. + if (that.selectedCell === 9000) { + return alert('请选择要删除的单元'); + } + for (const row of that.infos) { + for (const cell in row.cells) { + if (row.cells[cell].cellId === that.selectedCell) { + row.cells.splice(Number(cell), 1); + } + } + } + that.selectedCell = 9000; + }, + copySingleRow: (Id: number) => { + Id += 1; + }, +}; +export { Tool }; diff --git a/src/assets/templateInitialData.ts b/src/assets/templateInitialData.ts index 3f79edc..8bc8a69 100644 --- a/src/assets/templateInitialData.ts +++ b/src/assets/templateInitialData.ts @@ -728,7 +728,30 @@ const initialTemplateData = [ }, ], }, - { rowId: 9, rowTitle: '9', cells: [] }, + { + rowId: 9, + rowTitle: '9', + cells: [ + { + cellId: 9050, + title: '总计:', + colspan: '10', + height: 30, + textAlign: 'right', + fontSize: 16, + fontStyle: 'bold', + }, + { + cellId: 9051, + title: 'totalquantity', + colspan: '14', + height: 30, + textAlign: 'center', + fontSize: 16, + fontStyle: 'normal', + }, + ], + }, { rowId: 10, rowTitle: '10', cells: [] }, { rowId: 11, rowTitle: '11', cells: [] }, { rowId: 12, rowTitle: '12', cells: [] }, diff --git a/src/components/reportTemplate/ReportTemplate.vue b/src/components/reportTemplate/ReportTemplate.vue index 1f85709..a9187e1 100644 --- a/src/components/reportTemplate/ReportTemplate.vue +++ b/src/components/reportTemplate/ReportTemplate.vue @@ -15,8 +15,8 @@
- - + +
@@ -41,10 +41,16 @@
- -
+
-

{{this.inputTitle}}

+ 选择板材头模板:
+ 开始:
+ 结束: + +
+ +
+

以下功能用于测试使用


@@ -67,8 +73,10 @@ import startUpRowColumn from '@/assets/startUpRowColumn'; // report template for import data from '@/assets/data'; // userdata for testing use import reportCell from './reportCell.vue'; import test from './orderTitle.vue'; +import { Tool } from '@/assets/methodTool'; +import { debug } from 'util'; -let rowId = 29; // this figure is for testing use +let rowId = 30; // this figure is for testing use let cellId = 9050; // this figure is for testing use let undoRodoPointer = -1; let isundoOrRedoClick = false; @@ -135,15 +143,13 @@ export default Vue.extend({ fontSize: 0, fontStyle: '', }, + banCaiHeadStartLine: 5, + banCaiHeadEndLine: 8, }; }, computed: { + // 感知所有的用户输入 并且更新data和dom rows(): any { - if (!isUpdateInfos) { - isUpdateInfos = true; - return this.infos; - } - // undo的时候 给this.infos 从新赋值之后 所有user input 都感知不到。 for (const row of this.infos) { for (const cellKey in row.cells) { if (row.cells[cellKey].cellId === this.selectedCell) { @@ -159,16 +165,7 @@ export default Vue.extend({ } } } - // will not add to recordHistory if this.info is update by redo/undo button - if ( - isundoOrRedoClick === false && - this.recordHistory[this.recordHistory.length - 1] !== - JSON.stringify(this.infos) - ) { - this.recordHistory.push(JSON.stringify(this.infos)); - } else { - isundoOrRedoClick = false; - } + return this.infos; }, }, @@ -193,78 +190,31 @@ export default Vue.extend({ this.fontStyle = this.currentCell.fontStyle; }, addRow() { - if (this.selectedRow) { - for (const index in this.infos) { - if (this.selectedRow === this.infos[index].rowId) { - this.infos.splice(Number(index), 0, { - rowId: (rowId += 1), - rowTitle: rowId.toString(), - cells: [], - }); - this.selectedRow = 0; - break; - } - } - } else { - this.infos.push({ - rowId: (rowId += 1), - rowTitle: rowId.toString(), - cells: [], - }); - } + Tool.addRow(this, rowId); + rowId += 1; }, deleteRow() { - if (!this.selectedRow) { - return alert('请选择要删除行'); - } - this.infos = this.infos.filter((item) => item.rowId !== this.selectedRow); - this.selectedRow = 0; + Tool.deleteRow(this); }, addCell() { - if (!this.selectedRow) { - return alert('请选择要添加单元的行'); - } - for (const row of this.infos) { - if (this.selectedRow === row.rowId) { - row.cells.push({ - cellId: (cellId += 1), - title: '列' + cellId, - colspan: 0, - height: 30, - textAlign: 'center', - fontSize: 16, - fontStyle: 'normal', - }); - } - } + Tool.addCell(this, cellId); + cellId += 1; }, deleteCell() { - // 9000 is initial cell Id. - if (this.selectedCell === 9000) { - return alert('请选择要删除的单元'); - } - for (const row of this.infos) { - for (const cell in row.cells) { - if (row.cells[cell].cellId === this.selectedCell) { - row.cells.splice(Number(cell), 1); - } - } - } - this.selectedCell = 9000; + Tool.deleteCell(this); }, copySingleRow(Id: number) { if (Id) { copiedRowHolder = JSON.parse( JSON.stringify( - this.infos.filter((eachRow) => eachRow.rowId === Id), - )[0], + this.infos.filter((eachRow) => eachRow.rowId === Id)[0], + ), ); - copiedRowHolder.rowId = ++rowId; - for (const cell of copiedRowHolder.cells) { cell.cellId = ++cellId; } + return copiedRowHolder; } else { alert('请选择要复制的行'); } @@ -283,226 +233,150 @@ export default Vue.extend({ rowClickHandler(row: any): void { this.selectedRow = row.rowId; }, - undoHandler(): void { - if (undoRodoPointer === -1) { - undoRodoPointer = this.recordHistory.length - 1; - } - // this is to avoid JSON error on console log - if (undoRodoPointer === 0) { - return; - } - this.infos = JSON.parse(this.recordHistory[(undoRodoPointer -= 1)]); - isundoOrRedoClick = true; - isUpdateInfos = false; - }, - redoHandler() { - if (undoRodoPointer === -1) { - undoRodoPointer = this.recordHistory.length - 1; - } - // this is to avoid JSON error on console log + copyBanCaiHeadTemplate() { + let temStartLine = Number(this.banCaiHeadStartLine); + let banCaiHeadTemplateHolder = []; - if (undoRodoPointer === this.recordHistory.length - 1) { - return; + while (temStartLine <= Number(this.banCaiHeadEndLine)) { + banCaiHeadTemplateHolder.push( + this.copySingleRow(this.infos[temStartLine].rowId), + ); + temStartLine += 1; + } + return banCaiHeadTemplateHolder; + }, + pasteBanCaiHeadTemplate(copyBanCaiTemplate) { + const temCopyBanCaiTemplate = copyBanCaiTemplate; + for (const banCaiRow of temCopyBanCaiTemplate) { + for (const row of this.infos) { + if (row.cells.length === 0) { + this.infos.splice(this.infos.indexOf(row), 0, banCaiRow); + break; + } + } + } + }, + copyBanCaiBodyTemplate() { + for (const row of this.infos) { + for (const cell of row.cells) { + if ( + Object.keys(data.boards[0].boardInfos[0]).indexOf(cell.title) !== -1 + ) { + return this.infos.indexOf(row); + break; + } + } + } + }, + pasteBanCaiBodyTemplate(boardIndex) { + const boardInfosTemplateHolder = []; + const copyBanCaiBodyTemplateIndex = this.copyBanCaiBodyTemplate(); + + for (let i = 0; i < data.boards[boardIndex].boardInfos.length; i++) { + boardInfosTemplateHolder.push( + this.copySingleRow(this.infos[copyBanCaiBodyTemplateIndex].rowId), + ); + } + + for (let i = 0; i < boardInfosTemplateHolder.length; i++) { + for (const cell of boardInfosTemplateHolder[i].cells) { + for (const key in data.boards[boardIndex].boardInfos[i]) { + if (key === cell.title) { + cell.title = data.boards[boardIndex].boardInfos[i][key]; + } + } + } + } + + this.infos.splice(copyBanCaiBodyTemplateIndex, 1); + for (let i = 0; i < boardInfosTemplateHolder.length; i++) { + this.infos.splice( + copyBanCaiBodyTemplateIndex + i, + 0, + boardInfosTemplateHolder[i], + ); } - this.infos = JSON.parse(this.recordHistory[(undoRodoPointer += 1)]); - isundoOrRedoClick = true; - isUpdateInfos = false; }, importData() { - const addOrderTitle = () => { - let foundMatchedString = false; - for (const row of this.infos) { - for (const cell of row.cells) { - for (const dataKey in data) { - if (dataKey === cell.title) { - foundMatchedString = true; - cell.title = this.data[dataKey]; - } - } - } + const orderDetailsKeys = []; + const banCaiHeaderKeys = []; + const banCaiDetailsKeys = []; + const temRowHolder = []; + const banCaiTemplateIndexHolder = []; + for (const key in data) { + if (key !== 'boards') { + orderDetailsKeys.push(key); } - return foundMatchedString; - }; - const addBanCaiHeader = (board: any) => { - for (const row of this.infos) { - for (const cell of row.cells) { - if (board.hasOwnProperty(cell.title)) { - cell.title = board[cell.title]; - } - } - } - }; - const addBanCaiBody = (board: any) => { - const banCaiRowsHolder = []; - let index = 0; - for (const orderInfoDetails of board.boardInfos) { - const banCaiCellsHolder = []; - for (const eachDetail of Object.keys(orderInfoDetails)) { - // eachDetail === 每一条板材的信息 - for (const row of this.infos) { - for (const cell of row.cells) { - if (eachDetail === cell.title) { - index = this.infos.indexOf(row); - banCaiCellsHolder.push({ - cellId: (cellId += 1), - title: orderInfoDetails[eachDetail], - colspan: cell.colspan, - height: 30, - textAlign: 'center', - fontSize: 16, - fontStyle: 'normal', - }); - } - } - } - } - banCaiRowsHolder.push({ - rowId: (rowId += 1), - rowTitle: rowId.toString(), - cells: banCaiCellsHolder, - }); - } - - for (const banCaiRow of banCaiRowsHolder) { - if (banCaiRow.cells.length !== 0) { - this.infos.splice( - index + 1 + banCaiRowsHolder.indexOf(banCaiRow), - 0, - banCaiRow, - ); - } - } - if (index) { - this.infos.splice(index, 1); // 删除matched 的字段 - } - }; - const copyBanCaiHeader = () => { - const matchedRowIndexHolder = []; - const boardInfosKeysHolder = []; - for (const boardHeaderKey of Object.keys(data.boards[0])) { - if (boardInfosKeysHolder.indexOf(boardHeaderKey) === -1) { - boardInfosKeysHolder.push(boardHeaderKey); - } - } - for (const boardHeaderKey of Object.keys( - data.boards[0].boardInfos[0], - )) { - if (boardInfosKeysHolder.indexOf(boardHeaderKey) === -1) { - boardInfosKeysHolder.push(boardHeaderKey); - } - } - for (const row of this.infos) { - for (const cell of row.cells) { - if ( - boardInfosKeysHolder.indexOf(cell.title) !== -1 || - boardInfosKeysHolder.indexOf(cell.title.toString().slice(3)) !== - -1 - ) { - if ( - matchedRowIndexHolder.indexOf(this.infos.indexOf(row)) === -1 - ) { - matchedRowIndexHolder.push(this.infos.indexOf(row)); - } - break; - } - } - } - - const matchedRowHolder = []; - - for ( - let index = 0; - index <= matchedRowIndexHolder[matchedRowIndexHolder.length - 1]; - index += 1 - ) { - if ( - index >= matchedRowIndexHolder[0] && - index <= matchedRowIndexHolder[matchedRowIndexHolder.length - 1] - ) { - const matchedRow = JSON.parse(JSON.stringify(this.infos[index])); - matchedRow.rowId = ++rowId; - for (const cell of matchedRow.cells) { - cell.cellId = ++cellId; - } - matchedRowHolder.push(matchedRow); - } - } - return matchedRowHolder; - }; - const pasteBanCaiHeader = ( - items: Array<{ - rowId: number; - rowTitle: string; - cells: Array<{ - cellId: number; - title: string; - colspan: number; - height: number; - textAlign: string; - fontSize: number; - fontStyle: string; - }>; - }>, - ) => { - for (const item of items) { - for (const row of this.infos) { - if (row.cells.length === 0) { - this.infos.splice(this.infos.indexOf(row), 1, item); - break; - } - } - } - }; - const addSubTotal = ( - boardInfos: Array<{ - houseName: string; - closetName: string; - boardNo: string; - boardName: string; - length: number; - width: number; - thickness: number; - quantity: number; - area: number; - mutation: string; - shape: string; - direction: string; - stripe: string; - boardAddOn: string; - }>, - ) => { - let amountHolder = 0; - - for (const row of this.infos) { - for (const cell of row.cells) { - if (cell.title === 'subquantity') { - for (const eachBoardInfo of boardInfos) { - for (const detail in eachBoardInfo) { - if (detail === cell.title.slice(3)) { - amountHolder += eachBoardInfo[detail]; - } - } - } - cell.title = amountHolder.toString(); - } - } - } - }; - if (addOrderTitle()) { - addOrderTitle(); - for (const board of data.boards) { - const x = copyBanCaiHeader(); // 复制板材表头备用 - addBanCaiHeader(board); // 添加板材表头 - addBanCaiBody(board); // 添加板材表身 - addSubTotal(board.boardInfos); // 添加 小计 - // 添加 板材内的每一条信息 - if (data.boards.indexOf(board) !== data.boards.length - 1) { - pasteBanCaiHeader(x); - } - } - } else { - alert('没有找到匹配的orderTitle 字段'); } + for (const key in data.boards[0]) { + if (key !== 'boardInfos') { + banCaiHeaderKeys.push(key); + } + } + for (const key in data.boards[0].boardInfos[0]) { + banCaiDetailsKeys.push(key); + } + + const orderDetails = () => { + for (const row of this.infos) { + for (const cell of row.cells) { + if (orderDetailsKeys.indexOf(cell.title) !== -1) { + cell.title = data[cell.title]; + } + } + } + }; + + const banCaiHeader = (index) => { + for (const row of this.infos) { + for (const cell of row.cells) { + if (banCaiHeaderKeys.indexOf(cell.title) !== -1) { + if (temRowHolder.indexOf(row) === -1) { + temRowHolder.push(this.copySingleRow(row.rowId)); + } + + cell.title = data.boards[index][cell.title]; + } + } + } + }; + + const subQuantityMatch = (query) => { + for (const row of this.infos) { + for (const cell of row.cells) { + if (cell.title === query) { + cell.title = '单个板材数量'; + } + } + } + }; + const totalQuantityMatch = (query) => { + for (const row of this.infos) { + for (const cell of row.cells) { + if (cell.title === query) { + cell.title = '总共板材数量'; + } + } + } + }; + + // 复制板材的模板 + const copyBanCaiTemplate = []; + for (let i = 0; i < data.boards.length - 1; i++) { + copyBanCaiTemplate.push(this.copyBanCaiHeadTemplate()); + } + + // orderDetails(); + for (let i = 0; i < data.boards.length - 1; i++) { + banCaiHeader(i); + this.pasteBanCaiBodyTemplate(i); + subQuantityMatch('subquantity'); + this.pasteBanCaiHeadTemplate(copyBanCaiTemplate[i]); + banCaiHeader(i + 1); + this.pasteBanCaiBodyTemplate(i + 1); + subQuantityMatch('subquantity'); + } + totalQuantityMatch('totalquantity'); }, // for testing use -----import data from other file @@ -565,3 +439,5 @@ table { } + + diff --git a/temdata.txt b/temdata.txt deleted file mode 100644 index cd9d5bb..0000000 --- a/temdata.txt +++ /dev/null @@ -1,256 +0,0 @@ - [ { "rowId": "行0", "cells": [ { "cellId": 1, "title": "1" }, { "cellId": 2, "title": "2" }, { "cellId": 3, "title": "3" }, { "cellId": 4, "title": "4" }, { "cellId": 5, "title": "5" }, { "cellId": 6, "title": "6" }, { "cellId": 7, "title": "7" }, { "cellId": 8, "title": "8" }, { "cellId": 9, "title": "9" }, { "cellId": 10, "title": "10" }, { "cellId": 11, "title": "11" }, { "cellId": 12, "title": "12" }, { "cellId": 13, "title": "13" }, { "cellId": 14, "title": "14" }, { "cellId": 15, "title": "15" }, { "cellId": 16, "title": "16" }, { "cellId": 17, "title": "17" }, { "cellId": 18, "title": "18" }, { "cellId": 19, "title": "19" }, { "cellId": 20, "title": "20" }, { "cellId": 21, "title": "21" }, { "cellId": 22, "title": "22" }, { "cellId": 23, "title": "23" }, { "cellId": 24, "title": "24" } ] }, { "rowId": "1", "cells": [ { "title": "板材明细单", "colspan": "24", "cellId": 9001, "height": 30, "textAlign": "center", "fontSize": "49", "fontStyle": "bold" } ] }, { "rowId": "2", "cells": [ { "title": "订单号: 101808023922", "colspan": "8", "cellId": 9002, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "normal" }, { "title": "客户名称:SongQingyang3", "colspan": "8", "cellId": 9003, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "normal" }, { "title": "销售日期:2018-08-23", "colspan": "8", "cellId": 9004, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "normal" } ] }, { "rowId": "3", "cells": [ { "title": "联系人: K01", "colspan": "8", "cellId": 9005, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "normal" }, { "title": "联系电话:12345678901", "colspan": "8", "cellId": 9006, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "normal" }, { "title": "送货地址:D01", "colspan": "8", "cellId": 9007, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "normal" } ] }, { "rowId": "4", "cells": [ { "title": "备 注: 测试PTP-G刀偏置", "colspan": "8", "cellId": 9008, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "normal" } ] }, { "rowId": "6", "cells": [ { "title": "材料:颗粒板", "colspan": "8", "cellId": 9009, "height": 30, "textAlign": "left", "fontSize": "16", "fontStyle": "bold" }, { "title": "颜色:暖白", "colspan": "8", "cellId": 9010, "height": 30, "textAlign": "left", "fontSize": "16", "fontStyle": "bold" }, { "title": "共15条记录", "colspan": "8", "cellId": 9011, "height": 30, "textAlign": "left", "fontSize": "16", "fontStyle": "bold" } ] }, { "rowId": "8", "cells": [ { "title": "房名", "colspan": "2", "cellId": 9012, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "bold" }, { "title": "柜名", "colspan": 0, "cellId": 9013, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "bold" }, { "title": "板编号", "colspan": "2", "cellId": 9014, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "bold" }, { "title": "板名称", "colspan": "2", "cellId": 9015, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "bold" }, { "title": "开料长", "colspan": 0, "cellId": 9016, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "bold" }, { "title": "开料宽", "colspan": 0, "cellId": 9017, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "bold" }, { "title": "厚度", "colspan": 0, "cellId": 9018, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "bold" }, { "title": "数量", "colspan": 0, "cellId": 9019, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "bold" }, { "title": "面积", "colspan": 0, "cellId": 9020, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "bold" }, { "title": "异形", "colspan": 0, "cellId": 9021, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "bold" }, { "title": "造型", "colspan": 0, "cellId": 9022, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "bold" }, { "title": "左/右/上/下", "colspan": "3", "cellId": 9023, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "bold" }, { "title": "纹路", "colspan": "2", "cellId": 9024, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "bold" }, { "title": "备注", "colspan": "5", "cellId": 9025, "height": 30, "textAlign": "center", "fontSize": "16", "fontStyle": "bold" } ] }, { "rowId": "9", "cells": [] }, { "rowId": "10", "cells": [] }, { "rowId": "11", "cells": [] }, { "rowId": "12", "cells": [] }, { "rowId": "13", "cells": [] }, { "rowId": "14", "cells": [] }, { "rowId": "15", "cells": [] }, { "rowId": "16", "cells": [] }, { "rowId": "17", "cells": [] }, { "rowId": "18", "cells": [] }, { "rowId": "19", "cells": [] }, { "rowId": "20", "cells": [] }, { "rowId": "21", "cells": [] }, { "rowId": "22", "cells": [] }, { "rowId": "23", "cells": [] }, { "rowId": "24", "cells": [] }, { "rowId": "25", "cells": [] }, { "rowId": "26", "cells": [] }, { "rowId": "27", "cells": [] }, { "rowId": "28", "cells": [] }, { "rowId": "29", "cells": [] }, { "rowId": 30, "cells": [] } ] - - - /*[ - { - rowId: 0, - cells: [ - { - cellId: 1, - title: '1', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 2, - title: '2', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 3, - title: '3', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 4, - title: '4', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 5, - title: '5', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 6, - title: '6', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 7, - title: '7', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 8, - title: '8', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 9, - title: '9', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 10, - title: '10', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 11, - title: '11', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 12, - title: '12', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 13, - title: '13', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 14, - title: '14', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 15, - title: '15', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 16, - title: '16', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 17, - title: '17', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 18, - title: '18', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 19, - title: '19', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 20, - title: '20', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 21, - title: '21', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 22, - title: '22', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 23, - title: '23', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - { - cellId: 24, - title: '24', - colspan: 0, - height: 30, - textAlign: 'left', - fontSize: 16, - fontStyle: 'normal', - }, - ], - }, - { rowId: 1, cells: [] }, - { rowId: 2, cells: [] }, - { rowId: 3, cells: [] }, - { rowId: 4, cells: [] }, - { rowId: 5, cells: [] }, - { rowId: 6, cells: [] }, - { rowId: 7, cells: [] }, - { rowId: 8, cells: [] }, - { rowId: 9, cells: [] }, - { rowId: 10, cells: [] }, - { rowId: 11, cells: [] }, - { rowId: 12, cells: [] }, - { rowId: 13, cells: [] }, - { rowId: 14, cells: [] }, - { rowId: 15, cells: [] }, - { rowId: 16, cells: [] }, - { rowId: 17, cells: [] }, - { rowId: 18, cells: [] }, - { rowId: 19, cells: [] }, - { rowId: 20, cells: [] }, - { rowId: 21, cells: [] }, - { rowId: 22, cells: [] }, - { rowId: 23, cells: [] }, - { rowId: 24, cells: [] }, - { rowId: 25, cells: [] }, - { rowId: 26, cells: [] }, - { rowId: 27, cells: [] }, - { rowId: 28, cells: [] }, - { rowId: 29, cells: [] }, -]; -*/ \ No newline at end of file