| | |
| | | :show-overflow-tooltip="true"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="errorText" label="升级失败原因" |
| | | align="center" :min-width="180" |
| | | :show-overflow-tooltip="true"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="升级进度" |
| | | align="center" :min-width="200" |
| | | :show-overflow-tooltip="true"> |
| | |
| | | width="180" |
| | | align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="primary" size="mini" @click="confirmUpdate(scope.row)" v-if="scope.row.dfuEn == 0">升级</el-button> |
| | | <el-button type="primary" size="mini" @click="confirmUpdate(scope.row)" v-if="scope.row.dfuEn != 1">升级</el-button> |
| | | <el-button type="danger" size="mini" @click="confirmStop(scope.row)" v-else>停止升级</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | import {searchCity, searchCounty, searchProvince} from "@/assets/js/api"; |
| | | import createWs from "@/assets/js/websocket"; |
| | | import {update} from "./js/aioUpdate"; |
| | | import {getLabelByValue} from "@/assets/js/tools"; |
| | | const WSMixin = createWs("aioUpdateSearch"); |
| | | import AIO from "./js/const/aio"; |
| | | export default { |
| | | name: "aioUpdate", |
| | | mixins: [WSMixin], |
| | |
| | | item.dfuDataBlocknum = 0; |
| | | } |
| | | item.percent = item.dfuDataBlocklen != 0? (item.dfuDataBlocknum * 100 /item.dfuDataBlocklen).toHold(1):0; |
| | | item.dfuEnText = item.dfuEn == 0?"等待升级":item.dfuEn == 1?"升级中":item.dfuEn == 2?"升级完成":"升级失败"; |
| | | item.dfuEnText = getLabelByValue(item.dfuEn, AIO.updateState); |
| | | item.errorText = getLabelByValue(item.errorCode, AIO.updateError); |
| | | return item; |
| | | }); |
| | | this.table.data = list; |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(()=>{ |
| | | this.update(rowData, 0); |
| | | this.update(rowData, 3); |
| | | }).catch(error=>{}); |
| | | }, |
| | | update(rowData, dfuEn) { |
| | |
| | | }, |
| | | mounted() { |
| | | this.searchProvince();//查询省 |
| | | } |
| | | }, |
| | | } |
| | | </script> |
| | | |
New file |
| | |
| | | export default { |
| | | updateState: [ |
| | | { |
| | | value: 0, |
| | | label: "等待升级", |
| | | }, |
| | | { |
| | | value: 1, |
| | | label: "升级中", |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: "升级完成", |
| | | }, |
| | | { |
| | | value: 3, |
| | | label: "升级失败", |
| | | }, |
| | | ], |
| | | updateError: [ |
| | | { |
| | | value: 0, |
| | | label: "无", |
| | | }, |
| | | { |
| | | value: 1, |
| | | label: "文件没找到", |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: "参数错误", |
| | | }, |
| | | { |
| | | value: 3, |
| | | label: "发送文件超时", |
| | | }, |
| | | { |
| | | value: 4, |
| | | label: "远程停止", |
| | | }, |
| | | ], |
| | | } |