Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
桩
桩基检测
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张牧越
桩基检测
Commits
033fa492
Commit
033fa492
authored
Dec 20, 2023
by
马奔奔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature: 增加回弹详情地址地图
parent
f342d035
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
296 additions
and
50 deletions
+296
-50
htjc.html
pages/htjc.html
+1
-1
htjc.css
static/css/dist/htjc.css
+115
-27
htjc.js
static/js/htjc.js
+180
-22
No files found.
pages/htjc.html
View file @
033fa492
...
@@ -102,7 +102,7 @@
...
@@ -102,7 +102,7 @@
<div
class=
"right-item right-item1"
></div>
<div
class=
"right-item right-item1"
></div>
<div
class=
"right-item right-item2 hiddenImportant"
></div>
<div
class=
"right-item right-item2 hiddenImportant"
></div>
</div>
</div>
<div
id=
"test-location-main"
class=
"test-location-main hidden"
></div>
<div
id=
"test-location-main"
class=
"test-location-main hidden
Important
"
></div>
<div
class=
"hoverInfo hidden"
id=
"hoverInfo"
onmouseover=
"detail.hoverInfoMouseover()"
<div
class=
"hoverInfo hidden"
id=
"hoverInfo"
onmouseover=
"detail.hoverInfoMouseover()"
onmouseout=
"detail.hoverInfoMouseout()"
></div>
onmouseout=
"detail.hoverInfoMouseout()"
></div>
</div>
</div>
...
...
static/css/dist/htjc.css
View file @
033fa492
...
@@ -334,24 +334,25 @@
...
@@ -334,24 +334,25 @@
margin-bottom
:
0.05rem
;
margin-bottom
:
0.05rem
;
}
}
.popup-info
.tab
.tabBox
{
.popup-info
.tab
.tabBox
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
color
:
#FFFFFF
;
color
:
#FFFFFF
;
}
}
.popup-info
.tab
.tabBox
>
div
{
.popup-info
.tab
.tabBox
>
div
{
margin-right
:
0.68rem
;
margin-right
:
0.68rem
;
cursor
:
pointer
;
cursor
:
pointer
;
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
align-items
:
center
;
align-items
:
center
;
}
}
.popup-info
.tab
.tabBox
>
div
.actived
{
.popup-info
.tab
.tabBox
>
div
.actived
{
color
:
#00FFFF
;
color
:
#00FFFF
;
}
}
.popup-info
.tab
.tabBox
.actived
::after
{
.popup-info
.tab
.tabBox
.actived
::after
{
display
:
block
;
display
:
block
;
content
:
''
;
content
:
''
;
width
:
0.55rem
;
width
:
0.55rem
;
...
@@ -362,6 +363,84 @@
...
@@ -362,6 +363,84 @@
}
}
.popup-info
.test-location-main
{
width
:
100%
;
height
:
calc
(
100%
-
.97rem
);
}
.amap-logo
{
display
:
none
!important
;
}
.amap-copyright
{
display
:
none
!important
;
}
.modalBox
{
padding
:
0.2rem
0.1rem
;
background
:
rgba
(
0
,
0
,
0
,
.7
);
border
:
none
;
border-radius
:
4px
;
color
:
#C0D3E6
;
font-size
:
14px
;
}
.modalBox
.content
{
max-height
:
3.5rem
;
overflow
:
auto
;
}
.modalBox
.content
::-webkit-scrollbar
{
width
:
0.1rem
;
height
:
0.1rem
;
}
.modalBox
.content
::-webkit-scrollbar-thumb
{
background
:
#36384F
;
border-radius
:
8px
;
}
.modalBox
.content
::-webkit-scrollbar-track
{
background
:
#070813
;
border-radius
:
8px
;
}
.taskNoBox
{
color
:
#3FD9FF
;
}
.rwdImg
{
width
:
0.19rem
;
height
:
0.18rem
;
}
.countBox
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
margin-top
:
0.14rem
;
margin-bottom
:
0.1rem
;
}
.countBox
>
div
{
padding
:
0.08rem
0.16rem
;
border
:
1px
solid
#90A1B1
;
}
.modalBoxItem
{
padding
:
0.13rem
0.14rem
;
border-top
:
1px
solid
rgba
(
192
,
211
,
230
,
.4
);
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
}
.amap-marker-label
{
border
:
0
;
background-color
:
transparent
;
}
.popup-info
.main
{
.popup-info
.main
{
display
:
flex
;
display
:
flex
;
height
:
calc
(
100%
-
.97rem
);
height
:
calc
(
100%
-
.97rem
);
...
@@ -551,7 +630,7 @@
...
@@ -551,7 +630,7 @@
justify-content
:
space-evenly
;
justify-content
:
space-evenly
;
}
}
.popup-info
.main
.right-item
.flex-item
.box
.item
>
div
{
.popup-info
.main
.right-item
.flex-item
.box
.item
>
div
{
word-break
:
keep-all
;
word-break
:
keep-all
;
white-space
:
nowrap
;
white-space
:
nowrap
;
display
:
flex
;
display
:
flex
;
...
@@ -749,7 +828,7 @@
...
@@ -749,7 +828,7 @@
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.popup-info
.main
.right-item
.info-item
.bw-item
.item
.icon-change
{
.popup-info
.main
.right-item
.info-item
.bw-item
.item
.icon-change
{
width
:
63px
;
width
:
63px
;
height
:
46px
;
height
:
46px
;
position
:
absolute
;
position
:
absolute
;
...
@@ -758,12 +837,13 @@
...
@@ -758,12 +837,13 @@
}
}
.popup-info
.main
.right-item
.info-item
.bw-item
.common
{
.popup-info
.main
.right-item
.info-item
.bw-item
.common
{
background
:
#0D3177
;
background
:
#0D3177
;
border
:
.01rem
solid
#90A1B1
;
border
:
.01rem
solid
#90A1B1
;
color
:
#C0D3E6
;
color
:
#C0D3E6
;
}
}
.popup-info
.main
.right-item
.info-item
.bw-item
.fail
{
.popup-info
.main
.right-item
.info-item
.bw-item
.fail
{
background
:
rgba
(
147
,
24
,
24
,
.5
);
background
:
rgba
(
147
,
24
,
24
,
.5
);
border
:
.01rem
solid
#931818
;
border
:
.01rem
solid
#931818
;
color
:
#E7555C
;
color
:
#E7555C
;
...
@@ -825,13 +905,13 @@
...
@@ -825,13 +905,13 @@
margin-bottom
:
.1rem
;
margin-bottom
:
.1rem
;
}
}
.popup-info
.hoverInfo
.modification
{
.popup-info
.hoverInfo
.modification
{
border
:
.01rem
solid
#A76619
;
border
:
.01rem
solid
#A76619
;
color
:
#D99749
;
color
:
#D99749
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
#popup-info-change-list
.content
{
#popup-info-change-list
.content
{
box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
20px
;
padding
:
20px
;
font-size
:
18px
;
font-size
:
18px
;
...
@@ -839,25 +919,29 @@
...
@@ -839,25 +919,29 @@
}
}
#popup-info-change-list
.content
.table
{
#popup-info-change-list
.content
.table
{
height
:
100%
;
height
:
100%
;
overflow
:
auto
;
overflow
:
auto
;
}
}
#popup-info-change-list
.content
.table
::-webkit-scrollbar
{
#popup-info-change-list
.content
.table
::-webkit-scrollbar
{
width
:
10px
;
width
:
10px
;
height
:
10px
;
height
:
10px
;
}
}
#popup-info-change-list
.content
.table
::-webkit-scrollbar-thumb
{
#popup-info-change-list
.content
.table
::-webkit-scrollbar-thumb
{
background
:
rgba
(
0
,
0
,
0
,
0.4
);
background
:
rgba
(
0
,
0
,
0
,
0.4
);
border-radius
:
8px
;
border-radius
:
8px
;
}
}
#popup-info-change-list
.content
.table
::-webkit-scrollbar-track
{
#popup-info-change-list
.content
.table
::-webkit-scrollbar-track
{
background
:
rgba
(
42
,
93
,
197
,
0.3
);
background
:
rgba
(
42
,
93
,
197
,
0.3
);
border-radius
:
8px
;
border-radius
:
8px
;
}
}
#popup-info-change-list
.content
.table-head
{
#popup-info-change-list
.content
.table-head
{
height
:
50px
;
height
:
50px
;
color
:
#fff
;
color
:
#fff
;
background
:
rgb
(
17
,
56
,
131
);
background
:
rgb
(
17
,
56
,
131
);
...
@@ -867,22 +951,26 @@
...
@@ -867,22 +951,26 @@
#popup-info-change-list
.content
.table-body
tr
{
#popup-info-change-list
.content
.table-body
tr
{
height
:
50px
;
height
:
50px
;
color
:
#fff
;
color
:
#fff
;
}
}
#popup-info-change-list
.content
.table-body
tr
:nth-child
(
odd
)
{
#popup-info-change-list
.content
.table-body
tr
:nth-child
(
odd
)
{
background
:
rgba
(
17
,
56
,
131
,
.5
);
background
:
rgba
(
17
,
56
,
131
,
.5
);
}
}
#popup-info-change-list
.content
.table-body
tr
:nth-child
(
even
)
{
#popup-info-change-list
.content
.table-body
tr
:nth-child
(
even
)
{
background
:
rgba
(
17
,
56
,
131
,
.7
);
background
:
rgba
(
17
,
56
,
131
,
.7
);
}
}
#popup-info-change-list
.content
.table-body
td
{
#popup-info-change-list
.content
.table-body
td
{
text-align
:
center
;
text-align
:
center
;
font-weight
:
100
;
}
}
...
...
static/js/htjc.js
View file @
033fa492
...
@@ -12,7 +12,7 @@ var taskList = {
...
@@ -12,7 +12,7 @@ var taskList = {
dataType
:
"json"
,
dataType
:
"json"
,
data
:
{
data
:
{
keywords
:
$
(
"#rw-keywords"
).
val
(),
keywords
:
$
(
"#rw-keywords"
).
val
(),
date
:
$
(
"#rw-date"
).
val
(),
date
:
$
(
"#rw-date"
).
val
(),
page
:
1
,
page
:
1
,
limit
:
100
limit
:
100
},
},
...
@@ -293,7 +293,7 @@ var detail = {
...
@@ -293,7 +293,7 @@ var detail = {
data
:
[],
data
:
[],
ysjl_list
:
[],
ysjl_list
:
[],
sample_id
:
''
,
sample_id
:
''
,
selectedTab
:
'detail'
,
// detail=>数据详情
location=>检测定位
selectedTab
:
'data-detail'
,
// data-detail=>数据详情 test-
location=>检测定位
getData
:
function
(
project_id
,
sample_id
,
index
,
index2
)
{
getData
:
function
(
project_id
,
sample_id
,
index
,
index2
)
{
let
_this
=
this
;
let
_this
=
this
;
_this
.
project_id
=
project_id
;
_this
.
project_id
=
project_id
;
...
@@ -304,13 +304,15 @@ var detail = {
...
@@ -304,13 +304,15 @@ var detail = {
dataType
:
"json"
,
dataType
:
"json"
,
data
:
{
data
:
{
project_id
,
project_id
,
date
:
$
(
"#rw-date"
).
val
(),
date
:
$
(
"#rw-date"
).
val
(),
},
},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
console
.
log
(
data
,
'getData'
);
if
(
data
.
data
&&
data
.
data
.
length
>
0
)
{
if
(
data
.
data
&&
data
.
data
.
length
>
0
)
{
_this
.
setLeftData
(
data
.
data
,
sample_id
,
index
,
index2
);
_this
.
setLeftData
(
data
.
data
,
sample_id
,
index
,
index2
);
_this
.
setTab
();
_this
.
setTab
(
data
.
data
);
}
else
{
}
else
{
$
(
"#subrwList"
).
html
(
'<div class="noData">暂无数据</div>'
);
$
(
"#subrwList"
).
html
(
'<div class="noData">暂无数据</div>'
);
}
}
...
@@ -321,18 +323,19 @@ var detail = {
...
@@ -321,18 +323,19 @@ var detail = {
}
}
})
})
},
},
setTab
(){
setTab
(
data
)
{
detail
.
data
=
data
let
str
=
(
`
let
str
=
(
`
<div class="tabBox">
<div class="tabBox">
<div class="data-detail
${
this
.
selectedTab
===
'detail'
?
'actived'
:
''
}
" onclick="detail.changeTab('data-detail')" >数据详情</div>
<div class="data-detail
${
this
.
selectedTab
===
'data-detail'
?
'actived'
:
''
}
" onclick="detail.changeTab('data-detail')" >数据详情</div>
<div class="test-location
${
this
.
selectedTab
===
'location'
?
'actived'
:
''
}
" onclick="detail.changeTab('test-location')" >检测定位</div>
<div class="test-location
${
this
.
selectedTab
===
'test-location'
?
'actived'
:
''
}
" onclick="detail.changeTab('test-location')" >检测定位</div>
</div
</div
`
)
`
)
$
(
"#popup-info .tab"
).
html
(
str
);
$
(
"#popup-info .tab"
).
html
(
str
);
},
},
changeTab
(
val
){
changeTab
(
val
)
{
console
.
log
(
val
);
this
.
selectedTab
=
val
this
.
selectedTab
=
val
$
(
'.tabBox'
).
children
().
removeClass
(
'actived'
)
$
(
'.tabBox'
).
children
().
removeClass
(
'actived'
)
$
(
`.tabBox .
${
val
}
`
).
addClass
(
'actived'
)
$
(
`.tabBox .
${
val
}
`
).
addClass
(
'actived'
)
...
@@ -342,6 +345,10 @@ var detail = {
...
@@ -342,6 +345,10 @@ var detail = {
$
(
`#popup-info .test-location-main`
).
addClass
(
'hiddenImportant'
)
$
(
`#popup-info .test-location-main`
).
addClass
(
'hiddenImportant'
)
$
(
`#popup-info .
${
val
}
-main`
).
removeClass
(
'hiddenImportant'
)
$
(
`#popup-info .
${
val
}
-main`
).
removeClass
(
'hiddenImportant'
)
if
(
val
==
'test-location'
)
{
testLocationMap
.
setMap
()
}
...
@@ -379,8 +386,8 @@ var detail = {
...
@@ -379,8 +386,8 @@ var detail = {
if (sample_id) {
if (sample_id) {
detail.getsubRightData(sample_id, aindex, aindex2);
detail.getsubRightData(sample_id, aindex, aindex2);
sublistClick('subrwInfo-' + aindex);
sublistClick('subrwInfo-' + aindex);
let item = this.data[0];
$("#popup-info .head").html(`
$
{
item
.
project_no
?
'【'
+
item
.
project_no
+
'】'
:
''
}${
item
.
project_name
}
`
);
this.showPopup();
this.showPopup();
} else {
} else {
this.setRightData(0, 'subrwInfo-0');
this.setRightData(0, 'subrwInfo-0');
...
@@ -389,7 +396,7 @@ var detail = {
...
@@ -389,7 +396,7 @@ var detail = {
},
},
setRightData(index, id) {
setRightData(index, id) {
sublistClick(id);
sublistClick(id);
console
.
log
(
this
.
data
,
'this.data'
);
var item = this.data[index];
var item = this.data[index];
$("#subrwList .info-item").removeClass("active");
$("#subrwList .info-item").removeClass("active");
$("#subrwList .flex-item").removeClass("active");
$("#subrwList .flex-item").removeClass("active");
...
@@ -514,7 +521,9 @@ var detail = {
...
@@ -514,7 +521,9 @@ var detail = {
area: ['
13
rem
', '
75
%
'],
area: ['
13
rem
', '
75
%
'],
content: $('
#
popup
-
info
'),
content: $('
#
popup
-
info
'),
end: function () {
end: function () {
detail.changeTab('
data
-
detail
')
$("#popup-info").css('
display
', '
none
');
$("#popup-info").css('
display
', '
none
');
}
}
});
});
},
},
...
@@ -653,14 +662,14 @@ function mouseover(index, e) {
...
@@ -653,14 +662,14 @@ function mouseover(index, e) {
$("#hoverInfo").css("left", e.clientX + 10 + 'px').css("right", 'auto').css("top", e.clientY + 10 + 'px').removeClass("hidden");
$("#hoverInfo").css("left", e.clientX + 10 + 'px').css("right", 'auto').css("top", e.clientY + 10 + 'px').removeClass("hidden");
}
}
},
5
0);
},
3
0);
}
}
function mouseout() {
function mouseout() {
hoverInfoTime = setTimeout(() => {
hoverInfoTime = setTimeout(() => {
$("#hoverInfo").addClass("hidden").css("left", 0).css("right", 0).css("top", 0);
$("#hoverInfo").addClass("hidden").css("left", 0).css("right", 0).css("top", 0);
isHoverInfoModal = false
isHoverInfoModal = false
},
5
0);
},
3
0);
}
}
function listClick(id) {
function listClick(id) {
...
@@ -691,6 +700,155 @@ function sublistClick(id) {
...
@@ -691,6 +700,155 @@ function sublistClick(id) {
}
}
}
}
var testLocationMap = {
map: '',
markerObj: {},
isShowMarkerObj: {},
modalBoxTime: '',
setMap: function () {
this.map = new AMap.Map("test-location-main", {
viewMode: '2D', //默认使用 2D 模式
zoom: 11, //地图级别
mapStyle: 'amap://styles/d3ce37d9fe39b7cc5f08f48af52802a2',
center: [detail.data[0].project_mapx, detail.data[0].project_mapy], //地图中心点
});
this.setMarker()
this.setCircle()
this.markerObj = {}
this.isShowMarkerObj = {}
this.modalBoxTime = ''
},
setMarker: function () {
new AMap.Marker({
position: [detail.data[0].project_mapx, detail.data[0].project_mapy],
icon: new AMap.Icon({
size: new AMap.Size(28, 28),
imageSize: new AMap.Size(28, 28),
image: '../static/images/icon_dwi_san.png',
imageOffset: new AMap.Pixel(0, 0)
}),
map: this.map
});
for (let index = 0; index < detail.data.length; index++) {
let item = detail.data[index]
console.log(item, 'item');
let marker = new AMap.Marker({
position: [item.mapx, item.mapy],
icon: new AMap.Icon({
size: new AMap.Size(28, 28),
imageSize: new AMap.Size(28, 28),
image: '../static/images/icon_lv.gif',
imageOffset: new AMap.Pixel(0, 0)
}),
map: this.map
});
marker.on("mouseover", () => {
this.markerObj[index] = marker
marker.setLabel({
direction: "right",
offset: new AMap.Pixel(0, 0), //设置文本标注偏移量
content: `
<
div
class
=
"modalBox"
onmouseout
=
"testLocationMap.modalBoxMouseout(${index})"
onmouseover
=
"testLocationMap.modalBoxMouseover(${index})"
>
<
div
class
=
"taskNoBox"
>
<
img
class
=
"rwdImg"
src
=
"../static/images/icon_rwd.png"
/>
任务单:
$
{
item
.
task_no
}
</div>
<div class="countBox">
<div>已检测:
${
item
.
test_count
}
</div>
<div>强度不达标:
${
item
.
abnormal_count
}
</div>
<div>未检测:
${
item
.
untest_count
}
</div>
</div>
<div class="content">
<div class="modalBoxItem">开始时间:
${
item
.
test_begin_datetime
}
</div>
<div class="modalBoxItem">最近数据上传:
${
item
.
test_end_datetime
}
</div>
<div class="modalBoxItem">检测单位:
${
item
.
customer_name
}
</div>
${
item
.
sample_list
.
map
((
item2
)
=>
{
return
(
`<div class="modalBoxItem"><p>
${
item2
.
sample_name
}
</p><p class="desc
${
item2
.
test_status
==
1
?
'green'
:
item2
.
test_status
==
2
?
'red'
:
''
}
">
${
item2
.
test_status_str
}
</p></div>`
);
//0未检测 1已检测 2强度不达标
}).
join
(
''
)
}
<
/div>
<
/div>`, /
/
设置文本标注内容
}
);
});
marker.on("mouseout", () => {
if (this.isShowMarkerObj[index]) {
return;
}
this.modalBoxMouseout(index)
});
}
},
modalBoxMouseover: function (index) {
clearTimeout(this.modalBoxTime)
this.isShowMarkerObj[index] = true
},
modalBoxMouseout: function (index) {
clearTimeout(this.modalBoxTime)
this.modalBoxTime = setTimeout(() => {
this.markerObj[index].setLabel({
content: null, //设置文本标注内容
})
this.isShowMarkerObj[index] = false
}, 100)
},
setCircle: function () {
let centerMap = [detail.data[0].project_mapx, detail.data[0].project_mapy]
let arr = []
for (let index = 0; index < detail.data.length; index++) {
let item = detail.data[index]
let itemMap = [item.mapx, item.mapy]
arr.push(AMap.GeometryUtil.distance(centerMap, itemMap))
}
//设置圆的半径大小
let addRadius = Math.pow(10, Math.floor(Math.max(...arr)).toString().length)
let radius = Math.max(...arr) + addRadius;
let circle = new AMap.Circle({
center: centerMap, //圆心
radius: radius, //半径
borderWeight: 3, //描边的宽度
strokeColor: "#00FFA2", //轮廓线颜色
strokeOpacity: 1, //轮廓线透明度
strokeWeight: 1, //轮廓线宽度
fillOpacity: 0.2, //多边形填充透明度
strokeDasharray: [10, 10],
fillColor: "#00FFA2", //多边形填充颜色
zIndex: 50, //多边形覆盖物的叠加顺序
});
//圆形 Circle 对象添加到 Map
this.map.add(circle);
//根据覆盖物范围调整视野
this.map.setFitView([circle])
}
}
init();
init();
function init() {
function init() {
getHeader();
getHeader();
...
...
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