ZZJ
2022-04-12 994e5e08cba4e6b9ce321b7cf5cb1ec8d19dfa22
src/views/equipmentManagement/algorithmDetail/index.vue
@@ -51,7 +51,7 @@
            :key="index"
            :data="item"
            :type="'sdk'"
            :address="{ ip: ip, port: port }"
            :id="id"
          ></Card>
        </div>
        <el-select
@@ -78,7 +78,7 @@
            :data="item"
            :key="index"
            :type="'app'"
            :address="{ ip: ip, port: port }"
            :id="id"
          ></Card>
        </div>
        <el-select
@@ -108,11 +108,15 @@
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: "算法总数",
@@ -148,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: "",
    };
  },
@@ -174,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);
        }
      });
@@ -190,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);
        }
@@ -222,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;
@@ -260,6 +264,10 @@
        return this.upgradeSdk;
      }
      if (this.algorithm == "process") {
        return this.enableSdk;
      }
      return [];
    },
    applicationArr() {