Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-platform-ui
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
QA
qa-platform-ui
Commits
c332b908
Commit
c332b908
authored
Apr 20, 2021
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增jira钉钉通知
parent
9a45be2d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
244 additions
and
1 deletion
+244
-1
jira.js
src/api/jira.js
+33
-0
main.js
src/main.js
+3
-1
index.js
src/router/index.js
+5
-0
Notify.vue
src/views/jira/Notify.vue
+197
-0
menu.json
src/views/layout/leftAside/menu.json
+6
-0
No files found.
src/api/jira.js
0 → 100644
View file @
c332b908
import
request
from
'
@/utils/holmesRequest
'
export
function
getProjectRobotList
(
queryInfo
)
{
return
request
({
url
:
'
/jira/list/robot
'
,
method
:
'
get
'
,
params
:
queryInfo
})
}
export
function
addProjectRobot
(
data
)
{
return
request
({
url
:
'
/jira/add/robot
'
,
method
:
'
post
'
,
data
})
}
export
function
modifyProjectRobot
(
data
)
{
return
request
({
url
:
'
/jira/modify/robot
'
,
method
:
'
post
'
,
data
})
}
export
function
delProjectRobot
(
queryInfo
)
{
return
request
({
url
:
'
/jira/delete/robot
'
,
method
:
'
get
'
,
params
:
queryInfo
})
}
src/main.js
View file @
c332b908
...
@@ -39,7 +39,8 @@ import {
...
@@ -39,7 +39,8 @@ import {
TabPane
,
TabPane
,
Switch
,
Switch
,
RadioGroup
,
RadioGroup
,
Radio
Radio
,
MessageBox
}
from
'
element-ui
'
}
from
'
element-ui
'
Vue
.
config
.
productionTip
=
false
Vue
.
config
.
productionTip
=
false
...
@@ -49,6 +50,7 @@ Vue.prototype.$echarts = echarts
...
@@ -49,6 +50,7 @@ Vue.prototype.$echarts = echarts
Vue
.
prototype
.
$message
=
Message
Vue
.
prototype
.
$message
=
Message
Vue
.
prototype
.
$loading
=
Loading
Vue
.
prototype
.
$loading
=
Loading
Vue
.
prototype
.
$messageBox
=
MessageBox
// axios.defaults.baseURL = 'https://qa-platform-pre.liangkebang.net'
// axios.defaults.baseURL = 'https://qa-platform-pre.liangkebang.net'
// axios.defaults.baseURL = 'http://localhost:8082'
// axios.defaults.baseURL = 'http://localhost:8082'
...
...
src/router/index.js
View file @
c332b908
...
@@ -14,6 +14,7 @@ import Mock from '../views/mock/Mock'
...
@@ -14,6 +14,7 @@ import Mock from '../views/mock/Mock'
import
kdspDecrypt
from
'
../views/effect/KdspDecrypt
'
import
kdspDecrypt
from
'
../views/effect/KdspDecrypt
'
import
JenkinsBuildInfo
from
'
../views/effect/JenkinsBuildInfo
'
import
JenkinsBuildInfo
from
'
../views/effect/JenkinsBuildInfo
'
import
LoginWhiteList
from
'
../views/effect/LoginWhiteList
'
import
LoginWhiteList
from
'
../views/effect/LoginWhiteList
'
import
JiraNotify
from
'
../views/jira/Notify
'
Vue
.
use
(
Router
)
Vue
.
use
(
Router
)
...
@@ -76,6 +77,10 @@ const router = new Router({
...
@@ -76,6 +77,10 @@ const router = new Router({
{
{
'
path
'
:
'
/effect/whitelist
'
,
'
path
'
:
'
/effect/whitelist
'
,
component
:
LoginWhiteList
component
:
LoginWhiteList
},
{
'
path
'
:
'
/effect/jira/notify
'
,
component
:
JiraNotify
}
}
]
]
}
}
...
...
src/views/jira/Notify.vue
0 → 100644
View file @
c332b908
<
template
>
<div>
<el-card>
<!-- 顶部搜索栏 -->
<div
class=
"top"
>
<el-button
type=
"primary"
icon=
"el-icon-circle-plus-outline"
@
click=
"addDialogVisible = true"
>
新增
</el-button>
</div>
<el-table
:data=
"dingRobotList"
border
style=
"width: 100%"
>
<!--
<el-table-column
prop=
"id"
label=
"编号"
width=
"80px"
></el-table-column>
-->
<el-table-column
type=
"index"
label=
"序号"
width=
"50px"
></el-table-column>
<el-table-column
prop=
"projectName"
label=
"项目名"
width=
"250px"
></el-table-column>
<el-table-column
prop=
"dingUrl"
label=
"钉钉url"
></el-table-column>
<el-table-column
prop=
"creator"
label=
"创建人"
width=
"100px"
>
</el-table-column>
<el-table-column
prop=
"createTime"
label=
"创建时间"
width=
"180px"
></el-table-column>
<el-table-column
label=
"操作"
width=
"200px"
>
<slot
slot-scope=
"scope"
>
<el-button
type=
"primary"
@
click=
"openEditDialog(scope.row)"
>
编辑
</el-button>
<el-button
type=
"danger"
@
click=
"delProjectRobot(scope.row.id)"
>
删除
</el-button>
</slot>
</el-table-column>
<!--
<el-table-column
prop=
"updateTime"
label=
"更新时间"
></el-table-column>
-->
</el-table>
</el-card>
<!-- 分页 -->
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page.sync=
"queryInfo.pageNum"
:page-size=
"queryInfo.pageSize"
layout=
"total, prev, pager, next"
:total=
"totalNum"
></el-pagination>
<!-- 新增对话框 -->
<el-dialog
title=
"新增robot"
:visible.sync=
"addDialogVisible"
width=
"60%"
@
close=
"closeAddDialog"
>
<el-form
ref=
"addRobotFormRef"
:rules=
"formRules"
:model=
"robotForm"
label-width=
"150px"
>
<el-form-item
label=
"项目名称"
prop=
"projectName"
>
<el-input
v-model=
"robotForm.projectName"
placeholder=
"请输入项目名称"
></el-input>
</el-form-item>
<el-form-item
label=
"钉钉通知地址"
prop=
"dingUrl"
>
<el-input
v-model=
"robotForm.dingUrl"
placeholder=
"请输入钉钉通知地址"
type=
"textarea"
></el-input>
</el-form-item>
<el-form-item
label=
"创建人"
>
<el-input
v-model=
"robotForm.creator"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"addDialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"addRobotProject"
>
保 存
</el-button>
</span>
</el-dialog>
<!-- 编辑对话框 -->
<el-dialog
title=
"编辑"
:visible.sync=
"editDialogVisible"
width=
"60%"
@
close=
"closeEditDialog"
>
<el-form
ref=
"editRobotFormRef"
:rules=
"formRules"
:model=
"editRobotForm"
label-width=
"150px"
>
<el-form-item
label=
"项目名称"
prop=
"projectName"
>
<el-input
v-model=
"editRobotForm.projectName"
placeholder=
"请输入项目名称"
></el-input>
</el-form-item>
<el-form-item
label=
"钉钉通知地址"
prop=
"dingUrl"
>
<el-input
v-model=
"editRobotForm.dingUrl"
placeholder=
"请输入钉钉通知地址"
type=
"textarea"
></el-input>
</el-form-item>
<el-form-item
label=
"创建人"
>
<el-input
v-model=
"editRobotForm.creator"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"addDialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"editRobotProject"
>
保 存
</el-button>
</span>
</el-dialog>
</div>
</
template
>
<
script
>
import
{
getProjectRobotList
,
addProjectRobot
,
modifyProjectRobot
,
delProjectRobot
}
from
'
@/api/jira
'
export
default
{
data
()
{
return
{
dingRobotList
:
[],
queryInfo
:
{
pageNum
:
1
,
pageSize
:
10
},
totalNum
:
0
,
addDialogVisible
:
false
,
editDialogVisible
:
false
,
robotForm
:
{
projectName
:
''
,
dingUrl
:
''
,
creator
:
''
},
editRobotForm
:
{},
delRobotParams
:
{
projectRobotId
:
''
},
formRules
:
{
projectName
:
[
{
required
:
true
,
message
:
'
请输入项目名称
'
,
trigger
:
'
blur
'
}
],
dingUrl
:
[
{
required
:
true
,
message
:
'
请输入钉钉机器人url
'
,
trigger
:
'
blur
'
}
]
}
}
},
methods
:
{
getProjectRobotList
()
{
getProjectRobotList
(
this
.
queryInfo
).
then
((
resp
)
=>
{
this
.
dingRobotList
=
resp
.
data
.
data
.
list
this
.
totalNum
=
resp
.
data
.
data
.
total
})
},
// 新增
addRobotProject
()
{
addProjectRobot
(
this
.
robotForm
).
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
addDialogVisible
=
false
this
.
getProjectRobotList
()
return
this
.
$message
.
success
(
'
新增成功!
'
)
}
else
if
(
resp
.
data
.
data
===
false
)
{
return
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
},
// 编辑
editRobotProject
()
{
modifyProjectRobot
(
this
.
editRobotForm
).
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
editDialogVisible
=
false
this
.
getProjectRobotList
()
return
this
.
$message
.
success
(
'
修改成功!
'
)
}
else
if
(
resp
.
data
.
data
===
false
)
{
return
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
},
// 删除
delProjectRobot
(
robotId
)
{
this
.
delRobotParams
.
projectRobotId
=
robotId
this
.
$messageBox
.
confirm
(
'
此操作将永久删除, 是否继续?
'
,
'
提示
'
,
{
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
})
.
then
(()
=>
{
delProjectRobot
(
this
.
delRobotParams
).
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
$message
.
success
(
'
删除成功!
'
)
return
this
.
getProjectRobotList
()
}
else
if
(
resp
.
data
.
data
===
false
)
{
return
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
})
.
catch
(()
=>
{
this
.
$message
({
type
:
'
info
'
,
message
:
'
已取消删除
'
})
})
},
handleSizeChange
(
newSize
)
{
this
.
queryInfo
.
pageSize
=
newSize
this
.
getProjectRobotList
()
},
handleCurrentChange
(
newPage
)
{
this
.
queryInfo
.
pageNum
=
newPage
this
.
getProjectRobotList
()
},
openEditDialog
(
projectRobot
)
{
this
.
editDialogVisible
=
true
this
.
editRobotForm
=
projectRobot
},
closeAddDialog
()
{
this
.
$refs
.
addRobotFormRef
.
resetFields
()
},
closeEditDialog
()
{
this
.
$refs
.
editRobotFormRef
.
resetFields
()
}
},
created
()
{
this
.
getProjectRobotList
()
}
}
</
script
>
<
style
lang=
"less"
scoped
>
.el-input {
width: 300px;
margin-right: 20px;
}
.top {
margin-bottom: 20px;
}
</
style
>
src/views/layout/leftAside/menu.json
View file @
c332b908
...
@@ -79,6 +79,12 @@
...
@@ -79,6 +79,12 @@
"title"
:
"登录白名单"
,
"title"
:
"登录白名单"
,
"icon"
:
"el-icon-coffee"
,
"icon"
:
"el-icon-coffee"
,
"path"
:
"/effect/whitelist"
"path"
:
"/effect/whitelist"
},
{
"id"
:
4
,
"title"
:
"jira-钉钉通知"
,
"icon"
:
"el-icon-ice-tea"
,
"path"
:
"/effect/jira/notify"
}
}
]
]
}
}
...
...
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