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
76936d94
Commit
76936d94
authored
Jun 25, 2025
by
xinzhedeai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:po 动态test 数量4
parent
8ec065fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
8 deletions
+30
-8
index.vue
src/views/dataMonitor/jrx/history/index.vue
+30
-8
No files found.
src/views/dataMonitor/jrx/history/index.vue
View file @
76936d94
...
@@ -159,7 +159,7 @@ export default {
...
@@ -159,7 +159,7 @@ export default {
// Canvas绘制配置(支持批量扩展)
// Canvas绘制配置(支持批量扩展)
poConfigs
:
[
poConfigs
:
[
{
x
:
0
,
y
:
null
,
width
:
879
,
height
:
150
},
// 第一张po.png配置
{
x
:
0
,
y
:
null
,
width
:
879
,
height
:
150
},
// 第一张po.png配置
{
x
:
0
,
y
:
null
,
width
:
879
-
250
,
height
:
150
}
// 第二张po.png配置(宽度减少250px)
{
x
:
0
,
y
:
null
,
width
:
879
-
250
,
height
:
150
}
,
// 第二张po.png配置(宽度减少250px)
],
],
guanConfigs
:
[
guanConfigs
:
[
{
x
:
null
,
y
:
null
,
width
:
6
,
height
:
121
,
image
:
'
guanImage
'
},
// 第一张guan0.png
{
x
:
null
,
y
:
null
,
width
:
6
,
height
:
121
,
image
:
'
guanImage
'
},
// 第一张guan0.png
...
@@ -180,6 +180,28 @@ export default {
...
@@ -180,6 +180,28 @@ export default {
this
.
pageApi
.
created
&&
this
.
pageApi
.
created
();
this
.
pageApi
.
created
&&
this
.
pageApi
.
created
();
},
},
mounted
()
{
mounted
()
{
// 数据清洗
const
canvasH
=
600
this
.
poConfigs
=
[]
for
(
let
index
=
0
;
index
<
4
;
index
++
)
{
this
.
poConfigs
.
push
({
x
:
0
,
y
:
canvasH
-
((
index
+
1
)
*
150
),
width
:
879
-
(
index
*
250
),
height
:
150
})
// this.guanConfigs.push({
// x: null, y: null, width: 6, height: index==0?121:200, image: 'guanImage'
// })
}
// lineConfigs: [
// { points: [], color: 'red', lineWidth: 2 }, // 红色连接线配置
// { points: [], color: 'yellow', lineWidth: 2 } // 黄色连接线配置
// ]
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
loadData
();
this
.
loadData
();
});
});
...
@@ -232,11 +254,10 @@ export default {
...
@@ -232,11 +254,10 @@ export default {
this
.
ctx
.
save
();
this
.
ctx
.
save
();
this
.
ctx
.
setTransform
(
1
,
0
,
0
,
1
,
0
,
0
);
this
.
ctx
.
setTransform
(
1
,
0
,
0
,
1
,
0
,
0
);
// 动态计算y坐标(若未指定则默认画布底部-高度)
// 动态计算y坐标(若未指定则默认画布底部-高度)
const
y
=
config
.
y
?
config
.
y
:
(
this
.
canvas
.
height
-
config
.
height
);
this
.
ctx
.
drawImage
(
this
.
ctx
.
drawImage
(
this
.
poImage
,
this
.
poImage
,
config
.
x
,
config
.
x
,
y
,
config
.
y
,
config
.
width
,
config
.
width
,
config
.
height
config
.
height
);
);
...
@@ -308,12 +329,13 @@ export default {
...
@@ -308,12 +329,13 @@ export default {
this
.
drawBackground
();
this
.
drawBackground
();
// 2. 绘制po.png(遍历配置数组)
// 2. 绘制po.png(遍历配置数组)
console
.
log
(
this
.
poConfigs
,
'
poConfigs
'
)
this
.
poConfigs
.
forEach
((
config
,
index
)
=>
{
this
.
poConfigs
.
forEach
((
config
,
index
)
=>
{
// 第二张po.png的y坐标需要基于第一张计算(顶部对齐)
//
//
第二张po.png的y坐标需要基于第一张计算(顶部对齐)
if
(
index
===
1
)
{
//
if (index === 1) {
const
prevPo
=
this
.
poConfigs
[
0
];
//
const prevPo = this.poConfigs[0];
config
.
y
=
(
canvasHeight
-
prevPo
.
height
)
-
config
.
height
;
// 第一张顶部位置 - 自身高度
//
config.y = (canvasHeight - prevPo.height) - config.height; // 第一张顶部位置 - 自身高度
}
//
}
this
.
drawPoImage
(
config
);
this
.
drawPoImage
(
config
);
});
});
...
...
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