UA 添加自动升级检测功能 添加几种类型电池告警阀值
New file |
| | |
| | | NODE_ENV=none |
| | | VUE_APP_ENV="none" |
| | |
| | | |
| | | ### Customize configuration |
| | | See [Configuration Reference](https://cli.vuejs.org/config/). |
| | | |
| | | |
| | | ### update db |
| | | http://localhost:8093/res/dataBase/createTestDataSqlite |
| | |
| | | const fs = require('fs'); |
| | | const crypto = require('crypto'); |
| | | |
| | | const YOUR_FILE_PATH = 'resXmlParser-0.1.3-update.exe'; // POPULATE THIS |
| | | const YOUR_FILE_PATH = 'resXmlParser-0.1.4-update.exe'; // POPULATE THIS |
| | | |
| | | function hashFile(file, algorithm = 'sha512', encoding = 'base64', options) { |
| | | return new Promise((resolve, reject) => { |
| | |
| | | version: 0.1.3 |
| | | version: 0.1.5 |
| | | files: |
| | | - url: resXmlParser-0.1.3-update.exe |
| | | sha512: 9/tRIzuT2jbGSwX0M0xK2ZNMtwlpfwIZ9NS3Ev1W190DfDp2h2UbIz8IAl6GLtm1Pksg1TDce5MsllY0FEbZag== |
| | | - url: resXmlParser-0.1.4-update.exe |
| | | sha512: JwxDF3BQ4uD3DwIvwu6MdTn7jmLhSK2zte+Z6jx+o35ZT5ON4BL+aW/b647bLsZ1UuihVAanQBxYL4Ou05HjpQ== |
| | | size: 162342321 |
| | | path: resXmlParser-0.1.3-update.exe |
| | | sha512: 9/tRIzuT2jbGSwX0M0xK2ZNMtwlpfwIZ9NS3Ev1W190DfDp2h2UbIz8IAl6GLtm1Pksg1TDce5MsllY0FEbZag== |
| | | releaseDate: '2022-11-7T08:38:57.198Z' |
| | | path: resXmlParser-0.1.4-update.exe |
| | | sha512: JwxDF3BQ4uD3DwIvwu6MdTn7jmLhSK2zte+Z6jx+o35ZT5ON4BL+aW/b647bLsZ1UuihVAanQBxYL4Ou05HjpQ== |
| | | releaseDate: '2022-11-15T08:38:57.198Z' |
| | |
| | | |
| | | ; HM NIS Edit Wizard helper defines |
| | | !define PRODUCT_NAME "resXmlParser" |
| | | !define PRODUCT_VERSION "0.1.3" |
| | | !define PRODUCT_VERSION "0.1.4" |
| | | !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}" |
| | |
| | | !define MUI_ABORTWARNING |
| | | !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\res-icon.ico" |
| | | !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" |
| | | !define MUI_WELCOMEFINISHPAGE_BITMAP "bar.bmp" |
| | | ;!define MUI_WELCOMEFINISHPAGE_BITMAP "bar.bmp" |
| | | |
| | | ; Language Selection Dialog Settings |
| | | !define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}" |
| | |
| | | !insertmacro MUI_UNPAGE_INSTFILES |
| | | |
| | | ; Language files |
| | | !insertmacro MUI_LANGUAGE "English" |
| | | ;!insertmacro MUI_LANGUAGE "English" |
| | | !insertmacro MUI_LANGUAGE "SimpChinese" |
| | | |
| | | ; Reserve files |
| | |
| | | InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" |
| | | ShowInstDetails show |
| | | ShowUnInstDetails show |
| | | BrandingText "福光 - 武汉源畅" |
| | | BrandingText " " |
| | | DirText "安装向导将把 $(^NameDA) 安装在下列文件夹,升级安装不支持更改安装路径,点击 [安装(I)] 开始安装。" |
| | | |
| | | Function disabledDir |
| | |
| | | { |
| | | "name": "electron-res", |
| | | "version": "0.1.4", |
| | | "version": "0.1.5", |
| | | "private": true, |
| | | "scripts": { |
| | | "serve": "vue-cli-service serve", |
| | | "build": "vue-cli-service build", |
| | | "lint": "vue-cli-service lint", |
| | | "electron:build": "vue-cli-service electron:build", |
| | | "electron:build:test": "vue-cli-service electron:build --mode dev", |
| | | "electron:serve": "vue-cli-service electron:serve", |
| | | "electron:serve:test": "vue-cli-service electron:serve --mode dev", |
| | | "postinstall": "electron-builder install-app-deps", |
| | | "postuninstall": "electron-builder install-app-deps", |
| | | "pack": "electron-builder -w", |
| | |
| | | msg: '取值范围0~9999' |
| | | }, |
| | | |
| | | |
| | | // 低压阈值(1.2V) 0~1.2 3 |
| | | vol1d2LowCoeK1: { |
| | | pattern: /^[0-9]{1}(\.[0-9]{0,3})?$/, |
| | | regVal: true, |
| | | min: 0, |
| | | max: 1.2, |
| | | msg: '取值范围0~1.2(保留3位小数)' |
| | | }, |
| | | // 高压阈值(1.2V) 0~3 3 |
| | | vol1d2HighCoeK2: { |
| | | pattern: /^[0-9]{1}(\.[0-9]{0,3})?$/, |
| | | regVal: true, |
| | | min: 0, |
| | | max: 3, |
| | | msg: '取值范围0~3(保留3位小数)' |
| | | }, |
| | | // 低压阈值(2V) 0~2 3 |
| | | vol2LowCoeK1: { |
| | | pattern: /^[0-9]{1}(\.[0-9]{0,3})?$/, |
| | |
| | | min: 0, |
| | | max: 5, |
| | | msg: '取值范围0~5(保留3位小数)' |
| | | }, |
| | | // 低压阈值(6V) 0~6 3 |
| | | vol6LowCoeK1: { |
| | | pattern: /^[0-9]{1}(\.[0-9]{0,3})?$/, |
| | | regVal: true, |
| | | min: 0, |
| | | max: 6, |
| | | msg: '取值范围0~6(保留3位小数)' |
| | | }, |
| | | // 高压阈值(6V) 0~12 3 |
| | | vol6HighCoeK2: { |
| | | pattern: /^[0-9]{1,2}(\.[0-9]{0,3})?$/, |
| | | regVal: true, |
| | | min: 0, |
| | | max: 12, |
| | | msg: '取值范围0~12(保留3位小数)' |
| | | }, |
| | | // 低压阈值(12V) 0~12 3 |
| | | vol12LowCoeK1: { |
| | |
| | | // 内阻告警系数 0~1000 0 |
| | | // 内阻更换系数 0~1000 0 |
| | | // 连接条告警系数 0~1000 0 |
| | | // 连接条更换系数 0~1000 0 |
| | | resGoodCoeK3: { |
| | | pattern: /^[0-9]{1,4}$/, |
| | | regVal: true, |
| | |
| | | * |
| | | * |
| | | */ |
| | | Object.defineProperty(app, 'isPackaged', { |
| | | get() { |
| | | return true; |
| | | } |
| | | }); |
| | | |
| | | // 单例锁 |
| | | const gotTheLock = app.requestSingleInstanceLock() |
| | |
| | | } |
| | | if (cb && 'function' == typeof cb) { |
| | | win.once('ready-to-show', () => { |
| | | log.info('900') |
| | | cb(win.webContents); |
| | | }) |
| | | } |
| | | |
| | | // 自动检测更新 软件的第一个实例打开后 为了不影响加载速度 在指定时间后做一次自检 |
| | | win.once('ready-to-show', () => { |
| | | log.info('ready event'); |
| | | // TODO |
| | | setTimeout(() => { |
| | | update(win.webContents, true); |
| | | }, 1000 * 10); |
| | | }); |
| | | |
| | | win.webContents.session.on('will-download', (e, item) => { |
| | | // const filePath = path.join(saveUrl, item.getFilename()); |
| | |
| | | update(event.sender); |
| | | }); |
| | | |
| | | ipcMain.on('download-update', () => { |
| | | autoUpdater.downloadUpdate(); |
| | | }); |
| | | |
| | | ipcMain.on('quitAndInstall', () => { |
| | | autoUpdater.quitAndInstall(); |
| | | }); |
| | |
| | | <table class="table"> |
| | | <thead> |
| | | <tr> |
| | | <th>系数名称</th> |
| | | <th>系数值</th> |
| | | <th>评价</th> |
| | | <th colspan="2"> |
| | | <div class="cell-box"> |
| | | 一般告警 |
| | | <div class="color warn"></div> |
| | | </div> |
| | | </th> |
| | | <th colspan="2"> |
| | | <div class="cell-box"> |
| | | 严重告警 |
| | | <div class="color alarm"></div> |
| | | </div> |
| | | </th> |
| | | </tr> |
| | | <tr> |
| | | <th>告警名称</th> |
| | | <th>告警值</th> |
| | | <th>告警名称</th> |
| | | <th>告警值</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <tr> |
| | | <td>低压告警(1.2V)</td> |
| | | <td> |
| | | <el-form-item prop="vol1d2LowCoeK1"> |
| | | <el-input |
| | | v-model="p_params.vol1d2LowCoeK1" |
| | | placeholder="请输入" |
| | | > |
| | | <template slot="append">V</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </td> |
| | | <td>高压告警(1.2V)</td> |
| | | <td> |
| | | <el-form-item prop="vol1d2HighCoeK2"> |
| | | <el-input |
| | | v-model="p_params.vol1d2HighCoeK2" |
| | | placeholder="请输入" |
| | | > |
| | | <template slot="append">V</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>低压告警(2V)</td> |
| | | <td> |
| | | <el-form-item prop="vol2LowCoeK1"> |
| | | <el-input |
| | | type="number" |
| | | v-model="p_params.vol2LowCoeK1" |
| | | placeholder="请输入低压告警" |
| | | placeholder="请输入" |
| | | > |
| | | <template slot="append">V</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </td> |
| | | <td class="alarm"></td> |
| | | </tr> |
| | | <tr> |
| | | <td>高压告警(2V)</td> |
| | | <td> |
| | | <el-form-item prop="vol2HighCoeK2"> |
| | | <el-input |
| | | type="number" |
| | | v-model="p_params.vol2HighCoeK2" |
| | | placeholder="请输入高压告警" |
| | | placeholder="请输入" |
| | | > |
| | | <template slot="append">V</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </td> |
| | | <td class="warn"></td> |
| | | </tr> |
| | | <tr> |
| | | <td>低压告警(6V)</td> |
| | | <td> |
| | | <el-form-item prop="vol6LowCoeK1"> |
| | | <el-input |
| | | v-model="p_params.vol6LowCoeK1" |
| | | placeholder="请输入" |
| | | > |
| | | <template slot="append">V</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </td> |
| | | <td>高压告警(6V)</td> |
| | | <td> |
| | | <el-form-item prop="vol6HighCoeK2"> |
| | | <el-input |
| | | v-model="p_params.vol6HighCoeK2" |
| | | placeholder="请输入" |
| | | > |
| | | <template slot="append">V</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>低压告警(12V)</td> |
| | | <td> |
| | | <el-form-item prop="vol12LowCoeK1"> |
| | | <el-input |
| | | type="number" |
| | | v-model="p_params.vol12LowCoeK1" |
| | | placeholder="请输入低压告警" |
| | | placeholder="请输入" |
| | | > |
| | | <template slot="append">V</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </td> |
| | | <td class="alarm"></td> |
| | | </tr> |
| | | <tr> |
| | | <td>高压告警(12V)</td> |
| | | <td> |
| | | <el-form-item prop="vol12HighCoeK2"> |
| | | <el-input |
| | | type="number" |
| | | v-model="p_params.vol12HighCoeK2" |
| | | placeholder="请输入高压告警" |
| | | placeholder="请输入" |
| | | > |
| | | <template slot="append">V</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </td> |
| | | <td class="warn"></td> |
| | | </tr> |
| | | <tr> |
| | | <td>内阻告警</td> |
| | | <td> |
| | | <el-form-item prop="resGoodCoeK3"> |
| | | <el-input |
| | | type="number" |
| | | v-model="p_params.resGoodCoeK3" |
| | | placeholder="请输入内阻告警" |
| | | placeholder="请输入" |
| | | > |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </td> |
| | | <td class="warn"></td> |
| | | </tr> |
| | | <tr> |
| | | <td>内阻更换</td> |
| | | <td> |
| | | <el-form-item prop="resBadCoeK4"> |
| | | <el-input |
| | | type="number" |
| | | v-model="p_params.resBadCoeK4" |
| | | placeholder="请输入内阻更换" |
| | | placeholder="请输入" |
| | | > |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </td> |
| | | <td class="alarm"></td> |
| | | </tr> |
| | | <tr> |
| | | <td>连接条告警</td> |
| | | <td> |
| | | <el-form-item prop="chainResCoeK5"> |
| | | <el-input |
| | | type="number" |
| | | v-model="p_params.chainResCoeK5" |
| | | placeholder="请输入连接条告警" |
| | | placeholder="请输入" |
| | | > |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </td> |
| | | <td class="alarm"></td> |
| | | <td>连接条更换</td> |
| | | <td> |
| | | <el-form-item prop="chainResChange"> |
| | | <el-input |
| | | v-model="p_params.chainResChange" |
| | | placeholder="请输入" |
| | | > |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | |
| | | ></el-progress> |
| | | </div> |
| | | <div class="process-mask" v-show="processVisible"></div> |
| | | <!-- 更新日志 --> |
| | | <el-dialog |
| | | title="检测到新版本,请确认是否下载" |
| | | class="update-info" |
| | | :visible.sync="updateInfoVisible" |
| | | append-to-body |
| | | :close-on-click-modal="false" |
| | | :close-on-press-escape="false" |
| | | width="450px" |
| | | > |
| | | <div class="title"> |
| | | 检测到新版本 |
| | | <div class="version">V{{ pkgVersion }}</div> |
| | | <div class="size">大小:{{ pkgSize }} MB</div> |
| | | </div> |
| | | <div class="log"> |
| | | <div class="title">更新日志:</div> |
| | | <div class="log-list"> |
| | | <div |
| | | class="log-item" |
| | | v-for="(item, index) in logList" |
| | | :key="'list_' + index" |
| | | > |
| | | <div class="item-version">V{{ item.version }}</div> |
| | | <div class="item-info"> |
| | | <div |
| | | class="sub-item" |
| | | v-for="(note, idx) in item.notes" |
| | | :key="'note_' + idx" |
| | | > |
| | | <span class="index">{{ idx + 1 }})</span |
| | | >{{ note }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="footer"> |
| | | <el-button type="primary" @click="downloadOk">下载更新</el-button> |
| | | <el-button @click="downloadCancel">暂不更新</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 是否安装更新 --> |
| | | <el-dialog |
| | | title="是否安装更新" |
| | |
| | | setParams, |
| | | updateFileParam, |
| | | } from "@/apis"; |
| | | import axios from "axios"; |
| | | import { mapGetters, mapMutations } from "vuex"; |
| | | import CONST from "@/assets/js/const"; |
| | | import testVal from "@/assets/js/testVal"; |
| | |
| | | }, |
| | | ]; |
| | | const p_params = { |
| | | // chainResChange |
| | | chainResChange: 160, |
| | | chainResCoeK5: 120, |
| | | enabled: 1, |
| | | resBadCoeK4: 160, |
| | | resGoodCoeK3: 125, |
| | | vol1d2HighCoeK2: 1.44, |
| | | vol1d2LowCoeK1: 0.96, |
| | | vol2HighCoeK2: 2.35, |
| | | vol2LowCoeK1: 1.8, |
| | | vol6HighCoeK2: 7.05, |
| | | vol6LowCoeK1: 5.4, |
| | | vol12HighCoeK2: 14.1, |
| | | vol12LowCoeK1: 10.8, |
| | | }; |
| | |
| | | trigger: ["change", "blur"], |
| | | }; |
| | | const rules = { |
| | | vol1d2LowCoeK1: [ |
| | | { required: true, message: "请输入低压阈值", trigger: "blur" }, |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, O_rules.vol1d2LowCoeK1); |
| | | }, |
| | | trigger: ["change", "blur"], |
| | | }, |
| | | ], |
| | | vol1d2HighCoeK2: [ |
| | | { required: true, message: "请输入高压阈值", trigger: "blur" }, |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, O_rules.vol1d2HighCoeK2); |
| | | }, |
| | | trigger: ["change", "blur"], |
| | | }, |
| | | ], |
| | | vol2LowCoeK1: [ |
| | | { required: true, message: "请输入低压阈值", trigger: "blur" }, |
| | | { |
| | |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, O_rules.vol2HighCoeK2); |
| | | }, |
| | | trigger: ["change", "blur"], |
| | | }, |
| | | ], |
| | | vol6LowCoeK1: [ |
| | | { required: true, message: "请输入低压阈值", trigger: "blur" }, |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, O_rules.vol6LowCoeK1); |
| | | }, |
| | | trigger: ["change", "blur"], |
| | | }, |
| | | ], |
| | | vol6HighCoeK2: [ |
| | | { required: true, message: "请输入高压阈值", trigger: "blur" }, |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, O_rules.vol6HighCoeK2); |
| | | }, |
| | | trigger: ["change", "blur"], |
| | | }, |
| | |
| | | { required: true, message: "请输入连接条告警系数", trigger: "blur" }, |
| | | R_resGoodCoeK3, |
| | | ], |
| | | chainResChange: [ |
| | | { required: true, message: "请输入连接条更换系数", trigger: "blur" }, |
| | | R_resGoodCoeK3, |
| | | ], |
| | | }; |
| | | return { |
| | | rules, |
| | | askInstallVisible: false, |
| | | updateInfoVisible: false, |
| | | pkgVersion: "", |
| | | pkgPath: "", |
| | | pkgSize: 0, |
| | | logList: [], |
| | | percent: 0, |
| | | processVisible: false, |
| | | fileParseVisible: false, |
| | |
| | | }, |
| | | params(n) { |
| | | this.p_params = Object.assign({}, n); |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | ...mapMutations("setting", [ |
| | |
| | | this.askInstallVisible = true; |
| | | }); |
| | | |
| | | // 检测到更新 更新信息 |
| | | window.api.receive("update-info", this.showUpdateInfo); |
| | | |
| | | // this.$bus.$on("checkCloseAll", this.checkCloseAll); |
| | | |
| | | this.$bus.$on("setAlarmValue", this.viewsParams); |
| | |
| | | }, |
| | | installCancel() { |
| | | this.askInstallVisible = false; |
| | | }, |
| | | downloadOk() { |
| | | this.updateInfoVisible = false; |
| | | window.api.send("download-update"); |
| | | }, |
| | | downloadCancel() { |
| | | this.updateInfoVisible = false; |
| | | }, |
| | | showUpdateInfo(data) { |
| | | const { info, updataPath, currentVersion } = data; |
| | | axios({ |
| | | method: "GET", |
| | | url: `${updataPath}/update.info.json?t=${Math.random()}`, |
| | | }).then((res) => { |
| | | // console.log(res, info, "====json"); |
| | | let { data, status } = res; |
| | | if (200 == status && data) { |
| | | const { versions, notes } = data; |
| | | let list = []; |
| | | 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) { |
| | | break; |
| | | } |
| | | list.push({ |
| | | version, |
| | | notes: notes[version], |
| | | }); |
| | | } |
| | | this.logList = list; |
| | | this.updateInfoVisible = true; |
| | | } |
| | | }); |
| | | }, |
| | | updateProgress(progressObj) { |
| | | if (!this.processVisible) { |
| | |
| | | }); |
| | | } else { |
| | | const field = { |
| | | vol2LowCoeK1: "低压阈值", |
| | | vol2HighCoeK2: "高压阈值", |
| | | vol12LowCoeK1: "低压阈值", |
| | | vol12HighCoeK2: "高压阈值", |
| | | vol1d2LowCoeK1: "低压阈值(1.2V)", |
| | | vol1d2HighCoeK2: "高压阈值(1.2V)", |
| | | vol2LowCoeK1: "低压阈值(2V)", |
| | | vol2HighCoeK2: "高压阈值(2V)", |
| | | vol6LowCoeK1: "低压阈值(6V)", |
| | | vol6HighCoeK2: "高压阈值(6V)", |
| | | vol12LowCoeK1: "低压阈值(12V)", |
| | | vol12HighCoeK2: "高压阈值(12V)", |
| | | resGoodCoeK3: "内阻告警系数", |
| | | resBadCoeK4: "内阻更换系数", |
| | | chainResCoeK5: "连接条告警系数", |
| | | chainResChange: "连接条更换系数", |
| | | }; |
| | | let errStr = ""; |
| | | Object.keys(info).forEach((val) => { |
| | |
| | | border: 1px #333 solid; |
| | | padding: 4px; |
| | | } |
| | | td { |
| | | // color: #13c2c2; |
| | | .cell-box { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | .color { |
| | | width: 6em; |
| | | height: 1.6em; |
| | | margin-left: 4px; |
| | | // border: 0.5px #000 solid; |
| | | box-shadow: 1px 1px #000; |
| | | display: inline-block; |
| | | &.warn { |
| | | background: #ff0; |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | :deep(input)[type="number"]::-webkit-outer-spin-button, |
| | | :deep(input)[type="number"]::-webkit-inner-spin-button { |
| | | -webkit-appearance: none !important; |
| | | } |
| | | // :deep(input)[type="number"]::-webkit-outer-spin-button, |
| | | // :deep(input)[type="number"]::-webkit-inner-spin-button { |
| | | // -webkit-appearance: none !important; |
| | | // } |
| | | .process-wrap { |
| | | position: fixed; |
| | | left: 50%; |
| | |
| | | text-align: right; |
| | | } |
| | | } |
| | | .update-info :deep(.el-dialog__body) { |
| | | padding: 10px 20px; |
| | | .title { |
| | | display: flex; |
| | | margin-bottom: 10px; |
| | | } |
| | | .size { |
| | | margin-left: 3em; |
| | | } |
| | | .item-version, |
| | | .version { |
| | | margin-left: 0.4em; |
| | | display: inline-block; |
| | | font-weight: 700; |
| | | color: #090; |
| | | } |
| | | .log-list { |
| | | max-height: 200px; |
| | | overflow-y: auto; |
| | | } |
| | | .item-info { |
| | | padding-left: 2em; |
| | | .index { |
| | | display: inline-block; |
| | | margin-right: 0.6em; |
| | | } |
| | | } |
| | | .footer { |
| | | margin-top: 1.6em; |
| | | text-align: right; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | const { |
| | | resBadCoeK4, |
| | | resGoodCoeK3, |
| | | vol1d2HighCoeK2, |
| | | vol1d2LowCoeK1, |
| | | vol2HighCoeK2, |
| | | vol2LowCoeK1, |
| | | vol6HighCoeK2, |
| | | vol6LowCoeK1, |
| | | vol12HighCoeK2, |
| | | vol12LowCoeK1, |
| | | } = this.params; |
| | |
| | | BIT |
| | | ); |
| | | |
| | | if (2 == battVol) { |
| | | if (!this.marks.volChart.length) { |
| | | this.marks.volChart = [ |
| | | { |
| | | name: "高压告警", |
| | | y: 0, |
| | | type: "high", |
| | | color: "#ff0", |
| | | }, |
| | | { |
| | | name: "低压告警", |
| | | y: 0, |
| | | type: "low", |
| | | color: "#d9001b", |
| | | }, |
| | | ]; |
| | | } |
| | | switch (battVol) { |
| | | case 1.2: |
| | | this.marks.volChart[0].y = toFixed(vol1d2HighCoeK2, BIT); |
| | | this.marks.volChart[1].y = toFixed(vol1d2LowCoeK1, BIT); |
| | | break; |
| | | case 2: |
| | | this.marks.volChart[0].y = toFixed(vol2HighCoeK2, BIT); |
| | | this.marks.volChart[1].y = toFixed(vol2LowCoeK1, BIT); |
| | | } else if (12 == battVol) { |
| | | break; |
| | | case 6: |
| | | this.marks.volChart[0].y = toFixed(vol6HighCoeK2, BIT); |
| | | this.marks.volChart[1].y = toFixed(vol6LowCoeK1, BIT); |
| | | break; |
| | | case 12: |
| | | this.marks.volChart[0].y = toFixed(vol12HighCoeK2, BIT); |
| | | this.marks.volChart[1].y = toFixed(vol12LowCoeK1, BIT); |
| | | } else { |
| | | break; |
| | | default: |
| | | this.marks.volChart = []; |
| | | break; |
| | | } |
| | | this.$nextTick(() => { |
| | | this.initChart(); |
| | |
| | | :show-close="false" |
| | | width="800px" |
| | | > |
| | | <file-info v-if="fileInfoVisible" :info="fileData" @ok="editOk" @quit="quit"></file-info> |
| | | <file-info |
| | | v-if="fileInfoVisible" |
| | | :info="fileData" |
| | | @ok="editOk" |
| | | @quit="quit" |
| | | ></file-info> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | |
| | | import ChartContextMenu from "@/components/chartContextMenu"; |
| | | import offset from "@/assets/js/offset"; |
| | | import { mapGetters } from "vuex"; |
| | | import { Loading } from 'element-ui'; |
| | | import { Loading } from "element-ui"; |
| | | import { |
| | | getXmlValue, |
| | | testReport, |
| | |
| | | ], |
| | | chainVisiable: [ |
| | | { |
| | | name: "连接条", |
| | | name: "连接条告警", |
| | | y: 0, |
| | | type: "high", |
| | | color: "#ff0", |
| | | }, |
| | | { |
| | | name: "连接条更换", |
| | | y: 0, |
| | | type: "high", |
| | | color: "#d9001b", |
| | |
| | | let fileParam = data.fileParam; |
| | | |
| | | const { |
| | | chainResChange, |
| | | chainResCoeK5, |
| | | resBadCoeK4, |
| | | resGoodCoeK3, |
| | | vol1d2HighCoeK2, |
| | | vol1d2LowCoeK1, |
| | | vol2HighCoeK2, |
| | | vol2LowCoeK1, |
| | | vol6HighCoeK2, |
| | | vol6LowCoeK1, |
| | | vol12HighCoeK2, |
| | | vol12LowCoeK1, |
| | | } = this.params; |
| | | |
| | | this.marks.resVisiable[0].y = toFixed( |
| | | resGoodCoeK3 * fileParam.battRes / 100, |
| | | (resGoodCoeK3 * fileParam.battRes) / 100, |
| | | BIT |
| | | ); |
| | | this.marks.resVisiable[1].y = toFixed( |
| | | resBadCoeK4 * fileParam.battRes / 100, |
| | | (resBadCoeK4 * fileParam.battRes) / 100, |
| | | BIT |
| | | ); |
| | | if (2 == fileParam.battVol) { |
| | | this.marks.volVisiable[0].y = toFixed( |
| | | vol2HighCoeK2, |
| | | BIT |
| | | ); |
| | | this.marks.volVisiable[1].y = toFixed( |
| | | vol2LowCoeK1, |
| | | BIT |
| | | ); |
| | | } else if (12 == fileParam.battVol) { |
| | | this.marks.volVisiable[0].y = toFixed( |
| | | vol12HighCoeK2, |
| | | BIT |
| | | ); |
| | | this.marks.volVisiable[1].y = toFixed( |
| | | vol12LowCoeK1, |
| | | BIT |
| | | ); |
| | | } else { |
| | | if (!this.marks.volVisiable.length) { |
| | | this.marks.volVisiable = [ |
| | | { |
| | | name: "高压告警", |
| | | y: 0, |
| | | type: "high", |
| | | color: "#ff0", |
| | | }, |
| | | { |
| | | name: "低压告警", |
| | | y: 0, |
| | | type: "low", |
| | | color: "#d9001b", |
| | | }, |
| | | ]; |
| | | } |
| | | switch(fileParam.battVol) { |
| | | case 1.2: |
| | | this.marks.volVisiable[0].y = toFixed(vol1d2HighCoeK2, BIT); |
| | | this.marks.volVisiable[1].y = toFixed(vol1d2LowCoeK1, BIT); |
| | | break; |
| | | case 2: |
| | | this.marks.volVisiable[0].y = toFixed(vol2HighCoeK2, BIT); |
| | | this.marks.volVisiable[1].y = toFixed(vol2LowCoeK1, BIT); |
| | | break; |
| | | case 6: |
| | | this.marks.volVisiable[0].y = toFixed(vol6HighCoeK2, BIT); |
| | | this.marks.volVisiable[1].y = toFixed(vol6LowCoeK1, BIT); |
| | | break; |
| | | case 12: |
| | | this.marks.volVisiable[0].y = toFixed(vol12HighCoeK2, BIT); |
| | | this.marks.volVisiable[1].y = toFixed(vol12LowCoeK1, BIT); |
| | | break; |
| | | default: |
| | | this.marks.volVisiable = []; |
| | | break; |
| | | } |
| | | |
| | | this.marks.chainVisiable[0].y = toFixed( |
| | | chainResCoeK5 * fileParam.chainRes / 100, |
| | | (chainResCoeK5 * fileParam.chainRes) / 100, |
| | | BIT |
| | | ); |
| | | this.marks.chainVisiable[1].y = toFixed( |
| | | (chainResChange * fileParam.chainRes) / 100, |
| | | BIT |
| | | ); |
| | | |
| | |
| | | let fileParam = this.fileData; |
| | | |
| | | const { |
| | | chainResChange, |
| | | chainResCoeK5, |
| | | resBadCoeK4, |
| | | resGoodCoeK3, |
| | | vol1d2HighCoeK2, |
| | | vol1d2LowCoeK1, |
| | | vol2HighCoeK2, |
| | | vol2LowCoeK1, |
| | | vol6HighCoeK2, |
| | | vol6LowCoeK1, |
| | | vol12HighCoeK2, |
| | | vol12LowCoeK1, |
| | | } = this.params; |
| | | |
| | | this.marks.resVisiable[0].y = toFixed( |
| | | resGoodCoeK3 * fileParam.battRes / 100, |
| | | (resGoodCoeK3 * fileParam.battRes) / 100, |
| | | BIT |
| | | ); |
| | | this.marks.resVisiable[1].y = toFixed( |
| | | resBadCoeK4 * fileParam.battRes / 100, |
| | | (resBadCoeK4 * fileParam.battRes) / 100, |
| | | BIT |
| | | ); |
| | | if (2 == fileParam.battVol) { |
| | | this.marks.volVisiable[0].y = toFixed( |
| | | vol2HighCoeK2, |
| | | BIT |
| | | ); |
| | | this.marks.volVisiable[1].y = toFixed( |
| | | vol2LowCoeK1, |
| | | BIT |
| | | ); |
| | | } else if (12 == fileParam.battVol) { |
| | | this.marks.volVisiable[0].y = toFixed( |
| | | vol12HighCoeK2, |
| | | BIT |
| | | ); |
| | | this.marks.volVisiable[1].y = toFixed( |
| | | vol12LowCoeK1, |
| | | BIT |
| | | ); |
| | | } else { |
| | | switch(fileParam.battVol) { |
| | | case 1.2: |
| | | this.marks.volVisiable[0].y = toFixed(vol1d2HighCoeK2, BIT); |
| | | this.marks.volVisiable[1].y = toFixed(vol1d2LowCoeK1, BIT); |
| | | break; |
| | | case 2: |
| | | this.marks.volVisiable[0].y = toFixed(vol2HighCoeK2, BIT); |
| | | this.marks.volVisiable[1].y = toFixed(vol2LowCoeK1, BIT); |
| | | break; |
| | | case 6: |
| | | this.marks.volVisiable[0].y = toFixed(vol6HighCoeK2, BIT); |
| | | this.marks.volVisiable[1].y = toFixed(vol6LowCoeK1, BIT); |
| | | break; |
| | | case 12: |
| | | this.marks.volVisiable[0].y = toFixed(vol12HighCoeK2, BIT); |
| | | this.marks.volVisiable[1].y = toFixed(vol12LowCoeK1, BIT); |
| | | break; |
| | | default: |
| | | this.marks.volVisiable = []; |
| | | break; |
| | | } |
| | | |
| | | this.marks.chainVisiable[0].y = toFixed( |
| | | chainResCoeK5 * fileParam.chainRes / 100, |
| | | (chainResCoeK5 * fileParam.chainRes) / 100, |
| | | BIT |
| | | ); |
| | | this.marks.chainVisiable[1].y = toFixed( |
| | | (chainResChange * fileParam.chainRes) / 100, |
| | | BIT |
| | | ); |
| | | |
| | |
| | | 'autodownloadprogress', |
| | | 'isUpdateNow', |
| | | 'quitAndInstall', |
| | | "show-save-dialog" |
| | | "show-save-dialog", |
| | | "download-update", |
| | | "update-info" |
| | | ]; |
| | | |
| | | contextBridge.exposeInMainWorld('api', { |
| | |
| | | // 注意这个autoUpdater不是electron中的autoUpdater |
| | | import { autoUpdater } from "electron-updater" |
| | | import { dialog } from 'electron' |
| | | // import { dialog } from 'electron' |
| | | // import log from 'electron-log'; |
| | | |
| | | function handleUpdate(sender) { |
| | | /** |
| | | * |
| | | * @param {*} sender |
| | | * @param {*} quiet 静默模式 (系统自动检测时 不提示正在检查更新) |
| | | */ |
| | | function handleUpdate(sender, quiet) { |
| | | // log.info(autoUpdater); |
| | | const isTest = process.env.NODE_ENV == 'none'; |
| | | const returnData = { |
| | | error: { status: -1, msg: '检测更新查询异常' }, |
| | | checking: { status: 0, msg: '正在检查应用程序更新' }, |
| | |
| | | /* |
| | | 重点说明服务器的地址的内容,内容是打包以后生成的latest.yml,把这个文件放到服务器上,同时和你打包以后的安装包同级目录,这样latest.yml中的地址才能读取到 |
| | | */ |
| | | let updataPath = 'http://118.89.139.230:9098/res-update' |
| | | let updataPath = isTest ? 'http://118.89.139.230:9098/res-update-test' : 'http://118.89.139.230:9098/res-update'; |
| | | autoUpdater.setFeedURL({ |
| | | provider: 'generic', |
| | | url: updataPath |
| | |
| | | |
| | | //更新错误 |
| | | autoUpdater.on('error', function (error) { |
| | | sendUpdateMessage(sender, returnData.error) |
| | | !quiet && sendUpdateMessage(sender, returnData.error) |
| | | }); |
| | | |
| | | //检查中 |
| | | autoUpdater.on('checking-for-update', function () { |
| | | sendUpdateMessage(sender, returnData.checking); |
| | | !quiet && sendUpdateMessage(sender, returnData.checking); |
| | | }); |
| | | |
| | | //发现新版本 |
| | | // autoUpdater.on('update-available', function (info) { |
| | | // const options = { |
| | | // type: 'info', |
| | | // buttons: ['确定', '取消'], |
| | | // title: '更新提示', |
| | | // // ${info.version} Cannot read property 'version' of undefined |
| | | // message: `发现有新版本'${info.version}',是否下载?`, |
| | | // cancelId: 1 |
| | | // } |
| | | // dialog.showMessageBox(options).then(res => { |
| | | // // log.info(JSON.stringify(res)); |
| | | // if (res.response === 0) { |
| | | // autoUpdater.downloadUpdate() |
| | | // } else { |
| | | // return; |
| | | // } |
| | | // }) |
| | | // }); |
| | | autoUpdater.on('update-available', function (info) { |
| | | const options = { |
| | | type: 'info', |
| | | buttons: ['确定', '取消'], |
| | | title: '更新提示', |
| | | // ${info.version} Cannot read property 'version' of undefined |
| | | message: `发现有新版本'${info.version}',是否下载?`, |
| | | cancelId: 1 |
| | | } |
| | | dialog.showMessageBox(options).then(res => { |
| | | // log.info(JSON.stringify(res)); |
| | | if (res.response === 0) { |
| | | autoUpdater.downloadUpdate() |
| | | } else { |
| | | return; |
| | | } |
| | | }) |
| | | sender.send('update-info', { info, updataPath, currentVersion: autoUpdater.currentVersion.version }); |
| | | }); |
| | | |
| | | //当前版本为最新版本 |
| | | autoUpdater.on('update-not-available', function (info) { |
| | | setTimeout(function () { |
| | | !quiet && setTimeout(function () { |
| | | sendUpdateMessage(sender, returnData.updateNotAva) |
| | | }, 1000); |
| | | }); |
New file |
| | |
| | | { |
| | | "versions": ["0.1.4", "0.1.5"], |
| | | "notes": { |
| | | "0.1.4": ["添加了几个常用的快捷操作按钮", "调整了多页面逻辑,文件相关页面只能同时打开一个", "导出报告之后打开保存文件的路径", "添加了软件操作说明书"], |
| | | "0.1.5": ["添加了自动升级检测功能", "添加多种电池的电压告警阀值", "添加升级说明"] |
| | | } |
| | | } |