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 33a77b27
authored
Dec 21, 2022
by
李君
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
数据重传
1 parent
8b192334
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
251 additions
and
6 deletions
public/config.js
src/Request/PublicAxiosInstance.js
src/router/index.js
src/views/Main/Main.vue
src/views/equipmentDataRetransmission/api.js
src/views/equipmentDataRetransmission/equipmentDataRetransmission.vue
vue.config.js
public/config.js
View file @
33a77b2
window
.
_serverHost
=
[
'localhost'
,
'192.168.1.165'
].
includes
(
window
.
location
.
hostname
)
?
'36.112.68.214:33333'
:
window
.
location
.
host
window
.
_baseUrl
=
[
'localhost'
,
'192.168.1.165'
].
includes
(
window
.
location
.
hostname
)
?
'http://36.112.68.214:33333/btool/'
:
`https://
${
window
.
_serverHost
}
/btool/`
window
.
_baseImgUrl
=
[
'localhost'
,
'192.168.1.
165
'
].
includes
(
window
.
location
.
hostname
)
?
'https://store.keliuyun.com/images/'
:
`
${
window
.
location
.
origin
}
/images/`
window
.
_baseImgUrl
=
[
'localhost'
,
'192.168.1.
39
'
].
includes
(
window
.
location
.
hostname
)
?
'https://store.keliuyun.com/images/'
:
`
${
window
.
location
.
origin
}
/images/`
window
.
_socketUrl
=
[
'localhost'
,
'192.168.1.165'
].
includes
(
window
.
location
.
hostname
)
?
`wss://
${
window
.
_serverHost
}
/`
:
`wss://
${
window
.
_serverHost
}
/`
const
log
=
console
.
log
.
bind
(
console
)
src/Request/PublicAxiosInstance.js
View file @
33a77b2
...
...
@@ -4,7 +4,7 @@ import Cookies from "js-cookie"
import
{
getTimestampString
}
from
"@/PublicUtil/PublicUtil"
import
{
ElMessage
}
from
'element-plus'
// 创建 axios 的一个实例
let
baseURL
=
[
'localhost'
,
'192.168.1.
39
'
].
includes
(
window
.
location
.
hostname
)
?
''
:
window
.
_baseUrl
let
baseURL
=
[
'localhost'
,
'192.168.1.
28
'
].
includes
(
window
.
location
.
hostname
)
?
''
:
window
.
_baseUrl
const
axiosInstance
=
axios
.
create
(
{
baseURL
:
baseURL
...
...
@@ -14,14 +14,14 @@ const axiosInstance = axios.create(
// 请求拦截器
axiosInstance
.
interceptors
.
request
.
use
(
config
=>
{
// Cookies.set('atoken','
41ab4c2d-eb0e-44c2-9370-e5e338e234f8
')
// Cookies.set('atoken','
7ffdacd5-6eb3-489d-b9b0-bb9771767373
')
if
(
!
Cookies
.
get
(
'atoken'
)){
ElMessage
({
message
:
`登录过期,请重新登录`
,
type
:
'warning'
})
setTimeout
(()
=>
{
let
url
=
[
'localhost'
,
'192.168.1.
39
'
].
includes
(
window
.
location
.
hostname
)
?
'http://36.112.68.214:33333/'
:
window
.
location
.
origin
let
url
=
[
'localhost'
,
'192.168.1.
28
'
].
includes
(
window
.
location
.
hostname
)
?
'http://36.112.68.214:33333/'
:
window
.
location
.
origin
// if(url.includes('36.112.68.214')){
// url = 'http://36.112.68.214:33333/'
// }
...
...
@@ -45,7 +45,7 @@ axiosInstance.interceptors.response.use(
type
:
'warning'
})
setTimeout
(()
=>
{
let
url
=
[
'localhost'
,
'192.168.1.
39
'
].
includes
(
window
.
location
.
hostname
)
?
'http://36.112.68.214:33333/'
:
window
.
location
.
origin
let
url
=
[
'localhost'
,
'192.168.1.
28
'
].
includes
(
window
.
location
.
hostname
)
?
'http://36.112.68.214:33333/'
:
window
.
location
.
origin
// if(url.includes('36.112.68.214')){
// url = 'http://36.112.68.214:33333/'
// }
...
...
src/router/index.js
View file @
33a77b2
...
...
@@ -53,6 +53,10 @@ const menuRoute = [
path
:
'DataReplay'
,
component
:
()
=>
import
(
"@/views/DataReplay/DataReplay.vue"
),
},
{
path
:
'equipmentDataRetransmission'
,
component
:
()
=>
import
(
"@/views/equipmentDataRetransmission/equipmentDataRetransmission.vue"
),
},
]
},
]
...
...
src/views/Main/Main.vue
View file @
33a77b2
...
...
@@ -91,6 +91,12 @@
<span
style=
"padding: 0 5px"
>
数据重放
</span>
</div>
</a-menu-item>
<a-menu-item
:key=
"'/Main/equipmentDataRetransmission'"
>
<div
class=
"flex-vertical-center"
>
<img
:src=
"require('./Icons/2.svg')"
style=
"height: auto;width:20px"
/>
<span
style=
"padding: 0 5px"
>
设备数据重传
</span>
</div>
</a-menu-item>
</a-menu>
</el-aside>
<el-main>
...
...
src/views/equipmentDataRetransmission/api.js
0 → 100644
View file @
33a77b2
import
axiosInstance
from
"@/Request/PublicAxiosInstance"
import
{
filterEmptyValueInObject
}
from
"@/PublicUtil/PublicUtil"
class
DataReplay
{
getDeviceList
(
data
)
{
return
axiosInstance
.
request
(
{
method
:
'GET'
,
url
:
`/devices/all`
,
params
:
filterEmptyValueInObject
(
data
)
}
)
}
}
const
DataReplayApi
=
new
DataReplay
()
export
default
DataReplayApi
src/views/equipmentDataRetransmission/equipmentDataRetransmission.vue
0 → 100644
View file @
33a77b2
<
template
>
<a-form
:model=
"queryForm"
layout=
"inline"
:label-col=
"
{ style: { width: '70px' } }">
<a-form-item
label=
"集团:"
>
<a-select
v-model:value=
"queryForm.account_id"
style=
"width: 200px"
:options=
"accountList"
@
change=
"onAccountChange"
optionFilterProp=
"label"
show-search
>
</a-select>
</a-form-item>
<a-form-item
label=
"广场:"
>
<a-select
v-model:value=
"queryForm.plaza_id"
mode=
"multiple"
:maxTagCount=
"1"
@
change=
"onPlazaChange"
style=
"width: 200px"
:options=
"plazaList"
optionFilterProp=
"label"
show-search
>
</a-select>
</a-form-item>
<a-form-item
label=
"选择设备:"
>
<a-select
v-model:value=
"queryForm.device_id"
style=
"width: 300px"
mode=
"multiple"
:maxTagCount=
"1"
optionFilterProp=
"label"
:options=
"deviceList"
show-search
></a-select>
</a-form-item>
<a-form-item
label=
"选择日期:"
>
<a-date-picker
v-model:value=
"queryForm.date"
:format=
"'YYYY-MM-DD'"
style=
"width: 150px"
/>
</a-form-item>
<a-form-item
label=
"选择时间:"
>
<a-time-picker
v-model:value=
"queryForm.startTime"
style=
"width: 100px"
/>
<a-time-picker
v-model:value=
"queryForm.endTime"
style=
"width: 100px"
/>
</a-form-item>
<a-form-item>
<a-button
type=
"primary"
@
click=
"confirmSearch"
style=
"margin-right: 10px;"
>
查询
</a-button>
<a-button
type=
"primary"
@
click=
"implement"
>
执行
</a-button>
</a-form-item>
</a-form>
<a-table
:dataSource=
"deviceList"
v-loading=
"isLoading"
:rowKey=
"record=>record.serialnum"
:columns=
"columns"
:pagination=
"false"
>
</a-table>
</
template
>
<
script
>
import
{
reactive
,
ref
,
toRaw
}
from
'vue'
import
moment
from
'moment'
import
{
isArray
}
from
'@/PublicUtil/Judgment'
import
snapshotRecordApi
from
'@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi'
import
api
from
'./api.js'
import
axios
from
'axios'
export
default
{
setup
(){
const
accountList
=
ref
([])
const
plazaList
=
ref
([])
const
deviceList
=
ref
([])
const
columns
=
ref
([
{
title
:
'序号'
,
align
:
'center'
,
dataIndex
:
"index"
,
},
{
title
:
'IP配置'
,
dataIndex
:
'localIp'
,
align
:
'center'
,
},
{
title
:
'设备序列号'
,
dataIndex
:
'serialnum'
,
align
:
'center'
,
},
{
title
:
'数据重传状态'
,
dataIndex
:
'retransmission'
,
align
:
'center'
,
},
{
title
:
'设备重启状态'
,
dataIndex
:
'restart'
,
align
:
'center'
,
}
])
const
queryForm
=
reactive
(
{
account_id
:
''
,
plaza_id
:
[],
device_id
:
[],
date
:
moment
().
format
(
'YYYY-MM-DD'
),
startTime
:
moment
().
format
(
'YYYY-MM-DD 08:00:00'
),
endTime
:
moment
().
format
(
'YYYY-MM-DD 23:59:59'
),
}
)
const
getAccountList
=
function
()
{
queryForm
.
account_id
=
[]
accountList
.
value
=
[]
snapshotRecordApi
.
getAccountList
().
then
(
(
r
)
=>
{
if
(
isArray
(
r
))
{
for
(
const
item
of
r
)
{
accountList
.
value
.
push
(
{
value
:
item
.
id
,
label
:
item
.
name
,
}
)
}
}
}
)
}
const
onAccountChange
=
function
()
{
getPlazaList
()
}
const
getPlazaList
=
function
()
{
queryForm
.
plaza_id
=
[]
plazaList
.
value
=
[]
snapshotRecordApi
.
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
,
}
)
}
}
}
)
}
const
onPlazaChange
=
function
(){
queryForm
.
device_id
=
[]
deviceList
.
value
=
[]
getDevice
()
}
const
getDevice
=
function
(){
// 获取设备
const
rawData
=
toRaw
(
queryForm
)
const
data
=
{
mallIds
:
rawData
.
plaza_id
.
toString
()
}
api
.
getDeviceList
(
data
).
then
(
(
r
)
=>
{
if
(
isArray
(
r
))
{
for
(
var
i
=
0
;
i
<
r
.
length
;
i
++
)
{
r
[
i
].
index
=
i
+
1
r
[
i
].
label
=
r
[
i
].
serialnum
+
"——"
+
r
[
i
].
localIp
r
[
i
].
value
=
r
[
i
].
serialnum
deviceList
.
value
.
push
(
r
[
i
])
}
}
}
)
}
const
confirmSearch
=
function
(){
queryForm
.
device_id
=
[]
deviceList
.
value
=
[]
getDevice
()
}
const
implement
=
function
(){
deviceList
.
value
.
forEach
(
item
=>
{
queryForm
.
device_id
.
forEach
(
serialnum
=>
{
if
(
item
.
serialnum
==
serialnum
){
if
(
item
.
localIp
){
axios
({
method
:
'GET'
,
url
:
'http://'
+
item
.
localIp
+
':8080/do/CboxWebClient/resultresend?starttime='
+
moment
(
queryForm
.
date
).
format
(
'YYYY-MM-DD'
)
+
' '
+
moment
(
queryForm
.
startTime
).
format
(
'HH:mm:ss'
)
+
'&endtime='
+
moment
(
queryForm
.
date
).
format
(
'YYYY-MM-DD'
)
+
' '
+
moment
(
queryForm
.
endTime
).
format
(
'HH:mm:ss'
)
}).
then
(
result
=>
{
console
.
log
(
result
)
})
}
}
})
})
}
const
__main
=
function
()
{
getAccountList
()
}
__main
()
return
{
deviceList
,
accountList
,
plazaList
,
columns
,
queryForm
,
onAccountChange
,
confirmSearch
,
implement
,
onPlazaChange
}
}
}
</
script
>
<
style
>
</
style
>
\ No newline at end of file
vue.config.js
View file @
33a77b2
...
...
@@ -58,7 +58,7 @@ module.exports = {
devServer
:
{
proxy
:
{
'/'
:
{
target
:
'http
s://store.keliuyun.com
/btool/'
,
target
:
'http
://36.112.68.214: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