From f10636d07f7f8a6f747530562b33b9a05e943555 Mon Sep 17 00:00:00 2001
From: xwx <1594082401@qq.com>
Date: Thu, 21 Jul 2022 17:54:57 +0800
Subject: [PATCH] 【端口侦测】端口侦测调整

---
 hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSense/index.html     | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------
 hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSense/index.js       |  26 ++++++++++++++++----------
 hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSenseConfig/index.js |  25 +++++++++++++++++++++++--
 hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSenseSelect/index.js |   6 +++---
 4 files changed, 110 insertions(+), 101 deletions(-)

diff --git a/hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSense/index.html b/hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSense/index.html
index 2474f8e..b275065 100644
--- a/hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSense/index.html
+++ b/hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSense/index.html
@@ -1,88 +1,70 @@
-<div>
-    <el-row>
-        <el-col :span="24">
-            <div class="set-add-div">
-                <el-row style="margin-bottom: 5px;margin-top: 5px">
-                    <el-col :span="24">
-                        <div class="flex-div-start margin-top-bottom-10">
-                            <el-tooltip>
-                                <template #content>关键字检索包含<br/>资源名称<br/>IP地址</template>
-                                <el-input style="width:160px;margin-left: 10px;float: left;" class="margin-right-10"
-                                          v-model="keyWords"
-                                          placeholder="输入关键字"
-                                          clearable/>
-                                </el-input>
-                            </el-tooltip>
-                            <el-dropdown style="margin-top: -15px;margin-left: 10px;float: left;">
-                                <el-icon class="el-icon--right">
-                                    <arrow-down/>
-                                </el-icon>
-                                <cm-biz-type-tree-input multiple clearable collapseTags @callback="getBizType"/>
-                            </el-dropdown>
-
-                            <el-dropdown style="margin-top: -15px;margin-left: 10px;float: left;">
-                                <el-icon class="el-icon--right">
-                                    <arrow-down/>
-                                </el-icon>
-                                <cm-res-type-tree-input multiple clearable collapseTags @callback="getResType"/>
-                            </el-dropdown>
-
-                            <div class="flex-div-start" style="float: left;">
-<!--                                <el-button type="primary" @click="onReset()">重置</el-button>-->
-                                <el-button type="primary" @click="onBtnSearch()" style="margin-left: 10px">查询</el-button>
-                            </div>
-
-                        </div>
-                    </el-col>
-                </el-row>
-                <el-row>
-                    <div class="flex-div-start" style="margin: 4px;">
-                        <el-button type="primary" @click="save()" style="margin-left: 10px">新增</el-button>
-                        <el-button type="primary" @click="deleteOther()" style="margin-left: 10px">删除</el-button>
-                    </div>
-                </el-row>
-                <el-row class="margin-bottom-50">
-                    <el-col :span="24" class="table-height">
-                        <cm-table-page :columns="columns"
-                                       :dataList="portSenseData"
-                                       :total="count"
-                                       :pageSize="pageSize"
-                                       @loaddata="loadTableDataList"
-                                       @selectionChange="selectionChange"
-                                       :showIndex="true"
-                                       :showSelection="true"
-                                       :showBorder="true"
-                                       :loading="loading"
-                                       :showPage="true"
-                                       :showTools="true"
-                                       :height="(height - 150)">
-                            <template #default="{row,prop,column}">
-                                <div v-if="prop == 'resName'">
-                                    <!-- 资源名称点击事件 -->
-                                    <el-tooltip placement="top">
-                                        <el-button type="text" size="small" @click.prevent="resourceClick(row)">
-                                            <span class="">{{row.resName}}</span>
-                                        </el-button>
-                                        <template #content>{{row.resName}}</template>
-                                    </el-tooltip>
-                                </div>
-                            </template>
-                            <template #tools="{scope}">
-                                <el-button type="text" size="small" @click.prevent="deleteItem(scope.row,scope.$index)">
-                                    <i class="el-icon-delete"/>
-                                </el-button>
-                            </template>
-                        </cm-table-page>
-                    </el-col>
-                </el-row>
+<div class="container" :style="{'height':height+'px','max-height':height+'px','padding':'10px 0 10px 10px','background':'#fff','box-sizing':'border-box'}">
+    <div class="cm-card" :style="{'min-height':height+'px','max-height':height+'px','height':'100%','padding-top':'3px'}">
+        <div class="search">
+            <div class="condition esData-conditon" style="justify-content: space-between;width: 100%;">
+                <el-form :inline="true">
+                    <el-form-item>
+                        <el-tooltip placement="bottom-start">
+                            <template #content> 资源名称 <br /> 资源ip <br /> 业务名称</template>
+                            <el-input clearable :size="$global.elementConfig.size.input" v-model="keyWords" placeholder="关键字检索" />
+                        </el-tooltip>
+                    </el-form-item>
+                    <el-form-item style="margin-top: 9px;">
+                        <el-dropdown>
+                            <cm-res-type-tree-input :size="$global.elementConfig.size.input" @callback="getResType" clearable collapseTags multiple/>
+                        </el-dropdown>
+                    </el-form-item>
+                    <el-form-item style="margin-top: 9px;">
+                        <el-dropdown>
+                            <cm-biz-type-tree-input :size="$global.elementConfig.size.input" @callback="getBizType" clearable collapseTags multiple/>
+                        </el-dropdown>
+                    </el-form-item>
+                    <el-form-item style="margin-left: -30px;margin-top: -6px;">
+                        <el-button @click="onBtnSearch()" :size="$global.elementConfig.size.button" type="primary" style="margin-left: 6px">查询</el-button>
+                        <el-button type="primary" @click="save()" style="margin-left: 6px">新增</el-button>
+                        <el-button type="primary" @click="deleteOther()" style="margin-left: 6px">删除</el-button>
+                    </el-form-item>
+                </el-form>
             </div>
-        </el-col>
-    </el-row>
+        </div>
+        <div class="search-table">
+            <cm-table-page :columns="columns"
+                           :dataList="portSenseData"
+                           :total="count"
+                           :pageSize="pageSize"
+                           @loaddata="loadTableDataList"
+                           @selectionChange="selectionChange"
+                           :showIndex="true"
+                           :showSelection="true"
+                           :showBorder="true"
+                           :loading="loading"
+                           :showPage="true"
+                           :showTools="true"
+                           :height="(height - 150)">
+                <template #default="{row,prop,column}">
+                    <div v-if="prop == 'resName'">
+                        <!-- 资源名称点击事件 -->
+                        <el-tooltip placement="top">
+                            <el-button type="text" size="small" @click.prevent="resourceClick(row)">
+                                <span class="">{{row.resName}}</span>
+                            </el-button>
+                            <template #content>{{row.resName}}</template>
+                        </el-tooltip>
+                    </div>
+                </template>
+                <template #tools="{scope}">
+                    <el-button type="text" size="small" @click.prevent="deleteItem(scope.row,scope.$index)">
+                        <i class="el-icon-delete"/>
+                    </el-button>
+                </template>
+            </cm-table-page>
+        </div>
+    </div>
+</div>
 
-    <!--弹框-->
-    <cm-dialog :title="title" width="80%"  :showDialogVisible="showPortSense" :showFooter="false" @hidedialog="showPortSenseDialog" :showOkBtn="false" cancelText="关闭">
-        <template v-slot>
-            <port-sense-config :parameter="portSenseConfigData"></port-sense-config>
-        </template>
-    </cm-dialog>
-</div>
\ No newline at end of file
+<!--弹框-->
+<cm-dialog :title="title" width="80%"  :showDialogVisible="showPortSense" :showFooter="false" @hidedialog="showPortSenseDialog" :showOkBtn="false" cancelText="关闭">
+    <template v-slot>
+        <port-sense-config :parameter="portSenseConfigData"></port-sense-config>
+    </template>
+</cm-dialog>
diff --git a/hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSense/index.js b/hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSense/index.js
index 8800ed5..672b069 100644
--- a/hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSense/index.js
+++ b/hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSense/index.js
@@ -175,21 +175,22 @@ export default {
         }
         //删除单个数据
         let deleteItem = (row, index) => {
-            proxy.$global.confirm("确认删除吗?", function () {
-                deleteItems([row.resId]);
-            })
+            deleteItems([row.resId]);
         }
         //删除多个或单个
         let deleteItems = (list) => {
             let params = {
                 redIds: list.toString()
             }
-            proxy.$http.get('/api-web/bResourceExtendParam/delete', params, function (res) {
-                if (res && res.success) {
-                    proxy.$global.showMsg('删除成功');
-                    loadTableDataList({page: 1, limit: pageSize.value});
-                }
+            proxy.$global.confirm("确认删除吗?", function () {
+                proxy.$http.get('/api-web/bResourceExtendParam/delete', params, function (res) {
+                    if (res && res.success) {
+                        proxy.$global.showMsg('删除成功');
+                        loadTableDataList({page: 1, limit: pageSize.value});
+                    }
+                })
             })
+
         }
         //添加
         let save = () => {
@@ -230,7 +231,12 @@ export default {
             let list = pitch.value.map(item => {
                 return item.resId;
             })
-            deleteItems(list);
+            if (list != null && list != ''){
+                deleteItems(list);
+            }else {
+                proxy.$global.showMsg("请选择需要删除的端口侦测数据","warning");
+            }
+
         };
         //重新加载表格数据
         let loadTableDataList = ({page, limit}) => {
@@ -280,4 +286,4 @@ export default {
             showPortSenseDialog,
         }
     }
-}
\ No newline at end of file
+}
diff --git a/hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSenseConfig/index.js b/hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSenseConfig/index.js
index 715608c..035044f 100644
--- a/hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSenseConfig/index.js
+++ b/hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSenseConfig/index.js
@@ -162,7 +162,28 @@ export default {
                 resId: "",
                 resIdList: resIdArr.value,
             }
-            portSenseConfigData.value.push(data);
+
+            var length = portSenseConfigData.value.length
+            if (length == 0){
+                portSenseConfigData.value.push(data);
+            }
+            if (portSenseConfigData.value[length-1].protocolType == '' || portSenseConfigData.value[length-1].protocolType == null){
+                proxy.$global.showMsg('请填写协议类型','warning');
+                return false;
+            }else if (portSenseConfigData.value[length-1].port == '' || portSenseConfigData.value[length-1].port == null){
+                proxy.$global.showMsg('请填写端口号','warning');
+                return false;
+            }else if (portSenseConfigData.value[length-1].intervalTime == '' || portSenseConfigData.value[length-1].intervalTime == null){
+                proxy.$global.showMsg('请填写间隔时长','warning');
+                return false;
+            }else if (portSenseConfigData.value[length-1].portDesc == '' || portSenseConfigData.value[length-1].portDesc == null){
+                proxy.$global.showMsg('请填写端口备注','warning');
+                return false;
+            }else{
+                portSenseConfigData.value.push(data);
+            }
+
+
         }
         //下拉框值改变事件
         let changePortSense = () => {
@@ -331,4 +352,4 @@ export default {
             portSenseSelectData
         }
     }
-}
\ No newline at end of file
+}
diff --git a/hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSenseSelect/index.js b/hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSenseSelect/index.js
index 5e339d2..620c617 100644
--- a/hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSenseSelect/index.js
+++ b/hg-monitor-web-base/src/main/resources/static/vue3/src/views/portSenseSelect/index.js
@@ -28,7 +28,7 @@ export default {
         let initState = Vue.ref(true);
         //初始化
         let init = () => {
-            rowMaxHeight.value = "max-height: 75px;";
+            rowMaxHeight.value = "max-height: 58px;";
             initState.value = true;
             showIcon.value = "el-icon-arrow-down";
         }
@@ -77,7 +77,7 @@ export default {
         }
         //是否展开点击
         let changeItem = () => {
-            rowMaxHeight.value = initState.value ? "" : "max-height: 75px;";
+            rowMaxHeight.value = initState.value ? "" : "max-height: 58px;";
             showIcon.value = initState.value ? "el-icon-arrow-up" : "el-icon-arrow-down";
             initState.value = !initState.value;
         }
@@ -91,4 +91,4 @@ export default {
             changeItem
         }
     }
-}
\ No newline at end of file
+}
--
libgit2 0.24.0