| | |
| | | keyword: '', |
| | | eventStatus: '', |
| | | }) |
| | | let requestSeq = 0 // 请求序列号,用于丢弃快速切换tab时的过期响应 |
| | | const mockGeojson = |
| | | '[{"score":0.89990234375,"bbox":{"x_cen":195.5,"y_cen":326.5,"width":117.0,"height":265.0},"class_name":"car","algorithmId":"e71116098eeb1d60cfebd04d30653b151"},{"score":0.89306640625,"bbox":{"x_cen":1194.5,"y_cen":559.5,"width":115.0,"height":261.0},"class_name":"car","algorithmId":"e71116098eeb1d60cfebd04d30653b151"},{"score":0.88720703125,"bbox":{"x_cen":179.0,"y_cen":955.5,"width":124.0,"height":249.0},"class_name":"car","algorithmId":"e71116098eeb1d60cfebd04d30653b151"},{"score":0.88330078125,"bbox":{"x_cen":1198.5,"y_cen":260.5,"width":115.0,"height":285.0},"class_name":"car","algorithmId":"e71116098eeb1d60cfebd04d30653b151"},{"score":0.84716796875,"bbox":{"x_cen":204.5,"y_cen":71.5,"width":115.0,"height":143.0},"class_name":"car","algorithmId":"e71116098eeb1d60cfebd04d30653b151"},{"score":0.83203125,"bbox":{"x_cen":186.0,"y_cen":657.5,"width":114.0,"height":269.0},"class_name":"car","algorithmId":"e71116098eeb1d60cfebd04d30653b151"},{"score":0.78662109375,"bbox":{"x_cen":1205.5,"y_cen":49.5,"width":117.0,"height":99.0},"class_name":"car","algorithmId":"e71116098eeb1d60cfebd04d30653b151"}]' |
| | | const canvasSize = ref({ |
| | |
| | | } |
| | | |
| | | const getDataList = () => { |
| | | if (loading.value || !hasMore.value) return |
| | | if (!hasMore.value) return |
| | | |
| | | // 每次请求自增序列号,响应回来时校验是否过期 |
| | | const seq = ++requestSeq |
| | | loading.value = true |
| | | const params = { |
| | | current: listParams.value.current, |
| | |
| | | } |
| | | getGdList(params) |
| | | .then(async res => { |
| | | // 已有新请求发出,丢弃过期响应 |
| | | if (seq !== requestSeq) return |
| | | const resData = res.data.data |
| | | const response = resData.records |
| | | const list = [] |
| | |
| | | list.push({ ...item, aiImg }) |
| | | } |
| | | } |
| | | // 画图为异步耗时操作,完成后再次校验是否过期 |
| | | if (seq !== requestSeq) return |
| | | // 根据当前页码决定是替换还是追加数据 |
| | | if (listParams.value.current === 1) { |
| | | dataList.value = list |
| | |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | loading.value = false |
| | | // 仅在最新一次请求结束时关闭loading,避免过早关闭 |
| | | if (seq === requestSeq) loading.value = false |
| | | }) |
| | | } |
| | | const getstatusCountData = () => { |