diff --git a/src/views/main/recognition/index.vue b/src/views/main/recognition/index.vue index f2b39bf..6b44bb1 100644 --- a/src/views/main/recognition/index.vue +++ b/src/views/main/recognition/index.vue @@ -19,7 +19,7 @@ // 查询条件 const listQuery = ref({ // recognitionCode: '', // 第三方code - // recognitionType: '', // 识别类型 + recognitionType: '', // 识别类型 // recognitionTime: '', // 识别时间 // position: '', // 地理位置 // recognitionPrecision: '', // 准确度 @@ -37,7 +37,7 @@ // 表头 const columns = ref([ { text: '智能识别编号', value: 'recognitionCode', align: 'center', width: '160' }, - // { text: '识别类型', value: 'recognitionType', align: 'center' }, + { text: '识别类型', value: 'recognitionType', align: 'center' }, { text: '识别时间', value: 'recognitionTime', align: 'center' }, { text: '识别经纬度', value: 'latlng', align: 'center' }, { text: '识别位置', value: 'position', align: 'center' }, @@ -64,6 +64,10 @@ listQuery.value.endTime = '' } }) +// 查询字典 +const identifyTypeList = ref<{ name: string;value: string;id: string }[]>([]) // 识别类型 +const riskGradeList = ref<{ name: string;value: string;id: string }[]>() // 风险等级 +const alarmStatusList = ref<{ name: string;value: string;id: string }[]>() // 报警状态 const recognitionLevelDict: { [key: string]: string } = { low: '低风险', middle: '一般风险', @@ -71,7 +75,7 @@ suphigh: '严重风险', } // 数据查询 -function fetchData(isNowPage = false) { +async function fetchData(isNowPage = false) { loadingTable.value = true if (!isNowPage) { // 是否显示当前页,否则跳转第一页 @@ -79,7 +83,12 @@ } getIdentifyListPage(listQuery.value).then((res) => { console.log(res.data, '第三方') - list.value = res.data.rows.map((item: any) => ({ ...item, latlng: `${item.longitude},${item.latitude}`, recognitionLevel: recognitionLevelDict[item.recognitionLevel] })) + list.value = res.data.rows.map((item: any) => ({ + ...item, + latlng: `${item.longitude},${item.latitude}`, + recognitionLevel: recognitionLevelDict[item.recognitionLevel], + // recognitionType: identifyTypeList.value.filter((ele: any) => ele.value === item.recognitionType)[0].name, + })) // list.value.forEach((item: any) => { // getLocation(`${item.longitude},${item.latitude}`).then((res) => { // if (res.data.info === 'OK') { @@ -115,6 +124,7 @@ riskLevel: '', begTime: '', endTime: '', + recognitionType: '', offset: 1, limit: 20, } @@ -208,10 +218,6 @@ alarmRef.value.initDialog(row) } -// 查询字典 -const identifyTypeList = ref<{ name: string;value: string;id: string }[]>() // 识别类型 -const riskGradeList = ref<{ name: string;value: string;id: string }[]>() // 风险等级 -const alarmStatusList = ref<{ name: string;value: string;id: string }[]>() // 报警状态 const getDict = async () => { // 识别类型 getDictByCode('identifyType').then((response) => { @@ -255,11 +261,11 @@ clearable /> --> - +