Authored by xwx

【端口侦测】端口侦测调整

1 -<div>  
2 - <el-row>  
3 - <el-col :span="24">  
4 - <div class="set-add-div">  
5 - <el-row style="margin-bottom: 5px;margin-top: 5px">  
6 - <el-col :span="24">  
7 - <div class="flex-div-start margin-top-bottom-10">  
8 - <el-tooltip>  
9 - <template #content>关键字检索包含<br/>资源名称<br/>IP地址</template>  
10 - <el-input style="width:160px;margin-left: 10px;float: left;" class="margin-right-10"  
11 - v-model="keyWords"  
12 - placeholder="输入关键字"  
13 - clearable/>  
14 - </el-input>  
15 - </el-tooltip>  
16 - <el-dropdown style="margin-top: -15px;margin-left: 10px;float: left;">  
17 - <el-icon class="el-icon--right">  
18 - <arrow-down/>  
19 - </el-icon>  
20 - <cm-biz-type-tree-input multiple clearable collapseTags @callback="getBizType"/>  
21 - </el-dropdown>  
22 -  
23 - <el-dropdown style="margin-top: -15px;margin-left: 10px;float: left;">  
24 - <el-icon class="el-icon--right">  
25 - <arrow-down/>  
26 - </el-icon>  
27 - <cm-res-type-tree-input multiple clearable collapseTags @callback="getResType"/>  
28 - </el-dropdown>  
29 -  
30 - <div class="flex-div-start" style="float: left;">  
31 -<!-- <el-button type="primary" @click="onReset()">重置</el-button>-->  
32 - <el-button type="primary" @click="onBtnSearch()" style="margin-left: 10px">查询</el-button>  
33 - </div>  
34 -  
35 - </div>  
36 - </el-col>  
37 - </el-row>  
38 - <el-row>  
39 - <div class="flex-div-start" style="margin: 4px;">  
40 - <el-button type="primary" @click="save()" style="margin-left: 10px">新增</el-button>  
41 - <el-button type="primary" @click="deleteOther()" style="margin-left: 10px">删除</el-button>  
42 - </div>  
43 - </el-row>  
44 - <el-row class="margin-bottom-50">  
45 - <el-col :span="24" class="table-height">  
46 - <cm-table-page :columns="columns"  
47 - :dataList="portSenseData"  
48 - :total="count"  
49 - :pageSize="pageSize"  
50 - @loaddata="loadTableDataList"  
51 - @selectionChange="selectionChange"  
52 - :showIndex="true"  
53 - :showSelection="true"  
54 - :showBorder="true"  
55 - :loading="loading"  
56 - :showPage="true"  
57 - :showTools="true"  
58 - :height="(height - 150)">  
59 - <template #default="{row,prop,column}">  
60 - <div v-if="prop == 'resName'">  
61 - <!-- 资源名称点击事件 -->  
62 - <el-tooltip placement="top">  
63 - <el-button type="text" size="small" @click.prevent="resourceClick(row)">  
64 - <span class="">{{row.resName}}</span>  
65 - </el-button>  
66 - <template #content>{{row.resName}}</template>  
67 - </el-tooltip>  
68 - </div>  
69 - </template>  
70 - <template #tools="{scope}">  
71 - <el-button type="text" size="small" @click.prevent="deleteItem(scope.row,scope.$index)">  
72 - <i class="el-icon-delete"/>  
73 - </el-button>  
74 - </template>  
75 - </cm-table-page>  
76 - </el-col>  
77 - </el-row> 1 +<div class="container" :style="{'height':height+'px','max-height':height+'px','padding':'10px 0 10px 10px','background':'#fff','box-sizing':'border-box'}">
  2 + <div class="cm-card" :style="{'min-height':height+'px','max-height':height+'px','height':'100%','padding-top':'3px'}">
  3 + <div class="search">
  4 + <div class="condition esData-conditon" style="justify-content: space-between;width: 100%;">
  5 + <el-form :inline="true">
  6 + <el-form-item>
  7 + <el-tooltip placement="bottom-start">
  8 + <template #content> 资源名称 <br /> 资源ip <br /> 业务名称</template>
  9 + <el-input clearable :size="$global.elementConfig.size.input" v-model="keyWords" placeholder="关键字检索" />
  10 + </el-tooltip>
  11 + </el-form-item>
  12 + <el-form-item style="margin-top: 9px;">
  13 + <el-dropdown>
  14 + <cm-res-type-tree-input :size="$global.elementConfig.size.input" @callback="getResType" clearable collapseTags multiple/>
  15 + </el-dropdown>
  16 + </el-form-item>
  17 + <el-form-item style="margin-top: 9px;">
  18 + <el-dropdown>
  19 + <cm-biz-type-tree-input :size="$global.elementConfig.size.input" @callback="getBizType" clearable collapseTags multiple/>
  20 + </el-dropdown>
  21 + </el-form-item>
  22 + <el-form-item style="margin-left: -30px;margin-top: -6px;">
  23 + <el-button @click="onBtnSearch()" :size="$global.elementConfig.size.button" type="primary" style="margin-left: 6px">查询</el-button>
  24 + <el-button type="primary" @click="save()" style="margin-left: 6px">新增</el-button>
  25 + <el-button type="primary" @click="deleteOther()" style="margin-left: 6px">删除</el-button>
  26 + </el-form-item>
  27 + </el-form>
78 </div> 28 </div>
79 - </el-col>  
80 - </el-row> 29 + </div>
  30 + <div class="search-table">
  31 + <cm-table-page :columns="columns"
  32 + :dataList="portSenseData"
  33 + :total="count"
  34 + :pageSize="pageSize"
  35 + @loaddata="loadTableDataList"
  36 + @selectionChange="selectionChange"
  37 + :showIndex="true"
  38 + :showSelection="true"
  39 + :showBorder="true"
  40 + :loading="loading"
  41 + :showPage="true"
  42 + :showTools="true"
  43 + :height="(height - 150)">
  44 + <template #default="{row,prop,column}">
  45 + <div v-if="prop == 'resName'">
  46 + <!-- 资源名称点击事件 -->
  47 + <el-tooltip placement="top">
  48 + <el-button type="text" size="small" @click.prevent="resourceClick(row)">
  49 + <span class="">{{row.resName}}</span>
  50 + </el-button>
  51 + <template #content>{{row.resName}}</template>
  52 + </el-tooltip>
  53 + </div>
  54 + </template>
  55 + <template #tools="{scope}">
  56 + <el-button type="text" size="small" @click.prevent="deleteItem(scope.row,scope.$index)">
  57 + <i class="el-icon-delete"/>
  58 + </el-button>
  59 + </template>
  60 + </cm-table-page>
  61 + </div>
  62 + </div>
  63 +</div>
81 64
82 - <!--弹框-->  
83 - <cm-dialog :title="title" width="80%" :showDialogVisible="showPortSense" :showFooter="false" @hidedialog="showPortSenseDialog" :showOkBtn="false" cancelText="关闭">  
84 - <template v-slot>  
85 - <port-sense-config :parameter="portSenseConfigData"></port-sense-config>  
86 - </template>  
87 - </cm-dialog>  
88 -</div>  
  65 +<!--弹框-->
  66 +<cm-dialog :title="title" width="80%" :showDialogVisible="showPortSense" :showFooter="false" @hidedialog="showPortSenseDialog" :showOkBtn="false" cancelText="关闭">
  67 + <template v-slot>
  68 + <port-sense-config :parameter="portSenseConfigData"></port-sense-config>
  69 + </template>
  70 +</cm-dialog>
@@ -175,21 +175,22 @@ export default { @@ -175,21 +175,22 @@ export default {
175 } 175 }
176 //删除单个数据 176 //删除单个数据
177 let deleteItem = (row, index) => { 177 let deleteItem = (row, index) => {
178 - proxy.$global.confirm("确认删除吗?", function () {  
179 - deleteItems([row.resId]);  
180 - }) 178 + deleteItems([row.resId]);
181 } 179 }
182 //删除多个或单个 180 //删除多个或单个
183 let deleteItems = (list) => { 181 let deleteItems = (list) => {
184 let params = { 182 let params = {
185 redIds: list.toString() 183 redIds: list.toString()
186 } 184 }
187 - proxy.$http.get('/api-web/bResourceExtendParam/delete', params, function (res) {  
188 - if (res && res.success) {  
189 - proxy.$global.showMsg('删除成功');  
190 - loadTableDataList({page: 1, limit: pageSize.value});  
191 - } 185 + proxy.$global.confirm("确认删除吗?", function () {
  186 + proxy.$http.get('/api-web/bResourceExtendParam/delete', params, function (res) {
  187 + if (res && res.success) {
  188 + proxy.$global.showMsg('删除成功');
  189 + loadTableDataList({page: 1, limit: pageSize.value});
  190 + }
  191 + })
192 }) 192 })
  193 +
193 } 194 }
194 //添加 195 //添加
195 let save = () => { 196 let save = () => {
@@ -230,7 +231,12 @@ export default { @@ -230,7 +231,12 @@ export default {
230 let list = pitch.value.map(item => { 231 let list = pitch.value.map(item => {
231 return item.resId; 232 return item.resId;
232 }) 233 })
233 - deleteItems(list); 234 + if (list != null && list != ''){
  235 + deleteItems(list);
  236 + }else {
  237 + proxy.$global.showMsg("请选择需要删除的端口侦测数据","warning");
  238 + }
  239 +
234 }; 240 };
235 //重新加载表格数据 241 //重新加载表格数据
236 let loadTableDataList = ({page, limit}) => { 242 let loadTableDataList = ({page, limit}) => {
@@ -280,4 +286,4 @@ export default { @@ -280,4 +286,4 @@ export default {
280 showPortSenseDialog, 286 showPortSenseDialog,
281 } 287 }
282 } 288 }
283 -}  
  289 +}
@@ -162,7 +162,28 @@ export default { @@ -162,7 +162,28 @@ export default {
162 resId: "", 162 resId: "",
163 resIdList: resIdArr.value, 163 resIdList: resIdArr.value,
164 } 164 }
165 - portSenseConfigData.value.push(data); 165 +
  166 + var length = portSenseConfigData.value.length
  167 + if (length == 0){
  168 + portSenseConfigData.value.push(data);
  169 + }
  170 + if (portSenseConfigData.value[length-1].protocolType == '' || portSenseConfigData.value[length-1].protocolType == null){
  171 + proxy.$global.showMsg('请填写协议类型','warning');
  172 + return false;
  173 + }else if (portSenseConfigData.value[length-1].port == '' || portSenseConfigData.value[length-1].port == null){
  174 + proxy.$global.showMsg('请填写端口号','warning');
  175 + return false;
  176 + }else if (portSenseConfigData.value[length-1].intervalTime == '' || portSenseConfigData.value[length-1].intervalTime == null){
  177 + proxy.$global.showMsg('请填写间隔时长','warning');
  178 + return false;
  179 + }else if (portSenseConfigData.value[length-1].portDesc == '' || portSenseConfigData.value[length-1].portDesc == null){
  180 + proxy.$global.showMsg('请填写端口备注','warning');
  181 + return false;
  182 + }else{
  183 + portSenseConfigData.value.push(data);
  184 + }
  185 +
  186 +
166 } 187 }
167 //下拉框值改变事件 188 //下拉框值改变事件
168 let changePortSense = () => { 189 let changePortSense = () => {
@@ -331,4 +352,4 @@ export default { @@ -331,4 +352,4 @@ export default {
331 portSenseSelectData 352 portSenseSelectData
332 } 353 }
333 } 354 }
334 -}  
  355 +}
@@ -28,7 +28,7 @@ export default { @@ -28,7 +28,7 @@ export default {
28 let initState = Vue.ref(true); 28 let initState = Vue.ref(true);
29 //初始化 29 //初始化
30 let init = () => { 30 let init = () => {
31 - rowMaxHeight.value = "max-height: 75px;"; 31 + rowMaxHeight.value = "max-height: 58px;";
32 initState.value = true; 32 initState.value = true;
33 showIcon.value = "el-icon-arrow-down"; 33 showIcon.value = "el-icon-arrow-down";
34 } 34 }
@@ -77,7 +77,7 @@ export default { @@ -77,7 +77,7 @@ export default {
77 } 77 }
78 //是否展开点击 78 //是否展开点击
79 let changeItem = () => { 79 let changeItem = () => {
80 - rowMaxHeight.value = initState.value ? "" : "max-height: 75px;"; 80 + rowMaxHeight.value = initState.value ? "" : "max-height: 58px;";
81 showIcon.value = initState.value ? "el-icon-arrow-up" : "el-icon-arrow-down"; 81 showIcon.value = initState.value ? "el-icon-arrow-up" : "el-icon-arrow-down";
82 initState.value = !initState.value; 82 initState.value = !initState.value;
83 } 83 }
@@ -91,4 +91,4 @@ export default { @@ -91,4 +91,4 @@ export default {
91 changeItem 91 changeItem
92 } 92 }
93 } 93 }
94 -}  
  94 +}