Commit a498f4cd by 李君

抓拍聚类增加特征划线

1 parent edf49477
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
</div> </div>
<el-image :src="item.picture_url" <el-image :src="item.picture_url"
:fit="'fill'" :fit="'fill'"
class="single-image"> class="single-image" @click="handleClick(item.picture_url,item.features_url)">
</el-image> </el-image>
<div>时间:{{ item.counttime }}</div> <div>时间:{{ item.counttime }}</div>
<div>方向:{{ formatDirection(item.direction) }}</div> <div>方向:{{ formatDirection(item.direction) }}</div>
...@@ -136,6 +136,7 @@ ...@@ -136,6 +136,7 @@
style="text-align:center" style="text-align:center"
/> />
</div> </div>
<imgDialog ref='imgModelRef'></imgDialog>
</template> </template>
<script> <script>
...@@ -144,8 +145,11 @@ import clusterResultApi from '@/views/SnapshotCluster/ClusterResult/ClusterResul ...@@ -144,8 +145,11 @@ import clusterResultApi from '@/views/SnapshotCluster/ClusterResult/ClusterResul
import {isArray} from '@/PublicUtil/Judgment' import {isArray} from '@/PublicUtil/Judgment'
import moment from 'moment' import moment from 'moment'
import {filterEmptyValueInObject, formatDate, formatTime, getPagedList} from '@/PublicUtil/PublicUtil' import {filterEmptyValueInObject, formatDate, formatTime, getPagedList} from '@/PublicUtil/PublicUtil'
import imgDialog from '../imgDialog.vue'
export default { export default {
components:{
imgDialog
},
setup() { setup() {
// scalar // scalar
const pageNum = ref(1) const pageNum = ref(1)
...@@ -158,7 +162,7 @@ export default { ...@@ -158,7 +162,7 @@ export default {
const plazaList = ref([]) const plazaList = ref([])
const zoneList = ref([]) const zoneList = ref([])
const gateList = ref([]) const gateList = ref([])
const imgModelRef = ref();
const pagedTableDataList = computed( const pagedTableDataList = computed(
() => { () => {
return getPagedList(dataList.value, 8) return getPagedList(dataList.value, 8)
...@@ -384,7 +388,15 @@ export default { ...@@ -384,7 +388,15 @@ export default {
const downloadFile = function(url) { const downloadFile = function(url) {
window.open(url) window.open(url)
} }
const handleClick = function(url,feature){
clusterResultApi.getBodyPoint({'feature_url':feature}).then(
(r) => {
imgModelRef.value.initDialog(url,r.data);
}
)
}
const __main = function() { const __main = function() {
getAccountList() getAccountList()
} }
...@@ -416,6 +428,9 @@ export default { ...@@ -416,6 +428,9 @@ export default {
formatDirection, formatDirection,
downloadFile, downloadFile,
getPagedList, getPagedList,
handleClick,
// ref
imgModelRef
} }
} }
} }
......
...@@ -68,7 +68,18 @@ class ClusterResultApi { ...@@ -68,7 +68,18 @@ class ClusterResultApi {
} }
) )
} }
getBodyPoint(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/feature/bodyPoint`,
params: filterEmptyValueInObject(
data
)
}
)
}
} }
const clusterResultApi = new ClusterResultApi() const clusterResultApi = new ClusterResultApi()
......
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
</div> </div>
<el-image :src="item.picture_url" <el-image :src="item.picture_url"
:fit="'fill'" :fit="'fill'"
class="single-image"> class="single-image" @click="handleClick(item.picture_url,item.features_url)">
</el-image> </el-image>
<div>时间:{{ item.counttime }}</div> <div>时间:{{ item.counttime }}</div>
<div>方向:{{ formatDirection(item.direction) }}</div> <div>方向:{{ formatDirection(item.direction) }}</div>
...@@ -127,16 +127,22 @@ ...@@ -127,16 +127,22 @@
style="text-align:center" style="text-align:center"
/> />
</div> </div>
<imgDialog ref='imgModelRef'></imgDialog>
</template> </template>
<script> <script>
import {computed, reactive, ref, toRaw} from 'vue' import {computed, reactive, ref, toRaw} from 'vue'
import snapshotRecordApi from '@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi' import snapshotRecordApi from '@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi'
import clusterResultApi from '@/views/SnapshotCluster/ClusterResult/ClusterResultApi'
import {isArray} from '@/PublicUtil/Judgment' import {isArray} from '@/PublicUtil/Judgment'
import moment from 'moment' import moment from 'moment'
import {filterEmptyValueInObject, formatDate, formatTime, getPagedList} from '@/PublicUtil/PublicUtil' import {filterEmptyValueInObject, formatDate, formatTime, getPagedList} from '@/PublicUtil/PublicUtil'
import imgDialog from '../imgDialog.vue'
export default { export default {
components:{
imgDialog
},
setup() { setup() {
// scalar // scalar
const pageNum = ref(1) const pageNum = ref(1)
...@@ -149,7 +155,7 @@ export default { ...@@ -149,7 +155,7 @@ export default {
const plazaList = ref([]) const plazaList = ref([])
const zoneList = ref([]) const zoneList = ref([])
const gateList = ref([]) const gateList = ref([])
const imgModelRef = ref();
const pagedTableDataList = computed( const pagedTableDataList = computed(
() => { () => {
return getPagedList(dataList.value, 8) return getPagedList(dataList.value, 8)
...@@ -361,7 +367,13 @@ export default { ...@@ -361,7 +367,13 @@ export default {
const downloadFile = function(url) { const downloadFile = function(url) {
window.open(url) window.open(url)
} }
const handleClick = function(url,feature){
clusterResultApi.getBodyPoint({'feature_url':feature}).then(
(r) => {
imgModelRef.value.initDialog(url,r.data);
}
)
}
const __main = function() { const __main = function() {
getAccountList() getAccountList()
} }
...@@ -391,6 +403,9 @@ export default { ...@@ -391,6 +403,9 @@ export default {
confirmSearch, confirmSearch,
formatDirection, formatDirection,
downloadFile, downloadFile,
handleClick,
//ref
imgModelRef
} }
} }
} }
......
<template>
<a-modal
title="图片"
v-if='isVisible'
v-model:visible="isVisible"
width="1200px"
height='90%'
class="detail-modal"
>
<canvas id="myCanvas"></canvas>
<img :src="imgUrl" alt="" id="img">
<template #footer>
<a-button @click="onCancel">返回</a-button>
</template>
</a-modal>
</template>
<script>
import { reactive, ref } from "vue";
export default {
setup() {
const isVisible = ref(false);
const isLoading = ref(false);
const detailData = ref({});
const imgUrl = ref()
const canvas = ref()
const ctx = ref()
const initDialog = (url,data) => {
imgUrl.value = url
isVisible.value = true;
setTimeout(()=>{
debugger
var imgscream=document.getElementById("img");
let height = imgscream.offsetHeight;
let width = imgscream.offsetWidth;
canvas.value = document.getElementById("myCanvas");//初始化
canvas.value.height = height;
canvas.value.width = width;
ctx.value = canvas.value.getContext("2d")
ctx.value.drawImage(imgscream,0,0,width,height);
ctx.value.beginPath();
ctx.value.lineWidth = 3
ctx.value.strokeStyle = "red";
ctx.value.moveTo(data.head_x_inSmall, data.head_y_inSmall);//起始位置
ctx.value.lineTo(data.foot_x_inSmall, data.foot_y_inSmall);//停止位置
ctx.value.stroke();
},0)
};
const onCancel = () => {
canvas.value = ''
isVisible.value = false;
};
return {
isVisible,
onCancel,
initDialog,
isLoading,
imgUrl,
detailData
};
},
};
</script>
<style lang="less" scoped>
#myCanvas{
display: block;
margin: 0 auto;
}
#img{
position: relative;
top: -5000px;
float: left;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!