2019-12-16 17:14:58 +08:00
|
|
|
|
<template>
|
2020-05-21 16:08:23 +08:00
|
|
|
|
<div class="new-search" v-clickoutside="clickout">
|
2019-12-16 17:14:58 +08:00
|
|
|
|
<div class="search-input-all input-position" @click="stop_click">
|
|
|
|
|
|
<!-- 历史记录-->
|
2021-04-16 15:02:40 +08:00
|
|
|
|
<div class="search-history" v-if="showHistory">
|
2021-09-18 17:59:43 +08:00
|
|
|
|
<i class="nz-icon nz-icon-time" style="cursor: pointer" @click="look_history" id="search-view-history"></i>
|
2019-12-16 17:14:58 +08:00
|
|
|
|
<div :class="localStorage_display?'localStorage_list_box none':'localStorage_list_box'">
|
2021-09-18 17:59:43 +08:00
|
|
|
|
<div class="list_box_title" style="cursor: pointer">
|
2019-12-24 17:31:51 +08:00
|
|
|
|
<span>{{$t('search.recentSearch')}}</span>
|
2020-09-10 17:00:32 +08:00
|
|
|
|
<i class="nz-icon nz-icon-close" @click="localStorage_display=!localStorage_display" id="search-close-history"></i>
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="list_box_content" v-if="history_once.length>0">
|
|
|
|
|
|
<ul>
|
2020-01-13 18:48:25 +08:00
|
|
|
|
<li v-for="(val,ind) in history_once" @click="select_history(ind,$event)" :key="ind" :id="'search-history-pick-'+ind">
|
2019-12-16 17:14:58 +08:00
|
|
|
|
<span v-for="(item,key) in val" :key="key">
|
|
|
|
|
|
<span class="name">{{item.name}}: </span>
|
|
|
|
|
|
<span class="value">{{item.val+' '}}</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="list_box_clear">
|
2020-01-13 18:48:25 +08:00
|
|
|
|
<span v-if="history_once.length>0" @click="clear_history" id="search-clear-history">{{other.clearReSearch}}</span>
|
2019-12-24 17:31:51 +08:00
|
|
|
|
<span v-else class="no_historyList">{{$t('search.noRecentSearch')}}</span>
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 搜索框-->
|
|
|
|
|
|
<div class="input-center-box" id="input-center-box">
|
2021-04-16 15:02:40 +08:00
|
|
|
|
<el-scrollbar style="height: 100%;width: 100%; overflow-y: hidden" ref="searchScrollbar">
|
2019-12-16 17:14:58 +08:00
|
|
|
|
<ul class="sreach_fixe_left" id="search-ul">
|
|
|
|
|
|
<li class="selectinfo_box" v-if="select_list.length>0" v-for="(val,ind) in select_list" :key="ind" @click="update_sreach(ind,$event)">
|
|
|
|
|
|
<div class="select_condition">
|
|
|
|
|
|
{{val.name}}
|
|
|
|
|
|
</div>
|
2021-04-23 20:06:58 +08:00
|
|
|
|
<div class="select_content" v-if="typeof val.val !='undefined' && val.val != null && ind!=sreach_num">
|
2021-11-05 16:50:52 +08:00
|
|
|
|
<span>{{$t(val.valString ? val.valString : val.val)}}</span>
|
2021-09-18 17:59:43 +08:00
|
|
|
|
<i class="nz-icon nz-icon-close" style="cursor: pointer" @click="close_selcet_list(ind,$event)"></i>
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div v-else-if="!change_sreach_show && ind==sreach_num && val.id!==7 " class="select_input">
|
2020-11-17 16:41:52 +08:00
|
|
|
|
<input type="text" autocomplete="off" id="sreach_input" v-model="input_sreach" :readonly="val.readonly" @keyup="enter(val, $event)" @click="stop_click">
|
2021-03-23 15:47:18 +08:00
|
|
|
|
<div class="select_info_list" :style="'top:' + selectDom.top +'; left:'+selectDom.left " v-if="val.type == 'select'">
|
2020-04-17 21:27:20 +08:00
|
|
|
|
<el-scrollbar v-if="selectInfoList[val.label].length > 8" class="el-scrollbar-small" style="height: 240px;">
|
2019-12-16 17:14:58 +08:00
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in selectInfoList[val.label]" :key="key" @click="tr_selectInfo(val.label,item.value,item.label,$event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.label)}}</li>
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</ul>
|
2020-04-17 21:27:20 +08:00
|
|
|
|
</el-scrollbar>
|
|
|
|
|
|
<ul v-else>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in selectInfoList[val.label]" :key="key" @click="tr_selectInfo(val.label,item.value,item.label,$event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.label)}}</li>
|
2020-04-17 21:27:20 +08:00
|
|
|
|
</ul>
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</div>
|
2021-05-10 15:59:39 +08:00
|
|
|
|
<div v-if="val.type === 'selectString'" :style="'top:' + selectDom.top +'; left:'+selectDom.left " class="select_info_list">
|
2020-04-17 21:27:20 +08:00
|
|
|
|
<el-scrollbar v-if="selectInfoList[val.label].length > 8" class="el-scrollbar-small" style="height: 240px;">
|
2019-12-16 17:14:58 +08:00
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in selectInfoList[val.label]" :key="key" @click="stringSelectInfo(val, item, $event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.label)}}</li>
|
2019-12-17 17:17:30 +08:00
|
|
|
|
</ul>
|
2020-04-17 21:27:20 +08:00
|
|
|
|
</el-scrollbar>
|
|
|
|
|
|
<ul v-else>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in selectInfoList[val.label]" :key="key" @click="stringSelectInfo(val, item, $event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.label)}}</li>
|
2020-04-17 21:27:20 +08:00
|
|
|
|
</ul>
|
2019-12-17 17:17:30 +08:00
|
|
|
|
</div>
|
2021-04-23 20:06:58 +08:00
|
|
|
|
<div class="select_info_list" :style="'top:' + selectDom.top +'; left:'+selectDom.left " v-if="val.type == 'terminalStatus'">
|
|
|
|
|
|
<el-scrollbar v-if="selectInfoList['terminalStatus'].length > 8" class="el-scrollbar-small" style="height: 240px;">
|
|
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in selectInfoList['terminalStatus']" :key="key" @click="stringSelectInfo(val, item, $event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.label)}}</li>
|
2021-04-23 20:06:58 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</el-scrollbar>
|
|
|
|
|
|
<ul v-else>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in selectInfoList['terminalStatus']" :key="key" @click="stringSelectInfo(val, item, $event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.label)}}</li>
|
2021-04-23 20:06:58 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
2021-03-23 15:47:18 +08:00
|
|
|
|
<div class="select_info_list" :style="'top:' + selectDom.top +'; left:'+selectDom.left " v-if="val.type == 'dc'">
|
2020-04-17 21:27:20 +08:00
|
|
|
|
<el-scrollbar v-if="dcSelect.length > 8" class="el-scrollbar-small" style="height: 240px;">
|
2019-12-17 17:17:30 +08:00
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in dcSelect" :key="key" @click="selectObject(val, item, $event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.name)}}</li>
|
2019-12-20 17:18:30 +08:00
|
|
|
|
</ul>
|
2020-04-17 21:27:20 +08:00
|
|
|
|
</el-scrollbar>
|
|
|
|
|
|
<ul v-else>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in dcSelect" :key="key" @click="selectObject(val, item, $event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.name)}}</li>
|
2020-04-17 21:27:20 +08:00
|
|
|
|
</ul>
|
2019-12-20 17:18:30 +08:00
|
|
|
|
</div>
|
2021-03-23 15:47:18 +08:00
|
|
|
|
<div class="select_info_list" :style="'top:' + selectDom.top +'; left:'+selectDom.left" v-if="val.type == 'asset'">
|
2020-04-17 21:27:20 +08:00
|
|
|
|
<el-scrollbar v-if="assetSelect.length > 8" class="el-scrollbar-small" style="height: 240px;">
|
2019-12-20 17:18:30 +08:00
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in assetSelect" :key="key" @click="selectObject(val, item, $event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.host)}}</li>
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</ul>
|
2020-04-17 21:27:20 +08:00
|
|
|
|
</el-scrollbar>
|
|
|
|
|
|
<ul v-else>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in assetSelect" :key="key" @click="selectObject(val, item, $event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.host)}}</li>
|
2020-04-17 21:27:20 +08:00
|
|
|
|
</ul>
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</div>
|
2021-05-10 15:59:39 +08:00
|
|
|
|
<div v-if="val.type === 'assetState'" :style="'top:' + selectDom.top +'; left:'+selectDom.left" class="select_info_list">
|
|
|
|
|
|
<el-scrollbar v-if="assetStateSelect.length > 8" class="el-scrollbar-small" style="height: 240px;">
|
|
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in assetStateSelect" :key="key" :class="search_select_style_num==key?'search-style-ind':''" @click="selectObject(val, item, $event)">{{$t(item.name)}}</li>
|
2021-05-10 15:59:39 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</el-scrollbar>
|
|
|
|
|
|
<ul v-else>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in assetStateSelect" :key="key" :class="search_select_style_num==key?'search-style-ind':''" @click="selectObject(val, item, $event)">{{$t(item.name)}}</li>
|
2021-05-10 15:59:39 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="val.type === 'brand'" :style="'top:' + selectDom.top +'; left:'+selectDom.left" class="select_info_list">
|
|
|
|
|
|
<el-scrollbar v-if="brandSelect.length > 8" class="el-scrollbar-small" style="height: 240px;">
|
|
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in brandSelect" :key="key" :class="search_select_style_num==key?'search-style-ind':''" @click="selectObject(val, item, $event)">{{$t(item.name)}}</li>
|
2021-05-10 15:59:39 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</el-scrollbar>
|
|
|
|
|
|
<ul v-else>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in brandSelect" :key="key" :class="search_select_style_num==key?'search-style-ind':''" @click="selectObject(val, item, $event)">{{$t(item.name)}}</li>
|
2021-05-10 15:59:39 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="val.type === 'group'" :style="'top:' + selectDom.top +'; left:'+selectDom.left" class="select_info_list">
|
|
|
|
|
|
<el-scrollbar v-if="groupSelect.length > 8" class="el-scrollbar-small" style="height: 240px;">
|
|
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in groupSelect" :key="key" :class="search_select_style_num==key?'search-style-ind':''" @click="selectObject(val, item, $event)">{{$t(item.name)}}</li>
|
2021-05-10 15:59:39 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</el-scrollbar>
|
|
|
|
|
|
<ul v-else>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in groupSelect" :key="key" :class="search_select_style_num==key?'search-style-ind':''" @click="selectObject(val, item, $event)">{{$t(item.name)}}</li>
|
2021-05-10 15:59:39 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="val.type === 'project'" :style="'top:' + selectDom.top +'; left:'+selectDom.left " class="select_info_list">
|
2020-04-20 21:27:32 +08:00
|
|
|
|
<el-scrollbar v-if="projectSelect.length > 8" class="el-scrollbar-small" style="height: 240px;">
|
|
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in projectSelect" :key="key" @click="selectObject(val, item, $event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.name)}}</li>
|
2020-04-20 21:27:32 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</el-scrollbar>
|
|
|
|
|
|
<ul v-else>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in projectSelect" :key="key" @click="selectObject(val, item, $event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.name)}}</li>
|
2020-04-20 21:27:32 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
2021-05-10 15:59:39 +08:00
|
|
|
|
<div v-if="val.type === 'severity'" :style="'top:' + selectDom.top +'; left:'+selectDom.left " class="select_info_list">
|
|
|
|
|
|
<el-scrollbar v-if="severitySelect.length > 8" class="el-scrollbar-small" style="height: 240px;">
|
|
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in severitySelect" :key="key" :class="search_select_style_num==key?'search-style-ind':''" @click="selectObject(val, item, $event)">{{$t(item.name)}}</li>
|
2021-05-10 15:59:39 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</el-scrollbar>
|
|
|
|
|
|
<ul v-else>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in severitySelect" :key="key" :class="search_select_style_num==key?'search-style-ind':''" @click="selectObject(val, item, $event)">{{$t(item.name)}}</li>
|
2021-05-10 15:59:39 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
2021-09-14 16:14:25 +08:00
|
|
|
|
<div v-if="val.type === 'alertTypes'" :style="'top:' + selectDom.top +'; left:'+selectDom.left " class="select_info_list">
|
|
|
|
|
|
<el-scrollbar v-if="alertTypesSelect.length > 8" class="el-scrollbar-small" style="height: 240px;">
|
|
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in alertTypesSelect" :key="key" :class="search_select_style_num==key?'search-style-ind':''" @click="selectObject(val, item, $event)">{{$t(item.name)}}</li>
|
2021-09-14 16:14:25 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</el-scrollbar>
|
|
|
|
|
|
<ul v-else>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in alertTypesSelect" :key="key" :class="search_select_style_num==key?'search-style-ind':''" @click="selectObject(val, item, $event)">{{$t(item.name)}}</li>
|
2021-09-14 16:14:25 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
2021-03-23 15:47:18 +08:00
|
|
|
|
<div class="select_info_list" :style="'top:' + selectDom.top +'; left:'+selectDom.left " v-if="val.type == 'module'">
|
2020-04-20 21:27:32 +08:00
|
|
|
|
<el-scrollbar v-if="moduleSelect.length > 8" class="el-scrollbar-small" style="height: 240px;">
|
|
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in moduleSelect" :key="key" @click="selectObject(val, item, $event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.name)}}</li>
|
2020-04-20 21:27:32 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</el-scrollbar>
|
|
|
|
|
|
<ul v-else>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in moduleSelect" :key="key" @click="selectObject(val, item, $event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.name)}}</li>
|
2020-04-20 21:27:32 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
2019-12-16 17:14:58 +08:00
|
|
|
|
<!-- 新增日志模块action下拉选择 -->
|
2021-03-23 15:47:18 +08:00
|
|
|
|
<div class="select_info_list" :style="'top:' + selectDom.top +'; left:'+selectDom.left " v-if="val.type == 'selectAction'">
|
2019-12-16 17:14:58 +08:00
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in actionSelect" :key="key" @click="tr_selectInfo(val.label,item.id,item.value,$event)">{{$t(item.value)}}</li>
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 新增protocol下拉选择 -->
|
2021-03-23 15:47:18 +08:00
|
|
|
|
<div class="select_info_list" :style="'top:' + selectDom.top +'; left:'+selectDom.left " v-if="val.type == 'selectType'">
|
2019-12-16 17:14:58 +08:00
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in schemaTypeSelect" :key="key" @click="tr_selectTypeInfo(item)">{{$t(item.value)}}</li>
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 新增protocol二层下拉 -->
|
2021-03-23 15:47:18 +08:00
|
|
|
|
<div class="select_info_list" :style="'top:' + selectDom.top +'; left:'+selectDom.left " v-if="TypeSelect.length!=0&&val.type == 'selectType'&&secondShow">
|
2019-12-16 17:14:58 +08:00
|
|
|
|
<ul>
|
2021-06-10 15:04:20 +08:00
|
|
|
|
<!-- <li v-for="(item,key) in TypeSelect" :key="key" @click="tr_selectProtocolInfo(item)">{{item.name}}</li>-->
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 时间计划-->
|
2021-03-23 15:47:18 +08:00
|
|
|
|
<div class="select_info_list" :style="'top:' + selectDom.top +'; left:'+selectDom.left " v-if="val.type == 'select'&&val.id==5">
|
2019-12-16 17:14:58 +08:00
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item, i) in schlist" :key="i" @click="selectSul(item.name)">{{$t(item.name)}}</li>
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
2020-11-17 16:41:52 +08:00
|
|
|
|
<!--endpoint 状态-->
|
2021-03-23 15:47:18 +08:00
|
|
|
|
<div class="select_info_list" :style="'top:' + selectDom.top +'; left:'+selectDom.left " v-if="val.type == 'state'&&val.id==33">
|
2020-11-17 16:41:52 +08:00
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in selectInfoList['endpointState']" :key="key" @click="tr_selectInfo(val.label,item.value,item.label,$event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.label)}}</li>
|
2020-11-17 16:41:52 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
2020-11-21 16:12:02 +08:00
|
|
|
|
<!--alertMessage idc-->
|
2021-03-23 15:47:18 +08:00
|
|
|
|
<div class="select_info_list" :style="'top:' + selectDom.top +'; left:'+selectDom.left " v-if="val.type == 'idc'&&val.id==27">
|
2020-11-21 16:12:02 +08:00
|
|
|
|
<el-scrollbar v-if="dcSelect.length > 8" class="el-scrollbar-small" style="height: 240px;">
|
|
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in dcSelect" :key="key" @click="tr_selectInfo(val.label,item.id,item.name,$event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.name)}}</li>
|
2020-11-21 16:12:02 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</el-scrollbar>
|
|
|
|
|
|
<ul v-else>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in dcSelect" :key="key" @click="tr_selectInfo(val.label,item.id,item.name,$event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.name)}}</li>
|
2020-11-21 16:12:02 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
2021-03-16 17:54:05 +08:00
|
|
|
|
<!--exprTemp ganem-->
|
2021-03-23 15:47:18 +08:00
|
|
|
|
<div class="select_info_list" :style="'top:' + selectDom.top +'; left:'+selectDom.left " v-if="val.type == 'selectTemp'&&val.id==13">
|
2021-03-16 17:54:05 +08:00
|
|
|
|
<el-scrollbar v-if="gnameList.length > 8" class="el-scrollbar-small" style="height: 240px;">
|
|
|
|
|
|
<ul>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in gnameList" :key="key" @click="tr_selectInfo(val.label,item.id,item.name,$event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.name)}}</li>
|
2021-03-16 17:54:05 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</el-scrollbar>
|
|
|
|
|
|
<ul v-else>
|
2021-11-05 16:12:25 +08:00
|
|
|
|
<li v-for="(item,key) in gnameList" :key="key" @click="tr_selectInfo(val.label,item.id,item.name,$event)" :class="search_select_style_num==key?'search-style-ind':''">{{$t(item.name)}}</li>
|
2021-03-16 17:54:05 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</div>
|
2021-04-28 15:18:21 +08:00
|
|
|
|
<my-date-picker
|
2019-12-16 17:14:58 +08:00
|
|
|
|
v-model="timeFrame"
|
|
|
|
|
|
type="datetimerange"
|
|
|
|
|
|
range-separator="To"
|
|
|
|
|
|
start-placeholder="Start Time"
|
|
|
|
|
|
end-placeholder="End Time"
|
|
|
|
|
|
@change="changeDate"
|
|
|
|
|
|
:class="dataBackG?'':'dataBackG'"
|
|
|
|
|
|
v-if="ind==sreach_num&&val.id==7"
|
|
|
|
|
|
>
|
2021-04-28 15:18:21 +08:00
|
|
|
|
</my-date-picker>
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</li>
|
|
|
|
|
|
<!-- 最开始的input框-->
|
|
|
|
|
|
<li class="select_input" v-if="change_sreach_show">
|
2021-04-16 15:02:40 +08:00
|
|
|
|
<input type="text" @click="read_input" v-model="no_condition" @keyup="enter_one" id="one-input" @keydown="clear_search_list" :placeholder="placeholder">
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
2020-03-17 19:43:18 +08:00
|
|
|
|
</el-scrollbar>
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</div>
|
2020-03-17 19:01:09 +08:00
|
|
|
|
<div v-show="clearSearchShow" class="clear-search" @click="clear_input">
|
2020-09-10 17:00:32 +08:00
|
|
|
|
<i class="nz-icon nz-icon-circle-close"></i>
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</div>
|
2021-03-23 15:47:18 +08:00
|
|
|
|
<div :class="input_list?'input_list none':'input_list'" :style="'top:' + selectDom.top +'; left:'+selectDom.left " @click="stop_click" id="input_list" v-if="!single || (single&&searchLabelList.length==searchMsg.searchLabelList.length)">
|
2019-12-16 17:14:58 +08:00
|
|
|
|
<ul>
|
2020-11-17 16:41:52 +08:00
|
|
|
|
<li v-for="(val,ind) in searchLabelList" @click="select_name(val.name,ind,val.id,val.type,val.label,val.disabled,val.readonly,$event)" :key="ind" :class="{'search-style-ind':searchStyleNum==ind,'is-disabled':val.disabled}">
|
2019-12-16 17:14:58 +08:00
|
|
|
|
<span>{{val.name}}</span>
|
|
|
|
|
|
</li>
|
2019-12-17 17:17:30 +08:00
|
|
|
|
<!--<li v-for="(val,ind) in searchLabelList" v-if="val.name=='Protocol'" @click="select_type(val.name,ind,val.id,val.type,val.label,val.disabled)" :key="ind" :class="{'search-style-ind':searchStyleNum==ind,'is-disabled':val.disabled}">
|
2019-12-16 17:14:58 +08:00
|
|
|
|
<span>{{val.name}}</span>
|
2019-12-17 17:17:30 +08:00
|
|
|
|
</li>-->
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2021-04-16 15:02:40 +08:00
|
|
|
|
<button id="search-input-search" class="search-btn float-right" type="button" @click="select" v-if="showSearch"><i class="nz-icon nz-icon-search"></i></button>
|
2020-01-16 18:11:15 +08:00
|
|
|
|
<!--<div class="new-search-btn" @click="select">
|
2020-09-10 17:00:32 +08:00
|
|
|
|
<i class="nz-icon nz-icon-search"></i>
|
2020-01-16 18:11:15 +08:00
|
|
|
|
</div>-->
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-03-19 18:52:19 +08:00
|
|
|
|
import searchSelectInfo from './searchSelectInfo' // 搜索框组件--下拉框内容
|
|
|
|
|
|
export default {
|
2021-06-17 11:24:38 +08:00
|
|
|
|
name: 'searchInput',
|
2021-03-19 18:52:19 +08:00
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
2021-03-24 14:39:37 +08:00
|
|
|
|
selectDom: { top: '', left: '', tempTop: '', show: true }, // 选择弹框的位置
|
2021-03-19 18:52:19 +08:00
|
|
|
|
clearSearchShow: false,
|
|
|
|
|
|
select_conditionsName: '',
|
|
|
|
|
|
selectInfoList: searchSelectInfo,
|
|
|
|
|
|
select_title: '',
|
|
|
|
|
|
other: '',
|
|
|
|
|
|
localStorage_display: true,
|
|
|
|
|
|
input_list: true,
|
|
|
|
|
|
change_sreach_show: true,
|
|
|
|
|
|
select_list: [], // 当前的搜索条件和值
|
|
|
|
|
|
historyList: [],
|
|
|
|
|
|
actionSelect: [],
|
|
|
|
|
|
dcSelect: [], // 数据中心
|
|
|
|
|
|
assetSelect: [], // 资产
|
2021-05-10 15:59:39 +08:00
|
|
|
|
assetStateSelect: [],
|
|
|
|
|
|
brandSelect: [],
|
|
|
|
|
|
groupSelect: [],
|
2021-03-19 18:52:19 +08:00
|
|
|
|
projectSelect: [],
|
2021-05-10 15:59:39 +08:00
|
|
|
|
severitySelect: [],
|
2021-09-14 16:14:25 +08:00
|
|
|
|
alertTypesSelect: searchSelectInfo.searchMetrics,
|
2021-03-19 18:52:19 +08:00
|
|
|
|
moduleSelect: [],
|
|
|
|
|
|
modelSelect: [],
|
|
|
|
|
|
gnameList: [],
|
|
|
|
|
|
schemaTypeSelect: [], // 日志检索Protocol下拉菜单
|
|
|
|
|
|
TypeSelect: [], // Protocol二层下拉菜单
|
|
|
|
|
|
secondShow: '', // 二层显示控制
|
|
|
|
|
|
input_sreach: '',
|
|
|
|
|
|
sreach_num: 0,
|
|
|
|
|
|
searchLabelList: [ // 下拉列表里的选项
|
|
|
|
|
|
],
|
|
|
|
|
|
bool: false,
|
|
|
|
|
|
no_condition: '',
|
|
|
|
|
|
// 历史记录列表
|
|
|
|
|
|
history_once: [],
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
id: '',
|
|
|
|
|
|
schedata: {
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
isValid: 1,
|
|
|
|
|
|
pageSize: 30,
|
|
|
|
|
|
pageNo: 1
|
|
|
|
|
|
},
|
|
|
|
|
|
schlist: [],
|
|
|
|
|
|
timeFrame: [new Date(new Date() - 1 * 60 * 60 * 1000), new Date()],
|
|
|
|
|
|
dataBackG: true,
|
|
|
|
|
|
delBool: false,
|
|
|
|
|
|
searchStyleNum: -1,
|
|
|
|
|
|
isSearchNum: -1,
|
|
|
|
|
|
search_select_style_num: -1,
|
|
|
|
|
|
keyBool: false,
|
|
|
|
|
|
delnum: 0,
|
|
|
|
|
|
delcriteriaBool: false,
|
|
|
|
|
|
selectInfo: false,
|
|
|
|
|
|
disabaled: true,
|
|
|
|
|
|
downBool: false,
|
|
|
|
|
|
where: this.$route.path
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
defaultValue: {
|
|
|
|
|
|
immediate: true,
|
|
|
|
|
|
handler (n) {
|
|
|
|
|
|
if (n) {
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
if (this.defaultItem) {
|
|
|
|
|
|
if (this.defaultItem == 'alertMessageState' && this.defaultValue) {
|
|
|
|
|
|
this.searchLabelList.forEach((item, index) => {
|
|
|
|
|
|
if (item.id == 12) {
|
|
|
|
|
|
this.searchLabelList.splice(index, 1)
|
2020-03-31 17:22:15 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
})
|
|
|
|
|
|
this.select_list.push({
|
|
|
|
|
|
name: this.$t('alert.list.state'),
|
|
|
|
|
|
type: 'select',
|
|
|
|
|
|
label: 'state',
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
val: this.$t('alert.list.pending'),
|
|
|
|
|
|
valnum: 1
|
|
|
|
|
|
})
|
|
|
|
|
|
this.input_sreach = ''
|
|
|
|
|
|
this.sreach_num = this.select_list.length
|
|
|
|
|
|
this.change_sreach_show = false
|
|
|
|
|
|
this.input_list = true
|
|
|
|
|
|
this.select()
|
2020-03-31 17:22:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
inTransform: {
|
|
|
|
|
|
immediate: true,
|
|
|
|
|
|
handler (n) {
|
|
|
|
|
|
const listsK = document.querySelectorAll('.input_list')
|
|
|
|
|
|
listsK.forEach((item, index) => {
|
|
|
|
|
|
item.style.display = 'none'
|
|
|
|
|
|
})
|
|
|
|
|
|
const listsV = document.querySelectorAll('.select_info_list')
|
|
|
|
|
|
listsV.forEach((item, index) => {
|
|
|
|
|
|
item.style.display = 'none'
|
|
|
|
|
|
})
|
|
|
|
|
|
/* if (n) {
|
2020-03-23 21:46:19 +08:00
|
|
|
|
this.selectDom.tempTop = this.selectDom.top;
|
|
|
|
|
|
this.selectDom.top = '36px';
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.selectDom.top = this.selectDom.tempTop;
|
2021-03-19 18:52:19 +08:00
|
|
|
|
} */
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
listsK.forEach((item, index) => {
|
|
|
|
|
|
item.style.display = ''
|
|
|
|
|
|
})
|
|
|
|
|
|
listsV.forEach((item, index) => {
|
|
|
|
|
|
item.style.display = ''
|
|
|
|
|
|
})
|
|
|
|
|
|
}, 500)
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
select_list: {
|
|
|
|
|
|
// 监听下拉列表
|
|
|
|
|
|
handler (newData, oldData) {
|
|
|
|
|
|
this.$refs.searchScrollbar.update()
|
|
|
|
|
|
if (newData.length == 0) {
|
|
|
|
|
|
this.change_sreach_show = true
|
|
|
|
|
|
this.clearSearchShow = false
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.clearSearchShow = true
|
|
|
|
|
|
}
|
|
|
|
|
|
/* if (this.$route.path.indexOf("alertList") > -1 || this.$route.path.indexOf("alertConfig") > -1) {
|
2020-01-13 16:17:05 +08:00
|
|
|
|
// 处理alertType--asset联动问题:
|
|
|
|
|
|
// 当已选alertType为asset时,将可选列表中的asset的disabled恢复为false;
|
|
|
|
|
|
// 当已选alertType不为asset时,将可选列表中的asset的disabled设为true,若有已选的asset,则删除;
|
|
|
|
|
|
let hasType = false;
|
|
|
|
|
|
for (let i = 0; i < newData.length; i++) {
|
|
|
|
|
|
if (newData[i].label == "alertType" && newData[i].valnum) { //若存在alertType,判断可选列表中是否有asset,有的话disabled置为false
|
|
|
|
|
|
hasType = true;
|
|
|
|
|
|
if (newData[i].valnum == 3) {
|
|
|
|
|
|
for (let j = 0; j < this.searchLabelList.length; j++) {
|
|
|
|
|
|
if (this.searchLabelList[j].label == 'asset') {
|
|
|
|
|
|
this.searchLabelList[j].disabled = false;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
for (let j = 0; j < newData.length; j++) {
|
|
|
|
|
|
if (newData[j].label == "asset") {
|
|
|
|
|
|
this.close_selcet_list(j);
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
for (let j = 0; j < this.searchLabelList.length; j++) {
|
|
|
|
|
|
if (this.searchLabelList[j].label == 'asset') {
|
|
|
|
|
|
this.searchLabelList[j].disabled = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!hasType) {
|
|
|
|
|
|
for (let j = 0; j < this.searchLabelList.length; j++) {
|
|
|
|
|
|
if (this.searchLabelList[j].label == 'asset') {
|
|
|
|
|
|
this.searchLabelList[j].disabled = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
} */
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
no_condition: {
|
|
|
|
|
|
handler (newData, oldData) {
|
|
|
|
|
|
if (newData != '') {
|
|
|
|
|
|
this.input_list = true
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
searchMsg: {
|
|
|
|
|
|
immediate: true,
|
|
|
|
|
|
handler (n) {
|
|
|
|
|
|
if (n) {
|
|
|
|
|
|
n.searchLabelList.forEach(item => {
|
|
|
|
|
|
if (item.id === 27 && item.type === 'idc' && item.label === 'idcId') {
|
|
|
|
|
|
this.getDcData()
|
2020-11-21 16:12:02 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2021-04-16 15:02:40 +08:00
|
|
|
|
props: {
|
|
|
|
|
|
searchMsg: {},
|
|
|
|
|
|
defaultItem: {},
|
|
|
|
|
|
defaultValue: {},
|
|
|
|
|
|
inTransform: {},
|
|
|
|
|
|
position: {},
|
|
|
|
|
|
single: {},
|
|
|
|
|
|
showHistory: {
|
|
|
|
|
|
type: Boolean,
|
|
|
|
|
|
default: true
|
|
|
|
|
|
},
|
|
|
|
|
|
showSearch: {
|
|
|
|
|
|
type: Boolean,
|
|
|
|
|
|
default: true
|
|
|
|
|
|
},
|
|
|
|
|
|
placeholder: {
|
|
|
|
|
|
type: String,
|
|
|
|
|
|
default: ''
|
2021-11-09 11:22:52 +08:00
|
|
|
|
},
|
|
|
|
|
|
targetTab: {}
|
2021-04-16 15:02:40 +08:00
|
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
|
methods: {
|
|
|
|
|
|
// dc
|
|
|
|
|
|
clearSearch () {
|
|
|
|
|
|
this.select_list = []
|
|
|
|
|
|
},
|
|
|
|
|
|
clickout () {
|
|
|
|
|
|
this.input_list = true
|
|
|
|
|
|
},
|
|
|
|
|
|
selectObject (column, selectItem, e) {
|
|
|
|
|
|
this.stop_click(e)
|
|
|
|
|
|
for (let i = 0; i < this.select_list.length; i++) {
|
|
|
|
|
|
const val = this.select_list[i]
|
|
|
|
|
|
if (val.type == 'dc' && selectItem.searchType == 'dc') {
|
|
|
|
|
|
val.val = selectItem.name
|
|
|
|
|
|
val.valnum = selectItem.id
|
|
|
|
|
|
val.valString = ''
|
|
|
|
|
|
} else if (val.type == 'project' && selectItem.searchType == 'project') {
|
|
|
|
|
|
val.val = selectItem.name
|
|
|
|
|
|
val.valnum = selectItem.id
|
|
|
|
|
|
val.valString = ''
|
|
|
|
|
|
} else if (val.type == 'module' && selectItem.searchType == 'module') {
|
|
|
|
|
|
val.val = selectItem.name
|
|
|
|
|
|
val.valnum = selectItem.id
|
|
|
|
|
|
val.valString = ''
|
|
|
|
|
|
} else if (val.type == 'asset' && selectItem.searchType == 'asset') {
|
|
|
|
|
|
val.val = selectItem.host
|
|
|
|
|
|
val.valnum = selectItem.id
|
|
|
|
|
|
val.valString = ''
|
2021-05-10 15:59:39 +08:00
|
|
|
|
} else if (val.type == 'assetState' && selectItem.searchType == 'assetState') {
|
|
|
|
|
|
val.val = selectItem.name
|
|
|
|
|
|
val.valnum = selectItem.id
|
|
|
|
|
|
val.valString = ''
|
|
|
|
|
|
} else if (val.type === 'brand' && selectItem.searchType === 'brand') {
|
|
|
|
|
|
val.val = selectItem.name
|
|
|
|
|
|
val.valnum = selectItem.id
|
|
|
|
|
|
val.valString = ''
|
|
|
|
|
|
} else if (val.type === 'group' && selectItem.searchType === 'group') {
|
|
|
|
|
|
val.val = selectItem.name
|
|
|
|
|
|
val.valnum = selectItem.id
|
|
|
|
|
|
val.valString = ''
|
|
|
|
|
|
} else if (val.type === 'severity' && selectItem.searchType === 'severity') {
|
|
|
|
|
|
val.val = selectItem.name
|
|
|
|
|
|
val.valnum = selectItem.id
|
|
|
|
|
|
val.valString = ''
|
2021-09-14 16:14:25 +08:00
|
|
|
|
} else if (val.type === 'alertTypes' && selectItem.searchType === 'alertTypes') {
|
|
|
|
|
|
val.val = selectItem.name
|
|
|
|
|
|
val.valnum = selectItem.id
|
|
|
|
|
|
val.valString = ''
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// this.select_list.push({type: 'dc', val: selectItem.name, valnum: selectItem.id});
|
|
|
|
|
|
this.input_sreach = ''
|
|
|
|
|
|
this.sreach_num = this.select_list.length
|
|
|
|
|
|
this.change_sreach_show = true
|
|
|
|
|
|
this.input_list = false
|
|
|
|
|
|
const _this = this
|
|
|
|
|
|
setTimeout('document.getElementById("one-input").focus()', 500)
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
_this.getHeight()
|
|
|
|
|
|
})
|
|
|
|
|
|
/* this.$nextTick(() => {
|
2020-04-20 21:27:32 +08:00
|
|
|
|
this.$refs.searchScrollbar.update();
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}); */
|
|
|
|
|
|
},
|
|
|
|
|
|
// 一层下拉点击
|
|
|
|
|
|
tr_selectTypeInfo (val) {
|
|
|
|
|
|
this.TypeSelect = []
|
|
|
|
|
|
val.data.length != 0 && this.TypeSelect.push(val.data[0])
|
|
|
|
|
|
val.data.length != 0 && (this.secondShow = true)
|
|
|
|
|
|
},
|
|
|
|
|
|
// 二层下拉点击
|
|
|
|
|
|
tr_selectProtocolInfo (val) {
|
|
|
|
|
|
this.select_list = []
|
|
|
|
|
|
this.select_list.push({
|
|
|
|
|
|
name: val.name,
|
|
|
|
|
|
// id:id,
|
|
|
|
|
|
type: val.type,
|
|
|
|
|
|
label: val.label
|
|
|
|
|
|
// disabled:disabled
|
|
|
|
|
|
})
|
|
|
|
|
|
this.change_sreach_show = false
|
|
|
|
|
|
this.sreach_num = this.select_list.length - 1
|
|
|
|
|
|
this.input_list = !this.input_list
|
|
|
|
|
|
// setTimeout("document.getElementById(\"sreach_input\").focus()", 500);
|
|
|
|
|
|
const _this = this
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
_this.getHeight()
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
Iskeywords (ind) {
|
|
|
|
|
|
if (this.select_list[ind].id == 29) {
|
|
|
|
|
|
this.searchLabelList.forEach(val => {
|
|
|
|
|
|
if (val.id == 30 || val.id == 31 || val.id == 32 || val.id == 33) {
|
|
|
|
|
|
val.disabled = false
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
} else if (this.select_list[ind].id == 30 || this.select_list[ind].id == 31 || this.select_list[ind].id == 32 || this.select_list[ind].id == 33) {
|
|
|
|
|
|
this.searchLabelList.forEach(val => {
|
|
|
|
|
|
if (val.id == 29) {
|
|
|
|
|
|
val.disabled = false
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
getDcData () {
|
2021-04-29 22:24:38 +08:00
|
|
|
|
this.$get('dc', { pageNo: 1, pageSize: -1 }).then(response => {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.dcSelect = response.data.list
|
|
|
|
|
|
this.dcSelect.forEach((item, index) => {
|
|
|
|
|
|
this.$set(item, 'searchType', 'dc')
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
getAssetData () {
|
|
|
|
|
|
this.$get('asset', { pageNo: 1, pageSize: -1 }).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.assetSelect = response.data.list
|
|
|
|
|
|
this.assetSelect.forEach((item, index) => {
|
|
|
|
|
|
this.$set(item, 'searchType', 'asset')
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2021-05-10 15:59:39 +08:00
|
|
|
|
getAssetStateData () {
|
|
|
|
|
|
this.$get('asset/stateConf', { pageNo: 1, pageSize: -1 }).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.assetStateSelect = response.data.list
|
|
|
|
|
|
this.assetStateSelect.forEach((item, index) => {
|
|
|
|
|
|
this.$set(item, 'searchType', 'assetState')
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
getBrandData () {
|
|
|
|
|
|
this.$get('asset/brand', { pageNo: 1, pageSize: -1 }).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.brandSelect = response.data.list
|
|
|
|
|
|
this.brandSelect.forEach((item, index) => {
|
|
|
|
|
|
this.$set(item, 'searchType', 'brand')
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
getGroupData () {
|
|
|
|
|
|
this.$get('asset/field/group', { pageNo: 1, pageSize: -1 }).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.groupSelect = response.data.list
|
|
|
|
|
|
this.groupSelect.forEach((item, index) => {
|
|
|
|
|
|
this.$set(item, 'searchType', 'group')
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
|
getModelData () {
|
|
|
|
|
|
this.$get('model', { pageNo: 1, pageSize: -1 }).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.modelSelect = response.data.list
|
|
|
|
|
|
this.modelSelect.forEach((item, index) => {
|
|
|
|
|
|
this.$set(item, 'searchType', 'model')
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
getProjectData () {
|
2021-05-10 15:59:39 +08:00
|
|
|
|
this.$get('monitor/project', { pageNo: 1, pageSize: -1 }).then(response => {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.projectSelect = response.data.list
|
|
|
|
|
|
this.projectSelect.forEach((item, index) => {
|
|
|
|
|
|
this.$set(item, 'searchType', 'project')
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2021-05-10 15:59:39 +08:00
|
|
|
|
getSeverityData () {
|
|
|
|
|
|
this.$get('alert/severity', { pageNo: 1, pageSize: -1 }).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.severitySelect = response.data.list
|
|
|
|
|
|
this.severitySelect.forEach((item, index) => {
|
|
|
|
|
|
this.$set(item, 'searchType', 'severity')
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2021-03-19 18:52:19 +08:00
|
|
|
|
getModuleData () {
|
|
|
|
|
|
this.$get('module', { pageNo: 1, pageSize: -1 }).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.moduleSelect = response.data.list
|
|
|
|
|
|
this.moduleSelect.forEach((item, index) => {
|
|
|
|
|
|
this.$set(item, 'searchType', 'module')
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
getGnameList () {
|
|
|
|
|
|
this.$get('/expression/tmpl/gname').then(res => {
|
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
this.gnameList = res.data.list.map((item, index) => {
|
|
|
|
|
|
return {
|
|
|
|
|
|
value: item,
|
|
|
|
|
|
name: item,
|
|
|
|
|
|
id: index
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
// 点击确认选择下拉内容
|
|
|
|
|
|
tr_selectInfo (selectLabel, value, label, e) {
|
|
|
|
|
|
this.stop_click(e)
|
|
|
|
|
|
this.select_list.forEach(val => {
|
|
|
|
|
|
if (val.label == selectLabel) {
|
|
|
|
|
|
val.val = label
|
|
|
|
|
|
val.valnum = value
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
for (let i = 0; i < this.select_list.length; i++) {
|
|
|
|
|
|
if (this.select_list[i].label == selectLabel) {
|
|
|
|
|
|
this.select_list.splice(i, 1, Object.assign({}, this.select_list[i], { val: label, valnum: value }))
|
|
|
|
|
|
/* this.select_list[i].val = label;
|
|
|
|
|
|
this.select_list[i].valnum = value; */
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
this.input_sreach = ''
|
|
|
|
|
|
this.sreach_num = this.select_list.length
|
|
|
|
|
|
this.change_sreach_show = true
|
|
|
|
|
|
this.input_list = false
|
|
|
|
|
|
const _this = this
|
|
|
|
|
|
setTimeout('document.getElementById("one-input").focus()', 500)
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
_this.getHeight()
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
// 点击确认value是string类型的下拉内容, param: 字段对象,选中的选项
|
|
|
|
|
|
stringSelectInfo (column, selectItem, e) {
|
|
|
|
|
|
this.stop_click(e)
|
|
|
|
|
|
this.select_list.forEach(val => {
|
2021-05-10 15:59:39 +08:00
|
|
|
|
if (val.label === column.label) {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
val.val = selectItem.value
|
|
|
|
|
|
val.valString = selectItem.label
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
this.input_sreach = ''
|
|
|
|
|
|
this.sreach_num = this.select_list.length
|
|
|
|
|
|
this.change_sreach_show = true
|
|
|
|
|
|
this.input_list = false
|
|
|
|
|
|
const _this = this
|
|
|
|
|
|
setTimeout('document.getElementById("one-input").focus()', 500)
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
_this.getHeight()
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
// 点击历史记录图标
|
|
|
|
|
|
look_history (e) {
|
|
|
|
|
|
this.stop_click(e)
|
|
|
|
|
|
this.localStorage_display = !this.localStorage_display
|
|
|
|
|
|
this.restructure_historyDate()
|
|
|
|
|
|
},
|
|
|
|
|
|
backtime (t) {
|
|
|
|
|
|
const myDate = new Date(t)
|
|
|
|
|
|
const nt = myDate.getFullYear() + '-' + (myDate.getMonth() > 8 ? '' : 0) +
|
|
|
|
|
|
(myDate.getMonth() + 1) + '-' + (myDate.getDate() > 9 ? '' : 0) +
|
|
|
|
|
|
myDate.getDate() + ' ' +
|
|
|
|
|
|
(myDate.getHours() > 9 ? '' : '0') + myDate.getHours() + ':' +
|
|
|
|
|
|
(myDate.getMinutes() > 9 ? '' : 0) + myDate.getMinutes() + ':' +
|
|
|
|
|
|
(myDate.getSeconds() > 9 ? '' : 0) + myDate.getSeconds()
|
|
|
|
|
|
return nt
|
|
|
|
|
|
},
|
|
|
|
|
|
changeDate () {
|
|
|
|
|
|
this.dataBackG = false
|
|
|
|
|
|
this.change_sreach_show = true
|
|
|
|
|
|
if (this.timeFrame != []) {
|
|
|
|
|
|
this.select_list[this.sreach_num].val = this.backtime(this.timeFrame[0]) + ' - ' + this.backtime(this.timeFrame[1])
|
|
|
|
|
|
this.input_sreach = ''
|
|
|
|
|
|
this.sreach_num++
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// 选择时间计划
|
|
|
|
|
|
selectSul (name) {
|
|
|
|
|
|
this.change_sreach_show = true
|
|
|
|
|
|
this.select_list[this.sreach_num].val = name
|
|
|
|
|
|
this.input_sreach = ''
|
|
|
|
|
|
this.sreach_num++
|
|
|
|
|
|
this.getHeight()
|
|
|
|
|
|
},
|
|
|
|
|
|
// 点击搜索
|
|
|
|
|
|
select () {
|
|
|
|
|
|
const objectInfo = {}
|
|
|
|
|
|
this.change_sreach_show = true
|
2021-06-07 17:31:17 +08:00
|
|
|
|
this.name = ''
|
|
|
|
|
|
this.id = ''
|
2021-03-19 18:52:19 +08:00
|
|
|
|
if (this.input_sreach != '') {
|
|
|
|
|
|
this.select_list[this.sreach_num].val = this.input_sreach
|
|
|
|
|
|
this.input_sreach = ''
|
|
|
|
|
|
this.sreach_num = this.select_list.length
|
|
|
|
|
|
}
|
|
|
|
|
|
// input有值 默认添加到name中
|
|
|
|
|
|
if (this.no_condition != '') {
|
|
|
|
|
|
const no_condition_bool = false; let no_condition_str = ''; const route = this.$route.path
|
|
|
|
|
|
if (this.select_list.length == 0) {
|
|
|
|
|
|
// 日志模块新增路由判断
|
|
|
|
|
|
if (route == '/Log_SecurityEventLogs' || route == '/Log_ProxyEventLogs' || route == '/Log_SesssionRecords' || route == '/Log_RadiusLogs') {
|
|
|
|
|
|
no_condition_str = 'logId'
|
|
|
|
|
|
} else if (route == '/Device_DeviceList') {
|
|
|
|
|
|
no_condition_str = 'sn'
|
|
|
|
|
|
} else if (route == '/system_PolicyConfigurationLog' || route == '/system_LoginLog') {
|
|
|
|
|
|
no_condition_str = 'modifyBy'
|
|
|
|
|
|
} else {
|
|
|
|
|
|
no_condition_str = 'name'
|
|
|
|
|
|
}
|
|
|
|
|
|
if (no_condition_str == 'name') {
|
|
|
|
|
|
// 处理空白输入时不可作为搜索条件
|
|
|
|
|
|
// this.select_list.push({name: this.select_title.name, id:2, type:'input',val:this.no_condition,label:'name'});
|
|
|
|
|
|
// this.searchLabelList.forEach((val,ind)=>{
|
|
|
|
|
|
// if(val.id == 2){
|
|
|
|
|
|
// this.searchLabelList.splice(ind,1);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// })
|
|
|
|
|
|
} else if (no_condition_str == 'modifyBy') {
|
|
|
|
|
|
this.select_list.push({ name: this.select_title.Operator, id: 6, type: 'input', val: this.no_condition, label: 'modifyBy' })
|
|
|
|
|
|
this.searchLabelList.forEach((val, ind) => {
|
|
|
|
|
|
if (val.id == 6) {
|
|
|
|
|
|
this.searchLabelList.splice(ind, 1)
|
2019-12-17 17:17:30 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
})
|
|
|
|
|
|
} else if (no_condition_str == 'sn') {
|
|
|
|
|
|
this.select_list.push({ name: this.select_title.SN, id: 8, type: 'input', val: this.no_condition, label: 'sn' })
|
|
|
|
|
|
this.searchLabelList.forEach((val, ind) => {
|
|
|
|
|
|
if (val.id == 8) {
|
|
|
|
|
|
this.searchLabelList.splice(ind, 1)
|
2021-03-16 17:54:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
2021-03-19 18:52:19 +08:00
|
|
|
|
} else if (no_condition_str == 'id') {
|
|
|
|
|
|
this.select_list.push({ name: this.select_title.Policy_ID, id: 1, type: 'input', val: this.no_condition, label: 'id' })
|
|
|
|
|
|
this.searchLabelList.forEach((val, ind) => {
|
|
|
|
|
|
if (val.id == 1) {
|
|
|
|
|
|
this.searchLabelList.splice(ind, 1)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
} else if (no_condition_str == 'logId') { // 日志模块新增判断
|
|
|
|
|
|
this.select_list.push({ name: 'Log ID', type: 'input', label: 'Log Id', val: this.no_condition })
|
|
|
|
|
|
this.searchLabelList.forEach((val, ind) => {
|
|
|
|
|
|
if (val.id == 1) {
|
|
|
|
|
|
this.searchLabelList.splice(ind, 1)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
this.sreach_num++
|
|
|
|
|
|
} else {
|
|
|
|
|
|
const no_condition_bool = false; let no_condition_str = ''; const route = this.$route.path; let bool = true
|
|
|
|
|
|
if (route == '/Log_SesssionRecords' || route == '/Log_EventLogs') {
|
|
|
|
|
|
no_condition_str = 'id'
|
|
|
|
|
|
} else if (route == '/Device_DeviceList') {
|
|
|
|
|
|
no_condition_str = 'sn'
|
|
|
|
|
|
} else if (route == '/system_PolicyConfigurationLog' || route == '/system_UserManagement' || route == '/system_LoginLog') {
|
|
|
|
|
|
no_condition_str = 'modifyBy'
|
|
|
|
|
|
} else {
|
|
|
|
|
|
no_condition_str = 'name'
|
|
|
|
|
|
}
|
|
|
|
|
|
this.select_list.forEach(val => {
|
|
|
|
|
|
if (val.label == no_condition_str) {
|
|
|
|
|
|
bool = false
|
|
|
|
|
|
val.val += ',' + this.no_condition
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
if (bool) {
|
|
|
|
|
|
this.searchLabelList.forEach((val, ind) => {
|
|
|
|
|
|
if (val.label == no_condition_str) {
|
|
|
|
|
|
val.val = this.no_condition
|
|
|
|
|
|
this.select_list.push(val)
|
|
|
|
|
|
this.searchLabelList.splice(ind, 1)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
this.sreach_num++
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
this.no_condition = ''
|
|
|
|
|
|
}
|
|
|
|
|
|
let labelBool = true
|
|
|
|
|
|
this.select_list.forEach(val => {
|
2021-04-23 20:06:58 +08:00
|
|
|
|
if (typeof (val.val) !== 'undefined' && val.val != null) {
|
2021-05-24 16:11:45 +08:00
|
|
|
|
if (val.type === 'select') {
|
|
|
|
|
|
if (val.label === 'alertType' || val.label === 'promType') {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
objectInfo.type = val.valnum
|
2021-05-24 16:11:45 +08:00
|
|
|
|
} else if (val.label === 'assetState') {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
objectInfo.state = val.valnum
|
2021-05-24 16:42:46 +08:00
|
|
|
|
} else if (val.label === 'credentialType') {
|
|
|
|
|
|
objectInfo.types = val.valnum
|
2021-09-15 11:42:06 +08:00
|
|
|
|
} else if (val.label === 'promState') {
|
|
|
|
|
|
objectInfo.statuses = val.valnum
|
2021-03-19 18:52:19 +08:00
|
|
|
|
} else if (typeof (val.valnum) === 'undefined' || val.valnum == '') {
|
|
|
|
|
|
this.selectInfoList[val.label].forEach(item => {
|
2021-05-24 16:11:45 +08:00
|
|
|
|
if (item.label === val.val) {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
labelBool = false
|
|
|
|
|
|
objectInfo[val.label] = item.value
|
2019-12-16 17:14:58 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
})
|
|
|
|
|
|
if (labelBool) {
|
|
|
|
|
|
objectInfo[val.label] = val.val
|
|
|
|
|
|
}
|
2021-11-09 10:17:12 +08:00
|
|
|
|
} else {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
objectInfo[val.label] = val.valnum
|
|
|
|
|
|
}
|
2021-05-24 16:11:45 +08:00
|
|
|
|
} else if (val.type === 'selectSelf') {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
objectInfo[val.label] = val.valnum
|
2021-06-10 18:36:24 +08:00
|
|
|
|
} else if (val.type === 'severity') {
|
|
|
|
|
|
objectInfo[val.label] = val.valnum
|
2021-09-14 16:14:25 +08:00
|
|
|
|
} else if (val.type === 'alertTypes') {
|
|
|
|
|
|
objectInfo[val.label] = val.valnum
|
2021-05-24 16:11:45 +08:00
|
|
|
|
} else if (val.type === 'selectAction') { // 新增日志判断
|
2021-03-19 18:52:19 +08:00
|
|
|
|
objectInfo[val.label] = val.valnum
|
2021-05-24 16:11:45 +08:00
|
|
|
|
} else if (val.type === 'dc') {
|
2021-05-10 15:59:39 +08:00
|
|
|
|
objectInfo.dcIds = val.valnum
|
2021-05-24 16:11:45 +08:00
|
|
|
|
} else if (val.type === 'asset') {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
objectInfo.asset = val.val
|
2021-05-24 16:11:45 +08:00
|
|
|
|
} else if (val.type === 'module') {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
objectInfo.moduleId = val.valnum
|
2021-05-10 15:59:39 +08:00
|
|
|
|
} else if (val.type === 'project') {
|
|
|
|
|
|
objectInfo.projectIds = val.valnum
|
|
|
|
|
|
} else if (val.type === 'assetState') {
|
|
|
|
|
|
objectInfo.stateIds = val.valnum
|
|
|
|
|
|
} else if (val.type === 'brand') {
|
|
|
|
|
|
objectInfo.brandIds = val.valnum
|
|
|
|
|
|
} else if (val.type === 'group') {
|
|
|
|
|
|
objectInfo.groupIds = val.valnum
|
|
|
|
|
|
} else if (val.type === 'selectString') {
|
|
|
|
|
|
if (val.label === 'dcState') {
|
|
|
|
|
|
objectInfo.state = val.val
|
|
|
|
|
|
} else if (val.label === 'promType') {
|
|
|
|
|
|
objectInfo.type = val.val
|
|
|
|
|
|
} else if (val.label === 'chartType') {
|
|
|
|
|
|
objectInfo.type = val.val
|
2021-06-10 14:24:18 +08:00
|
|
|
|
} else if (val.label === 'protocol') {
|
2021-06-10 15:04:20 +08:00
|
|
|
|
objectInfo.protocol = val.val
|
2021-07-23 15:49:18 +08:00
|
|
|
|
} else if (val.label === 'operation') {
|
2021-06-10 18:11:57 +08:00
|
|
|
|
objectInfo.operation = val.val
|
2021-07-23 15:49:18 +08:00
|
|
|
|
} else if (val.label === 'state') {
|
2021-06-10 18:11:57 +08:00
|
|
|
|
objectInfo.state = val.val
|
2021-05-10 15:59:39 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
objectInfo[val.label] = val.val
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
this.getHeight()
|
|
|
|
|
|
// 搜索完成后存储在本地历史记录中
|
|
|
|
|
|
if (this.select_list.length != 0) {
|
|
|
|
|
|
if (JSON.parse(localStorage.getItem('nz-history-' + this.where)) == undefined || JSON.parse(localStorage.getItem('nz-history-' + this.where)) == []) {
|
|
|
|
|
|
this.historyList.unshift(this.select_list)
|
|
|
|
|
|
localStorage.setItem('nz-history-' + this.where, JSON.stringify(this.historyList))
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.historyList = JSON.parse(localStorage.getItem('nz-history-' + this.where))
|
|
|
|
|
|
this.historyList.unshift(this.select_list)
|
|
|
|
|
|
if (this.historyList.length > 10) {
|
|
|
|
|
|
this.historyList.length = 10
|
|
|
|
|
|
}
|
|
|
|
|
|
localStorage.setItem('nz-history-' + this.where, JSON.stringify(this.historyList))
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
this.input_list = true
|
|
|
|
|
|
this.restructure_historyDate()
|
2019-12-16 17:14:58 +08:00
|
|
|
|
|
2021-03-19 18:52:19 +08:00
|
|
|
|
this.$emit('search', objectInfo)
|
|
|
|
|
|
},
|
|
|
|
|
|
// 清空历史记录
|
|
|
|
|
|
clear_history () {
|
|
|
|
|
|
this.historyList = []
|
|
|
|
|
|
this.history_once = []
|
|
|
|
|
|
localStorage.setItem('nz-history-' + this.where, JSON.stringify(this.historyList))
|
|
|
|
|
|
},
|
|
|
|
|
|
// 再次点击之前的历史记录
|
|
|
|
|
|
select_history (ind, e) {
|
|
|
|
|
|
this.stop_click(e)
|
|
|
|
|
|
this.input_list = true
|
|
|
|
|
|
this.change_sreach_show = true
|
|
|
|
|
|
this.localStorage_display = !this.localStorage_display
|
|
|
|
|
|
this.select_list = []
|
|
|
|
|
|
JSON.parse(localStorage.getItem('nz-history-' + this.where)).splice(ind, 1)
|
|
|
|
|
|
this.select_list = JSON.parse(JSON.stringify(this.history_once[ind]))
|
|
|
|
|
|
this.sreach_num = this.select_list.length
|
|
|
|
|
|
this.select_list.forEach(val => {
|
|
|
|
|
|
this.searchLabelList.forEach((item, index) => {
|
|
|
|
|
|
if (val.id == item.id) {
|
|
|
|
|
|
this.searchLabelList.splice(index, 1)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
this.select()
|
|
|
|
|
|
},
|
|
|
|
|
|
// 获取历史记录 数据进行处理以便循环展示
|
|
|
|
|
|
restructure_historyDate () {
|
|
|
|
|
|
if (localStorage.getItem('nz-history-' + this.where) !== undefined && localStorage.getItem('nz-history-' + this.where) !== null) {
|
|
|
|
|
|
this.history_once = JSON.parse(localStorage.getItem('nz-history-' + this.where))
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
clear_search_list (e) {
|
|
|
|
|
|
const keyCode = window.event ? e.keyCode : e.which
|
|
|
|
|
|
},
|
|
|
|
|
|
// 监听输入框鼠标抬起事件
|
|
|
|
|
|
enter_one (e) {
|
|
|
|
|
|
const keyCode = window.event ? e.keyCode : e.which
|
|
|
|
|
|
if (keyCode == 40) {
|
|
|
|
|
|
if (this.searchStyleNum < this.searchLabelList.length - 1) {
|
|
|
|
|
|
var disabledNum = 0
|
|
|
|
|
|
this.searchLabelList.forEach(val => {
|
|
|
|
|
|
if (val.disabled) {
|
|
|
|
|
|
disabledNum++
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
this.isSearchNum = this.searchStyleNum
|
|
|
|
|
|
this.isSearchNum++
|
|
|
|
|
|
if (!(this.searchLabelList[this.isSearchNum].disabled)) {
|
|
|
|
|
|
this.searchStyleNum++
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.searchStyleNum += disabledNum + 1
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.searchStyleNum >= 7) {
|
|
|
|
|
|
document.getElementById('input_list').scrollTop += 28
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (keyCode == 38) {
|
|
|
|
|
|
if (this.searchStyleNum >= 0) {
|
|
|
|
|
|
var disabledNum = 0
|
|
|
|
|
|
this.searchLabelList.forEach(val => {
|
|
|
|
|
|
if (val.disabled) {
|
|
|
|
|
|
disabledNum++
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
this.isSearchNum = this.searchStyleNum
|
|
|
|
|
|
if (this.isSearchNum > 0) {
|
|
|
|
|
|
this.isSearchNum--
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!(this.searchLabelList[this.isSearchNum].disabled)) {
|
|
|
|
|
|
this.searchStyleNum--
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.searchStyleNum -= disabledNum + 1
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.searchStyleNum <= this.searchLabelList.length - 8) {
|
|
|
|
|
|
document.getElementById('input_list').scrollTop -= 28
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.no_condition == '') {
|
|
|
|
|
|
if (!this.keyBool) {
|
|
|
|
|
|
if (keyCode == 8) {
|
|
|
|
|
|
const arr = this.select_list
|
|
|
|
|
|
if (!this.delBool) {
|
|
|
|
|
|
if (this.input_sreach == '') {
|
|
|
|
|
|
for (let i = arr.length - 1; i >= 0; i--) {
|
|
|
|
|
|
this.input_list = true
|
|
|
|
|
|
this.change_sreach_show = false
|
|
|
|
|
|
this.sreach_num = i
|
|
|
|
|
|
this.input_sreach = arr[i].val
|
|
|
|
|
|
setTimeout('document.getElementById("sreach_input").focus()', 500)
|
|
|
|
|
|
this.delBool = true
|
|
|
|
|
|
break
|
2019-12-23 17:39:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (keyCode == 13) {
|
|
|
|
|
|
if (this.searchStyleNum <= 0) {
|
|
|
|
|
|
this.select()
|
|
|
|
|
|
} else {
|
|
|
|
|
|
const val = this.searchLabelList[this.searchStyleNum].name
|
|
|
|
|
|
const ind = this.searchStyleNum
|
|
|
|
|
|
const id = this.searchLabelList[this.searchStyleNum].id
|
|
|
|
|
|
const type = this.searchLabelList[this.searchStyleNum].type
|
|
|
|
|
|
const label = this.searchLabelList[this.searchStyleNum].label
|
|
|
|
|
|
const disabled = this.searchLabelList[this.searchStyleNum].disabled
|
|
|
|
|
|
const readonly = this.searchLabelList[this.searchStyleNum].readonly
|
|
|
|
|
|
this.searchStyleNum = -1
|
|
|
|
|
|
this.select_name(val, ind, id, type, label, disabled, readonly)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// input框监听是按删除还是回车
|
|
|
|
|
|
enter (val, e) {
|
|
|
|
|
|
const keyCode = window.event ? e.keyCode : e.which
|
|
|
|
|
|
if (val == 'ID' && keyCode == 13) {
|
|
|
|
|
|
const id = /^[0-9]*$/
|
|
|
|
|
|
if (!id.test(this.input_sreach) || this.input_sreach > 2147483647) {
|
|
|
|
|
|
// 如果有不正确的值 进行删除
|
|
|
|
|
|
this.input_sreach = ''
|
|
|
|
|
|
this.$message.error(this.other.delErrorId)
|
|
|
|
|
|
return false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (keyCode !== 8) {
|
|
|
|
|
|
this.delBool = false
|
|
|
|
|
|
this.delcriteriaBool = false
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.delBool) {
|
|
|
|
|
|
if (keyCode == 8) {
|
|
|
|
|
|
if (this.input_sreach == '') {
|
|
|
|
|
|
this.searchMsg.searchLabelList.forEach((val, k) => {
|
2021-09-22 11:15:32 +08:00
|
|
|
|
if (this.select_list[this.sreach_num].label == val.label) {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
this.searchLabelList.splice(k + 1, 0, val)
|
|
|
|
|
|
this.Iskeywords(this.sreach_num)
|
2019-12-16 17:14:58 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
})
|
|
|
|
|
|
this.select_list.splice(this.sreach_num, 1)
|
|
|
|
|
|
this.change_sreach_show = true
|
|
|
|
|
|
setTimeout('document.getElementById("one-input").focus()', 500)
|
|
|
|
|
|
this.input_list = false
|
|
|
|
|
|
this.delBool = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
if (keyCode == 8) {
|
|
|
|
|
|
if (this.delcriteriaBool) {
|
|
|
|
|
|
this.searchMsg.searchLabelList.forEach((val, k) => {
|
2021-09-22 11:15:32 +08:00
|
|
|
|
if (this.select_list[this.sreach_num].label == val.label) {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
this.searchLabelList.splice(k + 1, 0, val)
|
|
|
|
|
|
this.Iskeywords(this.sreach_num)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
this.select_list.splice(this.sreach_num, 1)
|
|
|
|
|
|
this.change_sreach_show = true
|
|
|
|
|
|
setTimeout('document.getElementById("one-input").focus()', 500)
|
|
|
|
|
|
this.input_list = false
|
|
|
|
|
|
this.delcriteriaBool = false
|
|
|
|
|
|
} else {
|
|
|
|
|
|
if (this.input_sreach == '') {
|
|
|
|
|
|
this.delcriteriaBool = true
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2019-12-16 17:14:58 +08:00
|
|
|
|
|
2021-03-19 18:52:19 +08:00
|
|
|
|
if (keyCode == 38 || keyCode == 40) {
|
|
|
|
|
|
if (this.select_list[this.sreach_num].type !== 'select') {
|
|
|
|
|
|
if (this.input_sreach !== '') {
|
|
|
|
|
|
this.zhezhao_click()
|
|
|
|
|
|
setTimeout('document.getElementById("one-input").focus()', 500)
|
|
|
|
|
|
this.input_list = false
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
if (keyCode == 40) {
|
|
|
|
|
|
this.selectInfo = true
|
|
|
|
|
|
if (this.search_select_style_num < this.selectInfoList[this.select_list[this.sreach_num].label].length - 1) {
|
|
|
|
|
|
this.search_select_style_num++
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (keyCode == 38) {
|
|
|
|
|
|
this.selectInfo = true
|
|
|
|
|
|
if (this.search_select_style_num >= 0) {
|
|
|
|
|
|
this.search_select_style_num--
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if (keyCode == 13) {
|
|
|
|
|
|
this.searchMsg.zheze_none = true
|
|
|
|
|
|
// 回车键
|
|
|
|
|
|
if (!this.selectInfo) {
|
|
|
|
|
|
this.select()
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.selectInfo = false
|
|
|
|
|
|
this.tr_selectInfo(this.select_list[this.sreach_num].label, this.selectInfoList[this.select_list[this.sreach_num].label][this.search_select_style_num].label, this.selectInfoList[this.select_list[this.sreach_num].label][this.search_select_style_num].value, e)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// 清空已输入的搜索条件
|
|
|
|
|
|
clear_input (e) {
|
|
|
|
|
|
this.stop_click(e)
|
|
|
|
|
|
this.no_condition = ''
|
|
|
|
|
|
this.input_sreach = ''
|
|
|
|
|
|
this.select_list = []
|
|
|
|
|
|
this.searchLabelList = []
|
|
|
|
|
|
JSON.parse(JSON.stringify(this.searchMsg.searchLabelList)).forEach(val => {
|
|
|
|
|
|
this.searchLabelList.push(val)
|
|
|
|
|
|
})
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.$refs.searchScrollbar.update()
|
|
|
|
|
|
})
|
2021-11-05 09:26:46 +08:00
|
|
|
|
this.select()
|
2021-03-19 18:52:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 修改已有参数
|
|
|
|
|
|
update_sreach (ind, e) {
|
|
|
|
|
|
// if(this.select_list[ind].id==6||this.select_list[ind].id==28){
|
|
|
|
|
|
if (false) {
|
|
|
|
|
|
this.sreach_num = ind
|
|
|
|
|
|
this.downBool = false
|
|
|
|
|
|
this.change_sreach_show = false
|
|
|
|
|
|
this.input_list = true
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.input_list = true
|
|
|
|
|
|
this.change_sreach_show = false
|
|
|
|
|
|
this.sreach_num = ind
|
|
|
|
|
|
this.input_sreach = this.select_list[ind].val
|
|
|
|
|
|
if (this.select_list[ind].type == 'input') {
|
|
|
|
|
|
this.downBool = true
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.downBool = false
|
|
|
|
|
|
}
|
|
|
|
|
|
setTimeout('document.getElementById("sreach_input").focus()', 50)
|
|
|
|
|
|
this.getHeight()
|
|
|
|
|
|
this.searchMsg.zheze_none = false
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// 删除要搜索的条件
|
|
|
|
|
|
close_selcet_list (ind, e) {
|
|
|
|
|
|
if (e) {
|
|
|
|
|
|
this.stop_click(e)
|
|
|
|
|
|
}
|
|
|
|
|
|
// 处理alertType--asset联动问题:删除alertType时,将asset也删除
|
|
|
|
|
|
/* if (this.select_list[ind].label == 'alertType') {
|
2020-01-10 20:09:33 +08:00
|
|
|
|
for (let i = 0; i < this.select_list.length; i++) {
|
|
|
|
|
|
if (this.select_list[i].label == 'asset') {
|
|
|
|
|
|
this.close_selcet_list(i);
|
|
|
|
|
|
for (let j = 0; j < this.searchLabelList.length; j++) {
|
|
|
|
|
|
if (this.searchLabelList[j].label == 'asset') {
|
|
|
|
|
|
this.searchLabelList[j].disabled = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
} */
|
|
|
|
|
|
this.searchMsg.searchLabelList.forEach((val, key) => {
|
2021-09-14 15:36:55 +08:00
|
|
|
|
if (this.select_list[ind].label == val.label) {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
this.searchLabelList.splice(key + 1, 0, val)
|
|
|
|
|
|
this.Iskeywords(ind)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
this.select_list.splice(ind, 1)
|
|
|
|
|
|
this.sreach_num--
|
2021-11-05 09:26:46 +08:00
|
|
|
|
this.select()
|
2021-03-19 18:52:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 阻止冒泡事件
|
|
|
|
|
|
stop_click (e) {
|
|
|
|
|
|
if (e) {
|
|
|
|
|
|
e.cancelBubble = true
|
|
|
|
|
|
e.stopPropagation()
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// 点击遮罩层
|
|
|
|
|
|
zhezhao_click () {
|
|
|
|
|
|
if (this.input_sreach != '') {
|
|
|
|
|
|
if (!this.searchMsg.zheze_none) {
|
|
|
|
|
|
if (this.input_sreach != '') {
|
|
|
|
|
|
this.change_sreach_show = true
|
|
|
|
|
|
let IDsplit
|
|
|
|
|
|
const id = /^[0-9]*$/
|
|
|
|
|
|
const bool = true
|
|
|
|
|
|
if (this.select_list[this.sreach_num].id == 1) {
|
|
|
|
|
|
// id==1 判断是不是搜索ID 如果是ID 会出现搜索多个ID 分割ID
|
|
|
|
|
|
IDsplit = this.input_sreach.split(',')
|
|
|
|
|
|
// 循环分割出来的ID 判断输入的每个ID是否正确
|
|
|
|
|
|
for (let i = IDsplit.length - 1; i >= 0; i--) {
|
|
|
|
|
|
if (!id.test(IDsplit[i]) || IDsplit[i] > 2147483647) {
|
|
|
|
|
|
// 如果有不正确的值 进行删除
|
|
|
|
|
|
IDsplit.splice(i, 1)
|
|
|
|
|
|
this.$message.error(this.other.delErrorId)
|
2020-03-03 14:12:21 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
if (IDsplit[i] == '') {
|
|
|
|
|
|
IDsplit.splice(i, 1)
|
2019-12-16 17:14:58 +08:00
|
|
|
|
}
|
2019-12-17 17:17:30 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
this.input_sreach = ''
|
|
|
|
|
|
// 从新拼接ID内容
|
|
|
|
|
|
IDsplit.forEach(val => {
|
|
|
|
|
|
this.input_sreach += val + ','
|
|
|
|
|
|
})
|
|
|
|
|
|
this.input_sreach = this.input_sreach.substr(0, this.input_sreach.length - 1)
|
|
|
|
|
|
if (this.input_sreach != '') {
|
|
|
|
|
|
this.select_list[this.sreach_num].val = this.input_sreach
|
|
|
|
|
|
this.input_sreach = ''
|
|
|
|
|
|
this.sreach_num++
|
|
|
|
|
|
this.sreach_num = this.select_list.length
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.sreach_num = 0
|
|
|
|
|
|
this.change_sreach_show = false
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.select_list[this.sreach_num].val = this.input_sreach
|
|
|
|
|
|
this.input_sreach = ''
|
|
|
|
|
|
this.sreach_num = this.select_list.length
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
let Bool = false
|
|
|
|
|
|
this.select_list.forEach(val => {
|
|
|
|
|
|
if (val.val == '' || val.val == undefined) {
|
|
|
|
|
|
Bool = true
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
if (Bool) {
|
|
|
|
|
|
this.sreach_num = this.select_list.length - 1
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.sreach_num = this.select_list.length
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.no_condition != '') {
|
|
|
|
|
|
this.change_sreach_show = true
|
|
|
|
|
|
if (this.select_list.length == 0) {
|
|
|
|
|
|
this.select_list.push({ name: 'Name', id: 2, type: 'input', val: this.no_condition, label: 'name' })
|
|
|
|
|
|
this.searchLabelList.forEach((val, ind) => {
|
|
|
|
|
|
if (val.id == 2) {
|
2019-12-17 17:17:30 +08:00
|
|
|
|
this.searchLabelList.splice(ind, 1)
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
this.sreach_num++
|
|
|
|
|
|
} else {
|
|
|
|
|
|
let bool = true
|
|
|
|
|
|
this.select_list.forEach(val => {
|
|
|
|
|
|
if (val.id == 2) {
|
|
|
|
|
|
bool = false
|
|
|
|
|
|
val.val += ',' + this.no_condition
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
if (bool) {
|
|
|
|
|
|
this.select_list.push({ name: 'Name', id: 2, type: 'input', val: this.no_condition, label: 'name' })
|
|
|
|
|
|
this.searchLabelList.forEach((val, ind) => {
|
|
|
|
|
|
if (val.id == 2) {
|
|
|
|
|
|
this.searchLabelList.splice(ind, 1)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
this.sreach_num++
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
this.no_condition = ''
|
|
|
|
|
|
this.sreach_num = this.select_list.length
|
|
|
|
|
|
}
|
|
|
|
|
|
setTimeout('document.getElementById("one-input").focus()', 500)
|
|
|
|
|
|
this.input_list = !this.input_list
|
|
|
|
|
|
const _this = this
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
_this.getHeight()
|
|
|
|
|
|
})
|
|
|
|
|
|
this.searchMsg.zheze_none = true
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// 点击搜索框 显示搜索类型
|
|
|
|
|
|
read_input (e) {
|
|
|
|
|
|
e.cancelBubble = true
|
|
|
|
|
|
e.stopPropagation()
|
|
|
|
|
|
this.getHeight()
|
|
|
|
|
|
this.input_list = !this.input_list
|
|
|
|
|
|
this.getSelectPosition(e)
|
|
|
|
|
|
},
|
|
|
|
|
|
// 点击选择 搜索类型
|
|
|
|
|
|
select_name (val, ind, id, type, label, disabled, readonly, e) {
|
|
|
|
|
|
if (type == 'input') {
|
|
|
|
|
|
this.downBool = true
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.downBool = false
|
|
|
|
|
|
}
|
|
|
|
|
|
this.no_condition = ''
|
|
|
|
|
|
this.searchMsg.zheze_none = false
|
|
|
|
|
|
if (!disabled) {
|
|
|
|
|
|
if (id == 7) {
|
|
|
|
|
|
this.searchLabelList.splice(ind, 1)
|
|
|
|
|
|
this.select_list.push({
|
|
|
|
|
|
name: val,
|
|
|
|
|
|
id: id,
|
|
|
|
|
|
type: type,
|
|
|
|
|
|
label: label,
|
|
|
|
|
|
disabled: disabled,
|
|
|
|
|
|
readonly
|
|
|
|
|
|
})
|
|
|
|
|
|
this.change_sreach_show = false
|
|
|
|
|
|
this.input_list = !this.input_list
|
|
|
|
|
|
} else if (id == 29) {
|
|
|
|
|
|
this.searchLabelList.splice(ind, 1)
|
|
|
|
|
|
this.select_list.push({
|
|
|
|
|
|
name: val,
|
|
|
|
|
|
id: id,
|
|
|
|
|
|
type: type,
|
|
|
|
|
|
label: label,
|
|
|
|
|
|
disabled: disabled,
|
|
|
|
|
|
readonly
|
|
|
|
|
|
})
|
|
|
|
|
|
this.change_sreach_show = false
|
|
|
|
|
|
this.sreach_num = this.select_list.length - 1
|
|
|
|
|
|
this.input_list = !this.input_list
|
|
|
|
|
|
setTimeout(document.getElementById('sreach_input').focus(), 500)
|
|
|
|
|
|
this.change_sreach_show = false
|
|
|
|
|
|
this.sreach_num = this.select_list.length - 1
|
|
|
|
|
|
this.input_list = !this.input_list
|
2021-11-01 17:23:01 +08:00
|
|
|
|
setTimeout(document.getElementById('sreach_input').focus(), 500)
|
2021-03-19 18:52:19 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.searchLabelList.splice(ind, 1)
|
|
|
|
|
|
this.select_list.push({
|
|
|
|
|
|
name: val,
|
|
|
|
|
|
id: id,
|
|
|
|
|
|
type: type,
|
|
|
|
|
|
label: label,
|
|
|
|
|
|
disabled: disabled,
|
|
|
|
|
|
readonly
|
|
|
|
|
|
})
|
|
|
|
|
|
this.change_sreach_show = false
|
|
|
|
|
|
this.sreach_num = this.select_list.length - 1
|
|
|
|
|
|
this.input_list = !this.input_list
|
|
|
|
|
|
if (id !== 6 && id !== 28) {
|
|
|
|
|
|
setTimeout('document.getElementById("sreach_input").focus()', 500)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
const _this = this
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
_this.getHeight()
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
/* 计算select弹框的位置 */
|
|
|
|
|
|
getSelectPosition (e) {
|
|
|
|
|
|
const inputListDom = this.getDomFromParents(e.target, 'input-center-box', 0)
|
|
|
|
|
|
if (inputListDom) {
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
if (this.inTransform) {
|
|
|
|
|
|
// this.selectDom.top = "36px";
|
|
|
|
|
|
} else {
|
|
|
|
|
|
const position = inputListDom.getBoundingClientRect()
|
|
|
|
|
|
this.selectDom.top = position.top + 36 + 'px'
|
2021-03-23 15:47:18 +08:00
|
|
|
|
this.selectDom.left = position.left + 'px'
|
2020-09-08 19:02:59 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
/* 递归向上获取指定class的dom */
|
|
|
|
|
|
getDomFromParents (dom, className, level) {
|
|
|
|
|
|
const parentClassNames = dom.parentElement.className
|
|
|
|
|
|
if (parentClassNames.indexOf(className) == -1) {
|
|
|
|
|
|
if (level < 20 && dom.parentElement) { // 限制20层,避免溢出
|
|
|
|
|
|
return this.getDomFromParents(dom.parentElement, className, ++level)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return false
|
2019-12-16 17:14:58 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
return dom.parentElement
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// 判断输入框的高度
|
|
|
|
|
|
getHeight () {
|
|
|
|
|
|
if (document.getElementById('search-ul').clientHeight < 24 || document.getElementById('input-center-box').clientHeight < 24) {
|
|
|
|
|
|
document.getElementById('input-center-box').style.height = 27 + 'px'
|
|
|
|
|
|
document.getElementById('search-ul').style.height = 21 + 'px'
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
chlick_sreach (e) {
|
|
|
|
|
|
this.stop_click(e)
|
|
|
|
|
|
this.searchMsg.zheze_none = false
|
|
|
|
|
|
},
|
|
|
|
|
|
// 时间计划
|
|
|
|
|
|
schelistget () {
|
|
|
|
|
|
this.schlist = []
|
|
|
|
|
|
this.$get('/schedule', this.schedata).then(data => {
|
|
|
|
|
|
if (data.code == 200) {
|
|
|
|
|
|
this.schlist = data.data.list
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
close_search (e) {
|
|
|
|
|
|
this.selectDom.show = false
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
mounted () {
|
|
|
|
|
|
if (this.position) {
|
|
|
|
|
|
this.where = this.$route.path + this.position
|
|
|
|
|
|
}
|
|
|
|
|
|
this.restructure_historyDate()
|
|
|
|
|
|
setTimeout(() => {
|
2021-11-09 11:22:52 +08:00
|
|
|
|
if (this.$route.path === '/asset' || this.targetTab === 'asset') {
|
2021-05-10 15:59:39 +08:00
|
|
|
|
this.getAssetStateData()
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
2021-05-10 15:59:39 +08:00
|
|
|
|
if (this.$route.path === '/agent') {
|
2021-07-01 09:56:30 +08:00
|
|
|
|
this.getDcData()
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
2021-05-10 15:59:39 +08:00
|
|
|
|
if (this.$route.path === '/model') {
|
|
|
|
|
|
this.getBrandData()
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.$route.path === '/assetLabel') {
|
|
|
|
|
|
this.getGroupData()
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
2021-05-10 15:59:39 +08:00
|
|
|
|
if (this.$route.path === '/monitor/module') {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
this.getProjectData()
|
|
|
|
|
|
}
|
2021-05-10 15:59:39 +08:00
|
|
|
|
if (this.$route.path === '/alertRule') {
|
|
|
|
|
|
this.getSeverityData()
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
2021-05-10 15:59:39 +08:00
|
|
|
|
if (this.$route.path === '/exprTemp') {
|
2021-03-19 18:52:19 +08:00
|
|
|
|
this.getGnameList()
|
|
|
|
|
|
}
|
|
|
|
|
|
}, 1000)
|
|
|
|
|
|
JSON.parse(JSON.stringify(this.searchMsg.searchLabelList)).forEach(val => {
|
|
|
|
|
|
if (val.prop == 'common_action') {
|
|
|
|
|
|
this.actionSelect = val.doc.data
|
|
|
|
|
|
}
|
|
|
|
|
|
this.actionSelect.forEach((item) => {
|
|
|
|
|
|
item.id = item.code
|
|
|
|
|
|
item.label = val.label
|
|
|
|
|
|
item.name = val.label
|
|
|
|
|
|
})
|
|
|
|
|
|
this.searchLabelList.push(val)
|
|
|
|
|
|
})
|
|
|
|
|
|
const _this = this
|
|
|
|
|
|
document.onkeydown = function (event) {
|
|
|
|
|
|
const e = event || window.event || arguments.callee.caller.arguments[0]
|
|
|
|
|
|
if (e.keyCode == 27) {
|
|
|
|
|
|
_this.close_search(e)
|
|
|
|
|
|
}
|
2019-12-16 17:14:58 +08:00
|
|
|
|
}
|
2021-03-19 18:52:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2019-12-16 17:14:58 +08:00
|
|
|
|
</script>
|