From 3b21f385cdae7d94fce1ebba6abb06a893f57114 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期二, 02 十一月 2021 10:40:29 +0800 Subject: [PATCH] 对需要向设备发起请求的http请求,使用缓存,等待设备请求返回的时候一次性释放所有请求 --- web_src/src/components/MediaServerManger.vue | 26 +++++++++++++++++++++++--- 1 files changed, 23 insertions(+), 3 deletions(-) diff --git a/web_src/src/components/MediaServerManger.vue b/web_src/src/components/MediaServerManger.vue index 19674d1..07b0523 100644 --- a/web_src/src/components/MediaServerManger.vue +++ b/web_src/src/components/MediaServerManger.vue @@ -18,9 +18,11 @@ <div class="card-img-zlm"></div> <div style="padding: 14px;text-align: left"> <span style="font-size: 16px">{{item.id}}</span> + <el-button icon="el-icon-edit" style="padding: 0;float: right;" type="text" @click="edit(item)">缂栬緫</el-button> + <el-button icon="el-icon-delete" style="margin-right: 10px;padding: 0;float: right;" type="text" @click="del(item)">绉婚櫎</el-button> <div style="margin-top: 13px; line-height: 12px; "> - <span style="font-size: 14px; color: #999; margin-top: 5px">鍒涘缓鏃堕棿锛� {{item.createTime}}</span> - <el-button icon="el-icon-edit" style="padding: 0;float: right;" type="text" @click="edit(item)">缂栬緫</el-button> + <span style="font-size: 14px; color: #999; margin-top: 5px; ">{{item.ip}}</span> + <span style="font-size: 14px; color: #999; margin-top: 5px; float: right;">{{item.createTime}}</span> </div> </div> <i v-if="item.status" class="iconfont icon-online server-card-status-online" title="鍦ㄧ嚎"></i> @@ -88,6 +90,25 @@ edit: function (row){ this.$refs.mediaServerEdit.openDialog(row, this.initData) }, + del: function (row){ + this.$confirm('纭鍒犻櫎姝よ妭鐐癸紵', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + this.mediaServerObj.delete(row.id, (data)=>{ + if (data.code === 0) { + this.$message({ + type: 'success', + message: '鍒犻櫎鎴愬姛!' + }); + } + }) + + }).catch(() => { + }); + + }, getNumberByWidth(){ let candidateNums = [1, 2, 3, 4, 6, 8, 12, 24] let clientWidth = window.innerWidth - 30; @@ -106,7 +127,6 @@ } } - console.log("aadada: "+ resultVal) return resultVal; }, dateFormat: function(/** timestamp=0 **/) { -- Gitblit v1.8.0