src/pages/analysisPower/index/App.vue
@@ -116,14 +116,42 @@
            </template>
          </el-table-column>
          <el-table-column
            label="执行算法"
            label="AI任务"
            align="center"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <span v-if="scope.row.run_type === -1">-</span>
              <span v-else-if="scope.row.tasks != null">{{
                scope.row.tasks | taskList
              <span v-else-if="scope.row.allTasks != null">{{
                scope.row.allTasks | allTaskList
              }}</span>
              <span v-else>-</span>
            </template>
          </el-table-column>
          <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-if="scope.row.allTasks != null">{{
                scope.row.allTasks | allDescription
              }}</span>
              <span v-else>-</span>
            </template>
          </el-table-column>
          <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-if="scope.row.allTasks != null">{{
                scope.row.allTasks | allEventName
              }}</span>
              <span v-else>-</span>
            </template>
@@ -276,7 +304,7 @@
    cameraType(type) {
      return type === -1 ? "监控摄像机" : "AI摄像机";
    },
    taskList(tasks) {
    taskList(tasks) {//执行算法
      return tasks
        .filter((task) => {
          return task.hasRule;
@@ -285,6 +313,27 @@
          return task.taskname;
        })
        .join(",");
    },
    allTaskList(allTasks) {
      return allTasks
        .map((allTasks) => {
          return allTasks.taskName;
        })
        .join(" / ");
    },
    allEventName(allTasks) {
      return allTasks
        .map((allTasks) => {
          return allTasks.eventName;
        })
        .join(" / ");
    },
    allDescription(allTasks) {
      return allTasks
        .map((allTasks) => {
          return allTasks.taskDescription;
        })
        .join(" / ");
    },
    switchText(type) {
      return type ? "已开启" : "未开启";
@@ -435,26 +484,26 @@
        _this.statistic();
      }, 10 * 1000);
    },
    pollSwitch(row) {
      changeRunType({ camera_ids: [row.id], run_type: row.run_type ^ 1 }).then(
        (rsp) => {
          if (rsp && rsp.success) {
            this.$notify({
              type: "success",
              message: "配置成功",
            });
    pollSwitch(row) {//轮询功能 暂未实现
      // changeRunType({ camera_ids: [row.id], run_type: row.run_type ^ 1 }).then(
      //   (rsp) => {
      //     if (rsp && rsp.success) {
      //       this.$notify({
      //         type: "success",
      //         message: "配置成功",
      //       });
            row.run_type = row.run_type ^ 1;
          } else {
            this.$notify({
              type: "error",
              message: "配置失败",
            });
          }
      //       row.run_type = row.run_type ^ 1;
      //     } else {
      //       this.$notify({
      //         type: "error",
      //         message: "配置失败",
      //       });
      //     }
          // this.PollData.fetchPollList();
        }
      );
      //     // this.PollData.fetchPollList();
      //   }
      // );
    },
    initLineChart() {
      // console.log(this.barChart,'initLineChart')