he wei
2023-04-26 715cb39dd2eaaa534b58d603380ffd404b1b18c5
UA win11服务问题修正 等测试反馈
1个文件已删除
2 文件已重命名
9个文件已添加
21个文件已修改
1 文件已复制
761 ■■■■ 已修改文件
11223.txt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
README.md 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dependent/ResMeterManager.jar 补丁 | 查看 | 原始文档 | blame | 历史
dependent/remove_service.bat 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hash.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
latest.yml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pack_lzma_0.1.13.nsi 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pack_lzma_1228.nsi 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pack_update1227.nsi 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/loading.html 194 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/softwareBook.pdf 补丁 | 查看 | 原始文档 | blame | 历史
resXmlParser-0.1.10-Setup.exe 补丁 | 查看 | 原始文档 | blame | 历史
resXmlParser-0.1.10-update.exe 补丁 | 查看 | 原始文档 | blame | 历史
resXmlParser-0.1.11-Setup.exe 补丁 | 查看 | 原始文档 | blame | 历史
resXmlParser-0.1.12-Setup.exe 补丁 | 查看 | 原始文档 | blame | 历史
resXmlParser-0.1.13-Setup.exe 补丁 | 查看 | 原始文档 | blame | 历史
resXmlParser-0.1.8-Setup.exe 补丁 | 查看 | 原始文档 | blame | 历史
resXmlParser-0.1.9-Setup.exe 补丁 | 查看 | 原始文档 | blame | 历史
resXmlParser-0.1.9-update.exe 补丁 | 查看 | 原始文档 | blame | 历史
src/App.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/getBarNum.js 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/util.js 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/background.js 223 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/contextMenu.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/fileInfo.vue 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/menuList.vue 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/myCharts/NormalBar.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/compare.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/data.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/empty.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/xmlResult.vue 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/preload.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
update.info.json 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
11223.txt
File was deleted
README.md
@@ -26,3 +26,5 @@
### update db
http://localhost:8093/res/dataBase/createTestDataSqlite
##   ########## 20230426 在0.1.12版本的基础上 修改‘软件启动时 发现服务不正常时 在重启服务之前终结对应的java进程(win11开机机制问题产生的服务重启失败表现为端口占用) 并改版本号为0.1.13
dependent/ResMeterManager.jar
Binary files differ
dependent/remove_service.bat
@@ -4,6 +4,9 @@
::echo %cd%
cd %~dp0
echo %cd%
set java_path=%cd%\runtime\bin\java.exe
wmic process where "ExecutablePath='%java_path:\=\\%'" call terminate
ResMeterManager.exe stop
ResMeterManager.exe uninstall
hash.js
@@ -2,7 +2,7 @@
const fs = require('fs');
const crypto = require('crypto');
const YOUR_FILE_PATH = 'resXmlParser-0.1.5-update.exe';  //  POPULATE THIS
const YOUR_FILE_PATH = 'resXmlParser-0.1.9-update.exe';  //  POPULATE THIS
function hashFile(file, algorithm = 'sha512', encoding = 'base64', options) {
  return new Promise((resolve, reject) => {
latest.yml
@@ -1,8 +1,8 @@
version: 0.1.3
version: 0.1.9
files:
  - url: resXmlParser-0.1.5-update.exe
    sha512: Zumqdc2t6yfG+4eJyfBO2O/wudZUliPpnL/3pmgHnW6Fz7hjIIw6gqFv7q9oRsjsYtTch5SaNT6Dvn3Ybt0+rQ==
  - url: resXmlParser-0.1.9-update.exe
    sha512: 4qZjj4kEhrsgMxu603tpeU18RpEGwDU1nLv6LQv08gelDjsLsu4DXBKM4wEPsZVXXMEZ7W6fpfQNwyNvk12Buw==
    size: 122648190
path: resXmlParser-0.1.5-update.exe
sha512: Zumqdc2t6yfG+4eJyfBO2O/wudZUliPpnL/3pmgHnW6Fz7hjIIw6gqFv7q9oRsjsYtTch5SaNT6Dvn3Ybt0+rQ==
releaseDate: '2022-11-18 8:05:54'
path: resXmlParser-0.1.9-update.exe
sha512: 4qZjj4kEhrsgMxu603tpeU18RpEGwDU1nLv6LQv08gelDjsLsu4DXBKM4wEPsZVXXMEZ7W6fpfQNwyNvk12Buw==
releaseDate: '2022-12-27 10:21:48'
pack_lzma_0.1.13.nsi
copy from pack_lzma_1201.nsi copy to pack_lzma_0.1.13.nsi
File was copied from pack_lzma_1201.nsi
@@ -2,7 +2,7 @@
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "resXmlParser"
!define PRODUCT_VERSION "0.1.8"
!define PRODUCT_VERSION "0.1.13"
!define PRODUCT_PUBLISHER "whyc"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\elevate.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
pack_lzma_1228.nsi
File was renamed from pack_lzma_1201.nsi
@@ -2,7 +2,7 @@
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "resXmlParser"
!define PRODUCT_VERSION "0.1.8"
!define PRODUCT_VERSION "0.1.12"
!define PRODUCT_PUBLISHER "whyc"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\elevate.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
pack_update1227.nsi
File was renamed from pack_update5.nsi
@@ -2,7 +2,7 @@
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "resXmlParser"
!define PRODUCT_VERSION "0.1.6"
!define PRODUCT_VERSION "0.1.10"
!define PRODUCT_PUBLISHER "whyc"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\elevate.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
@@ -73,12 +73,12 @@
Function .onInit
  !insertmacro MUI_LANGDLL_DISPLAY
  nsExec::Exec "$INSTDIR\remove_srv.bat"
  nsExec::Exec "$INSTDIR\remove_service.bat"
FunctionEnd
Function .onInstSuccess
nsExec::Exec "$INSTDIR\install.bat"
ExecWait "cmd /c echo 正在更新数据库... & ping 127.0.0.1 -n 5 > nul"
nsExec::Exec "$INSTDIR\setup_service.bat"
ExecWait "cmd /c echo 正在更新数据库... & ping 127.0.0.1 -n 15 > nul"
nsExec::Exec "curl -v http://localhost:8093/res/dataBase/createTestDataSqlite"
Exec $INSTDIR\${PRODUCT_NAME}.exe
FunctionEnd
@@ -168,9 +168,12 @@
  File "dist_electron\win-unpacked\vk_swiftshader_icd.json"
  File "dist_electron\win-unpacked\vulkan-1.dll"
  SetOverwrite on
  File "dependent\install.bat"
  File "dependent\setup_srv.bat"
  File "dependent\stop.bat"
  File "dependent\setup_service.bat"
  File "dependent\ResMeterManager.xml"
  File "dependent\ResMeterManager.jar"
  File "dependent\ResMeterManager.exe"
  File "dependent\remove_service.bat"
SectionEnd
Section -AdditionalIcons
@@ -205,13 +208,15 @@
FunctionEnd
Section Uninstall
  nsExec::Exec "net stop Res_Meter_Manager"
  nsExec::Exec "$INSTDIR\remove_srv.bat"
  nsExec::Exec "$INSTDIR\remove_service.bat"
  
  Delete "$INSTDIR\uninst.exe"
  Delete "$INSTDIR\remove_service.bat"
  Delete "$INSTDIR\ResMeterManager.exe"
  Delete "$INSTDIR\ResMeterManager.jar"
  Delete "$INSTDIR\install.bat"
  Delete "$INSTDIR\setup_srv.bat"
  Delete "$INSTDIR\ResMeterManager.xml"
  Delete "$INSTDIR\setup_service.bat"
  Delete "$INSTDIR\stop.bat"
  Delete "$INSTDIR\vulkan-1.dll"
  Delete "$INSTDIR\vk_swiftshader_icd.json"
  Delete "$INSTDIR\vk_swiftshader.dll"
package.json
@@ -1,6 +1,6 @@
{
  "name": "electron-res",
  "version": "0.1.8",
  "version": "0.1.13",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
@@ -42,6 +42,7 @@
    "eslint-plugin-vue": "^6.2.2",
    "less": "^3.12.2",
    "less-loader": "^6.2.0",
    "minimal-request-promise": "^1.5.0",
    "vue-cli-plugin-electron-builder": "~2.1.1",
    "vue-template-compiler": "^2.7.13"
  },
public/loading.html
New file
@@ -0,0 +1,194 @@
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <style>
    .main {
      position: relative;
      width: 200px;
      height: 200px;
      background: rgba(0, 0, 0, .4);
      border-radius: 50%;
    }
    ul {
      position: absolute;
      margin: -20px 0 0;
      padding: 0;
      left: 50%;
      top: 50%;
      transform: rotate(45deg) translate(-50%, -50%);
    }
    li {
      list-style-type: none;
      position: absolute;
      top: 0px;
      left: 0px;
      width: 20px;
      height: 20px;
      background: #00f7f9;
      border-radius: 50%;
    }
    #a {
      animation: a 1s ease-in-out infinite;
      top: -40px;
      left: -40px;
    }
    #b {
      animation: b 1s ease-in-out infinite;
      top: -40px;
      left: 0px;
    }
    #c {
      animation: c 1s ease-in-out infinite;
      top: -40px;
      left: 40px;
    }
    #d {
      animation: d 1s ease-in-out infinite;
      top: 0px;
      left: -40px;
    }
    #e {
      animation: e 1s ease-in-out infinite;
      top: 0px;
      left: 0px;
    }
    #f {
      animation: f 1s ease-in-out infinite;
      top: 0px;
      left: 40px;
    }
    #g {
      animation: g 1s ease-in-out infinite;
      top: 40px;
      left: -40px;
    }
    #h {
      animation: h 1s ease-in-out infinite;
      top: 40px;
      left: 0px;
    }
    #i {
      animation: i 1s ease-in-out infinite;
      top: 40px;
      left: 40px;
    }
    @keyframes a {
      50%,
      100% {
        top: 0px;
        left: -40px;
      }
    }
    @keyframes b {
      50%,
      100% {
        top: -40px;
        left: -40px;
      }
    }
    @keyframes c {
      50%,
      100% {
        top: -40px;
        left: 0px;
      }
    }
    @keyframes d {
      50%,
      100% {
        top: 40px;
        left: -40px;
      }
    }
    @keyframes f {
      50%,
      100% {
        top: -40px;
        left: 40px;
      }
    }
    @keyframes g {
      50%,
      100% {
        top: 40px;
        left: 0px;
      }
    }
    @keyframes h {
      50%,
      100% {
        top: 40px;
        left: 40px;
      }
    }
    @keyframes i {
      50%,
      100% {
        top: 0px;
        left: 40px;
      }
    }
  </style>
</head>
<body>
  <div class="main">
    <ul>
      <li id='a'></li>
      <li id='b'></li>
      <li id='c'></li>
      <li id='d'></li>
      <li id='e'></li>
      <li id='f'></li>
      <li id='g'></li>
      <li id='h'></li>
      <li id='i'></li>
    </ul>
  </div>
<script>
  api.send('renderer-ready');
  api.receive('java-ready', () => {
    api.send('java-ready');
  });
</script>
</body>
</html>
public/softwareBook.pdf
Binary files differ
resXmlParser-0.1.10-Setup.exe
Binary files differ
resXmlParser-0.1.10-update.exe
Binary files differ
resXmlParser-0.1.11-Setup.exe
Binary files differ
resXmlParser-0.1.12-Setup.exe
Binary files differ
resXmlParser-0.1.13-Setup.exe
Binary files differ
resXmlParser-0.1.8-Setup.exe
Binary files differ
resXmlParser-0.1.9-Setup.exe
Binary files differ
resXmlParser-0.1.9-update.exe
Binary files differ
src/App.vue
@@ -1,6 +1,12 @@
<template>
  <div id="app">
    <div class="main">
    <div
      class="main"
      v-loading="loading"
      :element-loading-text="loadingStr"
      element-loading-spinner="el-icon-loading"
      element-loading-background="rgba(0, 0, 0, 0.8)"
    >
      <div class="left" ref="left">
        <menu-list></menu-list>
        <btn-list></btn-list>
@@ -87,10 +93,12 @@
    TabsBar,
    AKeepAlive,
    FileInfo,
    BtnList
    BtnList,
  },
  data() {
    return {
      loading: false,
      loadingStr: '拼命加载中...',
      clickObj: {},
      // fileInfoVisible: false,
      fileData: {},
@@ -182,6 +190,7 @@
                    // url: item1.fileUrl,
                    fileId: item1.fileId,
                    level: 3,
                    stationId: item.stationId,
                    parent: [v.station1, val.station2, item.station3],
                  })),
                  level: 2,
@@ -248,7 +257,7 @@
      }
    },
    openFile(obj) {
      let { fileId, label } = obj;
      let { fileId, label, stationId } = obj;
      getParamByFileId(fileId).then((res) => {
        const { code, data, data2 } = res.data;
        if (code && data) {
@@ -256,6 +265,7 @@
          this.fileData = data2;
          this.currFile.name = label;
          // this.currFile.url = url;
          this.currFile.stationId = stationId;
          this.currFile.fileId = fileId;
          // 需求修改为不弹参数面板 直接跳转到解析页面
          // this.fileInfoVisible = true;
@@ -282,13 +292,14 @@
    //   this.toRes();
    // },
    toRes() {
      const { name, url, fileId } = this.currFile;
      const { name, url, fileId, stationId } = this.currFile;
      // debugger;
      this.$router.push({
        path: "/result/" + name,
        query: {
          url,
          fileId,
          stationId
        },
      });
      this.$bus.$emit("checkScroll");
@@ -363,6 +374,10 @@
    handle.addEventListener("mousedown", this.onMouseDown);
    this.$bus.$on("clearCaches", this.updateCaches);
    this.$bus.$on("stationReload", this.reload);
    this.$bus.$on("loading", (data) => {
      this.loading = true;
      this.loadingStr = data;
    });
    this.getStation();
  },
};
src/assets/js/getBarNum.js
New file
@@ -0,0 +1,27 @@
/**
 * 获取柱状图的重要的数据
 *
 * @param   {[type]}  data  柱状图数据
 *
 * @return  {[type]}        [return description]
 */
function getBarNum(data) {
  let arr = [];
  let sum = 0;
  data.forEach(item => {
    let val = Number(item);
    arr.push(val);
    sum += val;
  });
  // 获取平均值
  let avg = data.length > 0 ? sum / data.length : 0;
  return {
    min: arr.length > 0 ? Math.min.apply(null, arr) : 0,
    max: arr.length > 0 ? Math.max.apply(null, arr) : 0,
    sum: sum,
    avg: avg,
  }
}
export default getBarNum;
src/assets/js/util.js
@@ -1,11 +1,11 @@
export function isDef (v){
export function isDef(v) {
  return v !== undefined && v !== null
}
/**
 * Remove an item from an array.
 */
export function remove (arr, item) {
export function remove(arr, item) {
  if (arr.length) {
    const index = arr.indexOf(item)
    if (index > -1) {
@@ -14,7 +14,7 @@
  }
}
export function isRegExp (v) {
export function isRegExp(v) {
  return _toString.call(v) === '[object RegExp]'
}
@@ -23,4 +23,25 @@
  return Math.round(value * num) / num;
}
/**
 * 比较版本号 参数1是否比参数2 更大
 * @returns
 */
export function versionBig(version0, version1) {
  let v0 = version0.split('.').map((v) => v * 1);
  let v1 = version1.split('.').map((v) => v * 1);
  let len = v0.length;
  let res = false;
  for (let i = 0; i < len; i++) {
    if (v0[i] > v1[i]) {
      res = true;
      break;
    } else if (v0[i] < v1[i]) {
      res = false;
      break;
    }
  }
  return res;
}
const _toString = Object.prototype.toString
src/background.js
@@ -13,7 +13,7 @@
autoUpdater.logger.transports.file.level = 'info';
let win = null;
let loadingWin = null;
// 调试自动升级
@@ -63,6 +63,22 @@
// remote.enable()
const isDevelopment = process.env.NODE_ENV !== 'production'
const appUrl = 'http://localhost:8093/res/testParam/factorsAndThreshold';
const requestPromise = require('minimal-request-promise');
const checkService = function (cb) {
  requestPromise.get(appUrl).then(function (response) {
    log.info(response);
    log.info('Server started!');
    cb();
  }, function (response) {
    log.warn(response);
    log.info('Waiting for the server start...');
    setTimeout(function () {
      checkService(cb);
    }, 500)
  })
}
// const path = require('path');
// Scheme must be registered before the app is ready
@@ -73,9 +89,88 @@
if (!isDevelopment) {
  Menu.setApplicationMenu(null);
}
async function createWindow(cb) {
// loading 窗口
const loadingURL = isDevelopment ? path.join(__dirname, './loading.html') : `file://${__dirname}/loading.html`;
const showLoading = (cb, argFn) => {
  loadingWin = new BrowserWindow({
    // show: false,
    frame: false,
    width: 260,
    height: 260,
    resizable: false,
    transparent: true,
    webPreferences: {
      preload: path.join(__dirname, './preload.js')
    }
  });
  // loadingWin.once('show', () => {
  //   cb(true);
  // });
  // loadingWin.webContents.openDevTools();
  loadingWin.loadURL(loadingURL);
  loadingWin.setSkipTaskbar(true);
  // loadingWin.show();
  cb(true, argFn);
  // 启动java程序
  // if (platform === 'win32') {
  //   ipcMain.once('renderer-ready', (event, data) => {
  //     let dir = path.resolve(__dirname, '..');
  //     serverProcess = require('child_process').execFile(dir + '/app_x64.exe');
  //   });
  // }
  requestPromise.get(appUrl).then(function () {
    log.info('窗口初始化 服务正常');
    // ipcRenderer.send('java-ready');
    loadingWin.webContents.send('java-ready');
  }, function () {
    log.info('窗口初始化 接口不通');
    log.info('正在终止java进程,然后重启服务');
    let stop = child_process.spawn('cmd.exe', ['/c', 'stop.bat']);
    stop.on('exit', function (code) {
      if (code > 0) {
        return false;
      }
      log.info('java进程被终止,准备重启服务');
      child_process.exec(`"${process.cwd()}\\ResMeterManager.exe" restart`, (err) => {
        if (err) {
          log.info('重启服务出错了stderr: ' + JSON.stringify(err));
          return
        }
        log.info('服务重启成功,连接中');
        // 等到服务就绪再重启
        checkService(() => {
          loadingWin.webContents.send('java-ready');
        });
      });
    });
    // // 重启服务 然后重启应用
    // let restart = child_process.spawn('.\\ResMeterManager.exe', ['restart']);
    // restart.stdout.on('data', function (data) {
    //   log.info('stdout: ' + data);
    // });
    // restart.stderr.on('data', function (data) {
    //   log.info('stderr: ' + data);
    // });
    // restart.on('exit', (code) => {
    //   if (code > 0) {
    //     return false;
    //   }
    //   log.info('服务重启成功,连接中');
    //   // 等到服务就绪再重启
    //   checkService(() => {
    //     loadingWin.webContents.send('java-ready');
    //   });
    // });
  });
}
async function createWindow(wait, cb) {
  // Create the browser window.
  win = new BrowserWindow({
    show: !wait,
    width: 1000,
    height: 600,
    webPreferences: {
@@ -103,9 +198,18 @@
    // Load the index.html when not in development
    win.loadURL('app://./index.html')
  }
  if (wait) {
    ipcMain.on("java-ready", () => {
      log.info('java-ready!');
      loadingWin.hide();
      loadingWin.close();
      win.show();
    });
  }
  if (cb && 'function' == typeof cb) {
    win.once('ready-to-show', () => {
      // log.info('900')
      cb(win.webContents);
    })
  }
@@ -116,7 +220,7 @@
    // TODO
    setTimeout(() => {
      update(win.webContents, true);
    }, 1000 * 10);
    }, 1000 * 30);
  });
  win.webContents.session.on('will-download', (e, item) => {
@@ -170,6 +274,7 @@
})
app.on('activate', () => {
  log.info('app activate event');
  // On macOS it's common to re-create a window in the app when the
  // dock icon is clicked and there are no other windows open.
  if (BrowserWindow.getAllWindows().length === 0) createWindow()
@@ -179,13 +284,19 @@
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', async () => {
  log.info('app ready event');
  let cb = undefined;
  if (process.argv[1]) {
    cb = (sender) => {
      log.info('call selected-file..' + process.argv[1]);
      sender.send('selected-file', { filePaths: [process.argv[1]] }, 'MenuList');
    }
  }
  createWindow(cb);
  if (isDevelopment) {
    createWindow();
  } else {
    showLoading(createWindow, cb);
  }
})
// 所有的新开窗口事件都调用系统默认浏览器来打开页面
@@ -231,16 +342,112 @@
});
ipcMain.on('db-export', () => {
  let stop = child_process.spawn('cmd.exe', ['/c', 'stop.bat']);
  // 打开窗口选择导出文件的路径
  let path = dialog.showSaveDialogSync({
    title: '导出数据库',
    filters: [{ name: 'db', extensions: ['db'] }],
  });
  if (!path) {
    return false;
  }
  let src = 'res.db';
  child_process.exec(`copy "${process.cwd()}\\${src}" "${path}" /Y /V`, (err) => {
    if (err) {
      log.info('数据库导出出错了stderr: ' + JSON.stringify(err));
      return
    }
    log.info('数据库导出成功');
    // 打开文件夹
    shell.showItemInFolder(path);
  });
});
ipcMain.on('db-import', () => {
  let stop = child_process.spawn('cmd.exe', ['/c', 'stop.bat']);
  stop.on('exit', function (code) {
    console.log('child process exited with code ' + code);
    if (code > 0) {
      return false;
    }
    // 关闭服务成功后 打开选择文件对话框 让用户选择db文件 然后复制
    let path = dialog.showOpenDialogSync({
      filters: [{ name: 'db', extensions: ['db'] }],
      properties: ['openFile']
    });
    if (path) {
      // 然后复制文件
      let src = 'res.db';
      // 然后复制文件
      child_process.exec(`copy "${path}" "${process.cwd()}\\${src}" /Y /V`, (err) => {
        if (err) {
          log.info('数据库导入出错了stderr: ' + JSON.stringify(err));
          return
        }
        log.info('数据库导入成功');
        // 打开服务
        let restart = child_process.spawn('ResMeterManager.exe', ['restart']);
        log.info('restart');
        restart.stdout.on('data', function (data) {
          log.info('stdout: ' + data);
        });
        restart.stderr.on('data', function (data) {
          log.info('stderr: ' + data);
        });
        restart.on('exit', (code) => {
          if (code > 0) {
            return false;
          }
          log.info('服务重启成功,准备重启应用');
          // 等到服务就绪再重启
          checkService(() => {
            // 重新启动软件
            app.relaunch();
            app.exit();
          });
        });
        let status = child_process.spawn('ResMeterManager.exe', ['status']);
        log.info('restart');
        status.stdout.on('data', function (data) {
          log.info('stdout: ' + data);
        });
        status.stderr.on('data', function (data) {
          log.info('stderr: ' + data);
        });
      });
    } else {
      // 重启服务 然后重启应用
      let restart = child_process.spawn('ResMeterManager.exe', ['restart']);
      log.info('restart');
      restart.stdout.on('data', function (data) {
        log.info('stdout: ' + data);
      });
      restart.stderr.on('data', function (data) {
        log.info('stderr: ' + data);
      });
      restart.on('exit', (code) => {
        if (code > 0) {
          return false;
        }
        log.info('服务重启成功,准备重启应用');
        // 等到服务就绪再重启
        checkService(() => {
          // 重新启动软件
          app.relaunch();
          app.exit();
        });
      });
    }
  });
});
// Exit cleanly on request from parent process in development mode.
if (isDevelopment) {
  false;
  if (process.platform === 'win32') {
    process.on('message', (data) => {
      if (data === 'graceful-exit') {
src/components/contextMenu.vue
@@ -399,11 +399,11 @@
      });
    },
    deleteFile() {
      let { label, parent, url } = this.contextData;
      let { fileId, parent } = this.contextData;
      parent = parent.map((v) => v);
      let params = {
        stationName: parent.join("-"),
        FilePath: url,
        fileId,
      };
      delFileFromStation(params).then((res) => {
        const { code, data, data2 } = res.data;
src/components/fileInfo.vue
@@ -9,16 +9,15 @@
      :rules="rules"
    >
      <el-row :gutter="40">
        <el-col :span="8">
          <el-form-item label="区域" :prop="editAble ? 'battStation' : ''">
        <el-col :span="12">
          <el-form-item label="区域">
            <el-input
              v-model="info.battStation"
              :disabled="!editAble"
              placeholder="请输入站点名称"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
        <el-col :span="12">
          <el-form-item label="系统" prop="battGroupName">
            <el-input
              v-model="info.battGroupName"
@@ -26,34 +25,18 @@
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="测试时间">
            <el-date-picker
              v-model="info.testTime"
              type="datetime"
              format="yyyy-MM-dd HH:mm:ss"
              value-format="yyyy-MM-dd HH:mm:ss"
              :editable="false"
              :clearable="false"
              placeholder="选择测试时间"
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="电池品牌" :prop="editAble ? 'battBrand' : ''">
          <el-form-item label="电池品牌">
            <el-input
              v-model="info.battBrand"
              :disabled="!editAble"
              placeholder="请输入电池品牌"
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="电池型号" :prop="editAble ? 'battModel' : ''">
          <el-form-item label="电池型号">
            <el-input
              v-model="info.battModel"
              :disabled="!editAble"
              placeholder="请输入电池型号"
            ></el-input>
          </el-form-item>
@@ -103,7 +86,6 @@
          <el-form-item label="安装时间">
            <el-date-picker
              v-model="info.battBatch"
              :disabled="!editAble"
              format="yyyy-MM-dd"
              value-format="yyyyMMdd"
              type="date"
@@ -118,7 +100,6 @@
      <el-form-item label="外观标记">
        <el-radio-group
          v-model="info.battErrflag"
          :disabled="!editAble"
          size="medium"
        >
          <el-radio border class="good" :label="0">良好</el-radio>
@@ -152,9 +133,6 @@
    },
  },
  computed: {
    editAble() {
      return this.info.version != "V2.7";
    },
  },
  data() {
    let R_chainRes = {
src/components/menuList.vue
@@ -273,10 +273,7 @@
              <td>内阻更换</td>
              <td>
                <el-form-item prop="resBadCoeK4">
                  <el-input
                    v-model="p_params.resBadCoeK4"
                    placeholder="请输入"
                  >
                  <el-input v-model="p_params.resBadCoeK4" placeholder="请输入">
                    <template slot="append">%</template>
                  </el-input>
                </el-form-item>
@@ -380,8 +377,7 @@
                v-for="(note, idx) in item.notes"
                :key="'note_' + idx"
              >
                <span class="index">{{ idx + 1 }})</span
                >{{ note }}
                <span class="index">{{ idx + 1 }})</span>{{ note }}
              </div>
            </div>
          </div>
@@ -430,6 +426,7 @@
import { mapGetters, mapMutations } from "vuex";
import CONST from "@/assets/js/const";
import testVal from "@/assets/js/testVal";
import { versionBig } from "@/assets/js/util";
const O_rules = CONST.rules;
@@ -505,30 +502,30 @@
        title: "帮助",
        visible: false,
        children: [
          {
            title: "仪表说明书",
            method: "instructionBook",
          },
          {
            title: "软件说明书",
            method: "softwareBook",
          },
          {
            title: "操作视频",
            method: "video",
          },
          // {
          //   title: "仪表说明书",
          //   method: "instructionBook",
          // },
          // {
          //   title: "软件说明书",
          //   method: "softwareBook",
          // },
          // {
          //   title: "操作视频",
          //   method: "video",
          // },
          {
            title: "升级",
            method: "checkForUpdate",
          },
          {
            title: "联系支持",
            method: "contact",
          },
          {
            title: "关于福光",
            method: "others",
          },
          // {
          //   title: "联系支持",
          //   method: "contact",
          // },
          // {
          //   title: "关于福光",
          //   method: "others",
          // },
        ],
      },
    ];
@@ -834,11 +831,12 @@
        if (200 == status && data) {
          const { versions, notes } = data;
          let list = [];
          this.pkgSize = Math.round(info.files[0].size / 1024 / 1024 * 100) / 100;
          this.pkgSize =
            Math.round((info.files[0].size / 1024 / 1024) * 100) / 100;
          this.pkgVersion = info.version;
          for (let i = versions.length; --i >= 0; ) {
            let version = versions[i];
            if (version == currentVersion) {
            if (!versionBig(version, currentVersion)) {
              break;
            }
            list.push({
@@ -847,7 +845,7 @@
            });
          }
          this.logList = list;
          console.log(list, 'list')
          console.log(list, "list");
          this.updateInfoVisible = true;
        }
      });
src/components/myCharts/NormalBar.vue
@@ -1,5 +1,7 @@
<script>
import BaseChart from "@/components/myCharts/BaseChart";
import getBarNum from '@/assets/js/getBarNum';
export default {
  name: "NormalBar",
  extends: BaseChart,
@@ -50,6 +52,12 @@
        data: [],
      };
      let {
        min,
        max,
        avg
      } = getBarNum(data);
      let series = {
        name: this.name,
        type: "bar",
@@ -64,6 +72,7 @@
      let alarm = {
        high: [],
        low: [],
        agv: []
      };
      this.marks.forEach((v, i) => {
        alarm[v.type].push({
@@ -72,7 +81,7 @@
        });
        markLine.data.push({
          name: v.name,
          yAxis: v.y,
          yAxis: v.type != 'agv' ? v.y : avg,
          lineStyle: {
            width: 2,
            color: v.color,
@@ -93,7 +102,6 @@
          },
        });
      });
      let sData = data.map((v) => {
        let flag = false;
        let item = {
@@ -122,6 +130,14 @@
              }
            });
        }
        if (v == min) {
          flag = true;
          item.itemStyle.color = "#090"
        }
        if (v == max) {
          flag = true;
          item.itemStyle.color = "#E008F2"
        }
        return flag ? item : v;
      });
      series.data = sData;
src/pages/compare.vue
@@ -455,12 +455,12 @@
          label: monNum,
        });
      }
      headers.push({
        prop: "balanceRate",
        label: "均一性",
        fixed: "right",
        minWidth: 80,
      });
      // headers.push({
      //   prop: "balanceRate",
      //   label: "均一性",
      //   fixed: "right",
      //   minWidth: 80,
      // });
      return {
        headers,
        xLabel,
src/pages/data.vue
@@ -42,9 +42,20 @@
        </el-form-item>
      </el-form>
      <div class="btn-grp">
        <el-button size="mini" type="primary" @click="getDatas">查询</el-button>
        <el-button size="mini" type="primary" @click="dbImport">导入</el-button>
        <el-button size="mini" type="primary" @click="dbExport">导出</el-button>
        <el-button size="mini" type="primary" class="btn" @click="getDatas">查询</el-button>
        <el-popconfirm
          class="btn"
          title="导入操作将覆盖数据库记录,确定导入吗?"
          @confirm="dbImport"
        >
          <el-button
            slot="reference"
            size="mini"
            type="primary"
            >导入</el-button
          >
        </el-popconfirm>
        <el-button size="mini" class="btn" type="primary" @click="dbExport">导出</el-button>
      </div>
    </div>
    <div class="table-wrap">
@@ -284,6 +295,7 @@
    },
    // 数据库导入
    dbImport() {
      this.$bus.$emit("loading", '请不要关闭程序, 等待程序自动重启');
      window.api.send("db-import");
    },
    // 数据库导出
@@ -319,6 +331,12 @@
    display: flex;
    .btn-grp {
      margin-left: 0.4em;
      .btn{
        display: inline-block;
        & + .btn {
          margin-left: 4px;
        }
      }
    }
    :deep(.el-form) {
      flex: 1;
src/pages/empty.vue
@@ -1,7 +1,7 @@
<template>
  <div class="contain">
    <div class="info">
      <text-rotate content="欢迎使用福光内阻测试分析软件"></text-rotate>
      <!-- <text-rotate content="欢迎使用福光内阻测试分析软件"></text-rotate> -->
    </div>
  </div>
</template>
src/pages/xmlResult.vue
@@ -142,6 +142,12 @@
          type: "high",
          color: "#d9001b",
        },
        {
          name: "平均值",
          y: 0,
          type: "agv",
          color: "#0f0",
        },
      ],
      volVisiable: [
        {
@@ -156,6 +162,12 @@
          type: "low",
          color: "#ff0",
        },
        {
          name: "平均值",
          y: 0,
          type: "agv",
          color: "#0f0",
        },
      ],
      chainVisiable: [
        {
@@ -169,6 +181,12 @@
          y: 0,
          type: "high",
          color: "#d9001b",
        },
        {
          name: "平均值",
          y: 0,
          type: "agv",
          color: "#0f0",
        },
      ],
    };
@@ -201,6 +219,11 @@
        {
          prop: "bv",
          label: "电压(V)",
          minWidth: 100,
        },
        {
          prop: "estimatedCap",
          label: "预估容量(Ah)",
          minWidth: 100,
        },
        {
@@ -260,7 +283,7 @@
        condData.push(v.bs);
        // capData.push() TODO
        chainData.push(v.cr);
        tableData.push({ ...v, monNum: "#" + v.monNum });
        tableData.push({ ...v, estimatedCap: toFixed(v.estimatedCap, 1), monNum: "#" + v.monNum });
      });
      return {
        xLabel,
@@ -360,6 +383,12 @@
                type: "low",
                color: "#ff0",
              },
              {
                name: "平均值",
                y: 0,
                type: "agv",
                color: "#0f0",
              },
            ];
          }
          switch (fileParam.battVol * 1) {
@@ -380,7 +409,14 @@
              this.marks.volVisiable[1].y = toFixed(vol12LowCoeK1, BIT);
              break;
            default:
              this.marks.volVisiable = [];
              this.marks.volVisiable = [
                {
                  name: "平均值",
                  y: 0,
                  type: "agv",
                  color: "#0f0",
                },
              ];
              break;
          }
@@ -457,6 +493,12 @@
                type: "low",
                color: "#ff0",
              },
              {
                name: "平均值",
                y: 0,
                type: "agv",
                color: "#0f0",
              },
            ];
          }
          switch (fileParam.battVol * 1) {
@@ -477,7 +519,14 @@
              this.marks.volVisiable[1].y = toFixed(vol12LowCoeK1, BIT);
              break;
            default:
              this.marks.volVisiable = [];
              this.marks.volVisiable = [
                {
                  name: "平均值",
                  y: 0,
                  type: "agv",
                  color: "#0f0",
                },
              ];
              break;
          }
@@ -693,6 +742,7 @@
        this.fileInfoVisible = false;
        return false;
      }
      debugger;
      updateFileParam(this.stationId, data).then((res) => {
        const { code, data } = res.data;
        if (code && data) {
src/preload.js
@@ -19,7 +19,8 @@
  "download-update",
  "update-info",
  "db-import",
  "db-export"
  "db-export",
  "java-ready"
];
contextBridge.exposeInMainWorld('api', {
update.info.json
@@ -1,7 +1,9 @@
{
  "versions": ["0.1.4", "0.1.5"],
  "versions": ["0.1.4", "0.1.5", "0.1.9", "0.1.10"],
  "notes": {
    "0.1.4": ["添加了几个常用的快捷操作按钮", "调整了多页面逻辑,文件相关页面只能同时打开一个", "导出报告之后打开保存文件的路径", "添加了软件操作说明书"],
    "0.1.5": ["添加了自动升级检测功能", "添加多种电池的电压告警阀值", "添加升级说明"]
    "0.1.5": ["添加了自动升级检测功能", "添加多种电池的电压告警阀值", "添加升级说明"],
    "0.1.9": ["修复了同站下文件记录时间错误的bug"],
    "0.1.10": ["同站下文件测试时间不共用"]
  }
}