日志
-
+
+
+
+
+
+
+
+
@@ -303,6 +315,7 @@ const logList = ref([]);
const logSearch = ref('');
const logItemWidth = ref('auto');
const logType = ref(['subscribe', 'publish', 'system', '']);
+const searchLogReverseStatus = ref(false);
// 设备属性
const logTypeList = [
{
@@ -330,6 +343,10 @@ const updateLogItemWidth = () => {
logItemWidth.value = window.innerWidth - 180 - 80 + 'px';
};
+const toggleSearchLogReverseStatus = () => {
+ searchLogReverseStatus.value = !searchLogReverseStatus.value;
+}
+
const getGuid = () => {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = (Math.random() * 16) | 0,
@@ -559,16 +576,24 @@ const functionList = [
data: '00000001',
disabled: true
},
+ // {
+ // id: 3,
+ // name: '实时采集',
+ // addr: '62000',
+ // len: '2',
+ // data: '',
+ // disabled: true
+ // },
+ {
+ id: 4,
+ name: '实时采集(1次/分钟)',
+ addr: '62000',
+ len: '2',
+ data: '000927C00000EA60',
+ disabled: true
+ },
{
- id: 3,
- name: '实时采集',
- addr: '62000',
- len: '2',
- data: '',
- disabled: true
- },
- {
- id: 4,
+ id: 5,
name: '自定义',
addr: '',
len: '',
@@ -1074,7 +1099,13 @@ const searchLogList = computed(() => {
});
} else {
return logList.value.filter(item => {
- return JSON.stringify(item.msg).includes(logSearch.value) && logType.value.indexOf(item.type) !== -1;
+ if (searchLogReverseStatus.value) {
+ // 反向选择:筛选出不匹配的项
+ return !(JSON.stringify(item.msg).includes(logSearch.value) || logType.value.indexOf(item.type) === -1);
+ } else {
+ // 正常选择:筛选出匹配的项
+ return JSON.stringify(item.msg).includes(logSearch.value) && logType.value.indexOf(item.type) !== -1;
+ }
});
}
});