Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
罗鑫霖
/
vion-tools
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit abcbca35
authored
Jan 13, 2025
by
李乾广
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
小平台按需加载抓拍图
1 parent
50c4f0d5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
138 additions
and
14 deletions
public/config.js
src/Request/ReportAxiosInstance.js
src/views/SnapshotCluster/ClusterResult/ClusterResult.vue
src/views/SnapshotCluster/ClusterResult/ClusterResultApi.js
src/views/SnapshotCluster/SnapshotRecord/SnapshotRecord.vue
src/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi.js
vue.config.js
public/config.js
View file @
abcbca3
window
.
_serverHost
=
[
'localhost'
,
'192.168.1.120'
].
includes
(
window
.
location
.
hostname
)
?
'https://store.keliuyun.com/'
:
window
.
location
.
host
window
.
_baseUrl
=
[
'localhost'
,
'192.168.1.120'
].
includes
(
window
.
location
.
hostname
)
?
'https://store.keliuyun.com//tool/'
:
`
${
window
.
location
.
origin
}
/btool/`
window
.
_baseImgUrl
=
[
'localhost'
,
'192.168.1.120'
].
includes
(
window
.
location
.
hostname
)
?
'https://store.keliuyun.com/images/'
:
`
${
window
.
location
.
origin
}
/images/`
window
.
_serverHost
=
[
'localhost'
,
'192.168.1.120'
].
includes
(
window
.
location
.
hostname
)
?
'http://39.155.171.242:33333/'
:
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
.
_reportUrl
=
[
'localhost'
,
'192.168.1.120'
].
includes
(
window
.
location
.
hostname
)
?
'http://39.155.171.242:33333/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
.
_socketUrl
=
[
'localhost'
,
'192.168.1.120'
].
includes
(
window
.
location
.
hostname
)
?
`wss://
${
window
.
_serverHost
}
/btool/`
:
`wss://
${
window
.
_serverHost
}
/btool/`
const
log
=
console
.
log
.
bind
(
console
)
\ No newline at end of file
src/Request/ReportAxiosInstance.js
0 → 100644
View file @
abcbca3
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
)
?
''
:
window
.
_reportUrl
const
axiosReport
=
axios
.
create
(
{
baseURL
:
baseURL
,
// timeout:10000
}
)
// 请求拦截器
axiosReport
.
interceptors
.
request
.
use
(
config
=>
{
// Cookies.set('atoken','054e4006-e1c2-486e-8035-4946d80e4a3d')
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
src/views/SnapshotCluster/ClusterResult/ClusterResult.vue
View file @
abcbca3
...
...
@@ -329,6 +329,7 @@ export default {
},
setup
()
{
// scalar
const
dataSources
=
ref
(
0
)
const
pageNum
=
ref
(
1
)
const
pageSize
=
ref
(
10
)
const
total
=
ref
()
...
...
@@ -419,6 +420,7 @@ export default {
getZoneList
()
getGateList
()
getPositionList
()
dataSources
.
value
=
(
plazaList
.
value
.
filter
(
v
=>
v
.
value
==
queryForm
.
plaza_id
)[
0
]
||
{
dataSources
:
0
}).
dataSources
}
const
onZoneChange
=
function
()
{
...
...
@@ -465,6 +467,7 @@ export default {
{
value
:
item
.
id
,
label
:
item
.
name
,
dataSources
:
item
.
dataSources
||
0
,
}
)
}
...
...
@@ -474,6 +477,7 @@ export default {
}
else
{
queryForm
.
plaza_id
=
plazaList
.
value
[
0
].
value
}
dataSources
.
value
=
(
plazaList
.
value
.
filter
(
v
=>
v
.
value
==
queryForm
.
plaza_id
)[
0
]
||
{
dataSources
:
0
}).
dataSources
reqPersonType
(
1
)
getZoneList
(
1
)
getGateList
(
1
)
...
...
@@ -1008,6 +1012,14 @@ export default {
}
)
}
// 查询小平台单个图片
const
getDataSourcesImg
=
(
unid
)
=>
{
console
.
log
(
'getDataSourcesImg'
,
unid
)
clusterResultApi
.
operateGetPics
({
unids
:[
unid
]}).
then
((
r
)
=>
{})
setTimeout
(()
=>
{
confirmSearch
()
},
2000
)
}
// 添加人员库
const
personnelPoolRef
=
ref
();
const
addPersonnelPool
=
()
=>
{
...
...
@@ -1089,6 +1101,11 @@ export default {
}
const
handleClick
=
function
(
data
,
event
){
console
.
log
(
'handleClick'
,
data
,
event
)
console
.
log
(
'dataSources'
,
dataSources
.
value
,
data
)
if
(
dataSources
.
value
==
1
&&!
data
.
picture_url
){
// 小平台且没有图
getDataSourcesImg
(
data
.
unid
)
}
// 多选。只有设置为多选状态的组,才可以选中
if
(
isMultipleOperation
.
value
)
{
// 如果已选中,则取消。若未选中,则增加
...
...
@@ -1266,6 +1283,7 @@ export default {
return
{
// scalar
dataSources
,
isLoading
,
pageNum
,
pageSize
,
...
...
@@ -1303,6 +1321,7 @@ export default {
expandChange
,
updatePersonInfoByGroup
,
uploadGroupData
,
getDataSourcesImg
,
deletePersonRecord
,
addPersonnelPool
,
movePersonRecord
,
...
...
src/views/SnapshotCluster/ClusterResult/ClusterResultApi.js
View file @
abcbca3
import
axiosInstance
from
"@/Request/PublicAxiosInstance"
import
axiosReport
from
"@/Request/ReportAxiosInstance"
import
{
filterEmptyValueInObject
}
from
"@/PublicUtil/PublicUtil"
class
ClusterResultApi
{
operateGetPics
(
data
)
{
return
axiosReport
.
request
(
{
method
:
'POST'
,
url
:
`/aiot/operate/getPics`
,
data
:
data
}
)
}
getClusterResultList
(
data
)
{
return
axiosInstance
.
request
(
{
...
...
src/views/SnapshotCluster/SnapshotRecord/SnapshotRecord.vue
View file @
abcbca3
...
...
@@ -271,6 +271,7 @@ export default {
},
setup
()
{
// scalar
const
dataSources
=
ref
(
0
)
const
pageNum
=
ref
(
1
)
const
pageSize
=
ref
(
24
)
const
total
=
ref
()
...
...
@@ -354,6 +355,7 @@ export default {
getZoneList
()
getGateList
()
getPositionList
()
dataSources
.
value
=
(
plazaList
.
value
.
filter
(
v
=>
v
.
value
==
queryForm
.
plaza_id
)[
0
]
||
{
dataSources
:
0
}).
dataSources
}
const
onZoneChange
=
function
()
{
...
...
@@ -375,15 +377,17 @@ export default {
{
value
:
item
.
id
,
label
:
item
.
name
,
dataSources
:
item
.
dataSources
||
0
,
}
)
}
if
(
plazaList
.
value
.
length
){
if
(
!
val
&&
searchCondition
.
value
.
plaza_id
&&
searchCondition
.
value
.
plaza_id
.
length
>
0
){
queryForm
.
plaza_id
=
searchCondition
.
value
.
plaza_id
[
0
]
}
else
{
queryForm
.
plaza_id
=
plazaList
.
value
[
0
].
value
}
if
(
!
val
&&
searchCondition
.
value
.
plaza_id
&&
searchCondition
.
value
.
plaza_id
.
length
>
0
){
queryForm
.
plaza_id
=
searchCondition
.
value
.
plaza_id
[
0
]
}
else
{
queryForm
.
plaza_id
=
plazaList
.
value
[
0
].
value
}
dataSources
.
value
=
(
plazaList
.
value
.
filter
(
v
=>
v
.
value
==
queryForm
.
plaza_id
)[
0
]
||
{
dataSources
:
0
}).
dataSources
reqPersonType
(
1
)
getZoneList
(
1
)
getGateList
(
1
)
...
...
@@ -1344,13 +1348,26 @@ export default {
)
}
const
downloadTrajectoryFile
=
function
(
url
){
window
.
open
(
url
)
}
const
handleClick
=
function
(
data
){
const
downloadTrajectoryFile
=
function
(
url
){
window
.
open
(
url
)
}
const
handleClick
=
function
(
data
){
currentItemId
.
value
=
data
.
id
currobj
.
value
=
data
;
}
console
.
log
(
'dataSources'
,
dataSources
.
value
,
data
)
if
(
dataSources
.
value
==
1
&&!
data
.
picture_url
){
// 小平台且没有图
getDataSourcesImg
(
data
.
unid
)
}
}
// 查询小平台单个图片
const
getDataSourcesImg
=
(
unid
)
=>
{
console
.
log
(
'getDataSourcesImg'
,
unid
)
snapshotRecordApi
.
operateGetPics
({
unids
:[
unid
]}).
then
((
r
)
=>
{})
setTimeout
(()
=>
{
confirmSearch
()
},
2000
)
}
const
comparativeFun
=
function
(){
if
(
currobj
.
value
==
{})
{
ElMessage
({
...
...
@@ -1453,6 +1470,7 @@ export default {
return
{
// scalar
dataSources
,
isLoading
,
pageNum
,
pageSize
,
...
...
@@ -1483,6 +1501,7 @@ export default {
downloadFile
,
handleDeleteFile
,
handleDeleteFileConfirm
,
getDataSourcesImg
,
downloadTrajectoryFile
,
handleClick
,
comparativeFun
,
...
...
src/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi.js
View file @
abcbca3
import
axiosInstance
from
"@/Request/PublicAxiosInstance"
import
axiosReport
from
"@/Request/ReportAxiosInstance"
import
{
filterEmptyValueInObject
}
from
"@/PublicUtil/PublicUtil"
class
SnapshotRecordApi
{
...
...
@@ -116,6 +117,15 @@ class SnapshotRecordApi {
}
)
}
operateGetPics
(
data
)
{
return
axiosReport
.
request
(
{
method
:
'POST'
,
url
:
`/aiot/operate/getPics`
,
data
:
data
}
)
}
// 删除抓拍记录
delRecord
(
data
)
{
return
axiosInstance
.
request
(
...
...
vue.config.js
View file @
abcbca3
...
...
@@ -58,7 +58,7 @@ module.exports = {
devServer
:
{
proxy
:
{
'/'
:
{
target
:
'http
s://store.keliuyun.com
/btool/'
,
target
:
'http
://39.155.171.242:33333
/btool/'
,
// target: 'http://117.133.143.116:33333/btool/',
changeOrigin
:
true
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment