zhangzengfei
2021-03-29 b0947006bc9b9f69dca30e7101081bdd4bd7f7c4
修复算例管理. tasks为空时列表渲染出错的问题
1个文件已修改
26 ■■■■■ 已修改文件
src/pages/analysisPower/index/App.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/analysisPower/index/App.vue
@@ -67,7 +67,7 @@
          :cell-style="cellStyle"
        >
          <el-table-column label="序号" type="index" align="center" width="60px"></el-table-column>
          <el-table-column label="摄像机名称" align="center" show-overflow-tooltip >
          <el-table-column label="摄像机名称" align="center" show-overflow-tooltip>
            <template slot-scope="scope">
              <span
                :style="scope.row.is_running ? `color:#3d68e1` : '' "
@@ -75,16 +75,24 @@
            </template>
          </el-table-column>
          <el-table-column label="摄像机地址" prop="addr" align="center" show-overflow-tooltip sortable></el-table-column>
          <el-table-column label="摄像机IP" prop="ip" align="center" width="130px" sortable :sort-method="ipSortMethod"></el-table-column>
          <el-table-column label="摄像机类型" align="center" width="120px" >
          <el-table-column
            label="摄像机IP"
            prop="ip"
            align="center"
            width="130px"
            sortable
            :sort-method="ipSortMethod"
          ></el-table-column>
          <el-table-column label="摄像机类型" align="center" width="120px">
            <template slot-scope="scope">
              <span>{{scope.row.run_type | cameraType}}</span>
            </template>
          </el-table-column>
          <el-table-column label="执行算法" align="center" show-overflow-tooltip >
          <el-table-column label="执行算法" align="center" show-overflow-tooltip>
            <template slot-scope="scope">
              <span v-if="scope.row.run_type === -1 ">-</span>
              <span v-else>{{scope.row.tasks | taskList}}</span>
              <span v-else-if="scope.row.tasks != null ">{{scope.row.tasks | taskList}}</span>
              <span v-else>-</span>
            </template>
          </el-table-column>
          <el-table-column label="运行设备" align="center" width="160px" sortable>
@@ -283,13 +291,11 @@
    clearTimeout(this.timeout);
  },
  methods: {
    ipSortMethod(a,b){
      console.log(a,b);
      // debugger
      if(Number(a.ip.substr(a.ip.lastIndexOf('.')+1)) < Number(b.ip.substr(b.ip.lastIndexOf('.')+1))){
    ipSortMethod(a, b) {
      if (Number(a.ip.substr(a.ip.lastIndexOf('.') + 1)) < Number(b.ip.substr(b.ip.lastIndexOf('.') + 1))) {
        return -1;
      }
      if(Number(a.ip.substr(a.ip.lastIndexOf('.')+1)) > Number(b.ip.substr(b.ip.lastIndexOf('.')+1))){
      if (Number(a.ip.substr(a.ip.lastIndexOf('.') + 1)) > Number(b.ip.substr(b.ip.lastIndexOf('.') + 1))) {
        return 1;
      }
      return 0;