Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
road-demo
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
王健
road-demo
Commits
5f168ac5
提交
5f168ac5
authored
11月 27, 2021
作者:
王健
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
缝隙
上级
75a63020
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
48 行增加
和
11 行删除
+48
-11
App.vue
src/App.vue
+48
-11
没有找到文件。
src/App.vue
浏览文件 @
5f168ac5
...
@@ -111,10 +111,10 @@ export default {
...
@@ -111,10 +111,10 @@ export default {
tableData
:
[
tableData
:
[
{
{
dataType
:
"裂缝"
,
dataType
:
"裂缝"
,
startStake
:
"236
5
12"
,
startStake
:
"236
0
12"
,
startStakeCenter
:
"10"
,
startStakeCenter
:
"10"
,
endStake
:
"23
751
2"
,
endStake
:
"23
602
2"
,
endStakeCenter
:
"
30
"
,
endStakeCenter
:
"
5
"
,
dataHeight
:
"10"
,
dataHeight
:
"10"
,
dataWidth
:
"0"
,
dataWidth
:
"0"
,
},
},
...
@@ -271,14 +271,20 @@ export default {
...
@@ -271,14 +271,20 @@ export default {
// strokeStyle,
// strokeStyle,
// });
// });
}
else
if
(
data
.
dataType
===
"裂缝"
)
{
}
else
if
(
data
.
dataType
===
"裂缝"
)
{
// this.drowLine({
const
startx
=
// startx: 0,
this
.
boxStartx
+
(
data
.
startStake
-
this
.
startStake
)
*
this
.
ratio
;
// starty: this.center - this.lineHeight * (this.lineNumber / 2),
const
starty
=
this
.
center
-
data
.
startStakeCenter
*
this
.
ratio
;
// endx: this.boxWidth,
const
endx
=
// endy: this.center - this.lineHeight * (this.lineNumber / 2),
this
.
boxStartx
+
(
data
.
endStake
-
this
.
startStake
)
*
this
.
ratio
;
// lineWidth: 1,
const
endy
=
this
.
center
-
data
.
endStakeCenter
*
this
.
ratio
;
// strokeStyle: "#000",
this
.
drowGap
({
// });
startx
:
startx
,
starty
:
starty
,
endx
:
endx
,
endy
:
endy
,
lineWidth
:
1
,
strokeStyle
:
"#000"
,
});
}
}
});
});
},
},
...
@@ -357,6 +363,32 @@ export default {
...
@@ -357,6 +363,32 @@ export default {
this
.
ctx
.
stroke
();
this
.
ctx
.
stroke
();
this
.
ctx
.
closePath
();
this
.
ctx
.
closePath
();
},
},
drowGap
(
gap
)
{
const
{
startx
,
starty
,
endx
,
endy
}
=
gap
;
this
.
ctx
.
save
();
this
.
ctx
.
setLineDash
([]);
this
.
ctx
.
beginPath
();
this
.
ctx
.
moveTo
(
startx
,
starty
);
console
.
log
(
startx
,
starty
);
// console.log(this.getRandom(startx, endx));
console
.
log
(
endx
,
endy
);
// console.log(this.getRandom(starty, endy));
// this.ctx.lineTo(endx, endy);
for
(
var
i
=
0
;
i
<
1
;
i
++
)
{
this
.
ctx
.
quadraticCurveTo
(
this
.
getRandom
(
startx
,
endx
),
this
.
getRandom
(
starty
,
endy
),
this
.
getRandom
(
startx
,
endx
),
this
.
getRandom
(
starty
,
endy
)
);
}
this
.
ctx
.
quadraticCurveTo
(
537
,
236
,
endx
,
endy
);
this
.
ctx
.
lineWidth
=
4
;
this
.
ctx
.
strokeStyle
=
"#000"
;
this
.
ctx
.
stroke
();
this
.
ctx
.
closePath
();
},
drowText
()
{
drowText
()
{
this
.
ctx
.
font
=
"12px 微软雅黑"
;
this
.
ctx
.
font
=
"12px 微软雅黑"
;
this
.
ctx
.
fillStyle
=
"#000"
;
this
.
ctx
.
fillStyle
=
"#000"
;
...
@@ -380,6 +412,11 @@ export default {
...
@@ -380,6 +412,11 @@ export default {
const
b
=
Math
.
floor
(
Math
.
random
()
*
255
);
const
b
=
Math
.
floor
(
Math
.
random
()
*
255
);
return
"rgba("
+
r
+
","
+
g
+
","
+
b
+
",0.8)"
;
return
"rgba("
+
r
+
","
+
g
+
","
+
b
+
",0.8)"
;
},
},
getRandom
(
min
,
max
)
{
return
Math
.
floor
(
Math
.
random
()
*
(
max
-
min
))
===
min
?
min
+
1
:
Math
.
floor
(
Math
.
random
()
*
(
max
-
min
))
+
min
;
},
},
},
};
};
</
script
>
</
script
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论