| | |
| | | <div class="button add" @click="isShowAdd = true"> |
| | | <span>+</span>添加设备 |
| | | </div> |
| | | <div class="button export"> |
| | | <div class="button export" @click="exportFile"> |
| | | <span class="iconfont"></span>导出 |
| | | </div> |
| | | </div> |
| | |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="所属集群" show-overflow-tooltip min-width="154"> |
| | | <template> -- </template> |
| | | <template slot-scope="scope"> {{ scope.row.clusterName }} </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="状态" min-width="70"> |
| | |
| | | <el-table-column label="操作" min-width="180"> |
| | | <template slot-scope="scope"> |
| | | <!-- 加入 --> |
| | | <span |
| | | class="iconfont option" |
| | | @click="joinCluster(scope.row)" |
| | | v-if="scope.row.clusterId" |
| | | ></span |
| | | <el-tooltip |
| | | content="加入集群" |
| | | placement="top" |
| | | v-if="!scope.row.clusterId" |
| | | > |
| | | <span |
| | | class="iconfont option" |
| | | @click="joinCluster(scope.row)" |
| | | :class="{ disable: scope.row.isOnline != 1 }" |
| | | ></span |
| | | > |
| | | </el-tooltip> |
| | | <!-- 退出 --> |
| | | <span class="iconfont option" @click="quitCluster(scope.row)" v-else |
| | | ></span |
| | | > |
| | | <el-tooltip content="退出集群" placement="top" v-else> |
| | | <span |
| | | class="iconfont option" |
| | | @click="quitCluster(scope.row)" |
| | | :class="{ disable: scope.row.isOnline != 1 }" |
| | | ></span |
| | | > |
| | | </el-tooltip> |
| | | <!-- 算法详情 --> |
| | | <span class="iconfont option" @click="algorithmDetail(scope.row)" |
| | | ></span |
| | | > |
| | | <el-tooltip content="应用详情" placement="top"> |
| | | <span |
| | | class="iconfont option" |
| | | :class="{ disable: scope.row.isOnline != 1 }" |
| | | @click="algorithmDetail(scope.row)" |
| | | ></span |
| | | > |
| | | </el-tooltip> |
| | | <!-- 设备详情 --> |
| | | <span class="iconfont option" @click="checkDetail(scope.row)" |
| | | ></span |
| | | > |
| | | <el-tooltip content="设备详情" placement="top"> |
| | | <span |
| | | class="iconfont option" |
| | | :class="{ disable: scope.row.isOnline != 1 }" |
| | | @click="checkDetail(scope.row)" |
| | | ></span |
| | | > |
| | | </el-tooltip> |
| | | <!-- 解绑 --> |
| | | <span class="iconfont option" @click="Untying(scope.row)" |
| | | ></span |
| | | > |
| | | <el-tooltip content="解除绑定" placement="top"> |
| | | <span |
| | | class="iconfont option" |
| | | @click="Untying(scope.row)" |
| | | :class="{ disable: scope.row.isOnline != 1 }" |
| | | ></span |
| | | > |
| | | </el-tooltip> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { findDevList, findClustersBySearch } from "@/api/device"; |
| | | import { |
| | | findDevList, |
| | | findClustersBySearch, |
| | | exportDevListExcel, |
| | | } 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"; |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | searchTime: [ |
| | | this.$moment().format("YYYY-MM-DD 00:00:00"), |
| | | this.$moment().format("YYYY-MM-DD HH:mm:ss"), |
| | | ], //搜索时间 |
| | | searchTime: [], //搜索时间 |
| | | page: 1, |
| | | size: 10, //分页相关 |
| | | inputText: "", //输入框内容 |
| | |
| | | |
| | | // 跳到设备详情 |
| | | checkDetail(row) { |
| | | if (row.isOnline != 1) { |
| | | return; |
| | | } |
| | | this.$router.push({ |
| | | path: "/equipmentDetail", |
| | | query: { |
| | |
| | | |
| | | // 跳到算法详情 |
| | | algorithmDetail(row) { |
| | | if (row.isOnline != 1) { |
| | | return; |
| | | } |
| | | this.$router.push({ |
| | | path: "/algorithmDetail", |
| | | query: { |
| | |
| | | |
| | | // 查询列表 |
| | | searchingBtn() { |
| | | let param = { |
| | | page: this.page, |
| | | size: this.size, |
| | | startTime: this.searchTime[0], |
| | | endTime: this.searchTime[1], |
| | | clusterId: this.cluster, |
| | | inputText: this.inputText, |
| | | }; |
| | | let param = {}; |
| | | |
| | | if (!this.searchTime) { |
| | | param = { |
| | | page: this.page, |
| | | size: this.size, |
| | | startTime: "", |
| | | endTime: "", |
| | | clusterId: this.cluster, |
| | | inputText: this.inputText, |
| | | }; |
| | | } else { |
| | | param = { |
| | | page: this.page, |
| | | size: this.size, |
| | | startTime: this.searchTime[0], |
| | | endTime: this.searchTime[1], |
| | | clusterId: this.cluster, |
| | | inputText: this.inputText, |
| | | }; |
| | | } |
| | | |
| | | findDevList(param) |
| | | .then((res) => { |
| | | this.dataList = res.data.list; |
| | |
| | | |
| | | //解绑按钮 |
| | | Untying(row) { |
| | | if (row.isOnline != 1) { |
| | | return; |
| | | } |
| | | this.unbindId = row.devId; |
| | | this.isShowUnbind = true; |
| | | }, |
| | |
| | | |
| | | //解绑成功回调 |
| | | reflash() { |
| | | console.log("1111"); |
| | | this.isShowUnbind = false; |
| | | this.searchingBtn(); |
| | | }, |
| | |
| | | clearSearch() { |
| | | this.searchTime = this.getDateInit(); |
| | | this.inputText = ""; |
| | | this.cluster = ""; |
| | | this.searchingBtn(); |
| | | }, |
| | | |
| | | //退出集群 |
| | | quitCluster(equipment) { |
| | | if (equipment.isOnline != 1) { |
| | | return; |
| | | } |
| | | this.activeEquipment = equipment; |
| | | this.showQuit = true; |
| | | }, |
| | | |
| | | //加入集群 |
| | | joinCluster(equipment) { |
| | | if (equipment.isOnline != 1) { |
| | | return; |
| | | } |
| | | this.activeEquipment = equipment; |
| | | this.showJoin = true; |
| | | }, |
| | | |
| | | //导出列表文件 |
| | | async exportFile() { |
| | | let param = {}; |
| | | |
| | | if (!this.searchTime) { |
| | | param = { |
| | | page: this.page, |
| | | size: this.size, |
| | | startTime: "", |
| | | endTime: "", |
| | | clusterId: this.cluster, |
| | | inputText: this.inputText, |
| | | }; |
| | | } else { |
| | | param = { |
| | | page: this.page, |
| | | size: this.size, |
| | | startTime: this.searchTime[0], |
| | | endTime: this.searchTime[1], |
| | | clusterId: this.cluster, |
| | | inputText: this.inputText, |
| | | }; |
| | | } |
| | | const result = await exportDevListExcel(param); |
| | | |
| | | var blob = new Blob([result.body.data], { |
| | | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8", |
| | | }), |
| | | Temp = document.createElement("a"); |
| | | |
| | | Temp.href = window.URL.createObjectURL(blob); |
| | | |
| | | console.log(result); |
| | | console.log(result.fileName); |
| | | |
| | | Temp.download = window.decodeURI(result.fileName); |
| | | |
| | | Temp.setAttribute("download", result.fileName); |
| | | |
| | | document.body.appendChild(Temp); |
| | | |
| | | Temp.click(); |
| | | |
| | | document.body.removeChild(Temp); |
| | | |
| | | window.URL.revokeObjectURL(Temp); |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.searchTime = this.getDateInit(); |
| | | this.searchingBtn(); |
| | | }, |
| | | }; |
| | |
| | | |
| | | .cluster { |
| | | .el-select { |
| | | width: 200px; |
| | | width: 190px; |
| | | height: 40px; |
| | | line-height: 40px; |
| | | |
| | |
| | | } |
| | | |
| | | .el-input ::v-deep { |
| | | width: 280px; |
| | | width: 270px; |
| | | height: 40px; |
| | | margin-left: 10px; |
| | | margin-right: 20px; |
| | |
| | | } |
| | | |
| | | .el-date-editor { |
| | | width: 318px; |
| | | width: 340px; |
| | | height: 40px; |
| | | margin-left: 10px; |
| | | margin-right: 20px; |
| | |
| | | } |
| | | |
| | | .searchBtn { |
| | | width: 120px; |
| | | width: 110px; |
| | | height: 40px; |
| | | line-height: 40px; |
| | | text-align: center; |
| | |
| | | } |
| | | |
| | | .resetBtn { |
| | | width: 120px; |
| | | width: 110px; |
| | | height: 40px; |
| | | line-height: 40px; |
| | | text-align: center; |
| | |
| | | font-size: 24px; |
| | | color: rgb(0, 101, 255); |
| | | cursor: pointer; |
| | | |
| | | &.disable { |
| | | color: #666; |
| | | cursor: default; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .el-pagination ::v-deep { |
| | | margin-top: 30px; |
| | | text-align: center; |
| | | text-align: right; |
| | | height: 24px; |
| | | .el-pagination__sizes { |
| | | margin-right: 0; |
| | |
| | | border-color: #0065ff; |
| | | } |
| | | } |
| | | |
| | | .el-pagination__jump { |
| | | margin-left: 12px; |
| | | .el-pagination__editor { |
| | | width: 37px; |
| | | input { |
| | | width: 32px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |