Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
1848a760
Commit
1848a760
authored
Jul 16, 2020
by
chengcaixia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
巡检平台提示框修改为可拖动
parent
cfb30540
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
193 additions
and
35 deletions
+193
-35
.gitignore
.gitignore
+1
-0
drag.js
src/components/el-drag-dialog/drag.js
+78
-0
index.js
src/components/el-drag-dialog/index.js
+14
-0
Result.vue
src/views/Result.vue
+19
-7
ResultDetail.vue
src/views/ResultDetail.vue
+67
-22
Task.vue
src/views/Task.vue
+14
-6
No files found.
.gitignore
View file @
1848a760
node_modules
node_modules
dist
src/components/el-drag-dialog/drag.js
0 → 100644
View file @
1848a760
export
default
{
bind
(
el
,
binding
,
vnode
)
{
const
dialogHeaderEl
=
el
.
querySelector
(
'.el-dialog__header'
)
const
dragDom
=
el
.
querySelector
(
'.el-dialog'
)
dialogHeaderEl
.
style
.
cssText
+=
';cursor:move;'
dragDom
.
style
.
cssText
+=
';top:0px;'
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
const
getStyle
=
(
function
()
{
if
(
window
.
document
.
currentStyle
)
{
return
(
dom
,
attr
)
=>
dom
.
currentStyle
[
attr
]
}
else
{
return
(
dom
,
attr
)
=>
getComputedStyle
(
dom
,
false
)[
attr
]
}
})()
dialogHeaderEl
.
onmousedown
=
(
e
)
=>
{
// 鼠标按下,计算当前元素距离可视区的距离
const
disX
=
e
.
clientX
-
dialogHeaderEl
.
offsetLeft
const
disY
=
e
.
clientY
-
dialogHeaderEl
.
offsetTop
const
dragDomWidth
=
dragDom
.
offsetWidth
const
dragDomHeight
=
dragDom
.
offsetHeight
const
screenWidth
=
document
.
body
.
clientWidth
const
screenHeight
=
document
.
body
.
clientHeight
const
minDragDomLeft
=
dragDom
.
offsetLeft
const
maxDragDomLeft
=
screenWidth
-
dragDom
.
offsetLeft
-
dragDomWidth
const
minDragDomTop
=
dragDom
.
offsetTop
const
maxDragDomTop
=
screenHeight
-
dragDom
.
offsetTop
-
dragDomHeight
// 获取到的值带px 正则匹配替换
let
styL
=
getStyle
(
dragDom
,
'left'
)
let
styT
=
getStyle
(
dragDom
,
'top'
)
if
(
styL
.
includes
(
'%'
))
{
styL
=
+
document
.
body
.
clientWidth
*
(
+
styL
.
replace
(
/
\%
/g
,
''
)
/
100
)
styT
=
+
document
.
body
.
clientHeight
*
(
+
styT
.
replace
(
/
\%
/g
,
''
)
/
100
)
}
else
{
styL
=
+
styL
.
replace
(
/
\p
x/g
,
''
)
styT
=
+
styT
.
replace
(
/
\p
x/g
,
''
)
}
document
.
onmousemove
=
function
(
e
)
{
// 通过事件委托,计算移动的距离
let
left
=
e
.
clientX
-
disX
let
top
=
e
.
clientY
-
disY
// 边界处理
if
(
-
(
left
)
>
minDragDomLeft
)
{
left
=
-
minDragDomLeft
}
else
if
(
left
>
maxDragDomLeft
)
{
left
=
maxDragDomLeft
}
if
(
-
(
top
)
>
minDragDomTop
)
{
top
=
-
minDragDomTop
}
else
if
(
top
>
maxDragDomTop
)
{
top
=
maxDragDomTop
}
// 移动当前元素
dragDom
.
style
.
cssText
+=
`;left:
${
left
+
styL
}
px;top:
${
top
+
styT
}
px;`
// emit onDrag event
vnode
.
child
.
$emit
(
'dragDialog'
)
}
document
.
onmouseup
=
function
(
e
)
{
document
.
onmousemove
=
null
document
.
onmouseup
=
null
}
}
}
}
\ No newline at end of file
src/components/el-drag-dialog/index.js
0 → 100644
View file @
1848a760
import
drag
from
'./drag'
const
install
=
function
(
Vue
)
{
Vue
.
directive
(
'el-drag-dialog'
,
drag
)
}
if
(
window
.
Vue
)
{
window
[
'el-drag-dialog'
]
=
drag
Vue
.
use
(
install
);
// eslint-disable-line
}
drag
.
install
=
install
export
default
drag
\ No newline at end of file
src/views/Result.vue
View file @
1848a760
...
@@ -215,7 +215,11 @@
...
@@ -215,7 +215,11 @@
width: calc(100vw - 600px);
width: calc(100vw - 600px);
height: 100%;
height: 100%;
float: left;
float: left;
background: #888
background: #888;
.map {
width: calc(100vw - 600px);
height: 100%;
}
}
}
.picture{
.picture{
height: 90%;
height: 90%;
...
@@ -267,10 +271,7 @@
...
@@ -267,10 +271,7 @@
.pic_active{
.pic_active{
border: 5px solid #1296db;
border: 5px solid #1296db;
}
}
.map {
width: calc(100vw - 600px);
height: 100%;
}
</
style
>
</
style
>
<
script
>
<
script
>
...
@@ -398,10 +399,21 @@ export default {
...
@@ -398,10 +399,21 @@ export default {
};
};
},
},
mounted
()
{
mounted
()
{
if
(
this
.
$route
.
params
.
startTime
&&
this
.
$route
.
params
.
endTime
){
this
.
filters
.
dateTime
=
[
this
.
$route
.
params
.
startTime
,
this
.
$route
.
params
.
endTime
];
}
if
(
this
.
$route
.
params
.
equipment
){
this
.
filters
.
plateNo
=
[
this
.
$route
.
params
.
equipment
];
}
if
(
this
.
filters
.
dateTime
.
length
>
0
||
this
.
filters
.
plateNo
.
length
>
0
)
{
//do nothing
}
else
{
let
searchVal
=
sessionStorage
.
getItem
(
"searchVal"
);
let
searchVal
=
sessionStorage
.
getItem
(
"searchVal"
);
if
(
searchVal
)
{
if
(
searchVal
)
{
this
.
filters
=
JSON
.
parse
(
searchVal
);
this
.
filters
=
JSON
.
parse
(
searchVal
);
}
}
}
this
.
queryAllEquipment
();
this
.
queryAllEquipment
();
this
.
queryTravel
();
this
.
queryTravel
();
},
},
...
@@ -601,7 +613,7 @@ export default {
...
@@ -601,7 +613,7 @@ export default {
info
.
type2
=
capital
.
label
;
info
.
type2
=
capital
.
label
;
}
}
});
});
this
.
allPoints
.
push
({
lng
:
result
[
0
],
lat
:
result
[
1
],
markerAnim
:
''
,
url
:
info
.
status
==
1
?
require
(
'../assets/img/map-marker_orange.png'
)
:
require
(
'../assets/img/jingbao_red.png'
),
status
:
info
.
status
,
content
:
this
.
no
,
title
:
''
,
titleList
:
[
'资产类型:'
+
info
.
type2
,
'资产状态:'
+
info
.
status
==
1
?
'正常'
:
'异常'
,
'位置:'
+
info
.
position
]});
this
.
allPoints
.
push
({
lng
:
result
[
0
],
lat
:
result
[
1
],
markerAnim
:
''
,
url
:
info
.
status
==
1
?
require
(
'../assets/img/map-marker_orange.png'
)
:
require
(
'../assets/img/jingbao_red.png'
),
status
:
info
.
status
,
content
:
this
.
no
,
title
:
''
,
titleList
:
[
'资产类型:'
+
info
.
type2
,
'资产状态:'
+
(
info
.
status
==
1
?
'正常'
:
'异常'
)
,
'位置:'
+
info
.
position
]});
this
.
allImgs
.
push
({
url
:
'/roadlinks/getCapitalImg?imgPath='
+
info
.
imagePath
,
content
:
info
.
type2
+
' | '
+
(
info
.
status
==
1
?
'正常'
:
'异常'
)
+
' | '
+
info
.
position
,
number
:
this
.
no
,
id
:
'imageCard'
+
this
.
no
});
this
.
allImgs
.
push
({
url
:
'/roadlinks/getCapitalImg?imgPath='
+
info
.
imagePath
,
content
:
info
.
type2
+
' | '
+
(
info
.
status
==
1
?
'正常'
:
'异常'
)
+
' | '
+
info
.
position
,
number
:
this
.
no
,
id
:
'imageCard'
+
this
.
no
});
}
}
});
});
...
@@ -631,7 +643,7 @@ export default {
...
@@ -631,7 +643,7 @@ export default {
this
.
tableData
.
push
({
this
.
tableData
.
push
({
plateNo
:
key
,
plateNo
:
key
,
startEndTime
:
moment
(
val
[
val
.
length
-
1
].
timestamp
).
format
(
"YYYY-MM-DD hh:mm
:ss"
)
+
" - "
+
moment
(
val
[
0
].
timestamp
).
format
(
"YYYY-MM-DD hh:mm:ss
"
),
startEndTime
:
moment
(
val
[
val
.
length
-
1
].
timestamp
).
format
(
"YYYY-MM-DD hh:mm
"
)
+
" - "
+
moment
(
val
[
0
].
timestamp
).
format
(
"YYYY-MM-DD hh:mm
"
),
startEndPoint
:
val
[
val
.
length
-
1
].
position
+
" - "
+
val
[
0
].
position
,
startEndPoint
:
val
[
val
.
length
-
1
].
position
+
" - "
+
val
[
0
].
position
,
inspectDistance
:
(
totalDistance
/
1000
).
toFixed
(
1
)
+
'km'
,
inspectDistance
:
(
totalDistance
/
1000
).
toFixed
(
1
)
+
'km'
,
inspectNum
:
(
val
[
0
].
inspectNum
?
val
[
0
].
inspectNum
:
0
)
+
"个"
,
inspectNum
:
(
val
[
0
].
inspectNum
?
val
[
0
].
inspectNum
:
0
)
+
"个"
,
...
...
src/views/ResultDetail.vue
View file @
1848a760
...
@@ -104,6 +104,11 @@
...
@@ -104,6 +104,11 @@
label=
"图片路径"
label=
"图片路径"
prop=
"imagePath"
>
prop=
"imagePath"
>
</el-table-column>
</el-table-column>
<el-table-column
v-if=
"isShowCol"
label=
"分组ID"
prop=
"groupId"
>
</el-table-column>
<el-table-column
fixed=
"right"
label=
"详情"
>
<el-table-column
fixed=
"right"
label=
"详情"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<el-button
<el-button
...
@@ -131,6 +136,7 @@
...
@@ -131,6 +136,7 @@
</div>
</div>
<el-dialog
<el-dialog
v-el-drag-dialog
:visible
.
sync=
"isShowPicture"
:visible
.
sync=
"isShowPicture"
:title=
"imgContent"
:title=
"imgContent"
custom-class=
"customWidth"
custom-class=
"customWidth"
...
@@ -139,6 +145,32 @@
...
@@ -139,6 +145,32 @@
<img
:src=
"bigImgUrl"
width=
"100%"
style=
"height: 100%;"
>
<img
:src=
"bigImgUrl"
width=
"100%"
style=
"height: 100%;"
>
</div>
</div>
</el-dialog>
</el-dialog>
<el-dialog
title=
"确认信息"
v-el-drag-dialog
:visible
.
sync=
"dialogVisible1"
:modal=
"needModal"
width=
"30%"
>
<span>
此情况是否为异常?
</span>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible1 = false"
>
否
</el-button>
<el-button
type=
"primary"
@
click=
"showDialog2"
>
是
</el-button>
</span>
</el-dialog>
<el-dialog
title=
"确认信息"
v-el-drag-dialog
:visible
.
sync=
"dialogVisible2"
:modal=
"needModal"
width=
"30%"
>
<span>
此情况是否为异常?
</span>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible2 = false"
>
未处理
</el-button>
<el-button
type=
"primary"
@
click=
"updatePicStatus"
>
已处理
</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
</template>
<
style
lang=
"less"
scope
>
<
style
lang=
"less"
scope
>
...
@@ -157,10 +189,12 @@ import { Message } from 'element-ui';
...
@@ -157,10 +189,12 @@ import { Message } from 'element-ui';
import
echarts
from
'echarts'
;
import
echarts
from
'echarts'
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
address
from
'../config'
;
import
address
from
'../config'
;
import
{
export_json_to_excel
}
from
'@/excel/Export2Excel'
import
{
export_json_to_excel
}
from
'@/excel/Export2Excel'
;
import
elDragDialog
from
"@/components/el-drag-dialog"
;
export
default
{
export
default
{
name
:
'detail'
,
name
:
'detail'
,
directives
:
{
elDragDialog
},
data
()
{
data
()
{
return
{
return
{
tableData
:
[
tableData
:
[
...
@@ -180,6 +214,11 @@ export default {
...
@@ -180,6 +214,11 @@ export default {
imgContent
:
''
,
imgContent
:
''
,
bigImgUrl
:
''
,
bigImgUrl
:
''
,
no
:
0
,
no
:
0
,
dialogVisible1
:
false
,
dialogVisible2
:
false
,
needModal
:
false
,
groupId
:
null
,
tableIndex
:
-
1
,
capitalOptions
:
[
capitalOptions
:
[
{
{
label
:
'路面状况'
,
label
:
'路面状况'
,
...
@@ -285,7 +324,7 @@ export default {
...
@@ -285,7 +324,7 @@ export default {
created
()
{
created
()
{
let
startTime
=
null
;
let
startTime
=
null
;
let
endTime
=
null
;
let
endTime
=
null
;
let
equipment
=
null
let
equipment
=
null
;
if
(
this
.
$route
.
params
.
startTime
){
if
(
this
.
$route
.
params
.
startTime
){
startTime
=
this
.
$route
.
params
.
startTime
;
startTime
=
this
.
$route
.
params
.
startTime
;
}
}
...
@@ -468,33 +507,39 @@ export default {
...
@@ -468,33 +507,39 @@ export default {
}
}
return
false
;
return
false
;
},
},
showDialog2
()
{
this
.
dialogVisible1
=
false
;
this
.
dialogVisible2
=
true
;
},
showPicture
(
index
,
row
)
{
showPicture
(
index
,
row
)
{
this
.
imgContent
=
row
.
type2
+
"|"
+
row
.
status
+
"|"
+
row
.
position
;
this
.
imgContent
=
row
.
type2
+
"|"
+
row
.
status
+
"|"
+
row
.
position
;
this
.
bigImgUrl
=
"/roadlinks/getCapitalImg?imgPath="
+
row
.
imagePath
;
this
.
bigImgUrl
=
"/roadlinks/getCapitalImg?imgPath="
+
row
.
imagePath
;
this
.
isShowPicture
=
true
;
this
.
isShowPicture
=
true
;
if
(
row
.
status
==
"异常"
)
{
if
(
row
.
status
==
"异常"
)
{
this
.
$confirm
(
'此情况是否为异常?'
,
'确认信息'
,
{
this
.
dialogVisible1
=
true
;
distinguishCancelAndClose
:
true
,
this
.
groupId
=
row
.
groupId
;
confirmButtonText
:
'是'
,
this
.
tableIndex
=
index
;
cancelButtonText
:
'否'
}
})
},
.
then
(()
=>
{
updatePicStatus
()
{
this
.
$confirm
(
'是否已经处理改异常情况?'
,
'确认信息'
,
{
this
.
dialogVisible2
=
false
;
distinguishCancelAndClose
:
true
,
this
.
tableData
[
this
.
tableIndex
].
status
=
"正常"
;
confirmButtonText
:
'已处理'
,
axios
.
post
(
`/roadlinks/updateImageStatus`
,
{
cancelButtonText
:
'未处理'
id
:
this
.
groupId
})
}).
then
((
response
)
=>
{
.
then
(()
=>
{
if
(
response
.
data
.
code
===
200
)
{
this
.
tableData
[
index
].
status
=
"正常"
;
if
(
response
.
data
.
data
)
{
})
.
catch
(
action
=>
{
}
else
{
// do nothing
});
}
}
else
{
}
})
})
.
catch
(
action
=>
{
.
catch
((
error
)
=>
{
this
.
tableData
[
index
].
status
=
"正常"
;
console
.
log
(
error
)
;
});
});
}
},
},
exportTravel
(){
exportTravel
(){
this
.
tableData
.
forEach
((
item
,
index
)
=>
{
this
.
tableData
.
forEach
((
item
,
index
)
=>
{
...
...
src/views/Task.vue
View file @
1848a760
...
@@ -187,7 +187,11 @@
...
@@ -187,7 +187,11 @@
.ov-map{
.ov-map{
width: 100%;
width: 100%;
height: 100%;
height: 100%;
background: #888
background: #888;
.map {
width: 100%;
height: 100%;
}
}
}
}
}
.picture{
.picture{
...
@@ -212,10 +216,7 @@
...
@@ -212,10 +216,7 @@
}
}
}
}
}
}
.map {
width: 100%;
height: 100%;
}
</
style
>
</
style
>
<
script
>
<
script
>
import
axios
from
'axios'
;
import
axios
from
'axios'
;
...
@@ -646,7 +647,14 @@ export default {
...
@@ -646,7 +647,14 @@ export default {
},
},
// 巡检结果查看
// 巡检结果查看
linkResult
(
index
,
row
)
{
linkResult
(
index
,
row
)
{
this
.
$router
.
push
({
name
:
"result"
,
params
:
{
startTime
:
this
.
filters
.
dateTime
[
0
],
endTime
:
this
.
filters
.
dateTime
[
1
],
equipment
:
row
.
plateNo
}
});
},
},
shutdown
(
index
,
row
)
{
shutdown
(
index
,
row
)
{
console
.
log
(
index
,
row
);
console
.
log
(
index
,
row
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment