Commit 42703107 authored by Kerwin_Cui's avatar Kerwin_Cui

对接cmdb系统

parent f5d1998e
...@@ -40,4 +40,5 @@ urlpatterns = [ ...@@ -40,4 +40,5 @@ urlpatterns = [
url(r'^search_user_group/$', search_user_group), url(r'^search_user_group/$', search_user_group),
url(r'^alarm_count_info/$', alarm_count_info), url(r'^alarm_count_info/$', alarm_count_info),
url(r'^monitor_excel/$', monitor_excel), url(r'^monitor_excel/$', monitor_excel),
url(r'^system_cmdb/$', system_cmdb),
] ]
...@@ -2667,6 +2667,33 @@ def monitor_excel(request): ...@@ -2667,6 +2667,33 @@ def monitor_excel(request):
) )
def system_cmdb(request):
try:
sys_data = requests.get('http://192.168.1.246:8001/webapi/moduleInstances/108?pageNum=1&pageSize=500')
sys_data = sys_data.text
sys_data = json.loads(sys_data)
sys_data = sys_data['data']['list']
systemList = []
for i in sys_data:
newdic = {}
newdic['label'] = i[u'名称']
newdic['value'] = i[u'名称']
systemList.append(newdic)
return render_json({
"result": True,
"code": 0,
"message": u"搜索成功",
"data": systemList
})
except Exception as e:
return render_json(
{
"result": False,
"code": 1,
"message": u"未知错误:%s" % e,
"data": {}
}
)
# 同步事件 # 同步事件
def sync(request): def sync(request):
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<div> <div>
<el-form-item label="故障系统" label-width="97px" class="normal" style="display:inline-block;"> <el-form-item label="故障系统" label-width="97px" class="normal" style="display:inline-block;">
<el-select v-model="formLine.failure_sys_name" clearable filterable style="width:200px;" :disabled="editStatus"> <el-select v-model="formLine.failure_sys_name" clearable filterable style="width:200px;" :disabled="editStatus">
<el-option v-for="item in systemList" <el-option v-for="item in systemListCmdb"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.label"> :value="item.label">
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
style="display:inline-block;" > style="display:inline-block;" >
<el-select v-model="formLine.influenced_sys_name" multiple filterable <el-select v-model="formLine.influenced_sys_name" multiple filterable
style="width:210px;" :disabled="editStatus"> style="width:210px;" :disabled="editStatus">
<el-option v-for="item in systemList" <el-option v-for="item in systemListCmdb"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.label"></el-option> :value="item.label"></el-option>
...@@ -781,6 +781,7 @@ var unique= function (array) { ...@@ -781,6 +781,7 @@ var unique= function (array) {
partAlarmList: [],// 具体指标 partAlarmList: [],// 具体指标
preliminaryAnalysisOptions: [],//事件初步原因列表 preliminaryAnalysisOptions: [],//事件初步原因列表
systemList: [], systemList: [],
systemListCmdb:[],
labelList: [], labelList: [],
eventTypeOp: keyArray.eventType, eventTypeOp: keyArray.eventType,
urgency_degreeOp: keyArray.influenceLevel, urgency_degreeOp: keyArray.influenceLevel,
...@@ -930,6 +931,7 @@ var unique= function (array) { ...@@ -930,6 +931,7 @@ var unique= function (array) {
this.getSystem() this.getSystem()
this.getAlarmTitle() this.getAlarmTitle()
this.getLabel() this.getLabel()
this.system_cmdb()
}, },
computed: { computed: {
...@@ -1158,6 +1160,12 @@ var unique= function (array) { ...@@ -1158,6 +1160,12 @@ var unique= function (array) {
this.systemList = res this.systemList = res
}) })
}, },
system_cmdb(){
axios.get('${SITE_URL}system_cmdb/').then(res => {
res = res.data
this.systemListCmdb = res
})
},
getAlarmInfo() { getAlarmInfo() {
let vm = this let vm = this
vm.alarmDisplay = [] vm.alarmDisplay = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment