| | |
| | | { |
| | | "name": "demo", |
| | | "name": "fbx", |
| | | "version": "0.1.0", |
| | | "author": "whychw", |
| | | "description": "解析本地fbx文件 支持导出excel", |
| | | "private": true, |
| | | "scripts": { |
| | | "serve": "vue-cli-service serve", |
| | |
| | | let pathArr = app.getPath('exe').split('\\'); |
| | | pathArr.length = pathArr.length - 1; |
| | | let path = pathArr.join('\\'); |
| | | require('child_process').spawn('cmd.exe', ['/c', 'echo '+path+' > 123.txt']); |
| | | // require('child_process').spawn('cmd.exe', ['/c', 'echo '+path+' > 123.txt']); |
| | | |
| | | serverProcess = require('child_process').spawn('cmd.exe', ['/c', 'testElectronJ.bat'], { |
| | | cwd: path + '/bundled/bin' |
| | |
| | | })) |
| | | } |
| | | } |
| | | // Menu.setApplicationMenu(null); |
| | | if (!isDevelopment) { |
| | | Menu.setApplicationMenu(null); |
| | | } |
| | | async function createWindow() { |
| | | // Create the browser window. |
| | | const win = new BrowserWindow({ |
| | | width: 800, |
| | | height: 600, |
| | | icon: `${__static}/icon/1.png`, |
| | | webPreferences: { |
| | | webSecurity: false, |
| | | // Use pluginOptions.nodeIntegration, leave this alone |
| | |
| | | if (process.env.WEBPACK_DEV_SERVER_URL) { |
| | | // Load the url of the dev server if in development mode |
| | | await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL) |
| | | if (!process.env.IS_TEST) win.webContents.openDevTools() |
| | | // if (!process.env.IS_TEST) win.webContents.openDevTools() |
| | | } else { |
| | | createProtocol('app') |
| | | // Load the index.html when not in development |
| | |
| | | const startUp = function () { |
| | | const requestPromise = require('minimal-request-promise') |
| | | requestPromise.get(appUrl).then(function (response) { |
| | | require('child_process').spawn('cmd.exe', ['/c', 'echo '+JSON.stringify(response)+' success >> 123.txt']) |
| | | // require('child_process').spawn('cmd.exe', ['/c', 'echo '+JSON.stringify(response)+' success >> 123.txt']) |
| | | console.log(response); |
| | | console.log('Server started!'); |
| | | createWindow(); |
| | |
| | | }, function (response) { |
| | | console.log(response) |
| | | console.log('Waiting for the server start...'); |
| | | require('child_process').spawn('cmd.exe', ['/c', 'echo '+JSON.stringify(response)+' error >> 123.txt']) |
| | | // require('child_process').spawn('cmd.exe', ['/c', 'echo '+JSON.stringify(response)+' error >> 123.txt']) |
| | | setTimeout(function () { |
| | | startUp() |
| | | }, 500) |
| | |
| | | } |
| | | |
| | | app.on('ready', async () => { |
| | | require('child_process').spawn('cmd.exe', ['/c', 'echo ready >> 123.txt']) |
| | | // require('child_process').spawn('cmd.exe', ['/c', 'echo ready >> 123.txt']) |
| | | startUp() |
| | | }) |
| | | // Exit cleanly on request from parent process in development mode. |
| | |
| | | type: "line", |
| | | data: [] |
| | | }]; |
| | | let unit = this.unit; |
| | | let unit = (data ? data.unit : '') || this.unit; |
| | | return { |
| | | animation: false, |
| | | tooltip:{ |
| | |
| | | </flex-box> |
| | | </div> |
| | | </div> |
| | | <!-- 导出用的图表 可变的那组图 --> |
| | | <div class="hideContain"> |
| | | <normal-lines id="hideChart" ref="hideChart"></normal-lines> |
| | | </div> |
| | | </flex-layout> |
| | | </template> |
| | | |
| | |
| | | actualCapOption: null, |
| | | residualCapOption: null, |
| | | residualTimeOption: null, |
| | | unit: '' |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | series: SingleVol, |
| | | }; |
| | | let testCapOption = { |
| | | unit: 'AH', |
| | | xData: times, |
| | | series: [ |
| | | { |
| | |
| | | ], |
| | | }, |
| | | actualCapOption = { |
| | | unit: 'AH', |
| | | xData: times, |
| | | series: [ |
| | | { |
| | |
| | | ], |
| | | }, |
| | | residualCapOption = { |
| | | unit: 'AH', |
| | | xData: times, |
| | | series: [ |
| | | { |
| | |
| | | ], |
| | | }, |
| | | residualTimeOption = { |
| | | unit: '', |
| | | xData: times, |
| | | series: [ |
| | | { |
| | |
| | | }, |
| | | // 导出报表 |
| | | exportExcel() { |
| | | // axios({ |
| | | // url: 'export', |
| | | // method: 'POST', |
| | | // params: { |
| | | // filePath: this.info.filePath |
| | | // } |
| | | |
| | | // }).then((res) => { |
| | | // res = res.data; |
| | | // console.log(res, '======res'); |
| | | // }); |
| | | // 容量折线图 |
| | | let arr = ['testCap', 'actualCap']; |
| | | let o_pic = {}; |
| | | arr.forEach((v) => { |
| | | let option = this[v + 'Option']; |
| | | this.unit = option.unit; |
| | | this.$refs.hideChart.setData(option); |
| | | o_pic[v] = this.$refs.hideChart.getDataURL(); |
| | | }); |
| | | let params = { |
| | | filePath: this.info.filePath, |
| | | groupVol_echart: this.$refs.groupVol.getDataURL(), |
| | | curr_echart: this.$refs.groupCurr.getDataURL(), |
| | | vol_echart: this.$refs.vol.getDataURL(), |
| | | cap_echart: this.$refs.cap.getDataURL(), |
| | | cap_echart: o_pic.testCap, |
| | | actualCap_echart: o_pic.actualCap |
| | | }; |
| | | let baseURL = axios.defaults.baseURL; |
| | | baseURL = baseURL ? baseURL : ""; |
| | |
| | | .flex-row + .flex-row { |
| | | margin-top: 8px; |
| | | } |
| | | .hideContain { |
| | | position: absolute; |
| | | width: 0; |
| | | height: 0; |
| | | display: none; |
| | | } |
| | | </style> |
| | |
| | | //属性栏 |
| | | String[] rowName = {"测试时间","总电压","测试容量","剩余容量"}; |
| | | HSSFRow row = sheet1.createRow(rowNum); |
| | | for (int i=0;i<rowName.length;){ |
| | | for (int i=0;i<rowName.length;i++){ |
| | | row.createCell(i).setCellValue(rowName[i]); |
| | | } |
| | | //row.createCell(0).setCellValue("测试时间"); //创建单元格 |