ZZJ
2022-07-15 5c0c6ad7ac6f28e970532af9936de638830f1161
src/views/equipmentManagement/algorithmDetail/index.vue
@@ -4,7 +4,9 @@
    <!-- 面包屑 -->
    <div class="heart">
      <el-breadcrumb separator=">">
        <el-breadcrumb-item>管理中心</el-breadcrumb-item>
        <el-breadcrumb-item :to="{ path: '/manageCenter' }"
          >管理中心</el-breadcrumb-item
        >
        <el-breadcrumb-item :to="{ path: '/equipmentList' }"
          >设备管理</el-breadcrumb-item
        >
@@ -49,7 +51,7 @@
            :key="index"
            :data="item"
            :type="'sdk'"
            :address="{ ip: ip, port: port }"
            :id="id"
          ></Card>
        </div>
        <el-select
@@ -76,7 +78,7 @@
            :data="item"
            :key="index"
            :type="'app'"
            :address="{ ip: ip, port: port }"
            :id="id"
          ></Card>
        </div>
        <el-select
@@ -106,32 +108,36 @@
import Card from "@/views/equipmentManagement/algorithmDetail/components/Card";
export default {
  created() {
    this.userId = JSON.parse(sessionStorage.getItem("userInfo")).id;
    this.id = this.$route.query.id;
    this.getData();
  },
  data() {
    return {
      deviceData: {},
      userId: null,
      id: null,
      applicationInfo: [
        {
          label: "算法总数",
          count: "",
          img: "/images/equipmentManagement/算法.png",
          img: "/images/equipmentManagement/sdk.png",
        },
        {
          label: "应用总数",
          count: "",
          img: "/images/equipmentManagement/应用_红.png",
          img: "/images/equipmentManagement/app.png",
          color: "red",
        },
        {
          label: "待升级算法",
          count: "",
          img: "/images/equipmentManagement/算法_升级.png",
          img: "/images/equipmentManagement/upgrade.png",
        },
        {
          label: "待升级应用",
          count: "",
          img: "/images/equipmentManagement/应用_红_升级.png",
          img: "/images/equipmentManagement/app_upgrade.png",
          color: "red",
        },
      ], //应用信息
@@ -146,13 +152,12 @@
        { value: "all", label: "全部应用" },
        { value: "update", label: "待升级应用" },
      ], //应用下拉框选项
      ip: this.$route.query.ip,
      port: this.$route.query.port,
      id: this.$route.query.id,
      activeApp: [],
      upgradeApp: [],
      activeSdk: [],
      upgradeSdk: [],
      enableSdk: [],
      time: "",
    };
  },
@@ -172,13 +177,16 @@
    //获取应用列表
    async getApp() {
      const res = await findAllApp({ ip: this.ip, port: this.port });
      res.data.data.forEach((item) => {
      const res = await findAllApp({ userId: "", nodeId: this.id });
      res.data.forEach((item) => {
        if (item.installed) {
          this.activeApp.push(item);
        }
        if (item.installed && item.isUpgrade) {
          this.upgradeApp.push(item);
        }
        if (item.installed && item.enable) {
          this.enableSdk.push(item);
        }
      });
@@ -188,14 +196,12 @@
      this.applicationInfo[3].count = this.upgradeApp.length
        ? this.upgradeApp.length
        : 0;
      console.log(this.applicationInfo);
    },
    //获取算法列表
    async getSdk() {
      const res2 = await findAllSdk({ ip: this.ip, port: this.port });
      res2.data.data.forEach((item) => {
      const res2 = await findAllSdk({ userId: "", nodeId: this.id });
      res2.data.forEach((item) => {
        if (item.installed) {
          this.activeSdk.push(item);
        }
@@ -220,7 +226,7 @@
    //获取设备时间戳
    async getTime() {
      const res = await clockInfo({ ip: this.ip, port: this.port });
      const res = await clockInfo({ userId: this.userId, nodeId: this.id });
      if (res && res.success) {
        //   const timezone = res.data.time_zone;
        let timestamp = res.data.local_time;
@@ -258,6 +264,10 @@
        return this.upgradeSdk;
      }
      if (this.algorithm == "process") {
        return this.enableSdk;
      }
      return [];
    },
    applicationArr() {