ZZJ
2022-04-12 994e5e08cba4e6b9ce321b7cf5cb1ec8d19dfa22
src/views/equipmentManagement/equipmentList/components/FormList.vue
@@ -114,14 +114,14 @@
        <el-table-column label="操作" min-width="180">
          <template slot-scope="scope">
            <!-- 加入 -->
            <span class="iconfont option" @click="joinCluster(scope.row)"
            <span
              class="iconfont option"
              @click="joinCluster(scope.row)"
              v-if="scope.row.clusterId"
              >&#xe640;</span
            >
            <!-- 退出 -->
            <span
              class="iconfont option"
              @click="quitCluster(scope.row)"
              v-if="false"
            <span class="iconfont option" @click="quitCluster(scope.row)" v-else
              >&#xe63c;</span
            >
            <!-- 算法详情 -->
@@ -181,7 +181,7 @@
</template>
<script>
import { findDevList } from "@/api/device";
import { findDevList, findClustersBySearch } from "@/api/device";
import AddBox from "@/views/equipmentManagement/equipmentList/components/AddBox";
import UnbindBox from "@/views/equipmentManagement/equipmentDetail/components/UnbindBox";
import QuitClusterBox from "@/views/equipmentManagement/equipmentList/components/QuitClusterBox";
@@ -192,6 +192,9 @@
    UnbindBox,
    QuitClusterBox,
    JoinClusterBox,
  },
  created() {
    this.getCluster();
  },
  data() {
    return {
@@ -207,16 +210,7 @@
      isShowAdd: false, //是否展示新增弹窗
      isShowUnbind: false, //是否展示解绑弹窗
      unbindId: "",
      clusterArr: [
        {
          value: 0,
          label: "集群1",
        },
        {
          value: 1,
          label: "集群2",
        },
      ], //所属集群下拉框
      clusterArr: [], //所属集群下拉框
      cluster: null, //选中的集群类型
      showQuit: false, //展示退出集群的弹窗
      showJoin: false, //展示加入集群的弹窗
@@ -224,15 +218,29 @@
    };
  },
  methods: {
    async getCluster() {
      const res = await findClustersBySearch({
        InputText: "",
        Page: 1,
        Size: 10000,
        userId: JSON.parse(sessionStorage.getItem("userInfo")).id,
      });
      if (res && res.success) {
        res.data.list.forEach((item) => {
          this.clusterArr.push({
            label: item.clusterName,
            value: item.clusterId,
          });
        });
      }
    },
    // 跳到设备详情
    checkDetail(row) {
      this.$router.push({
        path: "/equipmentDetail",
        query: {
          id: row.devId,
          ip: row.devIp,
          port: row.serverPort,
          ndid: row.id,
        },
      });
    },
@@ -243,8 +251,6 @@
        path: "/algorithmDetail",
        query: {
          id: row.devId,
          ip: row.devIp,
          port: row.serverPort,
        },
      });
    },
@@ -291,39 +297,8 @@
    //解绑按钮
    Untying(row) {
      console.log(row);
      this.unbindId = row.id;
      this.unbindId = row.devId;
      this.isShowUnbind = true;
      /*  this.$confirm(
        "解绑后该设备将从设备列表中移除,是否确认操作?",
        "解绑提示",
        {
          type: "warning",
          center: true,
        }
      )
        .then(() => {
          unbind({ ids: [row.id] })
            .then(() => {
              this.$notify({
                type: "success",
                message: "解绑成功",
                duration: 2500,
                offset: 57,
              });
              this.searchingBtn();
            })
            .catch(() => {
              this.$notify({
                type: "error",
                message: "解绑失败,请联系客服",
                duration: 2500,
                offset: 57,
              });
            });
        })
        .catch((e) => {
          console.log(e);
        }); */
    },
    //获得默认时间
@@ -402,6 +377,26 @@
      align-items: center;
    }
    .cluster {
      .el-select {
        width: 200px;
        height: 40px;
        line-height: 40px;
        ::v-deep input {
          height: 40px;
        }
        .el-icon-arrow-up {
          line-height: 40px;
        }
        ::v-deep .el-icon-arrow-up {
          height: 40px;
        }
      }
    }
    .id .el-input ::v-deep {
      width: 180px;
    }