longyvfengyun
2022-05-11 e4d9e32befc94e645e225d3bcaaf10def762bd05
内容提交
1个文件已添加
1个文件已修改
58 ■■■■■ 已修改文件
src/views/jobManage/aioUpdate.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/jobManage/js/const/aio.js 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/jobManage/aioUpdate.vue
@@ -76,6 +76,11 @@
          :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">
@@ -97,7 +102,7 @@
          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>
@@ -126,7 +131,9 @@
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],
@@ -265,7 +272,8 @@
          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;
@@ -301,7 +309,7 @@
        cancelButtonText: '取消',
        type: 'warning'
      }).then(()=>{
        this.update(rowData, 0);
        this.update(rowData, 3);
      }).catch(error=>{});
    },
    update(rowData, dfuEn) {
@@ -336,7 +344,7 @@
  },
  mounted() {
    this.searchProvince();//查询省
  }
  },
}
</script>
src/views/jobManage/js/const/aio.js
New file
@@ -0,0 +1,42 @@
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: "远程停止",
    },
  ],
}