Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xcLab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
吴旭健
xcLab
Commits
80a7722a
提交
80a7722a
authored
3月 31, 2020
作者:
Your Name
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改选中项
上级
2ef56b9f
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
51 行增加
和
12 行删除
+51
-12
newApply.vue
src/components/dial/newApply.vue
+28
-9
labSystem.vue
src/views/labSystem.vue
+23
-3
没有找到文件。
src/components/dial/newApply.vue
浏览文件 @
80a7722a
...
...
@@ -5,7 +5,7 @@
<div
class=
"whole"
v-for=
"(item,index) in val "
>
<div
class=
"newApply-title"
>
<!--
<el-radio
v-model=
"tech"
:label=
"1"
>
{{
item
.
name
}}
</el-radio>
-->
<span
@
click=
"check(index)"
>
<i
:class=
"(i
sCheck==index
) ? 'isActive': ''"
></i>
</span>
<span
@
click=
"check(index)"
>
<i
:class=
"(i
ndex == isCheck - 1
) ? 'isActive': ''"
></i>
</span>
<div>
{{
item
.
name
}}
</div>
</div>
<div
class=
"newApply-content"
>
...
...
@@ -33,7 +33,7 @@ export default {
name
:
'newApply'
,
// import引入的组件需要注入到对象中才能使用
components
:
{},
props
:
[
'val'
,
'applyId'
],
props
:
[
'val'
,
'applyId'
,
'osId'
],
data
()
{
// 这里存放数据
return
{
...
...
@@ -49,11 +49,14 @@ export default {
},
check
(
i
)
{
console
.
log
(
'选中'
,
i
)
this
.
isCheck
=
i
;
console
.
log
(
this
.
isCheck
)
this
.
isCheck
=
i
+
1
console
.
log
(
this
.
isCheck
)
},
makeSure
()
{
let
a
=
this
.
applyId
;
let
b
=
this
.
isCheck
+
1
;
let
b
=
this
.
isCheck
;
let
obj
=
{
id
:
a
,
techId
:
b
...
...
@@ -61,9 +64,13 @@ export default {
this
.
$server
.
postMidify
(
obj
).
then
(
res
=>
{
console
.
log
(
'postMidify'
,
res
);
this
.
$emit
(
'on-close'
);
console
.
log
(
this
.
$parent
)
this
.
$emit
(
'on-closeWeb'
);
this
.
$emit
(
'on-project'
);
// this.$emit('on-websocket');
}).
catch
(
err
=>
{
console
.
log
(
err
)
this
.
$message
.
error
(
'请求失败'
)
...
...
@@ -79,12 +86,22 @@ export default {
},
'applyId'
:
function
(
applyId
)
{
console
.
log
(
'项目id'
,
applyId
)
}
},
'osId'
:
function
(
osId
)
{
console
.
log
(
'osIdid'
,
osId
)
this
.
isCheck
=
this
.
osId
},
},
//生命周期 - 创建完成(可以访问当前this实例)
created
()
{},
created
()
{
},
// 生命周期 - 挂载完成(可以访问DOM元素)
mounted
()
{},
mounted
()
{
console
.
log
(
this
.
osId
)
this
.
isCheck
=
this
.
osId
console
.
log
(
'122222'
,
this
.
isCheck
)
},
// 生命周期 - 创建之前
beforeCreate
()
{},
// 生命周期 - 挂载之前
...
...
@@ -92,7 +109,9 @@ export default {
// 生命周期 - 更新之前
beforeUpdate
()
{},
// 生命周期 - 更新之后
updated
()
{},
updated
()
{
// this.check(this.osId);
},
// 生命周期 - 销毁之前
beforeDestroy
()
{},
// 生命周期 - 销毁完成
...
...
src/views/labSystem.vue
浏览文件 @
80a7722a
...
...
@@ -128,7 +128,7 @@
</div>
<!--重新申请弹窗-->
<el-dialog
:visible
.
sync=
"applyModal"
width=
"0%"
>
<newApply
:val=
"applyMessage"
:applyId=
"applyId"
:osId=
"osId"
@
on-project=
"newProject()"
@
on-close=
"reset()"
></newApply>
<newApply
:val=
"applyMessage"
:applyId=
"applyId"
:osId=
"osId"
@
on-
closeWeb=
"websocketCosle"
@
on-websocket=
"newWebsocket()"
@
on-
project=
"newProject()"
@
on-close=
"reset()"
></newApply>
<img
src=
"../assets/img/close.png"
class=
"closeModel"
@
click=
"reset()"
>
</el-dialog>
...
...
@@ -168,7 +168,8 @@ export default {
jenkinsName
:
''
,
// webstock
logData
:
''
,
// 日志
data
:
''
,
osId
:
''
osId
:
''
,
techId
:
''
};
},
// 方法集合
...
...
@@ -193,6 +194,11 @@ export default {
this
.
pathSuffix
=
res
.
data
.
pathSuffix
this
.
jenkinsName
=
res
.
data
.
jenkinsName
this
.
copyWebsocket
(
res
.
data
.
jenkinsName
)
// localStorage.setItem('jenkinsName',this.jenkinsName);
// console.log(localStorage.getItem('jenkinsName'))
this
.
techId
=
res
.
data
.
techId
;
console
.
log
(
'66666666'
,
this
.
techId
)
}).
catch
(
err
=>
{
// console.log(err);
this
.
$message
.
error
(
'数据请求失败'
);
...
...
@@ -206,7 +212,8 @@ export default {
console
.
log
(
res
.
data
);
this
.
applyMessage
=
res
.
data
this
.
applyId
=
this
.
id
this
.
osId
=
this
.
os
.
id
this
.
osId
=
this
.
techId
console
.
log
(
'909090'
,
this
.
osId
)
// console.log('77777',this.applyId)
}).
catch
(
err
=>
{
// console.log(err)
...
...
@@ -258,11 +265,14 @@ export default {
},
// websocket
copyWebsocket
(
val
)
{
// console.log(this.val,this.close)
var
that
=
this
;
// Create WebSocket connection.
// console.log('this.jenkinsName2121',this.jenkinsName)
// const socket = new WebSocket('ws://' + baseUrl.WS_CONT + '/webServer/${this.jenkinsName}');
const
socket
=
new
WebSocket
(
`ws://
${
baseUrl
.
WS_CONT
}
/webServer/
${
val
}
`
);
this
.
WS
=
socket
;
// Connection opened
socket
.
addEventListener
(
'open'
,
function
(
event
)
{
socket
.
send
(
'Hello Server!'
);
...
...
@@ -282,6 +292,16 @@ export default {
newProject
(){
console
.
log
(
1
)
this
.
getProject
();
},
// newWebsocket(){
// console.log(99)
// this.copyWebsocket();
// },
websocketCosle
(
e
){
this
.
WS
.
close
()
// const socket = new WebSocket(`ws://${baseUrl.WS_CONT}/webServer/${this.jenkinsName}`);
// socket.close();
// this.copyWebsocket();
}
},
// 监听属性 类似于data概念
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论