From abe3a86c15105f215992d78bcaaf9b51efa1d565 Mon Sep 17 00:00:00 2001 From: ZZJ <10913410+zzj2100@user.noreply.gitee.com> Date: 星期四, 28 七月 2022 10:22:41 +0800 Subject: [PATCH] 解决冲突 --- src/views/equipmentManagement/equipmentList/components/FormList.vue | 167 +++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 119 insertions(+), 48 deletions(-) diff --git a/src/views/equipmentManagement/equipmentList/components/FormList.vue b/src/views/equipmentManagement/equipmentList/components/FormList.vue index ce47fc3..f46981c 100644 --- a/src/views/equipmentManagement/equipmentList/components/FormList.vue +++ b/src/views/equipmentManagement/equipmentList/components/FormList.vue @@ -44,7 +44,7 @@ <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> @@ -59,7 +59,7 @@ :default-sort="{ prop: 'createTime', order: 'descending' }" :stripe="true" > - <el-table-column label="搴忓彿" width="48" class-name="index"> + <el-table-column label="搴忓彿" width="80" class-name="index"> <template slot-scope="scope">{{ scope.$index + 1 + (page - 1) * size }}</template> @@ -67,7 +67,7 @@ <el-table-column prop="devId" label="璁惧ID" - min-width="180" + min-width="140" show-overflow-tooltip ></el-table-column> <el-table-column @@ -90,7 +90,7 @@ <div v-else>--</div> </template> </el-table-column> - <el-table-column label="棣栨浣跨敤鏃堕棿" min-width="159"> + <!-- <el-table-column label="棣栨浣跨敤鏃堕棿" min-width="159"> <template slot-scope="scope"> <div v-if="scope.row.firstUseTime.length > 1"> <div>{{ scope.row.firstUseTime[0] }}</div> @@ -98,10 +98,10 @@ </div> <div v-else>--</div> </template> - </el-table-column> + </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"> @@ -114,42 +114,54 @@ <el-table-column label="鎿嶄綔" min-width="180"> <template slot-scope="scope"> <!-- 鍔犲叆 --> - <span - class="iconfont option" - @click="joinCluster(scope.row)" + <el-tooltip + content="鍔犲叆闆嗙兢" + placement="top" v-if="!scope.row.clusterId" - :class="{ disable: scope.row.isOnline != 1 }" - ></span > + <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 - :class="{ disable: scope.row.isOnline != 1 }" - ></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" - :class="{ disable: scope.row.isOnline != 1 }" - @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" - :class="{ disable: scope.row.isOnline != 1 }" - @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> <!-- 瑙g粦 --> - <span - class="iconfont option" - @click="Untying(scope.row)" - :class="{ disable: scope.row.isOnline != 1 }" - ></span - > + <el-tooltip content="瑙i櫎缁戝畾" 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> @@ -195,7 +207,11 @@ </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"; @@ -215,10 +231,7 @@ }, 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: "", //杈撳叆妗嗗唴瀹� @@ -379,6 +392,7 @@ clearSearch() { this.searchTime = this.getDateInit(); this.inputText = ""; + this.cluster = ""; this.searchingBtn(); }, @@ -399,9 +413,56 @@ 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(); }, }; @@ -428,7 +489,7 @@ .cluster { .el-select { - width: 200px; + width: 190px; height: 40px; line-height: 40px; @@ -469,7 +530,7 @@ } .el-input ::v-deep { - width: 280px; + width: 270px; height: 40px; margin-left: 10px; margin-right: 20px; @@ -487,7 +548,7 @@ } .el-date-editor { - width: 318px; + width: 340px; height: 40px; margin-left: 10px; margin-right: 20px; @@ -503,7 +564,7 @@ } .searchBtn { - width: 120px; + width: 110px; height: 40px; line-height: 40px; text-align: center; @@ -513,7 +574,7 @@ } .resetBtn { - width: 120px; + width: 110px; height: 40px; line-height: 40px; text-align: center; @@ -616,7 +677,7 @@ .el-pagination ::v-deep { margin-top: 30px; - text-align: center; + text-align: right; height: 24px; .el-pagination__sizes { margin-right: 0; @@ -650,6 +711,16 @@ border-color: #0065ff; } } + + .el-pagination__jump { + margin-left: 12px; + .el-pagination__editor { + width: 37px; + input { + width: 32px; + } + } + } } } </style> -- Gitblit v1.8.0