Merge branch 'master-dev' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into master-dev
This commit is contained in:
commit
2a0be5104b
|
@ -4,18 +4,16 @@ import xss from "xss"
|
||||||
:title="title"
|
:title="title"
|
||||||
:width="modelStyle.width"
|
:width="modelStyle.width"
|
||||||
:visible="visible"
|
:visible="visible"
|
||||||
:bodyStyle ="bodyStyle"
|
:bodyStyle="bodyStyle"
|
||||||
:switchFullscreen="switchFullscreen"
|
:switchFullscreen="switchFullscreen"
|
||||||
@cancel="handleCancel"
|
@cancel="handleCancel"
|
||||||
>
|
>
|
||||||
<template slot="footer">
|
<template slot="footer">
|
||||||
<a-button key="back" @click="handleCancel">关闭</a-button>
|
<a-button key="back" @click="handleCancel">关闭</a-button>
|
||||||
<a-button v-if="record.openType==='url'" type="primary" @click="toHandle">去处理</a-button>
|
<a-button v-if="record.openType === 'url'" type="primary" @click="toHandle">去处理</a-button>
|
||||||
</template>
|
</template>
|
||||||
<a-card class="daily-article" :loading="loading">
|
<a-card class="daily-article" :loading="loading">
|
||||||
<a-card-meta
|
<a-card-meta :title="record.titile" :description="'发布人:' + record.sender + ' 发布时间: ' + record.sendTime">
|
||||||
:title="record.titile"
|
|
||||||
:description="'发布人:'+record.sender + ' 发布时间: ' + record.sendTime">
|
|
||||||
</a-card-meta>
|
</a-card-meta>
|
||||||
<a-divider />
|
<a-divider />
|
||||||
<span v-html="record.msgContent" class="article-content"></span>
|
<span v-html="record.msgContent" class="article-content"></span>
|
||||||
|
@ -24,133 +22,133 @@ import xss from "xss"
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getUserList} from '@/api/api'
|
import { getUserList } from '@/api/api'
|
||||||
import xss from 'xss'
|
import xss from 'xss'
|
||||||
export default {
|
export default {
|
||||||
name: "SysAnnouncementModal",
|
name: 'SysAnnouncementModal',
|
||||||
components: {
|
components: {},
|
||||||
},
|
data() {
|
||||||
data () {
|
return {
|
||||||
return {
|
title: '通知消息',
|
||||||
title:"通知消息",
|
record: {},
|
||||||
record: {},
|
labelCol: {
|
||||||
labelCol: {
|
xs: { span: 24 },
|
||||||
xs: { span: 24 },
|
sm: { span: 5 },
|
||||||
sm: { span: 5 },
|
|
||||||
},
|
|
||||||
wrapperCol: {
|
|
||||||
xs: { span: 24 },
|
|
||||||
sm: { span: 16 },
|
|
||||||
},
|
|
||||||
visible: false,
|
|
||||||
switchFullscreen: true,
|
|
||||||
loading: false,
|
|
||||||
bodyStyle:{
|
|
||||||
padding: "0",
|
|
||||||
height:(window.innerHeight*0.8)+"px",
|
|
||||||
"overflow-y":"auto",
|
|
||||||
|
|
||||||
},
|
|
||||||
modelStyle:{
|
|
||||||
width: '60%',
|
|
||||||
style: { top: '20px' },
|
|
||||||
fullScreen: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created () {
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
detail (record) {
|
|
||||||
//update-begin---author:wangshuai ---date:20220107 for:将其它页面传递过来的用户名改成用户真实姓名
|
|
||||||
if(record.sender){
|
|
||||||
getUserList({"username":record.sender}).then((res) =>{
|
|
||||||
if(res.success && res.result.records.length>0){
|
|
||||||
record.sender = res.result.records[0].realname
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//update-end---author:wangshuai ---date:20220107 for:将其它页面传递过来的用户名改成用户真实姓名
|
|
||||||
this.visible = true;
|
|
||||||
//update-begin-author:taoyan date:2022-7-14 for: VUEN-1702 【禁止问题】sql注入漏洞
|
|
||||||
if(record.msgContent){
|
|
||||||
record.msgContent = xss(record.msgContent)
|
|
||||||
}
|
|
||||||
//update-end-author:taoyan date:2022-7-14 for: VUEN-1702 【禁止问题】sql注入漏洞
|
|
||||||
this.record = record;
|
|
||||||
},
|
},
|
||||||
handleCancel () {
|
wrapperCol: {
|
||||||
this.visible = false;
|
xs: { span: 24 },
|
||||||
|
sm: { span: 16 },
|
||||||
},
|
},
|
||||||
/** 切换全屏显示 */
|
visible: false,
|
||||||
handleClickToggleFullScreen() {
|
switchFullscreen: true,
|
||||||
let mode = !this.modelStyle.fullScreen
|
loading: false,
|
||||||
if (mode) {
|
bodyStyle: {
|
||||||
this.modelStyle.width = '100%'
|
padding: '0',
|
||||||
this.modelStyle.style.top = '20px'
|
height: window.innerHeight * 0.8 + 'px',
|
||||||
} else {
|
'overflow-y': 'auto',
|
||||||
this.modelStyle.width = '60%'
|
|
||||||
this.modelStyle.style.top = '50px'
|
|
||||||
}
|
|
||||||
this.modelStyle.fullScreen = mode
|
|
||||||
},
|
},
|
||||||
toHandle(){
|
modelStyle: {
|
||||||
if(this.record.openType==='url'){
|
width: '60%',
|
||||||
this.visible = false;
|
style: { top: '20px' },
|
||||||
//链接跳转
|
fullScreen: false,
|
||||||
this.$router.push({path: this.record.openPage})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
detail(record) {
|
||||||
|
//update-begin---author:wangshuai ---date:20220107 for:将其它页面传递过来的用户名改成用户真实姓名
|
||||||
|
if (record.sender) {
|
||||||
|
getUserList({ username: record.sender }).then((res) => {
|
||||||
|
if (res.success && res.result.records.length > 0) {
|
||||||
|
record.sender = res.result.records[0].realname
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//update-end---author:wangshuai ---date:20220107 for:将其它页面传递过来的用户名改成用户真实姓名
|
||||||
|
this.visible = true
|
||||||
|
//update-begin-author:taoyan date:2022-7-14 for: VUEN-1702 【禁止问题】sql注入漏洞
|
||||||
|
if (record.msgContent) {
|
||||||
|
record.msgContent = xss(record.msgContent)
|
||||||
|
}
|
||||||
|
//update-end-author:taoyan date:2022-7-14 for: VUEN-1702 【禁止问题】sql注入漏洞
|
||||||
|
this.record = record
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.visible = false
|
||||||
|
},
|
||||||
|
/** 切换全屏显示 */
|
||||||
|
handleClickToggleFullScreen() {
|
||||||
|
let mode = !this.modelStyle.fullScreen
|
||||||
|
if (mode) {
|
||||||
|
this.modelStyle.width = '100%'
|
||||||
|
this.modelStyle.style.top = '20px'
|
||||||
|
} else {
|
||||||
|
this.modelStyle.width = '60%'
|
||||||
|
this.modelStyle.style.top = '50px'
|
||||||
|
}
|
||||||
|
this.modelStyle.fullScreen = mode
|
||||||
|
},
|
||||||
|
toHandle() {
|
||||||
|
if (this.record.openType === 'url') {
|
||||||
|
this.visible = false
|
||||||
|
//链接跳转
|
||||||
|
this.$router.push({ path: this.record.openPage })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.announcementCustomModal{
|
.announcementCustomModal {
|
||||||
.ant-modal-header {
|
.ant-modal-header {
|
||||||
border: none;
|
border: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
right: 56px;
|
right: 56px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
.ant-modal-title{
|
.ant-modal-title {
|
||||||
.custom-btn{
|
.custom-btn {
|
||||||
width: 56px;
|
width: 56px;
|
||||||
height: 56px;
|
height: 56px;
|
||||||
border: none;
|
border: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.daily-article{
|
|
||||||
border-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
.daily-article {
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ant-card-meta-description {
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
.daily-article {
|
.daily-article {
|
||||||
.article-button {
|
.article-button {
|
||||||
font-size: 1.2rem !important;
|
font-size: 1.2rem !important;
|
||||||
}
|
}
|
||||||
.ant-card-body {
|
.ant-card-body {
|
||||||
padding: 18px !important;
|
padding: 18px !important;
|
||||||
}
|
}
|
||||||
.ant-card-head {
|
.ant-card-head {
|
||||||
padding: 0 1rem;
|
padding: 0 1rem;
|
||||||
}
|
}
|
||||||
.ant-card-meta {
|
.ant-card-meta {
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
.article-content {
|
.article-content {
|
||||||
p {
|
p {
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
text-overflow: initial;
|
text-overflow: initial;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
font-size: .9rem !important;
|
font-size: 0.9rem !important;
|
||||||
margin-bottom: .8rem;
|
margin-bottom: 0.8rem;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -67,7 +67,7 @@ body {
|
||||||
@table-border-radius-base: 0;
|
@table-border-radius-base: 0;
|
||||||
@table-padding-vertical-sm: 2px;
|
@table-padding-vertical-sm: 2px;
|
||||||
@table-padding-vertical: 6px;
|
@table-padding-vertical: 6px;
|
||||||
@table-padding-horizontal: 8px;
|
@table-padding-horizontal: 8px;
|
||||||
@table-row-hover-bg: #0e505f;
|
@table-row-hover-bg: #0e505f;
|
||||||
|
|
||||||
.ant-table {
|
.ant-table {
|
||||||
|
@ -188,9 +188,8 @@ body {
|
||||||
}
|
}
|
||||||
&-time-picker-combobox {
|
&-time-picker-combobox {
|
||||||
background-color: @modalBg !important;
|
background-color: @modalBg !important;
|
||||||
border-color: @formInputBorderColor !important
|
border-color: @formInputBorderColor !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
&-picker {
|
&-picker {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -202,7 +201,7 @@ body {
|
||||||
color: #00e9fe !important;
|
color: #00e9fe !important;
|
||||||
}
|
}
|
||||||
&-select {
|
&-select {
|
||||||
background-color: @formInputBgColor !important
|
background-color: @formInputBgColor !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -275,7 +274,7 @@ body {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ant-calendar-range .ant-calendar-in-range-cell::before{
|
.ant-calendar-range .ant-calendar-in-range-cell::before {
|
||||||
background: #1397a3;
|
background: #1397a3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,7 +340,8 @@ body {
|
||||||
|
|
||||||
&-selected-day &-date,
|
&-selected-day &-date,
|
||||||
&-date:hover {
|
&-date:hover {
|
||||||
background-color: #072f32 !important;
|
background-color: #0b4f54 !important;
|
||||||
|
// background-color: #072f32 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -382,10 +382,10 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 输入框样式
|
// 输入框样式
|
||||||
.ant-calendar-input{
|
.ant-calendar-input {
|
||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
}
|
}
|
||||||
.ant-calendar-range-middle{
|
.ant-calendar-range-middle {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
.ant-input {
|
.ant-input {
|
||||||
|
@ -639,7 +639,7 @@ input[type='number']::-webkit-outer-spin-button {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ant-select-selection--multiple .ant-select-selection__choice{
|
.ant-select-selection--multiple .ant-select-selection__choice {
|
||||||
max-width: 60%;
|
max-width: 60%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -813,7 +813,6 @@ export default {
|
||||||
&-item {
|
&-item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
// background: #ade6ee;
|
|
||||||
&-chart {
|
&-chart {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100% - 40px);
|
height: calc(100% - 40px);
|
||||||
|
@ -831,7 +830,7 @@ export default {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
margin-left: 10px;
|
// margin-left: 5px;
|
||||||
span {
|
span {
|
||||||
color: #00e9fe;
|
color: #00e9fe;
|
||||||
background: none;
|
background: none;
|
||||||
|
|
|
@ -1,48 +1,38 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<a-modal
|
<a-modal title="Add Rule" :width="845" v-model="visible" @cancel="onCancel">
|
||||||
title='Add Rule'
|
<a-form-model ref="al_ruleForm" :model="form" :rules="rules" layout="vertical">
|
||||||
:width="845"
|
<a-row :gutter="[15, 0]">
|
||||||
v-model="visible"
|
|
||||||
@cancel="onCancel"
|
|
||||||
>
|
|
||||||
<a-form-model
|
|
||||||
ref="al_ruleForm"
|
|
||||||
:model="form"
|
|
||||||
:rules="rules"
|
|
||||||
layout="vertical"
|
|
||||||
>
|
|
||||||
<a-row :gutter="[15,0]">
|
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-model-item ref="sourceType" label="Source Type" prop="sourceType">
|
<a-form-model-item ref="sourceType" label="Source Type" prop="sourceType">
|
||||||
<a-select
|
<a-select
|
||||||
v-model="form.sourceType"
|
v-model="form.sourceType"
|
||||||
:options="typeOptions"
|
:options="typeOptions"
|
||||||
show-arrow
|
show-arrow
|
||||||
allowClear
|
allowClear
|
||||||
disabled
|
disabled
|
||||||
placeholder="select..."
|
placeholder="select..."
|
||||||
>
|
>
|
||||||
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
|
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-model-item ref="sourceId" label="Source" prop="sourceId">
|
<a-form-model-item ref="sourceId" label="Source" prop="sourceId">
|
||||||
<a-select
|
<a-select
|
||||||
v-model="form.sourceId"
|
v-model="form.sourceId"
|
||||||
:options="serverList"
|
:options="serverList"
|
||||||
show-arrow
|
show-arrow
|
||||||
allowClear
|
allowClear
|
||||||
disabled
|
disabled
|
||||||
placeholder="select..."
|
placeholder="select..."
|
||||||
>
|
>
|
||||||
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
|
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row :gutter="[15,0]">
|
<a-row :gutter="[15, 0]">
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-model-item ref="alarmRule" label="Alarm Rule" prop="name">
|
<a-form-model-item ref="alarmRule" label="Alarm Rule" prop="name">
|
||||||
<a-input v-model="form.name" placeholder="Pleace enter the alarm rule name" />
|
<a-input v-model="form.name" placeholder="Pleace enter the alarm rule name" />
|
||||||
|
@ -50,30 +40,30 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-model-item ref="monitorItem" label="Monitor Item" prop="itemId">
|
<a-form-model-item ref="monitorItem" label="Monitor Item" prop="itemId">
|
||||||
<a-select
|
<a-select
|
||||||
v-model="form.itemId"
|
v-model="form.itemId"
|
||||||
:options="itemOptions"
|
:options="itemOptions"
|
||||||
show-arrow
|
show-arrow
|
||||||
allowClear
|
allowClear
|
||||||
labelInValue
|
labelInValue
|
||||||
placeholder="select..."
|
placeholder="select..."
|
||||||
@change="onItemChange"
|
@change="onItemChange"
|
||||||
>
|
>
|
||||||
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
|
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row :gutter="[15,0]">
|
<a-row :gutter="[15, 0]">
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-model-item ref="monitorItem" label="Logic Symbol" prop="operator">
|
<a-form-model-item ref="monitorItem" label="Logic Symbol" prop="operator">
|
||||||
<a-select
|
<a-select
|
||||||
v-model="form.operator"
|
v-model="form.operator"
|
||||||
:options="operatorOptions"
|
:options="operatorOptions"
|
||||||
show-arrow
|
show-arrow
|
||||||
allowClear
|
allowClear
|
||||||
placeholder="select..."
|
placeholder="select..."
|
||||||
>
|
>
|
||||||
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
|
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
|
@ -84,29 +74,29 @@
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row :gutter="[15,0]">
|
<a-row :gutter="[15, 0]">
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-model-item ref="silenceCycle" label="Silence Cycle" prop="silenceCycle">
|
<a-form-model-item ref="silenceCycle" label="Silence Cycle" prop="silenceCycle">
|
||||||
<a-select
|
<a-select
|
||||||
v-model="form.silenceCycle"
|
v-model="form.silenceCycle"
|
||||||
:options="silenceCyclerOptions"
|
:options="silenceCyclerOptions"
|
||||||
show-arrow
|
show-arrow
|
||||||
allowClear
|
allowClear
|
||||||
placeholder="select..."
|
placeholder="select..."
|
||||||
>
|
>
|
||||||
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
|
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-model-item ref="contactGroup" label="Contact Group" prop="contactId">
|
<a-form-model-item ref="contactGroup" label="Contact Group" prop="contactId">
|
||||||
<a-select
|
<a-select
|
||||||
v-model="form.contactId"
|
v-model="form.contactId"
|
||||||
:options="contactGroupOptions"
|
:options="contactGroupOptions"
|
||||||
show-arrow
|
show-arrow
|
||||||
allowClear
|
allowClear
|
||||||
placeholder="select..."
|
placeholder="select..."
|
||||||
>
|
>
|
||||||
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
|
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
|
@ -116,7 +106,7 @@
|
||||||
<template slot="footer">
|
<template slot="footer">
|
||||||
<a-space class="operators" :size="20">
|
<a-space class="operators" :size="20">
|
||||||
<a-button type="success" @click="onSave">Save</a-button>
|
<a-button type="success" @click="onSave">Save</a-button>
|
||||||
<a-button type="warn" @click="onCancel">Cancel</a-button>
|
<a-button type="warn" @click="onCancel">Cancel</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
|
@ -124,125 +114,109 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getAction, postAction, httpAction, deleteAction } from '@/api/manage'
|
import { getAction } from '@/api/manage'
|
||||||
export default {
|
export default {
|
||||||
props: ["visible","serverList","currServer","serverLabel"],
|
props: ['visible', 'serverList', 'currServer', 'serverLabel'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
sourceType: "Server",
|
sourceType: 'Server',
|
||||||
sourceId: undefined,
|
sourceId: undefined,
|
||||||
name: "",
|
name: '',
|
||||||
itemId: undefined,
|
itemId: undefined,
|
||||||
operator: undefined,
|
operator: undefined,
|
||||||
threshold: "",
|
threshold: '',
|
||||||
silenceCycle: undefined,
|
silenceCycle: undefined,
|
||||||
contactId: undefined,
|
contactId: undefined,
|
||||||
},
|
},
|
||||||
units: "",
|
units: '',
|
||||||
itemOptions: [],
|
itemOptions: [],
|
||||||
typeOptions: [
|
typeOptions: [
|
||||||
{
|
{
|
||||||
label: "Server",
|
label: 'Server',
|
||||||
value: "Server"
|
value: 'Server',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Database",
|
label: 'Database',
|
||||||
value: "Database"
|
value: 'Database',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "E-MAIL",
|
label: 'E-MAIL',
|
||||||
value: "Email"
|
value: 'Email',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
sourceOptions: [],
|
sourceOptions: [],
|
||||||
operatorOptions: [
|
operatorOptions: [
|
||||||
{
|
{
|
||||||
label: ">",
|
label: '>',
|
||||||
value: ">"
|
value: '>',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "<",
|
label: '<',
|
||||||
value: "<"
|
value: '<',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: ">=",
|
label: '>=',
|
||||||
value: ">="
|
value: '>=',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "<=",
|
label: '<=',
|
||||||
value: "<="
|
value: '<=',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "==",
|
label: '==',
|
||||||
value: "=="
|
value: '==',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
silenceCyclerOptions: [
|
silenceCyclerOptions: [
|
||||||
{
|
{
|
||||||
label: "5 minutes",
|
label: '5 minutes',
|
||||||
value: 300
|
value: 300,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "15 minutes",
|
label: '15 minutes',
|
||||||
value: 900
|
value: 900,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "30 minutes",
|
label: '30 minutes',
|
||||||
value: 1800
|
value: 1800,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "60 minutes",
|
label: '60 minutes',
|
||||||
value: 3600
|
value: 3600,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "3 hours",
|
label: '3 hours',
|
||||||
value: 10800
|
value: 10800,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "6 hours",
|
label: '6 hours',
|
||||||
value: 21600
|
value: 21600,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "12 hours",
|
label: '12 hours',
|
||||||
value: 43200
|
value: 43200,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "24 hours",
|
label: '24 hours',
|
||||||
value: 86400
|
value: 86400,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
contactGroupOptions: [],
|
contactGroupOptions: [],
|
||||||
rules: {
|
rules: {
|
||||||
sourceType: [
|
sourceType: [{ required: true, message: 'Please select a sourceType', trigger: 'change' }],
|
||||||
{ required: true, message: 'Please select a sourceType', trigger: 'change'},
|
sourceId: [{ required: true, message: 'Please select a source', trigger: 'change' }],
|
||||||
],
|
name: [{ required: true, message: 'Please input alarmRule name' }],
|
||||||
sourceId: [
|
itemId: [{ required: true, message: 'Please select a monitorItem', trigger: 'change' }],
|
||||||
{ required: true, message: 'Please select a source', trigger: 'change'},
|
operator: [{ required: true, message: 'Please select a logicSymbol', trigger: 'change' }],
|
||||||
],
|
threshold: [{ required: true, message: 'Please input threshold' }],
|
||||||
name: [
|
silenceCycle: [{ required: true, message: 'Please select a silenceCycle', trigger: 'change' }],
|
||||||
{ required: true, message: 'Please input alarmRule name'},
|
contactId: [{ required: true, message: 'Please select a contactGroup', trigger: 'change' }],
|
||||||
],
|
},
|
||||||
itemId: [
|
|
||||||
{ required: true, message: 'Please select a monitorItem', trigger: 'change'},
|
|
||||||
],
|
|
||||||
operator: [
|
|
||||||
{ required: true, message: 'Please select a logicSymbol', trigger: 'change'},
|
|
||||||
],
|
|
||||||
threshold: [
|
|
||||||
{ required: true, message: 'Please input threshold'},
|
|
||||||
],
|
|
||||||
silenceCycle: [
|
|
||||||
{ required: true, message: 'Please select a silenceCycle', trigger: 'change'},
|
|
||||||
],
|
|
||||||
contactId: [
|
|
||||||
{ required: true, message: 'Please select a contactGroup', trigger: 'change'},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log(this.currServer);
|
console.log(this.currServer)
|
||||||
this.sourceOptions = this.serverList
|
this.sourceOptions = this.serverList
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -255,7 +229,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onCancel() {
|
onCancel() {
|
||||||
this.$emit("onCancel")
|
this.$emit('onCancel')
|
||||||
this.resetForm()
|
this.resetForm()
|
||||||
},
|
},
|
||||||
onItemChange(val, option) {
|
onItemChange(val, option) {
|
||||||
|
@ -264,22 +238,22 @@ export default {
|
||||||
},
|
},
|
||||||
onSave() {
|
onSave() {
|
||||||
this.$refs.al_ruleForm.validate((valid) => {
|
this.$refs.al_ruleForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let params = {
|
let params = {
|
||||||
silenceCycle:this.form.silenceCycle,
|
silenceCycle: this.form.silenceCycle,
|
||||||
contactId:this.form.contactId,
|
contactId: this.form.contactId,
|
||||||
sourceId:this.form.sourceId,
|
sourceId: this.form.sourceId,
|
||||||
sourceType:this.form.sourceType,
|
sourceType: this.form.sourceType,
|
||||||
itemId:this.form.itemId.key,
|
itemId: this.form.itemId.key,
|
||||||
rule: {
|
rule: {
|
||||||
name: this.form.itemId.label,
|
name: this.form.itemId.label,
|
||||||
operator: this.form.operator,
|
operator: this.form.operator,
|
||||||
threshold: this.form.threshold,
|
threshold: this.form.threshold,
|
||||||
units: this.units,
|
units: this.units,
|
||||||
},
|
},
|
||||||
name: this.form.name
|
name: this.form.name,
|
||||||
}
|
}
|
||||||
this.$emit("onCanonSavecel", params)
|
this.$emit('onCanonSavecel', params)
|
||||||
this.resetForm()
|
this.resetForm()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -289,42 +263,42 @@ export default {
|
||||||
this.units = option.data.props.units
|
this.units = option.data.props.units
|
||||||
},
|
},
|
||||||
getItems(val) {
|
getItems(val) {
|
||||||
getAction("/alarmRule/getItems", {sourceName:val}).then(res => {
|
getAction('/alarmRule/getItems', { sourceName: val }).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.itemOptions = res.result.map(item => {
|
this.itemOptions = res.result.map((item) => {
|
||||||
return {
|
return {
|
||||||
label: item.name,
|
label: item.name,
|
||||||
value: item.itemId,
|
value: item.itemId,
|
||||||
units:item.units
|
units: item.units,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning("This operation fails. Contact your system administrator")
|
this.$message.warning('This operation fails. Contact your system administrator')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
resetForm() {
|
resetForm() {
|
||||||
this.$refs.al_ruleForm.resetFields();
|
this.$refs.al_ruleForm.resetFields()
|
||||||
this.form= {
|
this.form = {
|
||||||
sourceType: undefined,
|
sourceType: undefined,
|
||||||
sourceId: undefined,
|
sourceId: undefined,
|
||||||
name: "",
|
name: '',
|
||||||
itemId: undefined,
|
itemId: undefined,
|
||||||
operator: undefined,
|
operator: undefined,
|
||||||
threshold: "",
|
threshold: '',
|
||||||
silenceCycle: undefined,
|
silenceCycle: undefined,
|
||||||
contactId: undefined,
|
contactId: undefined,
|
||||||
}
|
}
|
||||||
this.sourceOptions =[]
|
this.sourceOptions = []
|
||||||
this.itemOptions = []
|
this.itemOptions = []
|
||||||
this.units = ""
|
this.units = ''
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
/deep/.ant-modal-title{
|
/deep/.ant-modal-title {
|
||||||
letter-spacing: 1px;
|
letter-spacing: 1px;
|
||||||
}
|
}
|
||||||
.operators {
|
.operators {
|
||||||
|
@ -344,7 +318,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ant-select-dropdown-content{
|
.ant-select-dropdown-content {
|
||||||
position: relative;
|
position: relative;
|
||||||
background: #03353f;
|
background: #03353f;
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,14 +216,26 @@ export default {
|
||||||
processCpu: {
|
processCpu: {
|
||||||
content: null,
|
content: null,
|
||||||
legend: ['mysqld.exe', 'svchost.exe'],
|
legend: ['mysqld.exe', 'svchost.exe'],
|
||||||
color: ['#2d5cd3', '#60cae8', '#1ab060', '#ffbf44', '#e86954', 'red'],
|
color: [
|
||||||
|
['rgb(45, 92, 211)', 'rgba(45, 92, 211,0)'],
|
||||||
|
['rgb(96, 202, 232)', 'rgba(96, 202, 232,0)'],
|
||||||
|
['rgb(26, 176, 96)', 'rgba(26, 176, 96,0)'],
|
||||||
|
['rgb(255, 191, 68)', 'rgba(255, 191, 68,0)'],
|
||||||
|
['rgb(232, 105, 84)', 'rgba(232, 105, 84,0)'],
|
||||||
|
],
|
||||||
xData: [],
|
xData: [],
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
processMenbry: {
|
processMenbry: {
|
||||||
content: null,
|
content: null,
|
||||||
legend: ['mysqld.exe', 'svchost.exe'],
|
legend: ['mysqld.exe', 'svchost.exe'],
|
||||||
color: ['#2d5cd3', '#60cae8', '#1ab060', '#ffbf44', '#e86954', 'red'],
|
color: [
|
||||||
|
['rgb(45, 92, 211)', 'rgba(45, 92, 211,0)'],
|
||||||
|
['rgb(96, 202, 232)', 'rgba(96, 202, 232,0)'],
|
||||||
|
['rgb(26, 176, 96)', 'rgba(26, 176, 96,0)'],
|
||||||
|
['rgb(255, 191, 68)', 'rgba(255, 191, 68,0)'],
|
||||||
|
['rgb(232, 105, 84)', 'rgba(232, 105, 84,0)'],
|
||||||
|
],
|
||||||
xData: [],
|
xData: [],
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
|
@ -242,7 +254,6 @@ export default {
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
total: 0,
|
total: 0,
|
||||||
},
|
},
|
||||||
xData: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
|
||||||
rankData: {},
|
rankData: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -525,12 +536,12 @@ export default {
|
||||||
type: 'line',
|
type: 'line',
|
||||||
name: item.name,
|
name: item.name,
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
itemStyle: { normal: { color: this.processCpu.color[index] } },
|
itemStyle: { normal: { color: this.processCpu.color[index][0] } },
|
||||||
areaStyle: {
|
areaStyle: {
|
||||||
normal: {
|
normal: {
|
||||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
{ offset: 0, color: this.processCpu.color[index] },
|
{ offset: 0, color: this.processCpu.color[index][0] },
|
||||||
{ offset: 1, color: 'rgba(255,255,255,0)' },
|
{ offset: 1, color: this.processCpu.color[index][1] },
|
||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -599,12 +610,12 @@ export default {
|
||||||
type: 'line',
|
type: 'line',
|
||||||
name: item.name,
|
name: item.name,
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
itemStyle: { normal: { color: this.processCpu.color[index] } },
|
itemStyle: { normal: { color: this.processMenbry.color[index][0] } },
|
||||||
areaStyle: {
|
areaStyle: {
|
||||||
normal: {
|
normal: {
|
||||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
{ offset: 0, color: this.processCpu.color[index] },
|
{ offset: 0, color: this.processMenbry.color[index][0] },
|
||||||
{ offset: 1, color: 'rgba(255,255,255,0)' },
|
{ offset: 1, color: this.processMenbry.color[index][1] },
|
||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user