diff --git a/package-lock.json b/package-lock.json index 704a976..2fdf155 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4906,6 +4906,11 @@ "jest-regex-util": "^23.3.0" } }, + "expose-loader": { + "version": "0.7.5", + "resolved": "http://r.cnpmjs.org/expose-loader/download/expose-loader-0.7.5.tgz", + "integrity": "sha1-4p6i2a7u0yVKP6obNfUC25+cP28=" + }, "express": { "version": "4.16.3", "resolved": "http://r.cnpmjs.org/express/download/express-4.16.3.tgz", @@ -8361,6 +8366,11 @@ "topo": "3.x.x" } }, + "jquery": { + "version": "3.3.1", + "resolved": "http://r.cnpmjs.org/jquery/download/jquery-3.3.1.tgz", + "integrity": "sha1-lYzinoHJeQ8xvneS311NlfxX+8o=" + }, "js-base64": { "version": "2.4.9", "resolved": "http://r.cnpmjs.org/js-base64/download/js-base64-2.4.9.tgz", diff --git a/package.json b/package.json index 1da66cd..c3d6727 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,9 @@ "@types/html2canvas": "0.0.33", "@types/jspdf": "^1.1.31", "abab": "^2.0.0", + "expose-loader": "^0.7.5", "html2canvas": "^1.0.0-alpha.12", - "jspdf": "^1.4.1", + "jquery": "^3.3.1", "vue": "^2.5.17", "vue-class-component": "^6.0.0", "vue-property-decorator": "^7.0.0", diff --git a/public/index.html b/public/index.html index c6e423c..156c8c2 100644 --- a/public/index.html +++ b/public/index.html @@ -1,17 +1,23 @@ - - - - - - table-summary - - - -
- - - + + + + + + + table-summary + + + + +
+ + + + + + \ No newline at end of file diff --git a/src/assets/hightlight.js b/src/assets/hightlight.js new file mode 100644 index 0000000..5ddac08 --- /dev/null +++ b/src/assets/hightlight.js @@ -0,0 +1,72 @@ +export function hightlight(table) { + var isMouseDown = false; + var startRowIndex = null; + var startCellIndex = null; + + function selectTo(cell) { + var row = cell.parent(); + var cellIndex = cell.index(); + var rowIndex = row.index(); + + var rowStart, rowEnd, cellStart, cellEnd; + + if (rowIndex < startRowIndex) { + rowStart = rowIndex; + rowEnd = startRowIndex; + } else { + rowStart = startRowIndex; + rowEnd = rowIndex; + } + + if (cellIndex < startCellIndex) { + cellStart = cellIndex; + cellEnd = startCellIndex; + } else { + cellStart = startCellIndex; + cellEnd = cellIndex; + } + + for (var i = rowStart; i <= rowEnd; i++) { + var rowCells = table + .find('tr') + .eq(i) + .find('td'); + for (var j = cellStart; j <= cellEnd; j++) { + rowCells.eq(j - 1).addClass('selected'); + } + } + } + + table + .find('td') + .mousedown(function(e) { + isMouseDown = true; + var cell = $(this); + + table.find('.selected').removeClass('selected'); // deselect everything + + if (e.shiftKey) { + selectTo(cell); + } else { + cell.addClass('selected'); + startCellIndex = cell.index(); + startRowIndex = cell.parent().index(); + } + + return false; // prevent text selection + }) + .mouseover(function() { + if (!isMouseDown) return; + table.find('.selected').removeClass('selected'); + selectTo($(this)); + }) + .bind('selectstart', function() { + return false; + }); + + $(document).mouseup(function() { + var text = $('.selected').text(); + console.log(text); + isMouseDown = false; + }); +} diff --git a/src/assets/methodTool.ts b/src/assets/methodTool.ts index 3d485c3..a3420f1 100644 --- a/src/assets/methodTool.ts +++ b/src/assets/methodTool.ts @@ -18,7 +18,6 @@ const orderDetailsKeys: string[] = []; const banCaiHeaderKeys: string[] = []; const banCaiDetailsKeys: string[] = []; const temRowHolder: string[] = []; -const banCaiTemplateIndexHolder = []; for (const key in data) { if (key !== 'boards') { orderDetailsKeys.push(key); @@ -97,7 +96,7 @@ const Tool = { } that.selectedCell = 9000; }, - addTotalAmount: (query) => { + addTotalAmount: (query: string) => { let total = 0; const query1 = query.slice(5); for (const board of data.boards) { diff --git a/src/assets/typeScriptDeclaration.ts b/src/assets/typeScriptDeclaration.ts index 36557ff..e69de29 100644 --- a/src/assets/typeScriptDeclaration.ts +++ b/src/assets/typeScriptDeclaration.ts @@ -1,5 +0,0 @@ -export class typeScriptDeclaration { - name: string; - rollNo: string; - standard: number; -} diff --git a/src/components/reportTemplate/ReportTemplate.vue b/src/components/reportTemplate/ReportTemplate.vue index ad8e0c9..9068c6d 100644 --- a/src/components/reportTemplate/ReportTemplate.vue +++ b/src/components/reportTemplate/ReportTemplate.vue @@ -2,10 +2,10 @@
- +
- +
@@ -59,14 +59,14 @@ {{selectedRow}}
- - -
- -
-
{{this.infos}}
+ +
+ +
+
{{this.infos}}
+ diff --git a/tslint.json b/tslint.json index 2b37e40..70e7043 100644 --- a/tslint.json +++ b/tslint.json @@ -1,12 +1,8 @@ { "defaultSeverity": "warning", - "extends": [ - "tslint:recommended" - ], + "extends": ["tslint:recommended"], "linterOptions": { - "exclude": [ - "node_modules/**" - ] + "exclude": ["node_modules/**"] }, "rules": { "quotemark": [true, "single"],