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
c91f80ca
Commit
c91f80ca
authored
Jun 27, 2025
by
xinzhedeai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:坡面数据为空画布清空处理。 po台阶与设备数据加工独立处理。
parent
0c191572
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
23 deletions
+46
-23
index.vue
src/views/dataMonitor/jrx/history/index.vue
+46
-23
No files found.
src/views/dataMonitor/jrx/history/index.vue
View file @
c91f80ca
...
@@ -248,6 +248,20 @@ export default {
...
@@ -248,6 +248,20 @@ export default {
});
});
},
},
methods
:
{
methods
:
{
/** 清空画布内容及配置 */
clearCanvas
()
{
if
(
this
.
ctx
)
{
// 清除画布绘制内容(基于当前坐标系)
this
.
ctx
.
save
();
this
.
ctx
.
setTransform
(
1
,
0
,
0
,
1
,
0
,
0
);
// 恢复默认坐标系
this
.
ctx
.
clearRect
(
0
,
0
,
this
.
canvas
.
width
,
this
.
canvas
.
height
);
// 清空整个画布
this
.
ctx
.
restore
();
}
// 重置配置数据(避免残留)
this
.
canvasDataReal
.
poConfigs
=
[];
this
.
canvasDataReal
.
guanConfigs
=
[];
this
.
canvasDataReal
.
lineConfigs
=
[];
},
getCanvasData
()
{
getCanvasData
()
{
const
params
=
{
...
this
.
form
.
query
};
const
params
=
{
...
this
.
form
.
query
};
request
({
request
({
...
@@ -256,16 +270,19 @@ export default {
...
@@ -256,16 +270,19 @@ export default {
params
,
params
,
}).
then
(
async
(
res
)
=>
{
}).
then
(
async
(
res
)
=>
{
const
data
=
res
.
body
;
const
data
=
res
.
body
;
console
.
log
(
"
接口数据
"
,
data
);
// 判断数据是否为空(根据实际接口返回结构调整)
if
(
!
data
.
length
)
{
// const isEmpty =
// 数据为空时清空画布
// !data.jrxStepsDtoList?.length || !data.equipmentDataList?.length;
this
.
clearCanvas
();
// this.canvasDataEmpty = isEmpty; // 更新空数据状态
return
;
}
// if (!isEmpty) {
await
this
.
handleCanvasData
(
data
);
console
.
log
(
"
剖面接口数据
"
,
data
);
this
.
initCanvas
();
console
.
table
(
JSON
.
parse
(
JSON
.
stringify
(
data
[
0
].
jrxStepsDtoList
)))
// }
console
.
table
(
JSON
.
parse
(
JSON
.
stringify
(
data
[
0
].
equipmentDataList
)))
await
this
.
handleCanvasData
(
data
);
this
.
initCanvas
();
});
});
},
},
handleCanvasData
(
list
=
[])
{
handleCanvasData
(
list
=
[])
{
...
@@ -297,27 +314,29 @@ export default {
...
@@ -297,27 +314,29 @@ export default {
//第一层台阶的开孔深度和设备图片相除的系数
//第一层台阶的开孔深度和设备图片相除的系数
const
sbHeightModulus
=
poumian
.
equipmentDataList
[
0
].
jrxTrepanning
;
// / 130;
const
sbHeightModulus
=
poumian
.
equipmentDataList
[
0
].
jrxTrepanning
;
// / 130;
for
(
let
index
=
0
;
index
<
poCount
;
index
++
)
{
// 坡数据数据格式处理
// 坡数据数据格式处理
poumian
.
jrxStepsDtoList
.
forEach
((
po
,
poIndex
)
=>
{
this
.
canvasDataReal
.
poConfigs
.
push
({
this
.
canvasDataReal
.
poConfigs
.
push
({
x
:
0
,
x
:
0
,
y
:
canvasHeight
-
(
i
ndex
+
1
)
*
poH
,
y
:
canvasHeight
-
(
poI
ndex
+
1
)
*
poH
,
width
:
canvasWidth
-
(
i
ndex
+
1
)
*
po_pad_right
,
width
:
canvasWidth
-
(
poI
ndex
+
1
)
*
po_pad_right
,
height
:
poH
,
height
:
poH
,
});
});
})
// 管孔数据数据格式处理
poumian
.
equipmentDataList
.
forEach
((
equipment
,
equipIndex
)
=>
{
const
po
=
this
.
canvasDataReal
.
poConfigs
[
equipIndex
]
// 管孔数据数据格式处理
// 管孔数据数据格式处理
this
.
canvasDataReal
.
guanConfigs
.
push
({
this
.
canvasDataReal
.
guanConfigs
.
push
({
x
:
this
.
canvasDataReal
.
poConfigs
[
index
].
width
*
0.75
,
x
:
po
.
width
*
0.75
,
y
:
y
:
canvasHeight
-
po
.
height
*
(
equipIndex
+
1
)
+
30
,
canvasHeight
-
this
.
canvasDataReal
.
poConfigs
[
index
].
height
*
(
index
+
1
)
+
30
,
width
:
6
,
width
:
6
,
height
:
height
:
equipment
.
jrxTrepanning
*
sbHeightModulus
,
poumian
.
equipmentDataList
[
index
].
jrxTrepanning
*
sbHeightModulus
,
image
:
"
guanImage
"
,
image
:
"
guanImage
"
,
});
});
}
})
// 警戒线逻辑- 初始话基本数据结构
// 警戒线逻辑- 初始话基本数据结构
for
(
let
index1
=
0
;
index1
<
lineCount
;
index1
++
)
{
for
(
let
index1
=
0
;
index1
<
lineCount
;
index1
++
)
{
...
@@ -345,7 +364,11 @@ export default {
...
@@ -345,7 +364,11 @@ export default {
});
});
});
});
console
.
log
(
"
this.canvasDataReal
"
,
this
.
canvasDataReal
);
console
.
log
(
"
坡面处理完毕数据
"
,
this
.
canvasDataReal
);
console
.
table
(
JSON
.
parse
(
JSON
.
stringify
(
this
.
canvasDataReal
.
poConfigs
)))
console
.
table
(
JSON
.
parse
(
JSON
.
stringify
(
this
.
canvasDataReal
.
guanConfigs
)))
console
.
table
(
JSON
.
parse
(
JSON
.
stringify
(
this
.
canvasDataReal
.
lineConfigs
)))
resolve
();
// 数据处理完成后触发resolve
resolve
();
// 数据处理完成后触发resolve
});
});
},
},
...
...
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