diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..051ef60 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +**/*.ejs diff --git a/app/electron.js b/app/electron.js index 5c1a5be..282ee42 100644 --- a/app/electron.js +++ b/app/electron.js @@ -42,15 +42,15 @@ function createMainWindow () { const installExtension = require('electron-devtools-installer') installExtension.default(installExtension.VUEJS_DEVTOOLS) - .then(name => win.webContents.openDevTools()) - .catch(err => console.log('An error occurred: ', err)) + .then(name => win.webContents.openDevTools()) + .catch(err => console.log('An error occurred: ', err)) } win.on('closed', () => { console.log('触发 closed') mainWindow = null backgroundWindow = null - // 在Mac中完全退出程序,而不会留在dock中 + // 在Mac中完全退出程序,而不会留在dock中 app.quit() }) diff --git a/app/main.ejs b/app/main.ejs index 4933287..e6ba9e8 100644 --- a/app/main.ejs +++ b/app/main.ejs @@ -2,16 +2,16 @@ - - - - <%= htmlWebpackPlugin.options.title %> - + + + + <%= htmlWebpackPlugin.options.title %> + -
- +
+ - \ No newline at end of file + diff --git a/app/src/background/excelUtils.js b/app/src/background/excelUtils.js index 8df6b54..1d489be 100644 --- a/app/src/background/excelUtils.js +++ b/app/src/background/excelUtils.js @@ -42,23 +42,23 @@ Excel.prototype = { return {} }, readByData (data) { - // 用于前端上传文件,如:上传按钮和拖拽上传 + // 用于前端上传文件,如:上传按钮和拖拽上传 this.workbook = xlsx.read(data, { type: 'binary' }) }, readByPath (filename) { - // 用于 Node 直接通过路径读取文件 + // 用于 Node 直接通过路径读取文件 this.workbook = xlsx.readFile(filename) }, initData () { - // 表名列表 + // 表名列表 this.sheetNameList = this.workbook.SheetNames - // 插入每个sheet的数据(json格式) + // 插入每个sheet的数据(json格式) this.sheetNameList.forEach((curSheetName, index) => { this[curSheetName] = xlsx.utils.sheet_to_json(this.workbook.Sheets[curSheetName]) }) - // 获取表头 + // 获取表头 this.sheetNameList.forEach((curSheetName, index) => { const curSheetData = this.workbook.Sheets[curSheetName] const scope = this.workbook.Sheets[curSheetName]['!ref'].split(':') // A1 F5 @@ -87,14 +87,14 @@ Excel.prototype = { wbTem = null }) sheetNameList = null - // console.log(finalWB) + // console.log(finalWB) ipcRenderer.send('sync-saveFile-dialog', { filename: '过滤后的文件.xlsx', data: finalWB }) - // console.log(xlsx.writeFile(finalWB, fileName)) // Node导出 - // let wbout = XLSX.write(finalWB, {bookType:'xlsx', bookSST:false, type: 'binary'}); - // saveAs(new Blob([s2ab(wbout)],{type:'application/octet-stream'}), fileName) + // console.log(xlsx.writeFile(finalWB, fileName)) // Node导出 + // let wbout = XLSX.write(finalWB, {bookType:'xlsx', bookSST:false, type: 'binary'}); + // saveAs(new Blob([s2ab(wbout)],{type:'application/octet-stream'}), fileName) }, jsonToWBForOneSheet (json, colkeys, sheetName) { diff --git a/app/src/background/filterUtils.js b/app/src/background/filterUtils.js index b78ac56..a8c14f8 100644 --- a/app/src/background/filterUtils.js +++ b/app/src/background/filterUtils.js @@ -17,11 +17,11 @@ const filterUtils = { } return this.filterUnit({ operator, curVal, target }) }, - // 双列范围逻辑的【非or、and】,即表单3.1 + // 双列范围逻辑的【非or、and】,即表单3.1 filterByDoubleColsRange ({ row, colKeys, filterCol, operator, target, needConformColIndex }) { let passCounter = 0 - // 判断每列中是否有一列符合单一逻辑,即3.1 + // 判断每列中是否有一列符合单一逻辑,即3.1 for (let i = 0, len = filterCol.length; i < len; i++) { const selectKey = filterCol[i] const curKey = colKeys[selectKey] @@ -40,9 +40,9 @@ const filterUtils = { } return false }, - // 第二个表单:多列运算逻辑 + // 第二个表单:多列运算逻辑 filterByMultiColCalc ({ row, colKeys, filterCol, operator, target, colOperator }) { - // 此处 filterCol 是数组 + // 此处 filterCol 是数组 const rowCalcResult = this.calcMultiCol({ row, colOperator, @@ -56,7 +56,7 @@ const filterUtils = { target }) }, - // 计算每行是否符合要求 + // 计算每行是否符合要求 calcMultiCol ({ row, colOperator, colKeys, filterCol }) { let calcResult diff --git a/app/src/background/index.html b/app/src/background/index.html index d058907..f2270e1 100644 --- a/app/src/background/index.html +++ b/app/src/background/index.html @@ -1,9 +1,14 @@ - + - + + - \ No newline at end of file + diff --git a/app/src/background/index.js b/app/src/background/index.js index 7b0b2e1..b029d6c 100644 --- a/app/src/background/index.js +++ b/app/src/background/index.js @@ -14,14 +14,14 @@ let filRow = {} window.addEventListener('load', event => { ipcRenderer.on('readFile-start', (event, { data, activeSheetIndex }) => { - /* excelData 的数据结构 - { - sheetNameN: [] 所有行 - sheetNameN_headers: [] 所有列标题 - sheetNameList: [] - workbook: {} Excel 相关 - } - */ + /* excelData 的数据结构 + { + sheetNameN: [] 所有行 + sheetNameN_headers: [] 所有列标题 + sheetNameList: [] + workbook: {} Excel 相关 + } + */ excelData = new Excel().init(data) oriRow = {} filRow = {} @@ -124,7 +124,7 @@ function filterHandler ({ filterTagList, filterWay, uniqueCols }) { const tagLogicChar = cTag.logicOperator === 'and' ? '&&' : '||' let groupExpStr = '' - // 遍历当前组的 filters + // 遍历当前组的 filters cFilters.forEach((cF, index) => { const filterLogicChar = cF.logicOperator === 'and' ? '&&' : '||' const filterType = cF.filterType diff --git a/app/src/components/FirstScreenPageView/ColSelDialog.vue b/app/src/components/FirstScreenPageView/ColSelDialog.vue index e20c7ff..197aec9 100644 --- a/app/src/components/FirstScreenPageView/ColSelDialog.vue +++ b/app/src/components/FirstScreenPageView/ColSelDialog.vue @@ -24,6 +24,7 @@