Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
V3-TailingPond
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
xinzhedeai
V3-TailingPond
Commits
ba8a07b1
Commit
ba8a07b1
authored
Jun 25, 2025
by
xinzhedeai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:po数量》4 《=7容器高度处理
parent
a7fbb709
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
13 deletions
+36
-13
index.vue
src/views/dataMonitor/jrx/history/index.vue
+36
-13
No files found.
src/views/dataMonitor/jrx/history/index.vue
View file @
ba8a07b1
...
...
@@ -12,23 +12,20 @@
</div>
<div
class=
"new-container"
style=
"display: flex"
>
<div
class=
"canvas-wrapper"
style=
"width: 1000px;
height: 600px
"
>
<div
class=
"canvas-wrapper"
style=
"width: 1000px;"
>
<!-- 替换为 Canvas 元素 -->
<canvas
ref=
"canvas"
id=
"mainCanvas"
width=
"1000"
height=
"600"
style=
"background: #f0f0f0"
></canvas>
</div>
<div
class=
"chart-wrapper"
style=
"padding-left: 0px;"
>
<!-- 图表容器780 -->
<div
ref=
"chartContainer"
style=
"width: 870px; height: 550px; margin-bottom: 20px;border:1px solid gainsboro;"
></div>
<!-- 图表操作区域(调整到最下方左侧) -->
<div
class=
"chart-btn-group"
>
<button
size=
"small"
...
...
@@ -180,32 +177,58 @@ export default {
this
.
pageApi
.
created
&&
this
.
pageApi
.
created
();
},
mounted
()
{
// 新增:动态调整Canvas尺寸 目前支持7层。
const
poCount
=
4
;
const
lineCount
=
5
let
canvasWidth
=
1000
;
// 默认宽度
let
canvasHeight
=
600
;
// 默认高度
if
(
poCount
>
4
)
{
canvasHeight
=
poCount
*
150
;
// 高度 = 个数 × 150px
// canvasWidth = 1000 + (poCount - 4) * 150; // 宽度 = 原宽度 + (个数-4)×150px
}
// 更新Canvas元素属性和样式
const
canvasEl
=
this
.
$refs
.
canvas
;
if
(
canvasEl
)
{
// 实际绘图区域尺寸(关键属性)
canvasEl
.
width
=
canvasWidth
;
canvasEl
.
height
=
canvasHeight
;
// 显示尺寸(与绘图区域保持一致)
canvasEl
.
style
.
width
=
`
${
canvasWidth
}
px`
;
canvasEl
.
style
.
height
=
`
${
canvasHeight
}
px`
;
}
// 数据清洗
const
canvasH
=
600
const
canvasW
=
1000
const
po_pad_right
=
180
// 第一个台阶距离画布的距离
const
po_pad_right
=
poCount
>
4
?
130
:
180
// 第一个台阶距离画布的距离
const
poH
=
150
const
line_color
=
[
'
red
'
,
'
yellow
'
,
'
green
'
,
'
blue
'
,
'
white
'
]
this
.
poConfigs
=
[]
this
.
guanConfigs
=
[]
this
.
lineConfigs
=
[]
for
(
let
index
=
0
;
index
<
4
;
index
++
)
{
for
(
let
index
=
0
;
index
<
poCount
;
index
++
)
{
// 坡数据数据格式处理
this
.
poConfigs
.
push
({
x
:
0
,
y
:
canvasH
-
((
index
+
1
)
*
poH
),
width
:
canvasW
-
((
index
+
1
)
*
po_pad_right
),
height
:
150
y
:
canvasH
eight
-
((
index
+
1
)
*
poH
),
width
:
canvasW
idth
-
((
index
+
1
)
*
po_pad_right
),
height
:
poH
})
// 管孔数据数据格式处理
this
.
guanConfigs
.
push
({
x
:
this
.
poConfigs
[
index
].
width
*
0.75
,
y
:
canvasH
-
(
this
.
poConfigs
[
index
].
height
*
(
index
+
1
))
+
30
,
width
:
6
,
height
:
index
==
0
?
100
:
200
,
image
:
'
guanImage
'
x
:
this
.
poConfigs
[
index
].
width
*
0.75
,
y
:
canvasHeight
-
(
this
.
poConfigs
[
index
].
height
*
(
index
+
1
))
+
30
,
width
:
6
,
height
:
index
==
0
?
100
:
200
,
image
:
'
guanImage
'
})
}
// 警戒线逻辑- 初始化4条线
for
(
let
index1
=
0
;
index1
<
5
;
index1
++
)
{
for
(
let
index1
=
0
;
index1
<
lineCount
;
index1
++
)
{
this
.
lineConfigs
.
push
({
// 设置
points
:
[],
color
:
line_color
[
index1
],
...
...
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