| | |
| | | <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 |
| | | > |
| | | <!-- 算法详情 --> |
| | |
| | | </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"; |
| | | import JoinClusterBox from "@/views/equipmentManagement/equipmentList/components/JoinClusterBox"; |
| | | |
| | | import bus from "@/plugin/bus"; |
| | | |
| | | export default { |
| | | components: { |
| | | AddBox, |
| | | UnbindBox, |
| | | QuitClusterBox, |
| | | JoinClusterBox, |
| | | }, |
| | | created() { |
| | | this.getCluster(); |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | isShowAdd: false, //是否展示新增弹窗 |
| | | isShowUnbind: false, //是否展示解绑弹窗 |
| | | unbindId: "", |
| | | clusterArr: [ |
| | | { |
| | | value: 0, |
| | | label: "集群1", |
| | | }, |
| | | { |
| | | value: 1, |
| | | label: "集群2", |
| | | }, |
| | | ], //所属集群下拉框 |
| | | clusterArr: [], //所属集群下拉框 |
| | | cluster: null, //选中的集群类型 |
| | | showQuit: false, //展示退出集群的弹窗 |
| | | showJoin: false, //展示加入集群的弹窗 |
| | |
| | | }; |
| | | }, |
| | | 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, |
| | | }, |
| | | }); |
| | | }, |
| | |
| | | path: "/algorithmDetail", |
| | | query: { |
| | | id: row.devId, |
| | | ip: row.devIp, |
| | | port: row.serverPort, |
| | | }, |
| | | }); |
| | | }, |
| | |
| | | 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(" "); |
| | |
| | | if (res.data.total <= this.size) { |
| | | this.page = 1; |
| | | } |
| | | |
| | | bus.$emit("refleshNode", this.dataList); |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | |
| | | |
| | | //解绑按钮 |
| | | 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); |
| | | }); */ |
| | | }, |
| | | |
| | | //获得默认时间 |
| | |
| | | //关闭新增弹窗 |
| | | closeAddBox() { |
| | | this.isShowAdd = false; |
| | | this.searchingBtn(); |
| | | }, |
| | | // 关闭解绑弹窗 |
| | | closeUnbindBox() { |
| | |
| | | |
| | | //解绑成功回调 |
| | | reflash() { |
| | | console.log("1111"); |
| | | this.isShowUnbind = false; |
| | | this.searchingBtn(); |
| | | }, |
| | |
| | | padding: 60px 0 30px 0; |
| | | font-size: 14px; |
| | | border-bottom: 1px solid #e9ebee; |
| | | background-color: #fff; |
| | | |
| | | .left, |
| | | .right, |
| | |
| | | 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; |
| | | } |