From c992e66812f0deafce1e50dd54b927034cfeae22 Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期五, 22 四月 2022 16:18:30 +0800
Subject: [PATCH] 开通接口
---
src/views/equipmentManagement/equipmentList/components/FormList.vue | 107 +++++++++++++++++++++++++----------------------------
1 files changed, 51 insertions(+), 56 deletions(-)
diff --git a/src/views/equipmentManagement/equipmentList/components/FormList.vue b/src/views/equipmentManagement/equipmentList/components/FormList.vue
index 347be27..01bd855 100644
--- a/src/views/equipmentManagement/equipmentList/components/FormList.vue
+++ b/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"
></span
>
<!-- 閫�鍑� -->
- <span
- class="iconfont option"
- @click="quitCluster(scope.row)"
- v-if="false"
+ <span class="iconfont option" @click="quitCluster(scope.row)" v-else
></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, //鏄惁灞曠ず瑙g粦寮圭獥
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,
},
});
},
@@ -254,15 +260,15 @@
let param = {
page: this.page,
size: this.size,
- // startTime: this.searchTime[0],
- // endTime: this.searchTime[1],
+ startTime: this.searchTime[0],
+ endTime: this.searchTime[1],
+ clusterId: this.cluster,
inputText: this.inputText,
};
findDevList(param)
.then((res) => {
this.dataList = res.data.list;
//鏃堕棿鍒嗚鏄剧ず
-
this.dataList.forEach((item) => {
item.installTime = item.installTime.split(" ");
item.firstUseTime = item.firstUseTime.split(" ");
@@ -291,39 +297,8 @@
//瑙g粦鎸夐挳
Untying(row) {
console.log(row);
- this.unbindId = row.id;
+ this.unbindId = row.devId;
this.isShowUnbind = true;
- /* this.$confirm(
- "瑙g粦鍚庤璁惧灏嗕粠璁惧鍒楄〃涓Щ闄わ紝鏄惁纭鎿嶄綔?",
- "瑙g粦鎻愮ず",
- {
- type: "warning",
- center: true,
- }
- )
- .then(() => {
- unbind({ ids: [row.id] })
- .then(() => {
- this.$notify({
- type: "success",
- message: "瑙g粦鎴愬姛",
- duration: 2500,
- offset: 57,
- });
- this.searchingBtn();
- })
- .catch(() => {
- this.$notify({
- type: "error",
- message: "瑙g粦澶辫触锛岃鑱旂郴瀹㈡湇",
- 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;
}
--
Gitblit v1.8.0