fix: 编译类型缺失
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { PropType } from 'vue';
|
||||||
import DissectionTreeSub from './DissectionTreeSub.vue';
|
import DissectionTreeSub from './DissectionTreeSub.vue';
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
@@ -7,7 +8,7 @@ defineProps({
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
tree: {
|
tree: {
|
||||||
type: Array,
|
type: Array as PropType<Record<string, any>[]>,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
sub: {
|
sub: {
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, onMounted, toRaw, ref } from 'vue';
|
import { reactive, onMounted } from 'vue';
|
||||||
|
import { message, Upload } from 'ant-design-vue/lib';
|
||||||
|
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
|
||||||
|
import { FileType } from 'ant-design-vue/lib/upload/interface';
|
||||||
import { PageContainer } from 'antdv-pro-layout';
|
import { PageContainer } from 'antdv-pro-layout';
|
||||||
import DissectionTree from './components/DissectionTree.vue';
|
import DissectionTree from './components/DissectionTree.vue';
|
||||||
import DissectionDump from './components/DissectionDump.vue';
|
import DissectionDump from './components/DissectionDump.vue';
|
||||||
import PacketTable from './components/PacketTable.vue';
|
import PacketTable from './components/PacketTable.vue';
|
||||||
|
|
||||||
import { scriptUrl } from '@/assets/js/wiregasm_worker';
|
import { scriptUrl } from '@/assets/js/wiregasm_worker';
|
||||||
import { WK, OptionsType } from '@/plugins/wk-worker';
|
|
||||||
import { parseSizeFromFile } from '@/utils/parse-utils';
|
import { parseSizeFromFile } from '@/utils/parse-utils';
|
||||||
|
import { WK, OptionsType } from '@/plugins/wk-worker';
|
||||||
|
import useI18n from '@/hooks/useI18n';
|
||||||
|
const { t } = useI18n();
|
||||||
const wk = new WK();
|
const wk = new WK();
|
||||||
|
|
||||||
const NO_SELECTION = { id: '', idx: 0, start: 0, length: 0 };
|
const NO_SELECTION = { id: '', idx: 0, start: 0, length: 0 };
|
||||||
@@ -28,16 +32,34 @@ type StateType = {
|
|||||||
};
|
};
|
||||||
/**字段 */
|
/**字段 */
|
||||||
columns: string[];
|
columns: string[];
|
||||||
|
/**过滤条件 */
|
||||||
|
filter: string;
|
||||||
|
/**过滤条件错误信息 */
|
||||||
|
filterError: string | null;
|
||||||
|
/**当前过滤条件 */
|
||||||
|
currentFilter: string;
|
||||||
|
/**当前选中的帧编号 */
|
||||||
|
selectedFrame: number;
|
||||||
|
/**当前选中的帧数据 */
|
||||||
|
selectedPacket: { tree: any[]; data_sources: any[] };
|
||||||
|
/**pcap包帧数据 */
|
||||||
|
packetFrameData: Map<string, any> | null;
|
||||||
|
/**当前选中的帧数据-空占位 */
|
||||||
|
selectedTreeEntry: typeof NO_SELECTION;
|
||||||
|
/**选择帧的Dump数据标签 */
|
||||||
|
selectedDataSourceIndex: number;
|
||||||
|
/**处理完成状态 */
|
||||||
|
finishedProcessing: boolean;
|
||||||
/**pcap包帧数,匹配帧数 */
|
/**pcap包帧数,匹配帧数 */
|
||||||
totalFrames: number;
|
totalFrames: number;
|
||||||
/**pcap包帧数据 */
|
/**pcap包帧数据 */
|
||||||
packetFrames: any[];
|
packetFrames: any[];
|
||||||
/**加载帧数 */
|
/**加载帧数 */
|
||||||
nextPageSize: number;
|
nextPageSize: number;
|
||||||
|
/**加载页数 */
|
||||||
|
nextPageNum: number;
|
||||||
/**加载下一页 */
|
/**加载下一页 */
|
||||||
nextPageLoad: boolean;
|
nextPageLoad: boolean;
|
||||||
/**未知属性 */
|
|
||||||
// [key: string]: any;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const state = reactive<StateType>({
|
const state = reactive<StateType>({
|
||||||
@@ -53,22 +75,18 @@ const state = reactive<StateType>({
|
|||||||
elapsed_time: 0,
|
elapsed_time: 0,
|
||||||
},
|
},
|
||||||
columns: [],
|
columns: [],
|
||||||
|
|
||||||
/**过滤条件 */
|
|
||||||
filter: '',
|
filter: '',
|
||||||
filterError: null,
|
filterError: null,
|
||||||
currentFilter: '',
|
currentFilter: '',
|
||||||
/**当前选中的帧编号 */
|
|
||||||
selectedFrame: 1,
|
selectedFrame: 1,
|
||||||
/**当前选中的帧数据 */
|
/**当前选中的帧数据 */
|
||||||
selectedPacket: { tree: [], data_sources: [] },
|
selectedPacket: { tree: [], data_sources: [] },
|
||||||
packetFrameData: new Map(), // 注意:Map 需要额外处理
|
packetFrameData: null, // 注意:Map 需要额外处理
|
||||||
selectedTreeEntry: NO_SELECTION, // NO_SELECTION 需要定义
|
selectedTreeEntry: NO_SELECTION, // NO_SELECTION 需要定义
|
||||||
/**选择帧的Dump数据标签 */
|
/**选择帧的Dump数据标签 */
|
||||||
selectedDataSourceIndex: 0,
|
selectedDataSourceIndex: 0,
|
||||||
/**处理完成状态 */
|
/**处理完成状态 */
|
||||||
finishedProcessing: false,
|
finishedProcessing: false,
|
||||||
|
|
||||||
totalFrames: 0,
|
totalFrames: 0,
|
||||||
packetFrames: [],
|
packetFrames: [],
|
||||||
nextPageNum: 1,
|
nextPageNum: 1,
|
||||||
@@ -83,7 +101,7 @@ function fnStateReset() {
|
|||||||
// 选择帧的数据
|
// 选择帧的数据
|
||||||
state.selectedFrame = 0;
|
state.selectedFrame = 0;
|
||||||
state.selectedPacket = { tree: [], data_sources: [] };
|
state.selectedPacket = { tree: [], data_sources: [] };
|
||||||
state.packetFrameData = new Map();
|
state.packetFrameData = null;
|
||||||
state.selectedTreeEntry = NO_SELECTION;
|
state.selectedTreeEntry = NO_SELECTION;
|
||||||
state.selectedDataSourceIndex = 0;
|
state.selectedDataSourceIndex = 0;
|
||||||
}
|
}
|
||||||
@@ -119,9 +137,9 @@ function fnSelectedTreeEntry(e: any) {
|
|||||||
/**报文数据点击选中 */
|
/**报文数据点击选中 */
|
||||||
function fnSelectedFindSelection(src_idx: number, pos: number) {
|
function fnSelectedFindSelection(src_idx: number, pos: number) {
|
||||||
console.log('fnSelectedFindSelection', pos);
|
console.log('fnSelectedFindSelection', pos);
|
||||||
|
if (state.packetFrameData == null) return;
|
||||||
// find the smallest one
|
// find the smallest one
|
||||||
let current = null;
|
let current = null;
|
||||||
|
|
||||||
for (let [k, pp] of state.packetFrameData) {
|
for (let [k, pp] of state.packetFrameData) {
|
||||||
if (pp.idx !== src_idx) continue;
|
if (pp.idx !== src_idx) continue;
|
||||||
|
|
||||||
@@ -136,7 +154,6 @@ function fnSelectedFindSelection(src_idx: number, pos: number) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current != null) {
|
if (current != null) {
|
||||||
state.selectedTreeEntry = state.packetFrameData.get(current);
|
state.selectedTreeEntry = state.packetFrameData.get(current);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user