Toggle navigation
Toggle navigation
This project
Loading...
Sign in
monitor_v3
/
hg-monitor-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
王涛
3 years ago
Commit
5ab89d34c2f8dd10f6f4384de4e5df705fa5d358
2 parents
67f6367c
0e5bfefe
Merge branch 'master-v32-lushangqing' into 'master'
故障联调 基础环境增加弹框功能 See merge request
!279
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
652 additions
and
147 deletions
hg-monitor-web-zj/src/main/resources/static/vue3/public/css/faultDiagnosis.css
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/faultDiagnosis/components/APM/index.js
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/faultDiagnosis/components/applicationMoni/index.js
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/faultDiagnosis/components/basicEnvironment/index.html
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/faultDiagnosis/components/basicEnvironment/index.js
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/faultDiagnosis/components/basicEnvironmentAdd/index.html
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/faultDiagnosis/components/basicEnvironmentAdd/index.js
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/faultDiagnosis/components/diagnosis/index.html
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/faultDiagnosis/components/diagnosis/index.js
hg-monitor-web-zj/src/main/resources/static/vue3/public/css/faultDiagnosis.css
View file @
5ab89d3
...
...
@@ -436,6 +436,9 @@
width
:
30px
;
height
:
30px
;
}
.icon-step
img
{
width
:
100%
;
}
.cursorClass
{
cursor
:
pointer
;
}
...
...
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/faultDiagnosis/components/APM/index.js
View file @
5ab89d3
...
...
@@ -160,21 +160,32 @@ export default {
if
(
proxy
.
count
==
0
){
proxy
.
$global
.
showMsg
(
'暂无配置数据'
,
'warning'
);
}
else
{
proxy
.
$http
.
post
(
'/api-web/fault/conf/apm/saveOrUpdate'
,
params
,
function
(
res
){
if
(
res
&&
res
.
success
){
proxy
.
$global
.
showMsg
(
'添加成功'
,
'success'
);
proxy
.
targetId
=
res
.
src
;
proxy
.
saveModel
();
// proxy.APMVisible=false;
}
else
{
proxy
.
$global
.
showMsg
(
'添加失败'
,
'warning'
);
proxy
.
$http
.
post
(
'/api-web/fault/conf/apm/saveOrUpdate'
,
params
,
function
(
res
){
if
(
res
&&
res
.
success
){
if
(
res
.
count
==
0
){
proxy
.
$global
.
showMsg
(
res
.
msg
,
'warning'
);
}
else
{
proxy
.
$global
.
showMsg
(
'添加成功'
,
'success'
);
proxy
.
targetId
=
res
.
str
;
proxy
.
saveModel
();
// proxy.APMVisible=false;
}
}
else
{
proxy
.
$global
.
showMsg
(
'添加失败'
,
'warning'
);
}
})
}
})
}}
//表格全选事件
let
selectionChange
=
(
val
)
=>
{
proxy
.
tableDataList
.
map
((
v
,
i
)
=>
{
v
.
checked
=
false
;
})
let
selectData
=
val
;
if
(
selectData
.
length
>
0
){
selectData
.
map
((
item
,
index
)
=>
{
...
...
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/faultDiagnosis/components/applicationMoni/index.js
View file @
5ab89d3
...
...
@@ -8,18 +8,7 @@ export default {
titleName
:
'应用配置'
,
// applicationMonitorVisible: true,
columns
:[
/*{
prop: 'busTypeName',
label: '业务系统',
sortable: true,
align: 'center',
},*/
/*{
prop: 'streamId',
label: '链路id',
sortable: true,
align: 'center',
},*/
{
prop
:
'streamName'
,
label
:
'链路名称'
,
...
...
@@ -139,29 +128,42 @@ export default {
proxy
.
$global
.
showMsg
(
'暂无配置'
,
'warning'
);
}
else
{
proxy
.
isLoading
=
true
;
let
params
=
{
busId
:
proxy
.
bizId
,
targetId
:
proxy
.
targetId
,
}
proxy
.
$http
.
post
(
'/api-web/fault/conf/npm/AddAllNpm'
,
params
,
function
(
res
){
if
(
res
&&
res
.
success
){
proxy
.
$global
.
showMsg
(
'添加成功'
,
'success'
);
proxy
.
targetId
=
res
.
str
;
proxy
.
saveModel
();
// proxy.applicationMonitorVisible=false;
if
(
res
.
count
==
0
){
proxy
.
$global
.
showMsg
(
res
.
msg
,
'warning'
);
}
else
{
proxy
.
$global
.
showMsg
(
'添加成功'
,
'success'
);
proxy
.
targetId
=
res
.
str
;
proxy
.
saveModel
();
// proxy.applicationMonitorVisible=false;
}
}
else
{
proxy
.
$global
.
showMsg
(
'添加失败'
,
'warning'
);
}
proxy
.
isLoading
=
false
;
},
function
(
err
){
proxy
.
isLoading
=
false
;
})
}
}
//表格全选事件
let
selectionChange
=
(
val
)
=>
{
proxy
.
tableDataList
.
map
((
v
,
i
)
=>
{
v
.
checked
=
false
;
})
let
selectData
=
val
;
if
(
selectData
.
length
>
0
){
selectData
.
map
((
item
,
index
)
=>
{
...
...
@@ -177,6 +179,7 @@ export default {
v
.
checked
=
false
;
})
}
console
.
log
(
"selectchange"
,
val
,
proxy
.
tableDataList
)
}
//添加选中的
...
...
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/faultDiagnosis/components/basicEnvironment/index.html
View file @
5ab89d3
...
...
@@ -34,10 +34,10 @@
</el-row>
<el-row
class=
"margin-bottom-50"
>
<el-col
:span=
"24"
class=
"overflow-scroll-y"
>
<cm-table-page
:columns=
"columns"
:dataList=
"tableDataList"
@
loaddata=
"loadTableDataList"
<cm-table-page
v-if=
"tableDataList"
:columns=
"columns"
:dataList=
"tableDataList"
@
loaddata=
"loadTableDataList"
:showIndex=
"true"
:total=
"count"
:showBorder=
"true"
:loading=
"false"
:pageSize=
"pageSize"
:showPage=
"true"
:showTools=
"
isDetail
"
:height=
"(height - 500)"
>
:showPage=
"true"
:showTools=
"
true
"
:height=
"(height - 500)"
>
<!-- <template #default="{row,prop,column}">
<div v-if="prop == 'kpiName'" class="list-data">
<span class="list-data-text">{{row.kpiName }}</span>
...
...
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/faultDiagnosis/components/basicEnvironment/index.js
View file @
5ab89d3
...
...
@@ -2,7 +2,7 @@ export default {
name
:
'basicEnvironment'
,
template
:
''
,
components
:
{},
props
:[
'propsData'
],
props
:[
'propsData'
,
'isBaseDetail'
],
data
()
{
return
{
columns
:[
...
...
@@ -42,37 +42,7 @@ export default {
width
:
'150'
}
],
environmentTableData
:
[
{
name
:
'服务器'
,
address
:
'CPU使用率,内存使用率,文件系统使用率'
,
},
{
name
:
'服务器'
,
address
:
'CPU使用率,内存使用率,文件系统使用率'
,
},
{
name
:
'服务器'
,
address
:
'CPU使用率,内存使用率,文件系统使用率'
,
},
{
name
:
'服务器'
,
address
:
'CPU使用率,内存使用率,文件系统使用率'
,
},
{
name
:
'服务器'
,
address
:
'CPU使用率,内存使用率,文件系统使用率'
,
},
{
name
:
'服务器'
,
address
:
'CPU使用率,内存使用率,文件系统使用率'
,
},
{
name
:
'服务器'
,
address
:
'CPU使用率,内存使用率,文件系统使用率'
,
},
],
//基础环境表格数据
}
},
computed
:
{},
...
...
@@ -130,11 +100,18 @@ export default {
proxy
.
targetId
=
props
.
propsData
.
targetId
;
proxy
.
busTypeArr
=
[
props
.
propsData
.
bizId
];
}
if
(
proxy
.
targetId
){
proxy
.
isDetail
=
true
;
}
else
{
proxy
.
isDetail
=
false
;
}
console
.
log
(
"*"
,
props
.
propsData
,
proxy
.
bizId
,
proxy
.
busTypeArr
)
}
// 监听编辑状态
Vue
.
watch
(()
=>
props
.
propsData
.
bizId
,
(
newValue
,
oldVlaue
)
=>
{
Vue
.
watch
(()
=>
[
props
.
propsData
.
bizId
,
props
.
isBaseDetail
],
([
newValue
,
newValueDetail
],
[
oldValue
,
oldValueDetail
])
=>
{
console
.
log
(
'newValueDetail'
,
newValueDetail
)
proxy
.
isDetail
=
newValueDetail
;
proxy
.
bizId
=
newValue
;
proxy
.
resTypeArr
=
''
;
proxy
.
setBizId
();
...
...
@@ -154,7 +131,32 @@ export default {
proxy
.
pageSize
=
limit
;
proxy
.
getEnvironmentData
()
}
//获取基础环境资源列表数据
let
getEnvironmentData
=
()
=>
{
let
params
=
{
targetId
:
proxy
.
targetId
,
// busId:proxy.bizId,
// resId:proxy.resTypeArr,
page
:
proxy
.
page
,
pageSize
:
proxy
.
pageSize
}
console
.
log
(
"*/*/*"
,
proxy
.
targetId
)
proxy
.
$http
.
get
(
'/api-web/fault/conf/base/getFaultBaseAllResInfo'
,
params
,
function
(
res
){
if
(
res
&&
res
.
data
){
proxy
.
count
=
res
.
count
;
proxy
.
tableDataList
=
res
.
data
;
proxy
.
$emit
(
'baseCount'
,
proxy
.
count
);
}
})
}
return
{
getEnvironmentData
,
loadTableDataList
,
page
,
pageSize
,
...
...
@@ -181,21 +183,7 @@ export default {
},
methods
:
{
//取消节点列表配置
cancleList
(){
this
.
APMVisible
=
false
;
},
//保存节点添加配置
saveList
(){
this
.
APMVisible
=
false
;
},
//关闭弹框
closeDialog
(){
this
.
$emit
(
'callbackLog'
,
'base'
);
},
//删除表格指标
deleteItem
(
item
){
let
that
=
this
;
...
...
@@ -215,39 +203,7 @@ export default {
})
},
//获取基础环境资源列表数据
getEnvironmentData
(){
let
that
=
this
;
let
params
=
{
busId
:
this
.
bizId
,
resId
:
this
.
resTypeArr
,
page
:
this
.
page
,
pageSize
:
this
.
pageSize
}
console
.
log
(
"*/*/*"
,
this
.
targetId
)
if
(
this
.
targetId
){
//详情页面
this
.
isDetail
=
true
;
this
.
$http
.
get
(
'/api-web/fault/conf/base/getFaultBaseAllResInfo'
,
params
,
function
(
res
){
if
(
res
&&
res
.
data
){
that
.
count
=
res
.
count
;
that
.
tableDataList
=
res
.
data
;
that
.
$emit
(
'baseCount'
,
that
.
count
);
}
})
}
else
{
this
.
isDetail
=
false
;
this
.
$http
.
get
(
'/api-web/fault/base/config/page'
,
params
,
function
(
res
){
if
(
res
&&
res
.
data
){
that
.
count
=
res
.
count
;
that
.
tableDataList
=
res
.
data
;
that
.
$emit
(
'baseCount'
,
that
.
count
);
}
})
}
}
...
...
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/faultDiagnosis/components/basicEnvironmentAdd/index.html
0 → 100644
View file @
5ab89d3
<cm-dialog
:title=
"titleName"
width=
"90%"
:showDialogVisible=
"baseVisible"
@
hidedialog=
"closeDialog"
:showFooter=
"false"
>
<template
v-slot
>
<el-row>
<el-col
:span=
"24"
>
<div
class=
"set-add-div margin-30"
>
<el-row>
<el-col
:span=
"24"
>
<div
class=
"flex-div-start margin-top-bottom-10"
>
<!-- <span class="fault-book-input-text context-select-text">选择类型</span>-->
<!-- <el-select class="margin-right-10" v-model="busTypeArr" filterable clearable collapse-tags placeholder="从业务选择">
<el-option
v-for="item in busTypeList"
:label="item.busTypeName" :value="item.busId"></el-option>
</el-select>-->
<!--<el-dropdown class="margin-right-10">
<cm-res-type-tree-input multiple clearable collapseTags @callback="getResType"/>
</el-dropdown>
-->
<!--<el-select class="margin-right-10" v-model="resTypeArr" @change="changeRes" filterable clearable collapse-tags placeholder="从资源选择">
<el-option
v-for="item in resTypeList"
:label="item.resName" :value="item.resId"></el-option>
</el-select>-->
<!--<el-input style="width:160px;" class="margin-right-10" v-model="keyWords" placeholder="输入关键字" />-->
<div
class=
"flex-div-start"
>
<!-- <el-button type="primary" @click="onReset()">重置</el-button>
<el-button type="primary" @click="onBtnSearch()" style="margin-left: 10px">查询</el-button>-->
<el-button
type=
"primary"
:disabled=
"isLoading"
@
click=
"saveAll()"
style=
"margin-left: 10px"
>
批量添加
</el-button>
<el-button
type=
"primary"
:disabled=
"isLoading"
@
click=
"saveAlldata()"
style=
"margin-left: 10px"
>
全部添加
</el-button>
</div>
</div>
</el-col>
</el-row>
<el-row
class=
"margin-bottom-50"
>
<el-col
:span=
"24"
class=
"overflow-scroll-y"
>
<cm-table-page
v-if=
"tableDataList"
:columns=
"columns"
:dataList=
"tableDataList"
@
loaddata=
"loadTableDataList"
:showIndex=
"true"
:total=
"count"
:showSelection=
"true"
@
selectionChange=
"selectionChange"
:showBorder=
"true"
:loading=
"false"
:pageSize=
"pageSize"
:showPage=
"true"
:showTools=
"true"
:height=
"(height - 500)"
>
<!-- <template #default="{row,prop,column}">
<div v-if="prop == 'kpiName'" class="list-data">
<span class="list-data-text">{{row.kpiName }}</span>
<img :id="row.index" @click="deleteItem(row)" src="./src/assets/images/faultDiagnosis/icon-item-delete.png" class="img-delete cursorClass">
</div>
</template>-->
<template
#
tools=
"{scope}"
>
<el-button
type=
"text"
size=
"small"
@
click
.
prevent=
"addRes(scope.row,scope.$index)"
>
<i
class=
"el-icon-plus"
/>
添加
</el-button>
</template>
</cm-table-page>
</el-col>
</el-row>
</div>
</el-col>
</el-row>
<div
class=
"margin-top flex-center position-bottom"
>
<el-button
@
click=
"cancleList"
>
取消
</el-button>
<!-- <el-button @click="saveList" type="primary">保存</el-button>-->
</div>
</template>
</cm-dialog>
...
...
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/faultDiagnosis/components/basicEnvironmentAdd/index.js
0 → 100644
View file @
5ab89d3
export
default
{
name
:
'basicEnvironmentAdd'
,
template
:
''
,
components
:
{},
props
:[
'propsData'
,
'isDisplay'
],
data
()
{
return
{
columns
:[
{
prop
:
'resTypeName'
,
label
:
'资源类型'
,
sortable
:
true
,
align
:
'center'
,
width
:
'120'
},
{
prop
:
'resName'
,
label
:
'资源名称'
,
sortable
:
true
,
align
:
'center'
,
},
{
prop
:
'ipAddr'
,
label
:
'ip地址'
,
sortable
:
true
,
align
:
'center'
,
width
:
'150'
},
{
prop
:
'kpiName'
,
label
:
'指标名称'
,
sortable
:
true
,
align
:
'center'
,
width
:
'180'
},
{
prop
:
'flag'
,
label
:
'指标标识'
,
sortable
:
true
,
align
:
'center'
,
width
:
'150'
}
]
}
},
computed
:
{},
setup
(
props
){
const
{
proxy
}
=
Vue
.
getCurrentInstance
();
let
id
=
proxy
.
$global
.
getQueryVariable
(
'configId'
)
;
let
config
=
Vue
.
ref
(
id
==
false
?
null
:
id
);
let
count
=
Vue
.
ref
(
0
);
let
tableDataList
=
Vue
.
ref
([]);
let
resTypeArr
=
Vue
.
ref
();
let
kpiTypeArr
=
Vue
.
ref
([]);
let
busTypeArr
=
Vue
.
ref
([]);
let
keyWords
=
Vue
.
ref
(
''
);
let
resTypeList
=
Vue
.
ref
([]);
let
kpiList
=
Vue
.
ref
([]);
let
busTypeList
=
Vue
.
ref
([]);
let
bizId
=
Vue
.
ref
();
//所属业务id
let
targetId
=
Vue
.
ref
();
//所属模块id
let
page
=
Vue
.
ref
(
1
);
//当前页
let
pageSize
=
Vue
.
ref
(
10
);
//每页显示条数
//是否是详情页面
let
isDetail
=
Vue
.
ref
(
false
);
let
titleName
=
Vue
.
ref
(
'基础环境配置'
);
let
modleId
=
Vue
.
ref
();
//模块id
let
faultConfId
=
Vue
.
ref
();
let
bizName
=
Vue
.
ref
();
let
name
=
Vue
.
ref
();
let
baseVisible
=
Vue
.
ref
(
false
);
// 监听编辑状态
Vue
.
watch
(()
=>
props
.
isDisplay
,(
newValue
,
oldValue
)
=>
{
console
.
log
(
"base"
,
newValue
)
proxy
.
baseVisible
=
newValue
;
if
(
newValue
){
proxy
.
setBizId
();
proxy
.
getEnvironmentData
();
}
})
let
init
=
()
=>
{
let
params
=
{
busId
:
proxy
.
bizId
}
proxy
.
$http
.
get
(
"/api-web/fault/conf/resource/getResourceByBusId"
,
params
,
function
(
res
)
{
if
(
res
&&
res
.
data
)
{
proxy
.
resTypeList
=
res
.
data
;
}
})
/* proxy.$http.get("/api-web/home/business/findAllBusType", {}, function(res) {
if (res && res.data) {
proxy.busTypeList = res.data;
}
})*/
}
let
onReset
=
()
=>
{
proxy
.
keyWords
=
''
;
proxy
.
resTypeArr
=
''
;
proxy
.
kpiTypeArr
=
[];
proxy
.
busTypeArr
=
[];
}
// 点击按钮搜索
let
onBtnSearch
=
()
=>
{
proxy
.
getEnvironmentData
();
}
//获取接收到的传值 bizid
let
setBizId
=
()
=>
{
console
.
log
(
"props.propsData"
,
props
.
propsData
)
if
(
props
.
propsData
){
proxy
.
bizId
=
props
.
propsData
.
bizId
;
proxy
.
targetId
=
props
.
propsData
.
targetId
;
proxy
.
busTypeArr
=
[
props
.
propsData
.
bizId
];
proxy
.
faultConfId
=
props
.
propsData
.
faultConfId
;
proxy
.
bizName
=
props
.
propsData
.
bizName
;
proxy
.
modleId
=
props
.
propsData
.
modleId
;
proxy
.
name
=
props
.
propsData
.
name
;
}
}
//资源类型改变查找基础列表
let
changeRes
=
(
val
)
=>
{
console
.
log
(
val
)
proxy
.
getEnvironmentData
();
}
//重新加载表格数据
let
loadTableDataList
=
({
page
,
limit
})
=>
{
proxy
.
page
=
page
;
proxy
.
pageSize
=
limit
;
proxy
.
getEnvironmentData
()
}
//获取基础环境资源列表数据
let
getEnvironmentData
=
()
=>
{
let
params
=
{
busId
:
proxy
.
bizId
,
resId
:
proxy
.
resTypeArr
,
page
:
proxy
.
page
,
pageSize
:
proxy
.
pageSize
}
proxy
.
$http
.
get
(
'/api-web/fault/base/config/page'
,
params
,
function
(
res
){
if
(
res
&&
res
.
data
){
proxy
.
count
=
res
.
count
;
proxy
.
tableDataList
=
res
.
data
;
proxy
.
$emit
(
'baseCount'
,
proxy
.
count
);
}
})
}
//单个添加基础环境
let
addRes
=
(
row
,
index
)
=>
{
let
baseList
=
row
;
let
params
=
{
targetId
:
proxy
.
targetId
,
npmList
:[
baseList
]
}
proxy
.
$http
.
post
(
'/api-web/fault/conf/npm/batchAddNpm'
,
params
,
function
(
res
){
if
(
res
&&
res
.
success
){
proxy
.
$global
.
showMsg
(
'添加成功'
,
'success'
);
proxy
.
targetId
=
res
.
str
;
proxy
.
saveModel
();
// proxy.applicationMonitorVisible=false;
}
else
{
proxy
.
$global
.
showMsg
(
'添加失败'
,
'warning'
);
}
})
}
//全部添加
let
saveAlldata
=
()
=>
{
if
(
proxy
.
count
==
0
){
proxy
.
$global
.
showMsg
(
'暂无配置'
,
'warning'
);
}
else
{
proxy
.
isLoading
=
true
;
let
params
=
{
busId
:
proxy
.
bizId
,
targetId
:
proxy
.
targetId
,
}
proxy
.
$http
.
post
(
'/api-web/fault/conf/base/saveOrUpdate'
,
params
,
function
(
res
){
if
(
res
&&
res
.
success
){
if
(
res
.
count
==
0
){
proxy
.
$global
.
showMsg
(
res
.
msg
,
'warning'
);
}
else
{
proxy
.
$global
.
showMsg
(
'添加成功'
,
'success'
);
proxy
.
targetId
=
res
.
str
;
proxy
.
saveModel
();
}
}
else
{
proxy
.
$global
.
showMsg
(
'基础环境保存失败'
,
'warning'
)
}
proxy
.
isLoading
=
false
;
},
function
(
err
){
proxy
.
isLoading
=
false
;
})
}
}
//表格全选事件
let
selectionChange
=
(
val
)
=>
{
proxy
.
tableDataList
.
map
((
v
,
i
)
=>
{
v
.
checked
=
false
;
})
let
selectData
=
val
;
if
(
selectData
.
length
>
0
){
selectData
.
map
((
item
,
index
)
=>
{
proxy
.
tableDataList
.
map
((
v
,
i
)
=>
{
if
(
item
.
id
==
v
.
id
){
v
.
checked
=
true
;
}
})
})
}
else
{
proxy
.
tableDataList
.
map
((
v
,
i
)
=>
{
v
.
checked
=
false
;
})
}
}
//添加选中的
let
saveAll
=
()
=>
{
let
npmListSelectData
=
[];
proxy
.
tableDataList
.
map
(
item
=>
{
if
(
item
.
checked
){
npmListSelectData
.
push
(
item
)
}
})
if
(
npmListSelectData
.
length
==
0
){
proxy
.
$global
.
showMsg
(
'请选择配置'
,
'warning'
);
}
else
{
proxy
.
isLoading
=
true
;
let
params
=
{
targetId
:
proxy
.
targetId
,
npmList
:
npmListSelectData
}
proxy
.
$http
.
post
(
'/api-web/fault/conf/npm/batchAddNpm'
,
params
,
function
(
res
){
if
(
res
&&
res
.
success
){
proxy
.
$global
.
showMsg
(
'添加成功'
,
'success'
);
proxy
.
targetId
=
res
.
str
;
proxy
.
saveModel
();
// proxy.applicationMonitorVisible=false;
}
else
{
proxy
.
$global
.
showMsg
(
'添加失败'
,
'warning'
);
}
proxy
.
isLoading
=
false
;
})
}
}
//关闭弹框
let
closeDialog
=
()
=>
{
let
obj
=
{
targetId
:
proxy
.
targetId
,
faultConfId
:
proxy
.
faultConfId
,
}
proxy
.
$emit
(
'callbackBase'
,
obj
);
}
return
{
closeDialog
,
addRes
,
saveAlldata
,
saveAll
,
selectionChange
,
titleName
,
faultConfId
,
bizName
,
name
,
modleId
,
baseVisible
,
getEnvironmentData
,
loadTableDataList
,
page
,
pageSize
,
isDetail
,
changeRes
,
setBizId
,
bizId
,
targetId
,
config
,
count
,
tableDataList
,
kpiList
,
busTypeList
,
keyWords
,
resTypeArr
,
kpiTypeArr
,
busTypeArr
,
resTypeList
,
init
,
onReset
,
onBtnSearch
}
},
methods
:
{
//取消节点列表配置
cancleList
(){
this
.
baseVisible
=
false
;
},
//保存节点添加配置
saveList
(){
this
.
baseVisible
=
false
;
},
//删除表格指标
deleteItem
(
item
){
let
that
=
this
;
this
.
$global
.
confirm
(
"确认删除指标吗?"
,
function
()
{
let
params
=
{
id
:
item
.
id
}
that
.
$http
.
get
(
'/api-web/fault/conf/base/deleteById'
,
params
,
function
(
res
)
{
if
(
res
)
{
that
.
$global
.
showMsg
(
'删除成功'
);
that
.
getEnvironmentData
();
}
that
.
$emit
(
'callbackDelete'
,
item
)
})
})
},
//保存模块
saveModel
(){
let
that
=
this
;
let
params
=
{
type
:
'base'
,
targetId
:
this
.
targetId
,
state
:
'1'
,
id
:
this
.
modleId
,
faultConfig
:{
id
:
this
.
faultConfId
,
name
:
this
.
name
,
bizId
:
this
.
bizId
,
bizName
:
this
.
bizName
,
createBy
:
localStorage
.
getItem
(
"lgn"
)
}
}
this
.
$http
.
post
(
'/api-web/fault/conf/detail/saveConfigDetail'
,
params
,
function
(
res
){
if
(
res
&&
res
.
success
){
that
.
targetId
=
res
.
map
.
configDetail
.
targetId
;
that
.
faultConfId
=
res
.
map
.
configDetail
.
faultConfig
.
id
;
// that.$global.showMsg('保存成功','success')
// that.switchModel();
that
.
baseVisible
=
false
;
}
else
{
that
.
$global
.
showMsg
(
'模块保存失败'
,
'warning'
)
}
})
}
},
mounted
()
{
this
.
setBizId
();
this
.
init
();
this
.
getEnvironmentData
();
},
unmounted
()
{}
}
\ No newline at end of file
...
...
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/faultDiagnosis/components/diagnosis/index.html
View file @
5ab89d3
...
...
@@ -230,15 +230,21 @@
</el-col>
</el-row>
<el-row>
<el-col
:span=
"24"
>
<el-col
:span=
"24"
class=
"flex-div-start"
>
<div
class=
"context-radio flex-div-start margin-30"
>
<span
class=
"fault-book-input-text"
>
状态选择
</span>
<el-radio
v-model=
"faultEnvironmentRadio"
label=
"1"
>
启用
</el-radio>
<el-radio
v-model=
"faultEnvironmentRadio"
label=
"0"
>
不启用
</el-radio>
</div>
<div
class=
"flex-div margin-30 btn-el-btn margin-bottom-10"
v-if=
"faultEnvironmentRadio==1"
>
<el-button
class=
"multiple-choice-button color-999"
@
click=
"addBaseMonitor()"
>
添加基础环境
</el-button>
<img
style=
"top:0;"
src=
"./src/assets/images/faultDiagnosis/icon-item-add.png"
class=
"multiple-choice-add-icon"
>
</div>
</el-col>
</el-row>
<BasicEnvironment
v-if=
"faultEnvironmentRadio==1"
:propsData=
"propsData"
@
baseCount=
"baseCount"
@
callbackDelete=
"deleteEnvironment"
></BasicEnvironment>
<BasicEnvironment
ref=
"basic"
v-if=
"faultEnvironmentRadio==1"
:isBaseDetail=
"isBaseDetail"
:propsData=
"propsData"
@
baseCount=
"baseCount"
@
callbackDelete=
"deleteEnvironment"
></BasicEnvironment>
<!-- <el-row>
<el-col :span="24">
...
...
@@ -413,6 +419,8 @@
<DiagnosisNet
v-show=
"networkMonitorVisible"
:isDisplay=
"networkMonitorVisible"
:propsData=
"propsData"
@
callback=
"getNetworkMonitorList"
></DiagnosisNet>
<!--应用检测弹框-->
<ApplicationMoni
v-show=
"applicationMonitorVisible"
:isDisplay=
"applicationMonitorVisible"
:applicationMonitorList=
"applicationMonitorList"
:propsData=
"propsData"
@
callbackApp=
"getApplicationMoniList"
></ApplicationMoni>
<!--基础环境弹框-->
<BasicEnvironmentAdd
v-show=
"baseVisible"
:isDisplay=
"baseVisible"
:propsData=
"propsData"
@
callbackBase=
"getBasicEnvironmentList"
></BasicEnvironmentAdd>
<!--APM弹框-->
<APM
v-show=
"APMVisible"
:isDisplay=
"APMVisible"
:apmMonitorList=
"apmMonitorList"
:propsData=
"propsData"
@
callbackAPM=
"getAPMList"
></APM>
<!--日志监测弹框-->
...
...
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/faultDiagnosis/components/diagnosis/index.js
View file @
5ab89d3
...
...
@@ -8,6 +8,9 @@ export default {
'ApplicationMoni'
:
Vue
.
defineAsyncComponent
(
()
=>
myImport
(
'views/faultDiagnosis/components/applicationMoni/index'
)
),
//应用监测组件
'BasicEnvironmentAdd'
:
Vue
.
defineAsyncComponent
(
()
=>
myImport
(
'views/faultDiagnosis/components/basicEnvironmentAdd/index'
)
),
//基础环境新增组件
'APM'
:
Vue
.
defineAsyncComponent
(
()
=>
myImport
(
'views/faultDiagnosis/components/APM/index'
)
),
//APM组件
...
...
@@ -103,6 +106,7 @@ export default {
setup
(
props
){
const
{
proxy
}
=
Vue
.
getCurrentInstance
();
let
applicationMonitorVisible
=
Vue
.
ref
(
false
);
let
baseVisible
=
Vue
.
ref
(
false
);
//btn加载中
let
isLoading
=
Vue
.
ref
(
false
);
//所属业务id
...
...
@@ -186,11 +190,15 @@ export default {
let
baseCount
=
(
val
)
=>
{
proxy
.
count
=
val
;
}
//基础环境是否为编辑
let
isBaseDetail
=
Vue
.
ref
(
false
);
return
{
count
,
baseCount
,
setDetail
,
isBaseDetail
,
count
,
baseCount
,
setDetail
,
applicationMonitorVisible
,
baseVisible
,
modleId
,
ruleId
,
ruleName
,
...
...
@@ -303,16 +311,14 @@ export default {
})
}
this
.
postPropsData
(
'base'
,
index
);
/*if(this.busTypeArr){
this.hiddenAll();
this.basicEnvironmentHide = true;
this.isActiveIndex=index;
this.type='base';
this.state=this.faultEnvironmentRadio;
}else{
this.$global.showMsg('请选择所属业务','warning')
}*/
// this.postPropsData('base',index);
this
.
hiddenAll
();
this
.
basicEnvironmentHide
=
true
;
this
.
isActiveIndex
=
index
;
this
.
type
=
'base'
;
this
.
state
=
this
.
faultEnvironmentRadio
;
this
.
setDetailConfig
(
this
.
type
)
this
.
getBaseList
();
},
//APM
...
...
@@ -444,14 +450,26 @@ export default {
break
;
case
"base"
:
//基础环境
this
.
hiddenAll
();
this
.
basicEnvironmentHide
=
true
;
this
.
isActiveIndex
=
index
;
this
.
type
=
'base'
;
this
.
state
=
this
.
faultEnvironmentRadio
;
if
(
this
.
configData
){
this
.
configData
.
map
((
item
,
index
)
=>
{
if
(
item
.
type
==
typeVal
){
item
.
state
=
'1'
;
}
})
}
this
.
baseVisible
=
true
;
break
;
case
"apm"
:
//APM
if
(
this
.
configData
){
this
.
configData
.
map
((
item
,
index
)
=>
{
if
(
item
.
type
==
typeVal
){
item
.
state
=
'1'
;
}
})
}
this
.
APMVisible
=
true
;
break
;
case
"log"
:
...
...
@@ -618,6 +636,27 @@ export default {
}
})
},
//点击添加基础环境弹框
addBaseMonitor
(){
this
.
postPropsData
(
'base'
)
// this.baseVisible=true;
},
//关闭基础环境弹框
getBasicEnvironmentList
(
itemData
){
this
.
baseVisible
=
false
;
if
(
itemData
.
faultConfId
){
this
.
faultConfId
=
itemData
.
faultConfId
;
}
this
.
setTargetId
(
itemData
.
targetId
);
// this.targetId=itemData;
//获取已添加的环境基础列表
this
.
getBaseList
();
},
getBaseList
(){
console
.
log
(
'basic'
,
this
.
$refs
.
basic
)
this
.
$refs
.
basic
.
getEnvironmentData
();
},
//点击添加APM弹框
addAPM
(){
// this.APMVisible=true;
...
...
@@ -625,6 +664,7 @@ export default {
},
//关闭APM弹框
getAPMList
(
itemData
){
this
.
APMVisible
=
false
;
...
...
@@ -730,12 +770,12 @@ export default {
}
if
(
this
.
type
){
if
(
this
.
type
==
'base'
&&
this
.
faultEnvironmentRadio
==
'1'
){
this
.
saveBase
();
}
else
{
// if(this.type=='base' && this.faultEnvironmentRadio=='1'){
// this.saveBase();
// }else{
this
.
saveConfigDetailOther
();
}
//
}
}
else
{
this
.
saveFaultDefine
();
}
...
...
@@ -794,7 +834,7 @@ export default {
}
}
else
if
(
this
.
type
==
'apm'
){
if
(
this
.
apmMonitorList
.
length
==
0
){
this
.
$global
.
showMsg
(
'请先选择添加
apm
配置'
,
'warning'
);
this
.
$global
.
showMsg
(
'请先选择添加
APM
配置'
,
'warning'
);
return
;
}
}
...
...
@@ -841,6 +881,7 @@ export default {
break
;
case
"base"
:
//基础环境
this
.
isBaseDetail
=
true
;
break
;
case
"apm"
:
...
...
@@ -945,24 +986,36 @@ export default {
}
else
{
this
.
getTargetId
(
'base'
)
let
params
=
{
targetId
:
this
.
targetId
,
busId
:
this
.
busTypeArr
}
this
.
$http
.
post
(
'/api-web/fault/conf/base/saveOrUpdate'
,
params
,
function
(
res
){
if
(
res
&&
res
.
success
){
that
.
targetId
=
res
.
str
;
that
.
setTargetId
(
that
.
targetId
)
that
.
$global
.
showMsg
(
res
.
msg
)
// that.alarmList=res.data;
that
.
saveConfigDetailOther
();
if
(
that
.
faultEnvironmentRadio
==
1
){
if
(
this
.
targetId
){
this
.
$global
.
showMsg
(
'环境基础数据已存在,不能重复保存'
,
'warning'
)
}
else
{
that
.
$global
.
showMsg
(
'基础环境保存失败'
,
'warning'
)
let
params
=
{
targetId
:
this
.
targetId
,
busId
:
this
.
busTypeArr
}
this
.
$http
.
post
(
'/api-web/fault/conf/base/saveOrUpdate'
,
params
,
function
(
res
){
if
(
res
&&
res
.
success
){
that
.
targetId
=
res
.
str
;
that
.
setTargetId
(
that
.
targetId
)
// that.$global.showMsg(res.msg)
// that.alarmList=res.data;
that
.
saveConfigDetailOther
();
}
else
{
that
.
$global
.
showMsg
(
'基础环境保存失败'
,
'warning'
)
}
that
.
isLoading
=
false
;
})
}
that
.
isLoading
=
false
;
}
else
{
that
.
saveConfigDetailOther
();
}
})
}
},
...
...
Please
register
or
login
to post a comment