feat(断路器): 修复日志缺少类型,添加日志类型过滤
This commit is contained in:
parent
69756af817
commit
6257501187
Binary file not shown.
|
@ -210,7 +210,10 @@
|
||||||
<div class="log-box-title">
|
<div class="log-box-title">
|
||||||
<div>日志</div>
|
<div>日志</div>
|
||||||
<div class="log-box-search">
|
<div class="log-box-search">
|
||||||
<el-input v-model="logSearch" placeholder="请输入搜索日志" clearable />
|
<el-input v-model="logSearch" placeholder="请输入搜索日志" clearable style="max-width: 200px" />
|
||||||
|
<el-select v-model="logType" multiple collapse-tags placeholder="Select" style="margin-left: 10px; width: 150px">
|
||||||
|
<el-option v-for="item in logTypeList" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="log-box-operate">
|
<div class="log-box-operate">
|
||||||
|
@ -299,6 +302,27 @@ const activeFold = ref(['1', '3', '4', '5']);
|
||||||
const logList = ref([]);
|
const logList = ref([]);
|
||||||
const logSearch = ref('');
|
const logSearch = ref('');
|
||||||
const logItemWidth = ref('auto');
|
const logItemWidth = ref('auto');
|
||||||
|
const logType = ref(['subscribe', 'publish', 'system', '']);
|
||||||
|
// 设备属性
|
||||||
|
const logTypeList = [
|
||||||
|
{
|
||||||
|
label: '订阅',
|
||||||
|
value: 'subscribe'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '发布',
|
||||||
|
value: 'publish'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '系统',
|
||||||
|
value: 'system'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '其他',
|
||||||
|
value: ''
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
//连接状态
|
//连接状态
|
||||||
const connectionState = ref(false);
|
const connectionState = ref(false);
|
||||||
|
|
||||||
|
@ -1039,15 +1063,16 @@ const switchSocketStatus = computed(() => {
|
||||||
|
|
||||||
const searchLogList = computed(() => {
|
const searchLogList = computed(() => {
|
||||||
if (!logSearch.value) {
|
if (!logSearch.value) {
|
||||||
return logList.value
|
return logList.value.filter(item => {
|
||||||
|
console.log(item, logType.value.indexOf(item.type));
|
||||||
|
return logType.value.indexOf(item.type) !== -1;
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
return logList.value.filter(item => {
|
return logList.value.filter(item => {
|
||||||
return JSON.stringify(item.msg).includes(logSearch.value)
|
return JSON.stringify(item.msg).includes(logSearch.value) && logType.value.indexOf(item.type) !== -1;
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 生命周期钩子
|
// 生命周期钩子
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -1118,7 +1143,6 @@ onUnmounted(() => {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.log-box-operate {
|
.log-box-operate {
|
||||||
|
@ -1208,6 +1232,10 @@ onUnmounted(() => {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep(.log-box-search .el-select__wrapper) {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
.btn-box {
|
.btn-box {
|
||||||
:deep(.el-form-item__content) {
|
:deep(.el-form-item__content) {
|
||||||
justify-content: end;
|
justify-content: end;
|
||||||
|
|
Loading…
Reference in New Issue