diff --git a/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue b/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue index 76940c6ad..cd150b50f 100644 --- a/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue +++ b/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue @@ -52,22 +52,37 @@
+
+ +
IP
-
SN
+
SN
-
+
+
+ +
{{item.host}}
-
{{item.sn}}
+
{{item.sn}}
+
+
+ + All: {{this.assetList.length}} +
@@ -176,7 +191,7 @@
- +
@@ -286,6 +301,8 @@ show: true, } ], + assetListAll:false, + assetListHalf:false, } }, methods: { @@ -405,6 +422,7 @@ if (response.code === 200) { let respData = response.data.list; for (let i = 0; i < respData.length; i++) { + respData[i].sel=false; for (let j = 0; j < this.endpointList.length; j++) { if (respData[i].id == this.endpointList[j].assetId) { respData.splice(i, 1); @@ -466,25 +484,76 @@ }, // endpoint弹框中的asset子弹框里asset选择事件 - selectAsset(obj, index) { - this.endpointList.push({ - isEdit: false, - assetId: obj.id, - asset: obj, - host: obj.host, - param: this.currentModuleCopy.param ? this.currentModuleCopy.param : "", - paramObj: this.currentModuleCopy.paramObj ? this.currentModuleCopy.paramObj : {}, - port: this.currentModuleCopy.port, - path: this.currentModuleCopy.path, - moduleId: this.currentModuleCopy.id - }); - this.assetList.splice(index, 1); + selectAsset() { + this.$nextTick(()=>{ + let index=0; + this.assetList.forEach(item=>{ + if(item.sel){ + index++; + } + }); + if(index==0){ + this.assetListAll=false; + this.assetListHalf=false; + }else if(index{ + let flag=item.sel; + if(flag){ + item.sel=false; + let obj={ + isEdit: false, + assetId: item.id, + asset: item, + host: item.host, + param: this.currentModuleCopy.param ? this.currentModuleCopy.param : "", + paramObj: this.currentModuleCopy.paramObj ? this.currentModuleCopy.paramObj : {}, + port: this.currentModuleCopy.port, + path: this.currentModuleCopy.path, + moduleId: this.currentModuleCopy.id + }; + arr.push(obj); + } + return !flag + }); + this.endpointList=this.endpointList.concat(arr); this.$refs.assetScrollbar.update(); }, - + //全选的checkbox的事件 + assetListSelAll(flag){ + if(flag){ + this.assetListHalf=false; + this.assetList.forEach(item=>{ + item.sel=flag; + }); + }else if(!flag&& !this.assetListHalf){ + this.assetList.forEach(item=>{ + item.sel=flag; + }); + }else if(!flag&&this.assetListHalf){ + this.assetListHalf=false; + this.assetListAll=true; + this.assetList.forEach(item=>{ + item.sel= !flag; + }); + } + }, //将param转为json字符串格式 paramToJson(param) { let tempParam = {}; @@ -852,7 +921,7 @@ /* begin--table*/ .endpoint-sub-table { padding-top: 15px; - height: calc(100% - 45px); + height: calc(100% - 83px); } .line-100 { margin-bottom: 3px; @@ -903,6 +972,8 @@ height: 100%; background-color: rgba(255, 255, 255, 0.7); position: absolute; + z-index: 10; + top: 0; } .endpoints-clear-btn { margin: 6px 0 0 7px;