From 86c9a1b4e5f91e85ba3aef98be5961398f55e475 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@iotlink.com> Date: 星期一, 21 六月 2021 11:48:32 +0800 Subject: [PATCH] 添加lkg删除功能 --- src/pages/shuohuangMonitorAnalyze/components/lkgManage.vue | 38 +++++++++++++++++++++++++++++++++++++- 1 files changed, 37 insertions(+), 1 deletions(-) diff --git a/src/pages/shuohuangMonitorAnalyze/components/lkgManage.vue b/src/pages/shuohuangMonitorAnalyze/components/lkgManage.vue index b4c9115..d082523 100644 --- a/src/pages/shuohuangMonitorAnalyze/components/lkgManage.vue +++ b/src/pages/shuohuangMonitorAnalyze/components/lkgManage.vue @@ -27,13 +27,18 @@ <el-table-column prop="Driver2" label="鍓徃鏈�"></el-table-column> <el-table-column prop="StartTime" label="寮�濮嬫椂闂�"></el-table-column> <el-table-column prop="EndTime" label="缁撴潫鏃堕棿"></el-table-column> + <el-table-column label="鎿嶄綔"> + <template slot-scope="scope"> + <i class="el-icon-delete del-icon" @click="delLKG(scope.row)"></i> + </template> + </el-table-column> </el-table> </div> </div> </template> <script> -import { uploadLKG, getLKGData } from "@/api/shuohuang" +import { uploadLKG, getLKGData, delLKGData } from "@/api/shuohuang" export default { data() { @@ -74,6 +79,32 @@ this.lkgData = rsp.data; } }) + }, + delLKG(row) { + + this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + + delLKGData({ id: row.ID }).then(rsp => { + if (rsp && rsp.success) { + this.$message.success("鍒犻櫎鎴愬姛") + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + + this.fetchLKGData() + }).catch(err => { + this.$message.warning("鍒犻櫎澶辫触") + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堝垹闄�' + }); + }); } } } @@ -89,5 +120,10 @@ .lkg-list { margin: 10px 20px; } + + .del-icon { + color: red; + cursor: pointer; + } } </style> \ No newline at end of file -- Gitblit v1.8.0