Commit fbf79020 by 李君

优化

1 parent e429fe75
......@@ -2,25 +2,18 @@ import axios from 'axios'
import router from '@/router/index'
import Cookies from "js-cookie"
import {getTimestampString} from "@/PublicUtil/PublicUtil"
import {ElMessage} from 'element-plus'
// 创建 axios 的一个实例
const axiosInstance = axios.create(
{
baseURL: window._baseUrl
baseURL: ''
}
)
// 请求拦截器
axiosInstance.interceptors.request.use(
config => {
if (['localhost', '192.168.1.168'].includes(window.location.hostname))
{
config.headers.Authorization = '015269a1-3214-4271-b202-1922138d021c'
}
else
{
config.headers.Authorization = Cookies.get('atoken')
}
config.headers.Authorization = Cookies.get('atoken')
return config
}
......@@ -30,7 +23,14 @@ axiosInstance.interceptors.request.use(
axiosInstance.interceptors.response.use(
(r) => {
const responseData = r.data
if(responseData.ecode && responseData.ecode == '401'){
ElMessage({
message: `登录过期,请重新登录`,
type: 'warning'
})
// location.href=window.location.origin
return
}
return responseData
},
(e) => {
......
......@@ -211,8 +211,8 @@
const onAccountChange = function() {
getPlazaList()
getZoneList()
getGateList()
// getZoneList()
// getGateList()
}
const onPlazaChange = function() {
......@@ -238,6 +238,12 @@
label: item.name,
})
}
if(plazaList.value.length>0){
queryForm.plaza_id.push(plazaList.value[0].value)
getZoneList()
getGateList()
confirmSearch()
}
}
}
)
......@@ -297,6 +303,10 @@
label: item.name,
})
}
if(accountList.value.length){
queryForm.account_id.push(accountList.value[0].value)
getPlazaList(1)
}
}
}
)
......
......@@ -10,7 +10,7 @@
<a-row :gutter="[16,16]">
<a-col :span='4'>
<div style="margin: 0 5px" class="itemBox">
<el-image :src="detailData.picture_url" :fit="'fill'" class="single-image">
<el-image :src="detailData.picture_url" :fit="'fill'" class="single-image" @click='clickItem(detailData)'>
</el-image>
<span class="el-icon-document downloadFile" @click="downloadFile(detailData,$event)"></span>
<div>时间:{{ detailData.counttime }}</div>
......@@ -24,10 +24,10 @@
<a-row>
<a-col :span="4" v-for="item in row.personList" :key='item.id' class='colItem'>
<div style="margin: 0 5px" class="itemBox">
<el-image :src="item.picture_url" :fit="'fill'" class="single-image">
<el-image :src="item.picture_url" :fit="'fill'" class="single-image" @click='clickItem(item)'>
</el-image>
<span class="el-icon-document downloadFile" @click="downloadFile(item,$event)"></span>
<p class="featureNum">{{(item.featureNum).toFixed(2)}}</p>
<p class="featureNum">{{item.featureNum?(item.featureNum).toFixed(2):0}}</p>
<div>时间:{{ item.counttime }}</div>
</div>
</a-col>
......@@ -40,17 +40,24 @@
<a-button @click="onCancel">返回</a-button>
</template>
</a-modal>
<imgDialog ref='imgModelRef'></imgDialog>
</template>
<script>
import { reactive, ref } from "vue";
import {isArray } from '@/PublicUtil/Judgment'
import comparsionResultApi from '@/views/ComparisonCapturedPictures/api'
import clusterResultApi from '@/views/SnapshotCluster/ClusterResult/ClusterResultApi'
import imgDialog from '../SnapshotCluster/imgDialog.vue'
export default {
components:{
imgDialog
},
setup() {
const isVisible = ref(false);
const isLoading = ref(false);
const detailData = ref({});
const imgModelRef = ref();
const dataList = ref([])
const initDialog = (record,parmas) => {
detailData.value = record;
......@@ -62,7 +69,6 @@ export default {
if (isArray(r.data)) {
if(r.data.length>0){
r.data.forEach((item) => {
console.log(item)
item.personList.forEach((item1)=>{
if (item1.features_url) {
item1.features_url = window._baseImgUrl + item1.features_url
......@@ -95,6 +101,11 @@ export default {
}
}
}
const clickItem = function(data){
clusterResultApi.getBodyPoint({'feature_url':data.features_url}).then((r) => {
imgModelRef.value.initDialog(data.picture_url,r.data);
})
}
const onCancel = () => {
isVisible.value = false;
};
......@@ -122,7 +133,9 @@ export default {
initDialog,
isLoading,
formatDirection,
downloadFile
downloadFile,
clickItem,
imgModelRef
};
},
};
......@@ -131,6 +144,7 @@ export default {
.single-image {
height: 200px;
width: 150px;
cursor: pointer;
}
.rowBox{
border : 2px dashed #ccc;
......
......@@ -30,7 +30,7 @@
<el-image :src="item.picture_url" :fit="'fill'" class="single-image">
</el-image>
<span class="el-icon-document downloadFile" @click="downloadFile(item,$event)"></span>
<p class="featureNum">{{(item.featureNum).toFixed(2)}}</p>
<p class="featureNum">{{item.featureNum?(item.featureNum).toFixed(2):0}}</p>
<div>时间:{{ item.counttime }}</div>
<div>方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
......@@ -50,7 +50,7 @@
<el-image :src="item.picture_url" :fit="'fill'" class="single-image">
</el-image>
<span class="el-icon-document downloadFile" @click="downloadFile(item,$event)"></span>
<p class="featureNum">{{(item.featureNum).toFixed(2)}}</p>
<p class="featureNum">{{item.featureNum?(item.featureNum).toFixed(2):0}}</p>
<div>时间:{{ item.counttime }}</div>
<div>方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
......
......@@ -91,7 +91,7 @@
<el-image :src="item.picture_url" :fit="'fill'" class="single-image">
</el-image>
<span class="el-icon-document downloadFile" @click="downloadFile(item,$event)"></span>
<p class="featureNum">{{(item.featureNum).toFixed(2)}}</p>
<p class="featureNum">{{item.featureNum?(item.featureNum).toFixed(2):0}}</p>
<div>时间:{{ item.counttime }}</div>
<div>方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
......@@ -112,7 +112,7 @@
<el-image :src="item.picture_url" :fit="'fill'" class="single-image">
</el-image>
<span class="el-icon-document downloadFile" @click="downloadFile(item,$event)"></span>
<p class="featureNum">{{(item.featureNum).toFixed(2)}}</p>
<p class="featureNum">{{item.featureNum?(item.featureNum).toFixed(2):0}}</p>
<div>时间:{{ item.counttime }}</div>
<div>方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
......@@ -223,6 +223,12 @@
label: item.name,
})
}
if(plazaList.value.length>0){
queryForm.plaza_id.push(plazaList.value[0].value)
getZoneList()
getGateList()
confirmSearch()
}
}
}
)
......@@ -282,6 +288,10 @@
label: item.name,
})
}
if(accountList.value.length){
queryForm.account_id.push(accountList.value[0].value)
getPlazaList(1)
}
}
}
)
......
......@@ -97,15 +97,25 @@
<a-form-item style="padding: 5px 0">
<a-button type="primary" @click="confirmSearch" :loading="isLoading">查询</a-button>
</a-form-item>
<a-form-item style="padding: 5px 0">
<a-button type="primary" @click="comparativeFun">特征对比</a-button>
</a-form-item>
<a-form-item style="padding: 5px 0">
<a-button type="primary" @click="singleComparativeFun">单张特征对比</a-button>
</a-form-item>
<a-form-item style="padding: 5px 0">
<a-button type="primary" @click="clerkComparativeFun">店员特征对比</a-button>
</a-form-item>
</a-form>
<div v-loading="isLoading">
<div v-for="person in dataList" style="margin: 10px 0;border: solid 1px black">
<el-checkbox class="checkBox" v-model="person.checked" @change='checkChange(person)'></el-checkbox>
人id:{{ ' ' + person.person_unid }}
图片数量:{{ person.perrsonList.length }}
<el-row v-for="row in getPagedList(person.perrsonList, 8)">
<el-col :span="3" v-for="item in row">
<div style="margin: 0 5px">
<div style="margin: 0 5px" @click="handleClick(item)" :class="currentItemId==item.id?'actived':''">
<div style="display:flex; justify-content: flex-end ">
<span @click="downloadFile(item.features_url)"
style="color: #409EFF;font-size: 15px;cursor: pointer;">
......@@ -114,9 +124,10 @@
</div>
<el-image :src="item.picture_url"
:fit="'fill'"
class="single-image" @click="handleClick(item.picture_url,item.features_url)">
class="single-image" >
</el-image>
<div>时间:{{ item.counttime }}</div>
<div>人员类型:{{ item.person_type==1?'店员':'顾客' }}</div>
<div class="direction" :class="'direction'+item.direction">方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
</div>
......@@ -136,7 +147,10 @@
style="text-align:center"
/>
</div>
<imgDialog ref='imgModelRef'></imgDialog>
<!-- <imgDialog ref='imgModelRef'></imgDialog> -->
<DetailDialog ref="DetailDialogRef" />
<DetailDialogComparison ref="DetailDialogComparisonRef" />
<singleImgComparisonDialog ref="singleImgComparisonRef"></singleImgComparisonDialog>
</template>
<script>
......@@ -145,10 +159,17 @@ import clusterResultApi from '@/views/SnapshotCluster/ClusterResult/ClusterResul
import {isArray} from '@/PublicUtil/Judgment'
import moment from 'moment'
import {filterEmptyValueInObject, formatDate, formatTime, getPagedList} from '@/PublicUtil/PublicUtil'
import imgDialog from '../imgDialog.vue'
// import imgDialog from '../imgDialog.vue'
import {ElMessage} from 'element-plus'
import DetailDialog from "../../ComparisonCapturedPictures/DetailDialog.vue";
import DetailDialogComparison from "../../ComparisonCapturedPictures/DetailDialogComparisonNew.vue";
import singleImgComparisonDialog from "../singleImgComparisonDialog.vue";
export default {
components:{
imgDialog
// imgDialog
DetailDialog,
DetailDialogComparison,
singleImgComparisonDialog
},
setup() {
// scalar
......@@ -156,19 +177,23 @@ export default {
const pageSize = ref(10)
const total = ref()
const isLoading = ref(false)
const currobj = ref({})
const currentItemId = ref()
// sequence
const dataList = ref([])
const accountList = ref([])
const plazaList = ref([])
const zoneList = ref([])
const gateList = ref([])
const imgModelRef = ref();
// const imgModelRef = ref();
const pagedTableDataList = computed(
() => {
return getPagedList(dataList.value, 8)
}
)
const DetailDialogRef = ref();
const DetailDialogComparisonRef = ref();
const singleImgComparisonRef = ref()
const queryForm = reactive(
{
account_id: [],
......@@ -200,8 +225,8 @@ export default {
const onAccountChange = function() {
getPlazaList()
getZoneList()
getGateList()
// getZoneList()
// getGateList()
}
const onPlazaChange = function() {
......@@ -233,6 +258,12 @@ export default {
}
)
}
if(plazaList.value.length>0){
queryForm.plaza_id.push(plazaList.value[0].value)
getZoneList()
getGateList()
confirmSearch()
}
}
}
)
......@@ -308,6 +339,10 @@ export default {
}
)
}
if(accountList.value.length){
queryForm.account_id.push(accountList.value[0].value)
getPlazaList(1)
}
}
}
)
......@@ -389,14 +424,124 @@ export default {
window.open(url)
}
const handleClick = function(url,feature){
clusterResultApi.getBodyPoint({'feature_url':feature}).then(
(r) => {
imgModelRef.value.initDialog(url,r.data);
}
)
const handleClick = function(data){
currentItemId.value = data.id
currobj.value = data;
// clusterResultApi.getBodyPoint({'feature_url':feature}).then(
// (r) => {
// imgModelRef.value.initDialog(url,r.data);
// }
// )
}
const checkChange = function(data){
console.log(data)
}
// 特征对比
const comparativeFun = function(){
const rawData = toRaw(queryForm)
if(!currobj.value.id){
ElMessage(
{
message: `请选择图片`,
type: 'warning'
}
)
return
}
if(!currobj.value.picture_url){
ElMessage(
{
message: `该图片没有特征,请选择有效的图片`,
type: 'warning'
}
)
return
}
let parmas = {
mall_id:currobj.value.mall_id,
picType:rawData.picType,
pic_id:currobj.value.id,
countdate:formatDate(rawData.date),
dataList:[]
}
dataList.value.forEach(item=>{
if (item.checked && item.checked == true) {
parmas.dataList.push(item)
}
})
if(parmas.dataList && parmas.dataList.length > 0){
DetailDialogComparisonRef.value.initDialog(currobj.value,parmas);
}else{
ElMessage(
{
message: `请选择聚类图片`,
type: 'warning'
}
)
return
}
}
//单张特征对比
const singleComparativeFun = function(){
if(!currobj.value.id){
ElMessage(
{
message: `请选择图片`,
type: 'warning'
}
)
return
}
if(!currobj.value.picture_url){
ElMessage(
{
message: `该图片没有特征,请选择有效的图片`,
type: 'warning'
}
)
return
}
const rawData = toRaw(queryForm)
let parmas = {
person_unid:currobj.value.person_unid,
pic_type:rawData.picType,
countdate:formatDate(rawData.date),
pic_id:currobj.value.id,
ip:window._baseImgUrl,
plaza_id:currobj.value.mall_id
}
singleImgComparisonRef.value.initDialog(parmas);
}
// 店员特征对比
const clerkComparativeFun = function(){
const rawData = toRaw(queryForm)
if(!currobj.value.id){
ElMessage(
{
message: `请选择图片进行对比`,
type: 'warning'
}
)
return
}
if(!currobj.value.picture_url){
ElMessage(
{
message: `该图片没有特征,请选择有效的图片`,
type: 'warning'
}
)
return
}
let parmas = {
plaza_id:currobj.value.mall_id,
pic_type:rawData.picType,
pic_id:currobj.value.id,
ip:window._baseImgUrl,
countdate:formatDate(rawData.date)
}
DetailDialogRef.value.initDialog(currobj.value,parmas);
}
const __main = function() {
getAccountList()
}
......@@ -409,6 +554,8 @@ export default {
pageNum,
pageSize,
total,
currentItemId,
currobj,
// sequence
accountList,
plazaList,
......@@ -429,8 +576,15 @@ export default {
downloadFile,
getPagedList,
handleClick,
comparativeFun,
checkChange,
clerkComparativeFun,
singleComparativeFun,
// ref
imgModelRef
// imgModelRef,
DetailDialogRef,
DetailDialogComparisonRef,
singleImgComparisonRef
}
}
}
......@@ -438,5 +592,11 @@ export default {
<style lang="less" scoped>
@import "./ClusterResult";
.actived{
border: 1px solid #1890ff;
}
.checkBox{
margin-left: 10px;
}
</style>
......@@ -7,10 +7,10 @@
聚类结果
</a-menu-item>
</a-menu>
<div v-show="currentMenu[0] === '抓拍记录'">
<div v-if="currentMenu[0] === '抓拍记录'">
<SnapshotRecord></SnapshotRecord>
</div>
<div v-show="currentMenu[0] === '聚类结果'">
<div v-if="currentMenu[0] === '聚类结果'">
<ClusterResult></ClusterResult>
</div>
</template>
......
......@@ -91,12 +91,15 @@
<a-form-item style="padding: 5px 0">
<a-button type="primary" @click="confirmSearch" :loading="isLoading">查询</a-button>
</a-form-item>
<a-form-item style="padding: 5px 0">
<a-button type="primary" @click="comparativeFun">特征对比验证</a-button>
</a-form-item>
</a-form>
<div v-loading="isLoading">
<el-row v-for="row in pagedTableDataList">
<el-col :span="3" v-for="item in row">
<div style="margin: 0 5px">
<div style="margin: 0 5px;cursor: pointer;" @click="handleClick(item)" :class="currentItemId==item.id?'actived':''">
<div style="display:flex; justify-content: flex-end ">
<span @click="downloadFile(item.features_url)"
style="color: #409EFF;font-size: 15px;cursor: pointer;">
......@@ -105,9 +108,10 @@
</div>
<el-image :src="item.picture_url"
:fit="'fill'"
class="single-image" @click="handleClick(item.picture_url,item.features_url)">
class="single-image">
</el-image>
<div>时间:{{ item.counttime }}</div>
<div>人员类型:{{ item.person_type==1?'店员':'顾客' }}</div>
<div class="direction" :class="'direction'+item.direction">方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
</div>
......@@ -127,21 +131,23 @@
style="text-align:center"
/>
</div>
<imgDialog ref='imgModelRef'></imgDialog>
<!-- <imgDialog ref='imgModelRef'></imgDialog> -->
<DetailDialog ref="DetailDialogRef" />
</template>
<script>
import {computed, reactive, ref, toRaw} from 'vue'
import snapshotRecordApi from '@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi'
import clusterResultApi from '@/views/SnapshotCluster/ClusterResult/ClusterResultApi'
import {isArray} from '@/PublicUtil/Judgment'
import moment from 'moment'
import {filterEmptyValueInObject, formatDate, formatTime, getPagedList} from '@/PublicUtil/PublicUtil'
import imgDialog from '../imgDialog.vue'
// import imgDialog from '../imgDialog.vue'
import {ElMessage} from 'element-plus'
import DetailDialog from "../../ComparisonCapturedPictures/DetailDialog.vue";
export default {
components:{
imgDialog
// imgDialog ,
DetailDialog
},
setup() {
// scalar
......@@ -156,6 +162,10 @@ export default {
const zoneList = ref([])
const gateList = ref([])
const imgModelRef = ref();
const currentItemId = ref()
const currobj = ref({})
// ref
const DetailDialogRef = ref();
const pagedTableDataList = computed(
() => {
return getPagedList(dataList.value, 8)
......@@ -191,8 +201,8 @@ export default {
const onAccountChange = function() {
getPlazaList()
getZoneList()
getGateList()
// getZoneList()
// getGateList()
}
const onPlazaChange = function() {
......@@ -224,6 +234,12 @@ export default {
}
)
}
if(plazaList.value.length){
queryForm.plaza_id.push(plazaList.value[0].value)
getZoneList()
getGateList()
confirmSearch()
}
}
}
)
......@@ -299,6 +315,10 @@ export default {
}
)
}
if(accountList.value.length){
queryForm.account_id.push(accountList.value[0].value)
getPlazaList(1)
}
}
}
)
......@@ -367,13 +387,35 @@ export default {
const downloadFile = function(url) {
window.open(url)
}
const handleClick = function(url,feature){
clusterResultApi.getBodyPoint({'feature_url':feature}).then(
(r) => {
imgModelRef.value.initDialog(url,r.data);
}
)
const handleClick = function(data){
currentItemId.value = data.id
currobj.value = data;
}
const comparativeFun = function(){
if(currobj.value=={}) {
ElMessage({
message: `请选择图片进行对比验证`,
type: 'warning'
});
return false
}
if(!currobj.value.picture_url){
ElMessage({
message: `该图片没有特征,请选择有效的图片`,
type: 'warning'
})
return
}
const rawData = toRaw(queryForm)
let parmas = {
plaza_id:currobj.value.mall_id,
pic_type:rawData.picType,
pic_id:currobj.value.id,
ip:window._baseImgUrl,
countdate:formatDate(rawData.date)
}
DetailDialogRef.value.initDialog(currobj.value,parmas);
}
const __main = function() {
getAccountList()
}
......@@ -386,12 +428,14 @@ export default {
pageNum,
pageSize,
total,
currobj,
// sequence
accountList,
plazaList,
zoneList,
gateList,
pagedTableDataList,
currentItemId,
// mapping
queryForm,
// function
......@@ -404,7 +448,9 @@ export default {
formatDirection,
downloadFile,
handleClick,
//ref
comparativeFun,
// ref
DetailDialogRef,
imgModelRef
}
}
......@@ -413,5 +459,8 @@ export default {
<style lang="less" scoped>
@import "./SnapshotRecord";
.actived{
border: 1px solid #1890ff;
}
</style>
......@@ -29,7 +29,6 @@ export default {
imgUrl.value = url
isVisible.value = true;
setTimeout(()=>{
debugger
var imgscream=document.getElementById("img");
let height = imgscream.offsetHeight;
let width = imgscream.offsetWidth;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!