Commit 7c2fef15 by 李乾广

toolbug修复;新页面开发

1 parent a6c479ee
window._serverHost = ['localhost', '192.168.1.120'].includes(window.location.hostname) ? 'http://39.155.171.242:33333/' : window.location.host window._serverHost = ['localhost', '192.168.1.120'].includes(window.location.hostname) ? 'http://192.168.1.64/' : window.location.host
window._baseUrl = ['localhost', '192.168.1.120'].includes(window.location.hostname) ? 'http://39.155.171.242:33333//tool/' : `${window.location.origin}/btool/` window._baseUrl = ['localhost', '192.168.1.120'].includes(window.location.hostname) ? 'http://192.168.1.64/tool/' : `${window.location.origin}/btool/`
window._reportUrl = ['localhost', '192.168.1.120'].includes(window.location.hostname) ? 'http://39.155.171.242:33333/report/' : `${window.location.origin}/report/` window._reportUrl = ['localhost', '192.168.1.120'].includes(window.location.hostname) ? 'http://192.168.1.64/report/' : `${window.location.origin}/report/`
window._baseImgUrl = ['localhost', '192.168.1.120'].includes(window.location.hostname) ? 'http://39.155.171.242:33333/images/' : `${window.location.origin}/images/` window._baseImgUrl = ['localhost', '192.168.1.120'].includes(window.location.hostname) ? 'http://192.168.1.64/images/' : `${window.location.origin}/images/`
window._matchHost = ['localhost', '192.168.1.120'].includes(window.location.hostname) ? 'http://192.168.1.64:6689/' : window.location.host
window._socketUrl = ['localhost', '192.168.1.120'].includes(window.location.hostname) ? `wss://${window._serverHost}/btool/` : `wss://${window._serverHost}/btool/` window._socketUrl = ['localhost', '192.168.1.120'].includes(window.location.hostname) ? `wss://${window._serverHost}/btool/` : `wss://${window._serverHost}/btool/`
const log = console.log.bind(console) const log = console.log.bind(console)
\ No newline at end of file \ No newline at end of file
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 的一个实例
let baseURL = ['localhost', '192.168.1.134'].includes(window.location.hostname) ? '/match' : window._matchHost
const axiosReport = axios.create(
{
baseURL: baseURL,
// timeout:10000
}
)
// 请求拦截器
axiosReport.interceptors.request.use(
config => {
// Cookies.set('atoken','3cb99bee-4f38-43be-9aa2-3c4a9236af77')
if(!Cookies.get('atoken')){
ElMessage({
message: `登录过期,请重新登录`,
type: 'warning'
})
setTimeout(()=>{
let url = ['localhost', '192.168.1.134'].includes(window.location.hostname) ? 'https://store.keliuyun.com/' : window.location.origin
// if(url.includes('36.112.68.214')){
// url = 'http://36.112.68.214:33333/'
// }
window.open(url,'_blank')
},300)
return
}
config.headers.Authorization = Cookies.get('atoken')
return config
}
)
// 响应拦截器
axiosReport.interceptors.response.use(
(r) => {
const responseData = r.data
if(responseData.ecode && responseData.ecode == '401'){
ElMessage({
message: `登录过期,请重新登录`,
type: 'warning'
})
setTimeout(()=>{
let url = ['localhost', '192.168.1.134'].includes(window.location.hostname) ? 'https://store.keliuyun.com/' : window.location.origin
// if(url.includes('36.112.68.214')){
// url = 'http://36.112.68.214:33333/'
// }
window.open(url,'_blank')
},300)
return
}
return responseData
},
(e) => {
const responseData = e.response
return responseData
}
)
export default axiosReport
...@@ -14,7 +14,7 @@ const axiosInstance = axios.create( ...@@ -14,7 +14,7 @@ const axiosInstance = axios.create(
// 请求拦截器 // 请求拦截器
axiosInstance.interceptors.request.use( axiosInstance.interceptors.request.use(
config => { config => {
// Cookies.set('atoken','327f3575-fb75-4553-8430-c86750a436e1') // Cookies.set('atoken','3cb99bee-4f38-43be-9aa2-3c4a9236af77')
if(!Cookies.get('atoken')){ if(!Cookies.get('atoken')){
ElMessage({ ElMessage({
message: `登录过期,请重新登录`, message: `登录过期,请重新登录`,
......
...@@ -14,7 +14,7 @@ const axiosReport = axios.create( ...@@ -14,7 +14,7 @@ const axiosReport = axios.create(
// 请求拦截器 // 请求拦截器
axiosReport.interceptors.request.use( axiosReport.interceptors.request.use(
config => { config => {
// Cookies.set('atoken','054e4006-e1c2-486e-8035-4946d80e4a3d') // Cookies.set('atoken','3cb99bee-4f38-43be-9aa2-3c4a9236af77')
if(!Cookies.get('atoken')){ if(!Cookies.get('atoken')){
ElMessage({ ElMessage({
message: `登录过期,请重新登录`, message: `登录过期,请重新登录`,
......
...@@ -58,6 +58,10 @@ const menuRoute = [ ...@@ -58,6 +58,10 @@ const menuRoute = [
component: () => import("@/views/SourceTrajectoryAnalysis/index.vue"), component: () => import("@/views/SourceTrajectoryAnalysis/index.vue"),
}, },
{ {
path: 'CustomerMatchList',
component: () => import("@/views/CustomerMatchList/index.vue"),
},
{
path: 'EquipmentTimeErrorVerification', path: 'EquipmentTimeErrorVerification',
component: () => import("@/views/EquipmentTimeErrorVerification/EquipmentTimeErrorVerification.vue"), component: () => import("@/views/EquipmentTimeErrorVerification/EquipmentTimeErrorVerification.vue"),
}, },
...@@ -127,8 +131,8 @@ const router = createRouter( ...@@ -127,8 +131,8 @@ const router = createRouter(
) )
// 全局路由守卫 // 全局路由守卫
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// Cookies.set('atoken','c3ac0dd5-571d-4c4b-aa51-437b691ac013') // Cookies.set('atoken','3cb99bee-4f38-43be-9aa2-3c4a9236af77')
// Cookies.set('userrole_type','c3ac0dd5-571d-4c4b-2341-437b691ac013') // Cookies.set('userrole_type','3cb99bee-4f38-43be-2474-3c4a9236af77')
// 加密获取userType // 加密获取userType
let tokenArr = Cookies.get("atoken").split('') let tokenArr = Cookies.get("atoken").split('')
let tokenArr1 = Cookies.get("atoken").split('-') let tokenArr1 = Cookies.get("atoken").split('-')
......
...@@ -97,20 +97,44 @@ export default { ...@@ -97,20 +97,44 @@ export default {
comparisonList.value = [] comparisonList.value = []
parmas.dataList.forEach(item=>{ parmas.dataList.forEach(item=>{
isLoadingTop.value = true isLoadingTop.value = true
let personList = []
item.perrsonList.forEach(one=>{
personList.push({...one})
})
for(let i=0;i<personList.length;i++){
personList[i].features_url = personList[i].features_url.indexOf('/images/')!=-1?personList[i].features_url.split('/images/')[1]:personList[i].features_url;
personList[i].picture_url = personList[i].picture_url.indexOf('/images/')!=-1?personList[i].picture_url.split('/images/')[1]:personList[i].picture_url;
personList[i].track_url = personList[i].track_url.indexOf('/images/')!=-1?personList[i].track_url.split('/images/')[1]:personList[i].track_url;
}
let parmasObj = { let parmasObj = {
mall_id:parmas.mall_id, mall_id:parmas.mall_id,
picType:parmas.picType, picType:parmas.picType,
pic_id:parmas.pic_id, pic_id:parmas.pic_id,
countdate:parmas.countdate, countdate:parmas.countdate,
personList:item.perrsonList personList:personList,
} }
comparsionResultApi.getPersonContrastList(parmasObj).then((r) => { comparsionResultApi.getPersonContrastList(parmasObj).then((r) => {
isLoadingTop.value = false isLoadingTop.value = false
if (r.data&&isArray(r.data.personList)) { if (r.data&&isArray(r.data.personList)) {
if(r.data.personList.length>0){ if(r.data.personList.length>0){
r.data.personList.forEach((item)=>{
if (item.features_url) {
item.features_url = window._baseImgUrl + item.features_url
}
if (item.picture_url) {
item.picture_url = window._baseImgUrl + item.picture_url
}
if (item.eventPic) {
item.eventPic = window._baseImgUrl + item.eventPic
}
if (item.track_url) {
item.track_url = window._baseImgUrl + item.track_url
}
})
comparisonList.value.push(r.data.personList) comparisonList.value.push(r.data.personList)
} }
} }
console.log('comparisonList.value',comparisonList.value)
} }
) )
}) })
......
.single-image {
height: 300px;
width: 100%;
}
.direction{
font-weight: 900;
background-color: red;
color: white;
}
.direction1{
background-color: green;
}
.direction0{
background-color: orange;
}
<template>
<a-modal title="图片详情" v-model:visible="isVisible" width="90%" class="detail-modal" style="top: 50px" :body-style="{padding:'10px 20px'}" :footer="false">
<div class="one-match-content" v-loading="isLoading">
<el-row :gutter="12">
<el-col :span="6" v-for="(item,index) in dataList" :key="index">
<div class="one-match">
<div class="one-match-data">
<span>对比分数: {{ item.matchScore }}</span>
</div>
<div class="one-match-img-data">
<div class="one-match-img-data-one">
<el-image :src="item.srcBodyPic" :fit="'fill'" class="one-match-data-image"></el-image>
<div class="one-match-one-text">person_unid: {{ item.srcPersonUnid }}</div>
<div class="one-match-one-text">unid: {{ item.srcUnid }}</div>
<div class="one-match-one-text">抓拍时间: {{ item.srcCountTime }}</div>
</div>
<div class="one-match-img-data-one">
<el-image :src="item.targetBodyPic" :fit="'fill'" class="one-match-data-image"></el-image>
<div class="one-match-one-text">person_unid: {{ item.targetPersonUnid }}</div>
<div class="one-match-one-text">unid: {{ item.targetUnid }}</div>
<div class="one-match-one-text">抓拍时间: {{ item.targetCountTime }}</div>
</div>
</div>
</div>
</el-col>
</el-row>
</div>
</a-modal>
</template>
<script>
import {
ref,
} from 'vue'
import clusterResultApi from './ClusterResultApi'
export default {
components: {
},
setup() {
const isVisible = ref(false);
const isLoading = ref(false)
const dataList = ref([])
const initDialog = function(data) {
console.log(data)
isVisible.value = true;
isLoading.value = true
clusterResultApi.getPersonDetail(data).then((r) => {
isLoading.value = false
r.data.forEach((item) => {
if (item.targetBodyPic) {
item.targetBodyPic = window._baseImgUrl + item.targetBodyPic
}
if (item.srcBodyPic) {
item.srcBodyPic = window._baseImgUrl + item.srcBodyPic
}
})
dataList.value = r.data
})
}
return {
isVisible,
isLoading,
dataList,
initDialog,
}
}
}
</script>
<style lang="less" scoped>
@import "./ClusterResult";
.one-match-content{
height: 80vh;
padding:0 6px;
overflow-y: auto;
}
.one-match{
padding:0 12px 12px;
border:1px solid #eee;
border-radius: 4px;
margin-bottom: 12px;
}
.one-match-data{
display: flex;
align-items: center;
height: 26px;
font-size: 13px;
}
.one-match-img-data{
display: flex;
align-items: center;
justify-content: space-between;
}
.one-match-img-data-one{
display: inline-block;
width: 49%;
}
.one-match-one-text{
line-height: 20px;
font-size: 13px;
}
.one-match-data-image{
width: 100%;
height:250px;
}
</style>
\ No newline at end of file \ No newline at end of file
import axiosInstance from "@/Request/MatchAxiosInstance"
import {filterEmptyValueInObject} from "@/PublicUtil/PublicUtil"
class ClusterResultApi {
getPersonDetail(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/matchRecord/personDetail`,
params: filterEmptyValueInObject(
data
)
}
)
}
}
const clusterResultApi = new ClusterResultApi()
export default clusterResultApi
import axiosInstance from "@/Request/MatchAxiosInstance"
import {filterEmptyValueInObject} from "@/PublicUtil/PublicUtil"
class CustomerMatchListApi {
getList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/matchRecord/list`,
params: filterEmptyValueInObject(
data
)
}
)
}
}
const customerMatchListApi = new CustomerMatchListApi()
export default customerMatchListApi
<template>
<a-form :model="queryForm" layout="inline">
<a-form-item label="集团:" style="padding: 5px 0;margin-bottom: 24px;">
<a-select v-model:value="queryForm.account_id" style="width: 280px" @change="onAccountChange"
:options="accountList" optionFilterProp="label" show-search>
</a-select>
</a-form-item>
<a-form-item label="广场:" style="padding: 5px 0;margin-bottom: 24px;">
<a-select v-model:value="queryForm.plaza_id" style="width: 280px" :options="plazaList"
optionFilterProp="label" show-search>
</a-select>
</a-form-item>
<a-form-item label="日期:" style="padding: 5px 0;margin-bottom: 24px;">
<a-date-picker v-model:value="queryForm.countDate" style="width: 280px" />
</a-form-item>
<a-form-item style="padding: 5px 0;margin-bottom: 24px;">
<a-button type="primary" @click="search">查询</a-button>
</a-form-item>
</a-form>
<a-table :dataSource="dataList" :scroll="scroll" :scrollbar="scrollbar" v-loading="isLoading" :columns="[
{
title:'序号',
align:'center',
slots: { customRender: 'index' },
},
{
title: 'person_unid',
dataIndex: 'srcPersonUnid',
align:'center',
},
{
title: '抓拍时间',
dataIndex: 'srcCountTime',
align:'center',
},
{
title: '操作',
dataIndex: 'operation',
align: 'center',
slots: {
customRender: 'operation',
},
}
]" :pagination="false">
<template #index="{index}">
<span>{{index*1+1}}</span>
</template>
<template #operation="{ record }">
<div>
<a-button @click="showDetail(record)" type="primary">查看详情</a-button>
</div>
</template>
</a-table>
<a-pagination v-model:current="pageNum" v-model:pageSize="pageSize" :total="total"
:show-total="total => `共 ${total} 条`" :pageSizeOptions="['10', '20']" @change="onPageNumChange"
@showSizeChange="onPageSizeChange" show-size-changer show-quick-jumper style="text-align:center;margin-top: 10px;" />
<ClusterResult ref="ClusterResultRef" />
</template>
<script>
import moment from 'moment'
import {
isArray
} from '@/PublicUtil/Judgment'
import {
defineComponent,
ref,
toRaw,
reactive
} from 'vue'
import {
filterEmptyValueInObject,
formatDate
} from '@/PublicUtil/PublicUtil'
import clusterResultApi from '@/views/SnapshotCluster/ClusterResult/ClusterResultApi'
import CustomerMatchListApi from '@/views/CustomerMatchList/CustomerMatchListApi'
import ClusterResult from '@/views/CustomerMatchList/ClusterResult/ClusterResult.vue'
export default defineComponent({
components: {
ClusterResult,
},
setup() {
const scrollbar = ref(true);
const scroll = {
y: window.innerHeight - 260
};
const ClusterResultRef = ref();
const pageNum = ref(1)
const pageSize = ref(10)
const total = ref()
const dataList = ref([])
const isLoading = ref(false)
const accountList = ref([])
const plazaList = ref([])
const queryForm = reactive({
account_id: '',
plaza_id: '',
countDate: moment(moment().format('YYYY-MM-DD'), 'YYYY-MM-DD')
})
const searchCondition = ref({})
const getAccountList = function() {
queryForm.account_id = ''
accountList.value = []
clusterResultApi.getAccountList().then(
(r) => {
if (isArray(r)) {
for (const item of r) {
accountList.value.push({
value: item.id,
label: item.name,
})
}
if (accountList.value.length) {
if (searchCondition.value.account_id && searchCondition.value.account_id.length > 0) {
queryForm.account_id = searchCondition.value.account_id
} else {
queryForm.account_id = accountList.value[0].value
}
getPlazaList()
}
}
}
)
}
const onAccountChange = function() {
getPlazaList(1)
}
const getPlazaList = function(val) {
queryForm.plaza_id = ''
plazaList.value = []
if (!queryForm.account_id.toString()) {
return
}
clusterResultApi.getPlazaList({
account_id: queryForm.account_id.toString()
}).then(
(r) => {
if (isArray(r)) {
for (const item of r) {
plazaList.value.push({
value: item.id,
label: item.name,
})
}
if (plazaList.value.length > 0) {
if (!val && searchCondition.value.plaza_id && searchCondition.value.plaza_id.length > 0) {
queryForm.plaza_id = searchCondition.value.plaza_id
} else {
queryForm.plaza_id = plazaList.value[0].value
}
confirmSearch()
}
}
}
)
}
const onPageNumChange = function(num) {
pageNum.value = num
confirmSearch()
}
const onPageSizeChange = function(current, size) {
pageNum.value = 1
pageSize.value = size
confirmSearch()
}
const confirmSearch = function() {
isLoading.value = true
const rawData = toRaw(queryForm)
const data = filterEmptyValueInObject({
pageNum: pageNum.value,
pageSize: pageSize.value,
startDate: formatDate(rawData.countDate),
endDate: formatDate(rawData.countDate),
mallId: rawData.plaza_id,
})
dataList.value = [], total.value = 0
CustomerMatchListApi.getList(data).then(
(r) => {
isLoading.value = false
if(r.code==200&&r.data){
dataList.value = r.data.list
total.value = r.data.total
}
}
)
}
const search = function() {
pageNum.value = 1
pageSize.value = 10
confirmSearch()
}
const __main = function() {
getAccountList()
}
const showDetail = function(row) {
const rawData = toRaw(queryForm)
const data = filterEmptyValueInObject({
countDate:formatDate(rawData.countDate),
personUnid: row.srcPersonUnid,
})
// const data = filterEmptyValueInObject({
// page: 0,
// pageSize: 10,
// account_id: rawData.account_id,
// plaza_id: rawData.srcPersonUnid,
// type: 0,
// picType: 2,
// startTime:formatDate(rawData.countDate) + ' 00:00:00',
// countDate:formatDate(rawData.countDate),
// personUnid: row.srcPersonUnid,
// direction: '-1,1',
// })
// console.log(data)
ClusterResultRef.value.initDialog(data);
}
__main()
return {
scrollbar,
scroll,
ClusterResultRef,
accountList,
onAccountChange,
plazaList,
queryForm,
pageNum,
pageSize,
total,
isLoading,
dataList,
onPageNumChange,
onPageSizeChange,
confirmSearch,
search,
showDetail
}
},
})
</script>
<style lang="less" scoped>
/deep/.ant-table-body{
tr{
th{
padding: 13px 16px!important;
}
}
}
/deep/.ant-table-tbody{
tr{
td{
padding: 8px 16px!important;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -59,14 +59,21 @@ module.exports = { ...@@ -59,14 +59,21 @@ module.exports = {
proxy: { proxy: {
// http://39.155.171.242:33333/report/aiot/operate/getPics // http://39.155.171.242:33333/report/aiot/operate/getPics
'/aiot': { '/aiot': {
target: 'http://39.155.171.242:33333/report/', target: 'http://192.168.1.64/report/',
changeOrigin: true changeOrigin: true
}, },
'/match': {
target: 'http://192.168.1.64:6689/',
changeOrigin: true,
pathRewrite: {
'^/match': ''
}
},
'/': { '/': {
target: 'http://39.155.171.242:33333/btool/', target: 'http://192.168.1.64/btool/',
// target: 'http://117.133.143.116:33333/btool/', // target: 'http://117.133.143.116:33333/btool/',
changeOrigin: true changeOrigin: true
} },
} }
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!