This commit is contained in:
xiaoguangbin 2023-11-02 10:12:53 +08:00
commit ce20269bbe
12 changed files with 1407 additions and 1403 deletions

View File

@ -1,11 +1,9 @@
<template> <template>
<div style="height: 100%;overflow: hidden;"> <div style="height: 100%; overflow: hidden">
<div class="group-header"> <div class="group-header">
<a-button class="group-add" @click="showModal"> <a-button class="group-add" @click="showModal">
<img class="icon-add" src="@/assets/images/global/add.png" alt="" /> <img class="icon-add" src="@/assets/images/global/add.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Add Contact Group </span>
Add Contact Group
</span>
</a-button> </a-button>
</div> </div>
<div class="group-content"> <div class="group-content">
@ -14,13 +12,15 @@
<a-collapse-panel :key="item.id" :style="customStyle" v-for="item in contactGroups"> <a-collapse-panel :key="item.id" :style="customStyle" v-for="item in contactGroups">
<template slot="header"> <template slot="header">
{{ item.name }} {{ item.name }}
<span class="header-sub">Create Date: {{ item.createTime }} , Number of people: {{ item.personNumber }}</span> <span class="header-sub"
>Create Date: {{ item.createTime }} , Number of people: {{ item.personNumber }}</span
>
</template> </template>
<template slot="extra"> <template slot="extra">
<a-button class="actions" shape="circle" @click.stop="editGroup(item.id)"> <a-button class="actions" shape="circle" @click.stop="editGroup(item.id)">
<img class="icon-edit" src="@/assets/images/abnormalAlarm/edit.png" alt="" /> <img class="icon-edit" src="@/assets/images/abnormalAlarm/edit.png" alt="" />
</a-button> </a-button>
<a-button class="actions" style="margin-right: 15px;" shape="circle" @click.stop="deleteGroup(item.id)"> <a-button class="actions" style="margin-right: 15px" shape="circle" @click.stop="deleteGroup(item.id)">
<img class="icon-delete" src="@/assets/images/abnormalAlarm/delete.png" alt="" /> <img class="icon-delete" src="@/assets/images/abnormalAlarm/delete.png" alt="" />
</a-button> </a-button>
</template> </template>
@ -34,14 +34,24 @@
:scroll="{ y: 200 }" :scroll="{ y: 200 }"
> >
<template slot="name" slot-scope="{ text }"> <template slot="name" slot-scope="{ text }">
<img src="@/assets/images/abnormalAlarm/user.png" alt=""><span style="margin-left: 8px;padding-top: 2px;">{{ text }}</span> <img src="@/assets/images/abnormalAlarm/user.png" alt="" /><span
style="margin-left: 8px; padding-top: 2px"
>{{ text }}</span
>
</template> </template>
<template slot="role" slot-scope="{ record }"> <template slot="role" slot-scope="{ record }">
<span v-for="(role,index) in record.roles" :key="role.id">{{ role.roleName }}<i v-if="index!=record.roles.length-1">,</i></span> <span v-for="(role, index) in record.roles" :key="role.id"
>{{ role.roleName }}<i v-if="index != record.roles.length - 1">,</i></span
>
</template> </template>
<template slot="action" slot-scope="{ record }"> <template slot="action" slot-scope="{ record }">
<a-button class="actions" style="margin-right: 15px;" shape="circle" @click="deleteUser(item.id, record.id)"> <a-button
class="actions"
style="margin-right: 15px"
shape="circle"
@click="deleteUser(item.id, record.id)"
>
<img class="icon-delete" src="@/assets/images/abnormalAlarm/delete.png" alt="" /> <img class="icon-delete" src="@/assets/images/abnormalAlarm/delete.png" alt="" />
</a-button> </a-button>
</template> </template>
@ -57,7 +67,9 @@
show-size-changer show-size-changer
show-quick-jumper show-quick-jumper
:total="page.total" :total="page.total"
:show-total="(total, range) => `Total ${total} items Page ${page.currentPage} / ${Math.ceil(total / page.pageSize)}`" :show-total="
(total, range) => `Total ${total} items Page ${page.currentPage} / ${Math.ceil(total / page.pageSize)}`
"
show-less-items show-less-items
@change="handlePageChange" @change="handlePageChange"
@showSizeChange="handleSizeChange" @showSizeChange="handleSizeChange"
@ -67,6 +79,7 @@
<a-modal <a-modal
:title="isAdd ? 'Add Contact Group' : 'Edit Contact Group'" :title="isAdd ? 'Add Contact Group' : 'Edit Contact Group'"
:width="845" :width="845"
:maskClosable="false"
v-model="visible" v-model="visible"
@ok="handleOk" @ok="handleOk"
destroy-on-close destroy-on-close
@ -76,7 +89,7 @@
<a-transfer <a-transfer
:dataSource="userList" :dataSource="userList"
:target-keys="targetKeys" :target-keys="targetKeys"
:render="item => item.title" :render="(item) => item.title"
:operations="['Assign', 'Remove']" :operations="['Assign', 'Remove']"
:titles="['All Users', 'Contact Group']" :titles="['All Users', 'Contact Group']"
@change="handleChange" @change="handleChange"
@ -85,7 +98,6 @@
</a-transfer> </a-transfer>
<!-- 穿梭框右上方搜索 --> <!-- 穿梭框右上方搜索 -->
<div class="group-name"> <div class="group-name">
<!-- <label>Group Name</label> <!-- <label>Group Name</label>
<a-input :value="groupName" placeholder="Basic usage" @change="setGroupName" /> --> <a-input :value="groupName" placeholder="Basic usage" @change="setGroupName" /> -->
<a-form :form="form" :label-col="{ span: 9 }" :wrapper-col="{ span: 15 }"> <a-form :form="form" :label-col="{ span: 9 }" :wrapper-col="{ span: 15 }">
@ -119,7 +131,7 @@ const columns = [
dataIndex: 'username', dataIndex: 'username',
scopedSlots: { scopedSlots: {
customRender: 'name', customRender: 'name',
} },
}, },
{ {
title: 'ROLE', title: 'ROLE',
@ -132,12 +144,12 @@ const columns = [
{ {
title: 'Phone', title: 'Phone',
align: 'left', align: 'left',
dataIndex: 'telephone' dataIndex: 'telephone',
}, },
{ {
title: 'E-MAIL', title: 'E-MAIL',
align: 'left', align: 'left',
dataIndex: 'email' dataIndex: 'email',
}, },
{ {
title: '', title: '',
@ -146,18 +158,18 @@ const columns = [
scopedSlots: { scopedSlots: {
customRender: 'action', customRender: 'action',
}, },
} },
] ]
export default { export default {
data() { data() {
return { return {
activeKey:"", activeKey: '',
spinning: false, spinning: false,
page: { page: {
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
pageSizeOptions: ['10', '20', '30'], pageSizeOptions: ['10', '20', '30'],
total:0 total: 0,
}, },
contactGroups: [], contactGroups: [],
isAdd: true, isAdd: true,
@ -165,12 +177,11 @@ export default {
groupList: [], groupList: [],
columns, columns,
visible: false, visible: false,
customStyle: customStyle: 'background: #02282b;;margin-bottom: 20px;border: solid 1px #416f7f;overflow: hidden',
'background: #02282b;;margin-bottom: 20px;border: solid 1px #416f7f;overflow: hidden',
targetKeys: [], targetKeys: [],
groupName: "", groupName: '',
currGroupId: "", currGroupId: '',
form: this.$form.createForm(this) form: this.$form.createForm(this),
} }
}, },
mounted() { mounted() {
@ -192,21 +203,21 @@ export default {
this.spinning = true this.spinning = true
let params = { let params = {
pageNo: this.page.currentPage, pageNo: this.page.currentPage,
pageSize:this.page.pageSize pageSize: this.page.pageSize,
} }
getAction("/alarmContactGroup/findPage", params).then(res => { getAction('/alarmContactGroup/findPage', params).then((res) => {
this.spinning = false this.spinning = false
if (res.success) { if (res.success) {
this.contactGroups = res.result.records this.contactGroups = res.result.records
this.activeKey = this.contactGroups[0].id this.activeKey = this.contactGroups[0].id
this.page.total = res.result.total this.page.total = res.result.total
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
editGroup(id) { editGroup(id) {
getAction("/alarmContactGroup/findInfo", {id}).then(res => { getAction('/alarmContactGroup/findInfo', { id }).then((res) => {
if (res.success) { if (res.success) {
this.visible = true this.visible = true
this.isAdd = false this.isAdd = false
@ -214,26 +225,26 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue({ this.form.setFieldsValue({
name: res.result.name, name: res.result.name,
}); })
}) })
this.targetKeys = res.result.userIds this.targetKeys = res.result.userIds
this.currGroupId = res.result.id this.currGroupId = res.result.id
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
getAllUser() { getAllUser() {
getAction("sys/user/list").then(res => { getAction('sys/user/list').then((res) => {
if (res.success) { if (res.success) {
this.userList = res.result.records.map(item => { this.userList = res.result.records.map((item) => {
return { return {
key: item.id, key: item.id,
title:item.username title: item.username,
} }
}) })
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
@ -241,8 +252,8 @@ export default {
// this.groupName = e.target.value // this.groupName = e.target.value
// }, // },
handleChange(targetKeys, direction, moveKeys) { handleChange(targetKeys, direction, moveKeys) {
console.log(targetKeys, direction, moveKeys); console.log(targetKeys, direction, moveKeys)
this.targetKeys= targetKeys; this.targetKeys = targetKeys
}, },
handleOk() { handleOk() {
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
@ -254,10 +265,10 @@ export default {
this.updateContactGroup(values.name) this.updateContactGroup(values.name)
} }
} else { } else {
this.$message.warning("Please select User") this.$message.warning('Please select User')
} }
} }
}); })
}, },
onCancel() { onCancel() {
this.visible = false this.visible = false
@ -265,33 +276,33 @@ export default {
updateContactGroup(name) { updateContactGroup(name) {
let params = { let params = {
name, name,
description: "", description: '',
userIds: this.targetKeys, userIds: this.targetKeys,
id:this.currGroupId id: this.currGroupId,
} }
httpAction("/alarmContactGroup/update", params, "put").then(res => { httpAction('/alarmContactGroup/update', params, 'put').then((res) => {
if (res.success) { if (res.success) {
this.visible = false this.visible = false
this.$message.success("success") this.$message.success('success')
this.getAlarmGroup() this.getAlarmGroup()
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
createContactGroup(name) { createContactGroup(name) {
let params = { let params = {
name, name,
description: "", description: '',
userIds: this.targetKeys, userIds: this.targetKeys,
} }
postAction("/alarmContactGroup/create", params).then(res => { postAction('/alarmContactGroup/create', params).then((res) => {
if (res.success) { if (res.success) {
this.visible = false this.visible = false
this.$message.success("success") this.$message.success('success')
this.getAlarmGroup() this.getAlarmGroup()
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
@ -300,50 +311,50 @@ export default {
this.$confirm({ this.$confirm({
title: 'Are you sure to delete this item?', title: 'Are you sure to delete this item?',
onOk() { onOk() {
deleteAction("/alarmContactGroup/deleteById", {id}).then(res => { deleteAction('/alarmContactGroup/deleteById', { id }).then((res) => {
if (res.success) { if (res.success) {
_this.$message.success("success") _this.$message.success('success')
_this.getAlarmGroup() _this.getAlarmGroup()
} else { } else {
_this.$message.warning("This operation fails. Contact your system administrator") _this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
onCancel() { onCancel() {
console.log('Cancel'); console.log('Cancel')
}, },
class: 'test', class: 'test',
}); })
}, },
deleteUser(id, userId) { deleteUser(id, userId) {
let _this = this let _this = this
this.$confirm({ this.$confirm({
title: 'Are you sure to delete this item?', title: 'Are you sure to delete this item?',
onOk() { onOk() {
deleteAction("/alarmContactGroup/deleteUserById", {id,userId}).then(res => { deleteAction('/alarmContactGroup/deleteUserById', { id, userId }).then((res) => {
if (res.success) { if (res.success) {
_this.$message.success("success") _this.$message.success('success')
_this.getAlarmGroup() _this.getAlarmGroup()
} else { } else {
_this.$message.warning("This operation fails. Contact your system administrator") _this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
onCancel() { onCancel() {
console.log('Cancel'); console.log('Cancel')
} },
}); })
}, },
handleSearch(dir, value) { handleSearch(dir, value) {
console.log('search:', dir, value); console.log('search:', dir, value)
}, },
showModal() { showModal() {
this.targetKeys = [] this.targetKeys = []
this.groupName = "" this.groupName = ''
this.form.setFieldsValue({ this.form.setFieldsValue({
name: "", name: '',
}); })
this.visible = true; this.visible = true
}, },
}, },
} }
@ -371,7 +382,7 @@ export default {
font-family: ArialMT; font-family: ArialMT;
color: #ffffff; color: #ffffff;
border: none; border: none;
box-shadow: 0px 1px 1px 0px #000000 box-shadow: 0px 1px 1px 0px #000000;
} }
} }
.group-content { .group-content {

View File

@ -1,20 +1,18 @@
<template> <template>
<div style="height: 100%;"> <div style="height: 100%">
<div class="rules-header"> <div class="rules-header">
<div> <div>
<a-row type="flex" :gutter="10"> <a-row type="flex" :gutter="10">
<a-col flex="190px"> <a-col flex="190px">
<a-button class="rules-add" @click="handleAdd"> <a-button class="rules-add" @click="handleAdd">
<img class="icon-add" src="@/assets/images/global/add.png" alt="" /> <img class="icon-add" src="@/assets/images/global/add.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Create Alarm Rule </span>
Create Alarm Rule
</span>
</a-button> </a-button>
</a-col> </a-col>
<a-col flex="300px"> <a-col flex="300px">
<span class="item-label">Rule Status</span> <span class="item-label">Rule Status</span>
<a-select <a-select
style="width: 180px;display: inline-block;" style="width: 180px; display: inline-block"
v-model="queryParams.station" v-model="queryParams.station"
:options="stateOptions" :options="stateOptions"
show-arrow show-arrow
@ -28,7 +26,7 @@
<a-col flex="300px"> <a-col flex="300px">
<span class="item-label">Source Type</span> <span class="item-label">Source Type</span>
<a-select <a-select
style="width: 180px;display: inline-block;" style="width: 180px; display: inline-block"
v-model="queryParams.type" v-model="queryParams.type"
:options="typeOptions" :options="typeOptions"
show-arrow show-arrow
@ -42,7 +40,7 @@
<a-col flex="255px"> <a-col flex="255px">
<span class="item-label">Source</span> <span class="item-label">Source</span>
<a-select <a-select
style="width: 180px;display: inline-block;" style="width: 180px; display: inline-block"
v-model="queryParams.name" v-model="queryParams.name"
:options="nameOptions" :options="nameOptions"
show-arrow show-arrow
@ -56,9 +54,7 @@
<a-col> <a-col>
<a-button class="search-btn" @click="onSearch"> <a-button class="search-btn" @click="onSearch">
<img class="icon-add" src="@/assets/images/global/search.png" alt="" /> <img class="icon-add" src="@/assets/images/global/search.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Search </span>
Search
</span>
</a-button> </a-button>
</a-col> </a-col>
</a-row> </a-row>
@ -77,34 +73,50 @@
<div class="monitor-list-item-title"> <div class="monitor-list-item-title">
<div class="monitor-list-item-title-name">{{ item.name }}</div> <div class="monitor-list-item-title-name">{{ item.name }}</div>
<div class="monitor-list-item-title-server"> <div class="monitor-list-item-title-server">
<span style="color: #5b9cba;">{{ item.sourceType }}</span> <span style="color: #5b9cba">{{ item.sourceType }}</span>
<a-tooltip> <a-tooltip>
<template slot="title"> <template slot="title">
{{ item.sourceName }} {{ item.sourceName }}
</template> </template>
<span style="color: #ade6ee;">{{ item.sourceName }}</span> <span style="color: #ade6ee">{{ item.sourceName }}</span>
</a-tooltip> </a-tooltip>
</div> </div>
</div> </div>
<div class="monitor-list-item-content"> <div class="monitor-list-item-content">
<div class="monitor-list-item-content-info"> <div class="monitor-list-item-content-info">
{{ JSON.parse(item.operator).name }} {{ JSON.parse(item.operator).operator }} {{ JSON.parse(item.operator).threshold }}{{ JSON.parse(item.operator).units }} {{ JSON.parse(item.operator).name }} {{ JSON.parse(item.operator).operator }}
{{ JSON.parse(item.operator).threshold }}{{ JSON.parse(item.operator).units }}
</div> </div>
<div :class="[item.enabled==1?'monitor-list-item-content-enable':'monitor-list-item-content-disable', 'monitor-list-item-content-btn']"> <div
{{ item.enabled==1?"Enable":"Disabled" }} :class="[
item.enabled == 1 ? 'monitor-list-item-content-enable' : 'monitor-list-item-content-disable',
'monitor-list-item-content-btn',
]"
>
{{ item.enabled == 1 ? 'Enable' : 'Disabled' }}
</div> </div>
</div> </div>
<div class="monitor-list-item-footer"> <div class="monitor-list-item-footer">
<div class="monitor-list-item-footer-group"> <div class="monitor-list-item-footer-group">
<span style="color: #5b9cba;">Alarm Contact Group</span> <span style="color: #5b9cba">Alarm Contact Group</span>
<span style="color: #ade6ee;">{{ item.groupName }}</span> <span style="color: #ade6ee">{{ item.groupName }}</span>
</div> </div>
<div class="monitor-list-item-footer-actions"> <div class="monitor-list-item-footer-actions">
<span title="Edit" class="actions-edit" @click="editItem(item.id)"></span> <span title="Edit" class="actions-edit" @click="editItem(item.id)"></span>
<span title="Delete" class="actions-delete" @click="deleteItem(item.id)"></span> <span title="Delete" class="actions-delete" @click="deleteItem(item.id)"></span>
<span v-if="item.enabled==1" title="Enable" class="actions-enable" @click="changeItemStatus(item.id,item.enabled)"> <span
v-if="item.enabled == 1"
title="Enable"
class="actions-enable"
@click="changeItemStatus(item.id, item.enabled)"
>
</span> </span>
<span v-if="item.enabled==0" title="Disabled" class="actions-disable" @click="changeItemStatus(item.id,item.enabled)"> <span
v-if="item.enabled == 0"
title="Disabled"
class="actions-disable"
@click="changeItemStatus(item.id, item.enabled)"
>
</span> </span>
</div> </div>
</div> </div>
@ -119,7 +131,10 @@
show-size-changer show-size-changer
show-quick-jumper show-quick-jumper
:total="ipagination.total" :total="ipagination.total"
:show-total="(total, range) => `Total ${total} items Page ${ipagination.current} / ${Math.ceil(total / ipagination.pageSize)}`" :show-total="
(total, range) =>
`Total ${total} items Page ${ipagination.current} / ${Math.ceil(total / ipagination.pageSize)}`
"
show-less-items show-less-items
@change="handlePageChange" @change="handlePageChange"
@showSizeChange="handleSizeChange" @showSizeChange="handleSizeChange"
@ -129,14 +144,10 @@
:title="isAdd ? 'Add Rule' : 'Edit Rule'" :title="isAdd ? 'Add Rule' : 'Edit Rule'"
:width="845" :width="845"
v-model="visible" v-model="visible"
:maskClosable="false"
@cancel="onCancel" @cancel="onCancel"
> >
<a-form-model <a-form-model ref="al_ruleForm" :model="form" :rules="rules" layout="vertical">
ref="al_ruleForm"
:model="form"
:rules="rules"
layout="vertical"
>
<a-row :gutter="[15, 0]"> <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">
@ -251,7 +262,7 @@
<script> <script>
import { getAction, postAction, httpAction, deleteAction, putAction } from '@/api/manage' import { getAction, postAction, httpAction, deleteAction, putAction } from '@/api/manage'
import BoxTitle from '../../components/boxTitle.vue'; import BoxTitle from '../../components/boxTitle.vue'
export default { export default {
components: { components: {
BoxTitle, BoxTitle,
@ -274,36 +285,36 @@ export default {
}, },
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
total: 0 total: 0,
}, },
visible: false, visible: false,
queryParams: { queryParams: {
station: undefined, station: undefined,
type: undefined, type: undefined,
name: undefined name: undefined,
}, },
stateOptions: [ stateOptions: [
{ {
label: "Disabled", label: 'Disabled',
value: "0" value: '0',
}, },
{ {
label: "Enable", label: 'Enable',
value: "1" value: '1',
} },
], ],
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',
}, },
], ],
nameOptions: [], nameOptions: [],
@ -312,100 +323,84 @@ export default {
form: { 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,
}, },
currId:"", currId: '',
units: "", units: '',
sourceOptions: [], sourceOptions: [],
operatorOptions: [ operatorOptions: [
{ {
label: ">", label: '>',
value: ">" value: '>',
}, },
{ {
label: "<", label: '<',
value: "<" value: '<',
}, },
{ {
label: ">=", label: '>=',
value: ">=" value: '>=',
}, },
{ {
label: "<=", label: '<=',
value: "<=" value: '<=',
}, },
{ {
label: "==", label: '==',
value: "==" value: '==',
}, },
], ],
itemOptions: [], itemOptions: [],
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() {
@ -414,30 +409,30 @@ export default {
}, },
methods: { methods: {
getAlarmSources(val) { getAlarmSources(val) {
getAction("/alarmRule/getSources", {souceType:val}).then(res => { getAction('/alarmRule/getSources', { souceType: val }).then((res) => {
if (res.success) { if (res.success) {
this.nameOptions = res.result.map(item => { this.nameOptions = res.result.map((item) => {
return { return {
label: item.sourceName, label: item.sourceName,
value: item.sourceId value: item.sourceId,
} }
}) })
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
getSourcesOptions(val) { getSourcesOptions(val) {
getAction("/alarmRule/getSources", {souceType:val}).then(res => { getAction('/alarmRule/getSources', { souceType: val }).then((res) => {
if (res.success) { if (res.success) {
this.sourceOptions = res.result.map(item => { this.sourceOptions = res.result.map((item) => {
return { return {
label: item.sourceName, label: item.sourceName,
value: item.sourceId value: item.sourceId,
} }
}) })
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
@ -448,15 +443,15 @@ export default {
pageSize: this.ipagination.pageSize, pageSize: this.ipagination.pageSize,
enabled: this.queryParams.station, enabled: this.queryParams.station,
sourceType: this.queryParams.type, sourceType: this.queryParams.type,
sourceId: this.queryParams.name sourceId: this.queryParams.name,
} }
getAction("/alarmRule/findPage", params).then(res => { getAction('/alarmRule/findPage', params).then((res) => {
this.spinning = false this.spinning = false
if (res.success) { if (res.success) {
this.monitorList = res.result.records this.monitorList = res.result.records
this.ipagination.total = res.result.total this.ipagination.total = res.result.total
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
@ -468,7 +463,7 @@ export default {
this.queryParams = { this.queryParams = {
station: undefined, station: undefined,
type: undefined, type: undefined,
name: undefined name: undefined,
} }
}, },
handlePageChange(page, pageSize) { handlePageChange(page, pageSize) {
@ -508,7 +503,6 @@ export default {
this.form.itemId = undefined this.form.itemId = undefined
if (val) { if (val) {
this.getSourcesOptions(val) this.getSourcesOptions(val)
} else { } else {
this.sourceOptions = [] this.sourceOptions = []
} }
@ -523,17 +517,17 @@ export default {
} }
}, },
getItems(val) { getItems(val) {
getAction("/alarmRule/getItems", {sourceId:val}).then(res => { getAction('/alarmRule/getItems', { sourceId: 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')
} }
}) })
}, },
@ -544,18 +538,18 @@ export default {
getAlarmGroup() { getAlarmGroup() {
let params = { let params = {
pageNo: 1, pageNo: 1,
pageSize: 9999 pageSize: 9999,
} }
getAction("/alarmContactGroup/findPage", params).then(res => { getAction('/alarmContactGroup/findPage', params).then((res) => {
if (res.success) { if (res.success) {
this.contactGroupOptions = res.result.records.map(item => { this.contactGroupOptions = res.result.records.map((item) => {
return { return {
label: item.name, label: item.name,
value: item.id value: item.id,
} }
}) })
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
@ -575,49 +569,49 @@ export default {
units: this.units, units: this.units,
}, },
name: this.form.name, name: this.form.name,
id: this.isAdd?"":this.currId id: this.isAdd ? '' : this.currId,
} }
if (this.isAdd) { if (this.isAdd) {
postAction("/alarmRule/create", params).then(res => { postAction('/alarmRule/create', params).then((res) => {
if (res.success) { if (res.success) {
this.visible = false this.visible = false
this.$message.success("success") this.$message.success('success')
this.getAlarmRulesPage() this.getAlarmRulesPage()
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
} else { } else {
httpAction("/alarmRule/update", params, "put").then(res => { httpAction('/alarmRule/update', params, 'put').then((res) => {
if (res.success) { if (res.success) {
this.visible = false this.visible = false
this.$message.success("success") this.$message.success('success')
this.getAlarmRulesPage() this.getAlarmRulesPage()
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
} }
} }
}); })
}, },
onCancel() { onCancel() {
this.resetForm() this.resetForm()
this.visible = false this.visible = false
}, },
editItem(id) { editItem(id) {
getAction("/alarmRule/findInfo", {alarmRuleId:id}).then(async res => { getAction('/alarmRule/findInfo', { alarmRuleId: id }).then(async (res) => {
if (res.success) { if (res.success) {
this.isAdd = false this.isAdd = false
this.form.sourceType = res.result.sourceType this.form.sourceType = res.result.sourceType
this.form.sourceId = { this.form.sourceId = {
key: res.result.sourceId||"", key: res.result.sourceId || '',
label: res.result.sourceName||"" label: res.result.sourceName || '',
} }
this.form.name = res.result.name this.form.name = res.result.name
this.form.itemId = { this.form.itemId = {
key: res.result.itemId, key: res.result.itemId,
label: JSON.parse(res.result.operator).name label: JSON.parse(res.result.operator).name,
} }
this.form.operator = JSON.parse(res.result.operator).operator this.form.operator = JSON.parse(res.result.operator).operator
this.form.threshold = JSON.parse(res.result.operator).threshold this.form.threshold = JSON.parse(res.result.operator).threshold
@ -626,37 +620,41 @@ export default {
this.form.contactId = res.result.contactId this.form.contactId = res.result.contactId
this.currId = res.result.id this.currId = res.result.id
this.visible = true this.visible = true
getAction("/alarmRule/getSources", { souceType: res.result.sourceType }).then(res => { getAction('/alarmRule/getSources', { souceType: res.result.sourceType })
.then((res) => {
if (res.success) { if (res.success) {
this.sourceOptions = res.result.map(item => { this.sourceOptions = res.result.map((item) => {
return { return {
label: item.sourceName, label: item.sourceName,
value: item.sourceId value: item.sourceId,
} }
}) })
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}).catch(err => {
this.$message.warning("This operation fails. Contact your system administrator")
}) })
getAction("/alarmRule/getItems", { sourceId: res.result.sourceId }).then(res => { .catch((err) => {
this.$message.warning('This operation fails. Contact your system administrator')
})
getAction('/alarmRule/getItems', { sourceId: res.result.sourceId })
.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')
} }
}).catch(err => { })
this.$message.warning("This operation fails. Contact your system administrator") .catch((err) => {
this.$message.warning('This operation fails. Contact your system administrator')
}) })
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
@ -665,47 +663,46 @@ export default {
this.$confirm({ this.$confirm({
title: 'Are you sure to delete this item?', title: 'Are you sure to delete this item?',
onOk() { onOk() {
deleteAction("/alarmRule/deleteById", {alarmRuleId:id}).then(res => { deleteAction('/alarmRule/deleteById', { alarmRuleId: id }).then((res) => {
if (res.success) { if (res.success) {
_this.$message.success("success") _this.$message.success('success')
_this.getAlarmRulesPage() _this.getAlarmRulesPage()
} else { } else {
_this.$message.warning("This operation fails. Contact your system administrator") _this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
onCancel() { onCancel() {
console.log('Cancel'); console.log('Cancel')
}, },
}); })
}, },
changeItemStatus(id, isEnabled) { changeItemStatus(id, isEnabled) {
putAction(`/alarmRule/updateStatus?alarmRuleId=${id}&enabled=${isEnabled==1?0:1}`).then(res => { putAction(`/alarmRule/updateStatus?alarmRuleId=${id}&enabled=${isEnabled == 1 ? 0 : 1}`).then((res) => {
if (res.success) { if (res.success) {
this.$message.success("success") this.$message.success('success')
this.getAlarmRulesPage() this.getAlarmRulesPage()
} 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>

View File

@ -1,18 +1,17 @@
<template> <template>
<div style="height: 100%;"> <div style="height: 100%">
<div class="rules-header"> <div class="rules-header">
<a-row type="flex" :gutter="10"> <a-row type="flex" :gutter="10">
<a-col flex="190px"> <a-col flex="190px">
<a-button class="rules-add" @click="handleAdd"> <a-button class="rules-add" @click="handleAdd">
<img class="icon-add" src="@/assets/images/global/add.png" alt="" /> <img class="icon-add" src="@/assets/images/global/add.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Create Alarm Rule </span>
Create Alarm Rule
</span>
</a-button> </a-button>
</a-col> </a-col>
<a-col flex="265px"> <a-col flex="265px">
<span class="item-label">Stations</span> <span class="item-label">Stations</span>
<a-select style="width:180px" <a-select
style="width: 180px"
v-model="queryParams.station" v-model="queryParams.station"
mode="multiple" mode="multiple"
placeholder="select..." placeholder="select..."
@ -28,15 +27,12 @@
</a-col> </a-col>
<a-col flex="294px"> <a-col flex="294px">
<span class="item-label">Sources</span> <span class="item-label">Sources</span>
<DicSelect <DicSelect v-model="queryParams.source" placeholder="select..." dictCode="alarm_analyse_rule_source" />
v-model="queryParams.source"
placeholder="select..."
dictCode="alarm_analyse_rule_source"
/>
</a-col> </a-col>
<a-col flex="275px"> <a-col flex="275px">
<span class="item-label">Nuclide</span> <span class="item-label">Nuclide</span>
<a-select style="width:180px" <a-select
style="width: 180px"
v-model="queryParams.nuclide" v-model="queryParams.nuclide"
mode="multiple" mode="multiple"
placeholder="select..." placeholder="select..."
@ -53,9 +49,7 @@
<a-col> <a-col>
<a-button class="search-btn" @click="onSearch"> <a-button class="search-btn" @click="onSearch">
<img class="icon-add" src="@/assets/images/global/search.png" alt="" /> <img class="icon-add" src="@/assets/images/global/search.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Search </span>
Search
</span>
</a-button> </a-button>
</a-col> </a-col>
</a-row> </a-row>
@ -67,8 +61,8 @@
<div class="monitor-list-item-title"> <div class="monitor-list-item-title">
<div class="monitor-list-item-title-name">{{ item.name }}</div> <div class="monitor-list-item-title-name">{{ item.name }}</div>
<div class="monitor-list-item-title-server"> <div class="monitor-list-item-title-server">
<span style="color: #5b9cba;">Qualifier</span> <span style="color: #5b9cba">Qualifier</span>
<span style="color: #ade6ee;">{{ item.spectralQualifier.join("、") }}</span> <span style="color: #ade6ee">{{ item.spectralQualifier.join('、') }}</span>
</div> </div>
</div> </div>
<div class="monitor-list-item-content"> <div class="monitor-list-item-content">
@ -77,10 +71,10 @@
<a-col :span="4" class="monitor-list-item-content-info-key">Source</a-col> <a-col :span="4" class="monitor-list-item-content-info-key">Source</a-col>
<a-tooltip> <a-tooltip>
<template slot="title"> <template slot="title">
{{ item.source.join("、") }} {{ item.source.join('、') }}
</template> </template>
<a-col :span="18" class="monitor-list-item-content-info-val"> <a-col :span="18" class="monitor-list-item-content-info-val">
{{ item.source.join("、") }} {{ item.source.join('、') }}
</a-col> </a-col>
</a-tooltip> </a-tooltip>
</a-row> </a-row>
@ -88,10 +82,10 @@
<a-col :span="4" class="monitor-list-item-content-info-key">Stations</a-col> <a-col :span="4" class="monitor-list-item-content-info-key">Stations</a-col>
<a-tooltip> <a-tooltip>
<template slot="title"> <template slot="title">
{{ item.stations.join("、") }} {{ item.stations.join('、') }}
</template> </template>
<a-col :span="18" class="monitor-list-item-content-info-val"> <a-col :span="18" class="monitor-list-item-content-info-val">
{{ item.stations.join("、") }} {{ item.stations.join('、') }}
</a-col> </a-col>
</a-tooltip> </a-tooltip>
</a-row> </a-row>
@ -99,29 +93,44 @@
<a-col :span="4" class="monitor-list-item-content-info-key">Nuclides</a-col> <a-col :span="4" class="monitor-list-item-content-info-key">Nuclides</a-col>
<a-tooltip> <a-tooltip>
<template slot="title"> <template slot="title">
{{ item.nuclides.join("、") }} {{ item.nuclides.join('、') }}
</template> </template>
<a-col :span="18" class="monitor-list-item-content-info-val"> <a-col :span="18" class="monitor-list-item-content-info-val">
{{ item.nuclides.join("、") }} {{ item.nuclides.join('、') }}
</a-col> </a-col>
</a-tooltip> </a-tooltip>
</a-row> </a-row>
</div> </div>
<div :class="[item.enabled==1?'monitor-list-item-content-enable':'monitor-list-item-content-disable', 'monitor-list-item-content-btn']"> <div
{{ item.enabled==1?"Enable":"Disabled" }} :class="[
item.enabled == 1 ? 'monitor-list-item-content-enable' : 'monitor-list-item-content-disable',
'monitor-list-item-content-btn',
]"
>
{{ item.enabled == 1 ? 'Enable' : 'Disabled' }}
</div> </div>
</div> </div>
<div class="monitor-list-item-footer"> <div class="monitor-list-item-footer">
<div class="monitor-list-item-footer-group"> <div class="monitor-list-item-footer-group">
<span style="color: #5b9cba;">Alarm Contact Group</span> <span style="color: #5b9cba">Alarm Contact Group</span>
<span style="color: #ade6ee;">{{ item.groupName }}</span> <span style="color: #ade6ee">{{ item.groupName }}</span>
</div> </div>
<div class="monitor-list-item-footer-actions"> <div class="monitor-list-item-footer-actions">
<span title="Edit" class="actions-edit" @click="editItem(item.id)"></span> <span title="Edit" class="actions-edit" @click="editItem(item.id)"></span>
<span title="Delete" class="actions-delete" @click="deleteItem(item.id)"></span> <span title="Delete" class="actions-delete" @click="deleteItem(item.id)"></span>
<span v-if="item.enabled==1" title="Enable" class="actions-enable" @click="changeItemStatus(item.id,item.enabled)"> <span
v-if="item.enabled == 1"
title="Enable"
class="actions-enable"
@click="changeItemStatus(item.id, item.enabled)"
>
</span> </span>
<span v-if="item.enabled==0" title="Disabled" class="actions-disable" @click="changeItemStatus(item.id,item.enabled)"> <span
v-if="item.enabled == 0"
title="Disabled"
class="actions-disable"
@click="changeItemStatus(item.id, item.enabled)"
>
</span> </span>
</div> </div>
</div> </div>
@ -136,7 +145,10 @@
show-size-changer show-size-changer
show-quick-jumper show-quick-jumper
:total="ipagination.total" :total="ipagination.total"
:show-total="(total, range) => `Total ${total} items Page ${ipagination.current} / ${Math.ceil(total / ipagination.pageSize)}`" :show-total="
(total, range) =>
`Total ${total} items Page ${ipagination.current} / ${Math.ceil(total / ipagination.pageSize)}`
"
show-less-items show-less-items
@change="handlePageChange" @change="handlePageChange"
@showSizeChange="handleSizeChange" @showSizeChange="handleSizeChange"
@ -146,21 +158,18 @@
:title="isAdd ? 'Add Rule' : 'Edit Rule'" :title="isAdd ? 'Add Rule' : 'Edit Rule'"
:width="800" :width="800"
v-model="visible" v-model="visible"
:maskClosable="false"
@cancel="onCancel" @cancel="onCancel"
> >
<a-form <a-form :form="form" :label-col="labelCol" :wrapper-col="wrapperCol">
:form="form"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-item label="Name"> <a-form-item label="Name">
<a-input <a-input
v-decorator="[ v-decorator="[
'name', 'name',
{ {
rules: [{ required: true, message: 'Please input name!' }], rules: [{ required: true, message: 'Please input name!' }],
initialVale: this.formVal.name initialVale: this.formVal.name,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -173,8 +182,8 @@
'source', 'source',
{ {
rules: [{ required: true }], rules: [{ required: true }],
initialVale: this.formVal.source initialVale: this.formVal.source,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -190,8 +199,8 @@
'station', 'station',
{ {
rules: [{ required: true, message: 'Please select station' }], rules: [{ required: true, message: 'Please select station' }],
initialVale: this.formVal.station initialVale: this.formVal.station,
} },
]" ]"
> >
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" /> <img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
@ -210,8 +219,8 @@
'nuclide', 'nuclide',
{ {
rules: [{ required: true, message: 'Please select nuclide' }], rules: [{ required: true, message: 'Please select nuclide' }],
initialVale: this.formVal.nuclide initialVale: this.formVal.nuclide,
} },
]" ]"
> >
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" /> <img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
@ -225,8 +234,8 @@
'qualifier', 'qualifier',
{ {
rules: [{ required: true }], rules: [{ required: true }],
initialVale: this.formVal.qualifier initialVale: this.formVal.qualifier,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -239,8 +248,8 @@
'condition', 'condition',
{ {
rules: [{ required: true }], rules: [{ required: true }],
initialVale: this.formVal.condition initialVale: this.formVal.condition,
} },
]" ]"
> >
</dic-select> </dic-select>
@ -256,8 +265,8 @@
'contactGroup', 'contactGroup',
{ {
rules: [{ required: true }], rules: [{ required: true }],
initialVale: this.formVal.contactGroup initialVale: this.formVal.contactGroup,
} },
]" ]"
> >
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" /> <img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
@ -269,8 +278,8 @@
v-decorator="[ v-decorator="[
'remark', 'remark',
{ {
initialVale: this.formVal.remark initialVale: this.formVal.remark,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -287,7 +296,7 @@
<script> <script>
import { getAction, postAction, httpAction, deleteAction, putAction } from '@/api/manage' import { getAction, postAction, httpAction, deleteAction, putAction } from '@/api/manage'
import DicSelect from '../../components/dicSelect.vue'; import DicSelect from '../../components/dicSelect.vue'
export default { export default {
components: { components: {
DicSelect, DicSelect,
@ -300,17 +309,17 @@ export default {
queryParams: { queryParams: {
station: undefined, station: undefined,
source: undefined, source: undefined,
nuclide: undefined nuclide: undefined,
}, },
sourceOptions: [ sourceOptions: [
{ {
label: "IDC", label: 'IDC',
value: "idc" value: 'idc',
}, },
{ {
label: "ARMD", label: 'ARMD',
value: "armd" value: 'armd',
} },
], ],
stationOptions: [], stationOptions: [],
nuclideOptions: [], nuclideOptions: [],
@ -324,66 +333,66 @@ export default {
}, },
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
total: 0 total: 0,
}, },
labelCol: { span: 4 }, labelCol: { span: 4 },
wrapperCol: { span: 18 }, wrapperCol: { span: 18 },
form: this.$form.createForm(this), form: this.$form.createForm(this),
contactGroupOptions: [], contactGroupOptions: [],
formVal: { formVal: {
name: "", name: '',
source: null, source: null,
station: undefined, station: undefined,
nuclide: undefined, nuclide: undefined,
qualifier: null, qualifier: null,
condition: null, condition: null,
contactGroup: undefined, contactGroup: undefined,
remark: "" remark: '',
}, },
monitorList: [], monitorList: [],
currId:"", currId: '',
} }
}, },
created() { created() {
this.getStationList(); this.getStationList()
this.getNuclideList(); this.getNuclideList()
this.getAlarmGroup(); this.getAlarmGroup()
this.getAlarmRulesPage() this.getAlarmRulesPage()
}, },
methods: { methods: {
getStationList() { getStationList() {
getAction("/webStatistics/findStationList",{menuName:""}).then(res => { getAction('/webStatistics/findStationList', { menuName: '' }).then((res) => {
if (res.success) { if (res.success) {
if (res.result.length > 0) { if (res.result.length > 0) {
this.stationOptions = res.result.map(item => { this.stationOptions = res.result.map((item) => {
return { return {
label: item.stationCode, label: item.stationCode,
value: `${item.stationId}` value: `${item.stationId}`,
} }
}) })
} else { } else {
this.stationOptions = [] this.stationOptions = []
} }
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
getNuclideList() { getNuclideList() {
getAction("/sys/defaultNuclide/allName",{useType:2}).then(res => { getAction('/sys/defaultNuclide/allName', { useType: 2 }).then((res) => {
if (res.success) { if (res.success) {
if (res.result.length > 0) { if (res.result.length > 0) {
this.nuclideOptions = res.result.map(item => { this.nuclideOptions = res.result.map((item) => {
return { return {
label: item, label: item,
value: item value: item,
} }
}) })
} else { } else {
this.nuclideOptions = [] this.nuclideOptions = []
} }
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
@ -392,9 +401,7 @@ export default {
this.visible = true this.visible = true
}, },
filterOption(input, option) { filterOption(input, option) {
return ( return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
}, },
onStationChange(val) { onStationChange(val) {
this.queryParams.station = val this.queryParams.station = val
@ -412,15 +419,15 @@ export default {
pageSize: this.ipagination.pageSize, pageSize: this.ipagination.pageSize,
stations: this.queryParams.station, stations: this.queryParams.station,
source: this.queryParams.source, source: this.queryParams.source,
nuclides: this.queryParams.nuclide nuclides: this.queryParams.nuclide,
} }
getAction("/alarmAnalysisRule/findPage", params).then(res => { getAction('/alarmAnalysisRule/findPage', params).then((res) => {
this.spinning = false this.spinning = false
if (res.success) { if (res.success) {
this.monitorList = res.result.records this.monitorList = res.result.records
this.ipagination.total = res.result.total this.ipagination.total = res.result.total
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
@ -430,7 +437,7 @@ export default {
}, },
editItem(id) { editItem(id) {
this.currId = id this.currId = id
getAction("/alarmAnalysisRule/finInfo", { id }).then( res => { getAction('/alarmAnalysisRule/finInfo', { id }).then((res) => {
if (res.success) { if (res.success) {
this.isAdd = false this.isAdd = false
this.visible = true this.visible = true
@ -443,11 +450,11 @@ export default {
qualifier: res.result.qualifierChecked.join(','), qualifier: res.result.qualifierChecked.join(','),
condition: res.result.conditionChecked.join(','), condition: res.result.conditionChecked.join(','),
contactGroup: res.result.contactGroup, contactGroup: res.result.contactGroup,
remark: res.result.remark remark: res.result.remark,
}); })
}) })
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
@ -456,27 +463,27 @@ export default {
this.$confirm({ this.$confirm({
title: 'Are you sure to delete this item?', title: 'Are you sure to delete this item?',
onOk() { onOk() {
deleteAction("/alarmAnalysisRule/delete", {id:id}).then(res => { deleteAction('/alarmAnalysisRule/delete', { id: id }).then((res) => {
if (res.success) { if (res.success) {
_this.$message.success("success") _this.$message.success('success')
_this.getAlarmRulesPage() _this.getAlarmRulesPage()
} else { } else {
_this.$message.warning("This operation fails. Contact your system administrator") _this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
onCancel() { onCancel() {
console.log('Cancel'); console.log('Cancel')
}, },
}); })
}, },
changeItemStatus(id, isEnabled) { changeItemStatus(id, isEnabled) {
putAction(`/alarmAnalysisRule/updateStatus?id=${id}&enabled=${isEnabled==1?0:1}`).then(res => { putAction(`/alarmAnalysisRule/updateStatus?id=${id}&enabled=${isEnabled == 1 ? 0 : 1}`).then((res) => {
if (res.success) { if (res.success) {
this.$message.success("success") this.$message.success('success')
this.getAlarmRulesPage() this.getAlarmRulesPage()
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
@ -493,18 +500,18 @@ export default {
getAlarmGroup() { getAlarmGroup() {
let params = { let params = {
pageNo: 1, pageNo: 1,
pageSize: 9999 pageSize: 9999,
} }
getAction("/alarmContactGroup/findPage", params).then(res => { getAction('/alarmContactGroup/findPage', params).then((res) => {
if (res.success) { if (res.success) {
this.contactGroupOptions = res.result.records.map(item => { this.contactGroupOptions = res.result.records.map((item) => {
return { return {
label: item.name, label: item.name,
value: item.id value: item.id,
} }
}) })
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
@ -515,32 +522,32 @@ export default {
conditions: values.condition, conditions: values.condition,
name: values.name, name: values.name,
remark: values.remark, remark: values.remark,
stations:values.station.join(","), stations: values.station.join(','),
source: values.source, source: values.source,
nuclides:values.nuclide.join(","), nuclides: values.nuclide.join(','),
contactGroup: values.contactGroup, contactGroup: values.contactGroup,
spectralQualifier: values.qualifier, spectralQualifier: values.qualifier,
} }
if (this.isAdd) { if (this.isAdd) {
postAction("/alarmAnalysisRule/add", params).then(res => { postAction('/alarmAnalysisRule/add', params).then((res) => {
if (res.success) { if (res.success) {
this.visible = false this.visible = false
this.form.resetFields() this.form.resetFields()
this.$message.success("success") this.$message.success('success')
this.getAlarmRulesPage() this.getAlarmRulesPage()
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
} else { } else {
httpAction("/alarmAnalysisRule/edit", {...params,id: this.currId}, "put").then(res => { httpAction('/alarmAnalysisRule/edit', { ...params, id: this.currId }, 'put').then((res) => {
if (res.success) { if (res.success) {
this.visible = false this.visible = false
this.form.resetFields() this.form.resetFields()
this.$message.success("success") this.$message.success('success')
this.getAlarmRulesPage() this.getAlarmRulesPage()
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
} }

View File

@ -1,11 +1,9 @@
<template> <template>
<div style="height: 100%;"> <div style="height: 100%">
<div class="search-bar"> <div class="search-bar">
<a-row type="flex"> <a-row type="flex">
<a-col flex="108px"> <a-col flex="108px">
<a-button class="search-btn" type="primary" @click="handleConfig"> <a-button class="search-btn" type="primary" @click="handleConfig"> Config </a-button>
Config
</a-button>
</a-col> </a-col>
<a-col flex="380px"> <a-col flex="380px">
<span class="item-label">Cacl date</span> <span class="item-label">Cacl date</span>
@ -35,17 +33,16 @@
show-size-changer show-size-changer
show-quick-jumper show-quick-jumper
:total="ipagination.total" :total="ipagination.total"
:show-total="(total, range) => `Total ${total} items Page ${ipagination.current} / ${Math.ceil(total / ipagination.pageSize)}`" :show-total="
(total, range) =>
`Total ${total} items Page ${ipagination.current} / ${Math.ceil(total / ipagination.pageSize)}`
"
show-less-items show-less-items
@change="handlePageChange" @change="handlePageChange"
@showSizeChange="handleSizeChange" @showSizeChange="handleSizeChange"
/> />
</div> </div>
<a-modal <a-modal title="Config" v-model="visible" :maskClosable="false" @cancel="onCancel">
title="Config"
v-model="visible"
@cancel="onCancel"
>
<a-form :form="form" :label-col="{ span: 5 }" :wrapper-col="{ span: 17 }"> <a-form :form="form" :label-col="{ span: 5 }" :wrapper-col="{ span: 17 }">
<a-form-item label="Cycle"> <a-form-item label="Cycle">
<a-input-number <a-input-number
@ -56,8 +53,8 @@
{ required: true, message: 'Please input days!' }, { required: true, message: 'Please input days!' },
{ pattern: new RegExp('^[1-9]\\d*$'), message: 'Please input a positive integer!' }, { pattern: new RegExp('^[1-9]\\d*$'), message: 'Please input a positive integer!' },
], ],
initialVale: this.formVal.days initialVale: this.formVal.days,
} },
]" ]"
/>days />days
</a-form-item> </a-form-item>
@ -70,8 +67,8 @@
{ required: true, message: 'Please input index!' }, { required: true, message: 'Please input index!' },
{ pattern: new RegExp('^([1-9]|[1-9]\\d|100)$'), message: 'Please input an integer from 1 to 100!' }, { pattern: new RegExp('^([1-9]|[1-9]\\d|100)$'), message: 'Please input an integer from 1 to 100!' },
], ],
initialVale: this.formVal.index initialVale: this.formVal.index,
} },
]" ]"
/>% />%
</a-form-item> </a-form-item>
@ -88,31 +85,35 @@
<script> <script>
import dateFormat from '@/components/jeecg/JEasyCron/format-date' import dateFormat from '@/components/jeecg/JEasyCron/format-date'
import moment from 'moment'; import moment from 'moment'
import TableList from '../../components/tableList.vue'; import TableList from '../../components/tableList.vue'
import { getAction, postAction, httpAction, deleteAction } from '@/api/manage' import { getAction, postAction, httpAction, deleteAction } from '@/api/manage'
const columns = [ const columns = [
{ {
title: 'NUCLIDE', title: 'NUCLIDE',
align: 'center', align: 'center',
dataIndex: 'nuclide', dataIndex: 'nuclide',
},{ },
{
title: 'VALUE', title: 'VALUE',
align: 'center', align: 'center',
dataIndex: 'val', dataIndex: 'val',
},{ },
{
title: 'SOURCE TYPE', title: 'SOURCE TYPE',
align: 'center', align: 'center',
dataIndex: 'datasource', dataIndex: 'datasource',
},{ },
{
title: 'CACL DATE', title: 'CACL DATE',
align: 'center', align: 'center',
dataIndex: 'caclDate', dataIndex: 'caclDate',
},{ },
{
title: 'CYCLE', title: 'CYCLE',
align: 'center', align: 'center',
dataIndex: 'cycle' dataIndex: 'cycle',
} },
] ]
export default { export default {
components: { components: {
@ -125,7 +126,7 @@ export default {
loading: false, loading: false,
queryParams: { queryParams: {
startDate: dateFormat(new Date(), 'yyyy-MM-dd'), startDate: dateFormat(new Date(), 'yyyy-MM-dd'),
endDate: dateFormat(new Date(), 'yyyy-MM-dd') endDate: dateFormat(new Date(), 'yyyy-MM-dd'),
}, },
ipagination: { ipagination: {
current: 1, current: 1,
@ -137,46 +138,46 @@ export default {
}, },
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
total: 0 total: 0,
}, },
isAdd: true, isAdd: true,
visible: false, visible: false,
form: this.$form.createForm(this), form: this.$form.createForm(this),
formVal: { formVal: {
days:"", days: '',
index: "", index: '',
}, },
currId:"" currId: '',
} }
}, },
created() { created() {
this.queryParams.startDate = this.getBeforeDate(1) this.queryParams.startDate = this.getBeforeDate(1)
}, },
mounted() { mounted() {
this.getNuclideAvgList(); this.getNuclideAvgList()
}, },
methods: { methods: {
// n // n
getBeforeDate(n) { getBeforeDate(n) {
var n = n; var n = n
var d = new Date(); var d = new Date()
var year = d.getFullYear(); var year = d.getFullYear()
var mon=d.getMonth()+1; var mon = d.getMonth() + 1
var day=d.getDate(); var day = d.getDate()
if (day <= n) { if (day <= n) {
if (mon > 1) { if (mon > 1) {
mon=mon-1; mon = mon - 1
} else { } else {
year = year-1; year = year - 1
mon = 12; mon = 12
} }
} }
d.setDate(d.getDate()-n); d.setDate(d.getDate() - n)
year = d.getFullYear(); year = d.getFullYear()
mon=d.getMonth()+1; mon = d.getMonth() + 1
day=d.getDate(); day = d.getDate()
var s = year+"-"+(mon<10?('0'+mon):mon)+"-"+(day<10?('0'+day):day); var s = year + '-' + (mon < 10 ? '0' + mon : mon) + '-' + (day < 10 ? '0' + day : day)
return s; return s
}, },
moment, moment,
getNuclideAvgList() { getNuclideAvgList() {
@ -185,15 +186,15 @@ export default {
startDate: this.queryParams.startDate, startDate: this.queryParams.startDate,
endDate: this.queryParams.endDate, endDate: this.queryParams.endDate,
pageNo: this.ipagination.current, pageNo: this.ipagination.current,
pageSize: this.ipagination.pageSize pageSize: this.ipagination.pageSize,
} }
getAction("/nuclideAvg/findPage", params).then(res => { getAction('/nuclideAvg/findPage', params).then((res) => {
this.loading = false this.loading = false
if (res.success) { if (res.success) {
this.dataSource = res.result.records this.dataSource = res.result.records
this.ipagination.total = res.result.total this.ipagination.total = res.result.total
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
@ -214,15 +215,15 @@ export default {
}, },
handleConfig() { handleConfig() {
this.visible = true this.visible = true
getAction("/nuclideParam/findInfo").then(res => { getAction('/nuclideParam/findInfo').then((res) => {
if (res.success) { if (res.success) {
this.currId = res.result.id this.currId = res.result.id
this.form.setFieldsValue({ this.form.setFieldsValue({
days: res.result.days, days: res.result.days,
index: res.result.index*100 index: res.result.index * 100,
}); })
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
@ -232,13 +233,13 @@ export default {
let params = { let params = {
id: this.currId, id: this.currId,
days: values.days, days: values.days,
index:values.index/100 index: values.index / 100,
} }
httpAction("/nuclideParam/update", params, "put").then(res => { httpAction('/nuclideParam/update', params, 'put').then((res) => {
if (res.success) { if (res.success) {
this.form.resetFields() this.form.resetFields()
this.visible = false this.visible = false
this.$message.success("success") this.$message.success('success')
} else { } else {
this.$message.info(res.result.message) this.$message.info(res.result.message)
} }
@ -308,6 +309,6 @@ export default {
.ant-input-number { .ant-input-number {
width: 85%; width: 85%;
margin-right: 10px; margin-right: 10px;
background-color: #03353f !important background-color: #03353f !important;
} }
</style> </style>

View File

@ -1,31 +1,25 @@
<template> <template>
<div style="height: 100%;"> <div style="height: 100%">
<div class="view-header"> <div class="view-header">
<div class="view-num">Alarms<span>{{ alarmTotal }}</span></div> <div class="view-num">
Alarms<span>{{ alarmTotal }}</span>
</div>
<div> <div>
<a-button class="view-btn" @click="onAdd"> <a-button class="view-btn" @click="onAdd">
<img class="icon-add" src="@/assets/images/global/add.png" alt="" /> <img class="icon-add" src="@/assets/images/global/add.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Add </span>
Add
</span>
</a-button> </a-button>
<a-button class="view-btn" @click="onEdit"> <a-button class="view-btn" @click="onEdit">
<img class="icon-add" src="@/assets/images/global/edit.png" alt="" /> <img class="icon-add" src="@/assets/images/global/edit.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Edit </span>
Edit
</span>
</a-button> </a-button>
<a-button class="view-btn" @click="onDelete"> <a-button class="view-btn" @click="onDelete">
<img class="icon-add" src="@/assets/images/global/delete.png" alt="" /> <img class="icon-add" src="@/assets/images/global/delete.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Delete </span>
Delete
</span>
</a-button> </a-button>
<a-button class="view-btn" @click="getSysDatabase"> <a-button class="view-btn" @click="getSysDatabase">
<img class="icon-add" src="@/assets/images/global/reset-pwd.png" alt="" /> <img class="icon-add" src="@/assets/images/global/reset-pwd.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Refresh </span>
Refresh
</span>
</a-button> </a-button>
</div> </div>
</div> </div>
@ -44,22 +38,24 @@
> >
<template slot="status" slot-scope="{ record }"> <template slot="status" slot-scope="{ record }">
<div> <div>
<img v-if="record.online" src="@/assets/images/abnormalAlarm/on.png" alt=""> <img v-if="record.online" src="@/assets/images/abnormalAlarm/on.png" alt="" />
<img v-else src="@/assets/images/abnormalAlarm/off.png" alt=""> <img v-else src="@/assets/images/abnormalAlarm/off.png" alt="" />
<span :class="[record.online?'status-on':'status-off']">{{ record.online?"Connecting":"Disconnect" }}</span> <span :class="[record.online ? 'status-on' : 'status-off']">{{
record.online ? 'Connecting' : 'Disconnect'
}}</span>
</div> </div>
</template> </template>
<template slot="alarms" slot-scope="{ text, record }"> <template slot="alarms" slot-scope="{ text, record }">
<span :class="[record.alarmRed ? 'isAlarm' : '', 'alarm-text']">{{ text }}</span> <span :class="[record.alarmRed ? 'isAlarm' : '', 'alarm-text']">{{ text }}</span>
</template> </template>
<template slot="cpu" slot-scope="{ text, record }"> <template slot="cpu" slot-scope="{ text, record }">
<span :class="[record.cpuRed?'isRed':'','alarm-text']">{{ text?text:"--" }}</span> <span :class="[record.cpuRed ? 'isRed' : '', 'alarm-text']">{{ text ? text : '--' }}</span>
</template> </template>
<template slot="memory" slot-scope="{ text, record }"> <template slot="memory" slot-scope="{ text, record }">
<span :class="[record.memoryRed?'isRed':'','alarm-text']">{{ text?text:"--" }}</span> <span :class="[record.memoryRed ? 'isRed' : '', 'alarm-text']">{{ text ? text : '--' }}</span>
</template> </template>
<template slot="disk" slot-scope="{ text, record }"> <template slot="disk" slot-scope="{ text, record }">
<span :class="[record.diskRed?'isRed':'','alarm-text']">{{ text?text:"--" }}</span> <span :class="[record.diskRed ? 'isRed' : '', 'alarm-text']">{{ text ? text : '--' }}</span>
</template> </template>
</TableList> </TableList>
</div> </div>
@ -71,17 +67,16 @@
show-size-changer show-size-changer
show-quick-jumper show-quick-jumper
:total="ipagination.total" :total="ipagination.total"
:show-total="(total, range) => `Total ${total} items Page ${ipagination.current} / ${Math.ceil(total / ipagination.pageSize)}`" :show-total="
(total, range) =>
`Total ${total} items Page ${ipagination.current} / ${Math.ceil(total / ipagination.pageSize)}`
"
show-less-items show-less-items
@change="handlePageChange" @change="handlePageChange"
@showSizeChange="handleSizeChange" @showSizeChange="handleSizeChange"
/> />
</div> </div>
<a-modal <a-modal :title="isAdd ? 'Add' : 'Edit'" v-model="visible" :maskClosable="false" @cancel="onCancel">
:title="isAdd ? 'Add' : 'Edit'"
v-model="visible"
@cancel="onCancel"
>
<a-form :form="form" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }"> <a-form :form="form" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }">
<a-form-item label="Name"> <a-form-item label="Name">
<a-input <a-input
@ -89,8 +84,8 @@
'name', 'name',
{ {
rules: [{ required: true, message: 'Please input name!' }], rules: [{ required: true, message: 'Please input name!' }],
initialVale: this.formVal.name initialVale: this.formVal.name,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -102,8 +97,8 @@
'type', 'type',
{ {
rules: [{ required: true, message: 'Please select a DB Type!' }], rules: [{ required: true, message: 'Please select a DB Type!' }],
initialVale: this.formVal.type initialVale: this.formVal.type,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -113,8 +108,8 @@
'port', 'port',
{ {
rules: [{ required: true, message: 'Please input port!' }], rules: [{ required: true, message: 'Please input port!' }],
initialVale: this.formVal.port initialVale: this.formVal.port,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -124,8 +119,8 @@
'ipAddress', 'ipAddress',
{ {
rules: [{ required: true, message: 'Please input ip address!' }], rules: [{ required: true, message: 'Please input ip address!' }],
initialVale: this.formVal.ipAddress initialVale: this.formVal.ipAddress,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -135,8 +130,8 @@
'username', 'username',
{ {
rules: [{ required: true, message: 'Please input username!' }], rules: [{ required: true, message: 'Please input username!' }],
initialVale: this.formVal.username initialVale: this.formVal.username,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -146,8 +141,8 @@
'password', 'password',
{ {
rules: [{ required: true, message: 'Please input DB Password!' }], rules: [{ required: true, message: 'Please input DB Password!' }],
initialVale: this.formVal.password initialVale: this.formVal.password,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -163,64 +158,73 @@
</template> </template>
<script> <script>
import TableList from '../../components/tableList.vue'; import TableList from '../../components/tableList.vue'
import { getAction, postAction, httpAction, deleteAction } from '@/api/manage' import { getAction, postAction, httpAction, deleteAction } from '@/api/manage'
const columns = [ const columns = [
{ {
title: 'NAME', title: 'NAME',
align: 'center', align: 'center',
dataIndex: 'name' dataIndex: 'name',
},{ },
{
title: 'STATUS', title: 'STATUS',
align: 'center', align: 'center',
dataIndex: 'online', dataIndex: 'online',
scopedSlots: { scopedSlots: {
customRender: 'status' customRender: 'status',
} },
},{ },
{
title: 'IP ADDRESS', title: 'IP ADDRESS',
align: 'center', align: 'center',
dataIndex: 'ipAddress' dataIndex: 'ipAddress',
},{ },
{
title: 'DB TYPE', title: 'DB TYPE',
align: 'center', align: 'center',
dataIndex: 'dataBaseType' dataIndex: 'dataBaseType',
},{ },
{
title: 'PROT', title: 'PROT',
align: 'center', align: 'center',
dataIndex: 'port' dataIndex: 'port',
},{ },
{
title: 'SLOW QUERY', title: 'SLOW QUERY',
align: 'center', align: 'center',
dataIndex: 'slowQuery' dataIndex: 'slowQuery',
},{ },
{
title: 'ALARMS', title: 'ALARMS',
align: 'center', align: 'center',
dataIndex: 'alarms', dataIndex: 'alarms',
scopedSlots: { scopedSlots: {
customRender: 'alarms', customRender: 'alarms',
} },
},{ },
{
title: 'CPU UTILIZATION', title: 'CPU UTILIZATION',
align: 'center', align: 'center',
dataIndex: 'cpuUutilzation', dataIndex: 'cpuUutilzation',
scopedSlots: { scopedSlots: {
customRender: 'cpu', customRender: 'cpu',
} },
},{ },
{
title: 'MEMORY USAGE', title: 'MEMORY USAGE',
align: 'center', align: 'center',
dataIndex: 'memoryUsage', dataIndex: 'memoryUsage',
scopedSlots: { scopedSlots: {
customRender: 'memory', customRender: 'memory',
} },
},{ },
{
title: 'DISK USAGE', title: 'DISK USAGE',
align: 'center', align: 'center',
dataIndex: 'diskUsage', dataIndex: 'diskUsage',
scopedSlots: { scopedSlots: {
customRender: 'disk', customRender: 'disk',
} },
}, },
] ]
export default { export default {
@ -234,14 +238,14 @@ export default {
visible: false, visible: false,
form: this.$form.createForm(this), form: this.$form.createForm(this),
formVal: { formVal: {
username: "", username: '',
password: "", password: '',
name: "", name: '',
type: undefined, type: undefined,
port: "", port: '',
ipAddress:"" ipAddress: '',
}, },
currentId:"", currentId: '',
columns, columns,
dataSource: [], dataSource: [],
ipagination: { ipagination: {
@ -254,36 +258,36 @@ export default {
}, },
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
total: 0 total: 0,
}, },
} }
}, },
computed: { computed: {
alarmTotal() { alarmTotal() {
let num = 0 let num = 0
this.dataSource.forEach(item => { this.dataSource.forEach((item) => {
num = item.alarmRed ? num + item.alarms : num num = item.alarmRed ? num + item.alarms : num
}); })
return num return num
} },
}, },
mounted() { mounted() {
this.getSysDatabase(); this.getSysDatabase()
}, },
methods: { methods: {
getSysDatabase() { getSysDatabase() {
this.loading = true this.loading = true
let params = { let params = {
pageNo: this.ipagination.current, pageNo: this.ipagination.current,
pageSize: this.ipagination.pageSize pageSize: this.ipagination.pageSize,
} }
getAction("/sysDatabase/findPage", params).then(res => { getAction('/sysDatabase/findPage', params).then((res) => {
this.loading = false this.loading = false
if (res.success) { if (res.success) {
this.ipagination.total = res.result.total this.ipagination.total = res.result.total
this.dataSource = res.result.records this.dataSource = res.result.records
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
@ -305,7 +309,7 @@ export default {
if (this.currentId) { if (this.currentId) {
this.isAdd = false this.isAdd = false
this.visible = true this.visible = true
getAction("/sysDatabase/findInfo", {id:this.currentId}).then(res => { getAction('/sysDatabase/findInfo', { id: this.currentId }).then((res) => {
if (res.success) { if (res.success) {
this.form.setFieldsValue({ this.form.setFieldsValue({
username: res.result.username, username: res.result.username,
@ -313,14 +317,14 @@ export default {
name: res.result.name, name: res.result.name,
type: res.result.type, type: res.result.type,
port: res.result.port, port: res.result.port,
ipAddress: res.result.ipAddress ipAddress: res.result.ipAddress,
}); })
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
} else { } else {
this.$message.info("Please select a piece of data") this.$message.info('Please select a piece of data')
} }
}, },
onDelete() { onDelete() {
@ -329,39 +333,39 @@ export default {
this.$confirm({ this.$confirm({
title: 'Are you sure to delete this item?', title: 'Are you sure to delete this item?',
onOk() { onOk() {
deleteAction("/sysDatabase/deleteById", {id:_this.currentId}).then(res => { deleteAction('/sysDatabase/deleteById', { id: _this.currentId }).then((res) => {
if (res.success) { if (res.success) {
_this.$message.success("success") _this.$message.success('success')
this.currentId="" this.currentId = ''
_this.getSysDatabase() _this.getSysDatabase()
} else { } else {
_this.$message.warning("This operation fails. Contact your system administrator") _this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
onCancel() { onCancel() {
console.log('Cancel'); console.log('Cancel')
}, },
}); })
} else { } else {
this.$message.info("Please select a piece of data") this.$message.info('Please select a piece of data')
} }
}, },
selectRow(record) { selectRow(record) {
this.currentId = record.id this.currentId = record.id
}, },
cancelRow() { cancelRow() {
this.currentId = "" this.currentId = ''
}, },
onSave() { onSave() {
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
if (!err) { if (!err) {
if (this.isAdd) { if (this.isAdd) {
postAction("/sysDatabase/create", values).then(res => { postAction('/sysDatabase/create', values).then((res) => {
if (res.success) { if (res.success) {
this.form.resetFields() this.form.resetFields()
this.visible = false this.visible = false
this.$message.success("success") this.$message.success('success')
this.getSysDatabase() this.getSysDatabase()
} else { } else {
this.$message.info(res.result.message) this.$message.info(res.result.message)
@ -370,13 +374,13 @@ export default {
} else { } else {
let params = { let params = {
id: this.currentId, id: this.currentId,
...values ...values,
} }
httpAction("/sysDatabase/update", params, "put").then(res => { httpAction('/sysDatabase/update', params, 'put').then((res) => {
if (res.success) { if (res.success) {
this.form.resetFields() this.form.resetFields()
this.visible = false this.visible = false
this.$message.success("success") this.$message.success('success')
this.getSysDatabase() this.getSysDatabase()
} else { } else {
this.$message.info(res.result.message) this.$message.info(res.result.message)
@ -384,22 +388,22 @@ export default {
}) })
} }
} }
}); })
}, },
onCancel() { onCancel() {
this.form.resetFields() this.form.resetFields()
this.visible = false this.visible = false
}, },
onRowDbclick(record) { onRowDbclick(record) {
console.log(record); console.log(record)
let query = { let query = {
id:record.id id: record.id,
} }
this.$router.push({ this.$router.push({
path: '/alarm/databaseMonitor/instances', path: '/alarm/databaseMonitor/instances',
query query,
}) })
} },
}, },
} }
</script> </script>
@ -433,7 +437,7 @@ export default {
color: #ffffff; color: #ffffff;
border: none; border: none;
margin-left: 20px; margin-left: 20px;
box-shadow: 0px 1px 1px 0px #000000;; box-shadow: 0px 1px 1px 0px #000000;
} }
} }
.view-main { .view-main {
@ -488,6 +492,6 @@ export default {
} }
.ant-input-number { .ant-input-number {
width: 100%; width: 100%;
background-color: #03353f !important background-color: #03353f !important;
} }
</style> </style>

View File

@ -1,31 +1,25 @@
<template> <template>
<div style="height: 100%;"> <div style="height: 100%">
<div class="view-header"> <div class="view-header">
<div class="view-num">Alarms<span>{{ alarmTotal }}</span></div> <div class="view-num">
Alarms<span>{{ alarmTotal }}</span>
</div>
<div> <div>
<a-button class="view-btn" @click="onAdd"> <a-button class="view-btn" @click="onAdd">
<img class="icon-add" src="@/assets/images/global/add.png" alt="" /> <img class="icon-add" src="@/assets/images/global/add.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Add </span>
Add
</span>
</a-button> </a-button>
<a-button class="view-btn" @click="onEdit"> <a-button class="view-btn" @click="onEdit">
<img class="icon-add" src="@/assets/images/global/edit.png" alt="" /> <img class="icon-add" src="@/assets/images/global/edit.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Edit </span>
Edit
</span>
</a-button> </a-button>
<a-button class="view-btn" @click="onDelete"> <a-button class="view-btn" @click="onDelete">
<img class="icon-add" src="@/assets/images/global/delete.png" alt="" /> <img class="icon-add" src="@/assets/images/global/delete.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Delete </span>
Delete
</span>
</a-button> </a-button>
<a-button class="view-btn" @click="getSysEmail"> <a-button class="view-btn" @click="getSysEmail">
<img class="icon-add" src="@/assets/images/global/reset-pwd.png" alt="" /> <img class="icon-add" src="@/assets/images/global/reset-pwd.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Refresh </span>
Refresh
</span>
</a-button> </a-button>
</div> </div>
</div> </div>
@ -44,31 +38,33 @@
> >
<template slot="status" slot-scope="{ record }"> <template slot="status" slot-scope="{ record }">
<div> <div>
<img v-if="record.online" src="@/assets/images/abnormalAlarm/on.png" alt=""> <img v-if="record.online" src="@/assets/images/abnormalAlarm/on.png" alt="" />
<img v-else src="@/assets/images/abnormalAlarm/off.png" alt=""> <img v-else src="@/assets/images/abnormalAlarm/off.png" alt="" />
<span :class="[record.online?'status-on':'status-off']">{{ record.online?"Connecting":"Disconnect" }}</span> <span :class="[record.online ? 'status-on' : 'status-off']">{{
record.online ? 'Connecting' : 'Disconnect'
}}</span>
</div> </div>
</template> </template>
<template slot="enabled" slot-scope="{ text }"> <template slot="enabled" slot-scope="{ text }">
<div> <div>
<img v-if="text==1" src="@/assets/images/abnormalAlarm/on.png" alt=""> <img v-if="text == 1" src="@/assets/images/abnormalAlarm/on.png" alt="" />
<img v-else src="@/assets/images/abnormalAlarm/off.png" alt=""> <img v-else src="@/assets/images/abnormalAlarm/off.png" alt="" />
</div> </div>
</template> </template>
<template slot="today" slot-scope="{ text }"> <template slot="today" slot-scope="{ text }">
<span class="alarm-text">{{ text?text:"--" }}</span> <span class="alarm-text">{{ text ? text : '--' }}</span>
</template> </template>
<template slot="yesterday" slot-scope="{ text }"> <template slot="yesterday" slot-scope="{ text }">
<span class="alarm-text">{{ text?text:"--" }}</span> <span class="alarm-text">{{ text ? text : '--' }}</span>
</template> </template>
<template slot="weekly" slot-scope="{ text }"> <template slot="weekly" slot-scope="{ text }">
<span class="alarm-text">{{ text?text:"--" }}</span> <span class="alarm-text">{{ text ? text : '--' }}</span>
</template> </template>
<template slot="alarms" slot-scope="{ text, record }"> <template slot="alarms" slot-scope="{ text, record }">
<span :class="[record.alarmRed ? 'isAlarm' : '', 'alarm-text']">{{ text }}</span> <span :class="[record.alarmRed ? 'isAlarm' : '', 'alarm-text']">{{ text }}</span>
</template> </template>
<template slot="stoer" slot-scope="{ text, record }"> <template slot="stoer" slot-scope="{ text, record }">
<span :class="[record.cpuRed?'isRed':'','alarm-text']">{{ text?text:"--" }}</span> <span :class="[record.cpuRed ? 'isRed' : '', 'alarm-text']">{{ text ? text : '--' }}</span>
</template> </template>
</TableList> </TableList>
</div> </div>
@ -80,17 +76,16 @@
show-size-changer show-size-changer
show-quick-jumper show-quick-jumper
:total="ipagination.total" :total="ipagination.total"
:show-total="(total, range) => `Total ${total} items Page ${ipagination.current} / ${Math.ceil(total / ipagination.pageSize)}`" :show-total="
(total, range) =>
`Total ${total} items Page ${ipagination.current} / ${Math.ceil(total / ipagination.pageSize)}`
"
show-less-items show-less-items
@change="handlePageChange" @change="handlePageChange"
@showSizeChange="handleSizeChange" @showSizeChange="handleSizeChange"
/> />
</div> </div>
<a-modal <a-modal :title="isAdd ? 'Add' : 'Edit'" v-model="visible" :maskClosable="false" @cancel="onCancel">
:title="isAdd ? 'Add' : 'Edit'"
v-model="visible"
@cancel="onCancel"
>
<a-form :form="form" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }"> <a-form :form="form" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }">
<a-form-item label="Name"> <a-form-item label="Name">
<a-input <a-input
@ -98,8 +93,8 @@
'name', 'name',
{ {
rules: [{ required: true, message: 'Please input name!' }], rules: [{ required: true, message: 'Please input name!' }],
initialVale: this.formVal.name initialVale: this.formVal.name,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -109,8 +104,8 @@
'emailServerAddress', 'emailServerAddress',
{ {
rules: [{ required: true, message: 'Please input email server address!' }], rules: [{ required: true, message: 'Please input email server address!' }],
initialVale: this.formVal.emailServerAddress initialVale: this.formVal.emailServerAddress,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -120,8 +115,8 @@
'username', 'username',
{ {
rules: [{ required: true, message: 'Please input email address!' }], rules: [{ required: true, message: 'Please input email address!' }],
initialVale: this.formVal.username initialVale: this.formVal.username,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -131,8 +126,8 @@
'password', 'password',
{ {
rules: [{ required: true, message: 'Please input password!' }], rules: [{ required: true, message: 'Please input password!' }],
initialVale: this.formVal.password initialVale: this.formVal.password,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -144,8 +139,8 @@
'emilType', 'emilType',
{ {
rules: [{ required: true, message: 'Please input your name!' }], rules: [{ required: true, message: 'Please input your name!' }],
initialVale: this.formVal.emilType initialVale: this.formVal.emilType,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -156,17 +151,13 @@
'enabled', 'enabled',
{ {
rules: [{ required: true, message: 'Please select a Station!' }], rules: [{ required: true, message: 'Please select a Station!' }],
initialVale: this.formVal.enabled initialVale: this.formVal.enabled,
} },
]" ]"
> >
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" /> <img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
<a-select-option :value="1"> <a-select-option :value="1"> Enable </a-select-option>
Enable <a-select-option :value="0"> Disabled </a-select-option>
</a-select-option>
<a-select-option :value="0">
Disabled
</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="Port"> <a-form-item label="Port">
@ -175,8 +166,8 @@
'port', 'port',
{ {
rules: [{ required: true, message: 'Please input port!' }], rules: [{ required: true, message: 'Please input port!' }],
initialVale: this.formVal.port initialVale: this.formVal.port,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -192,67 +183,75 @@
</template> </template>
<script> <script>
import TableList from '../../components/tableList.vue'; import TableList from '../../components/tableList.vue'
import { getAction, postAction, httpAction, deleteAction } from '@/api/manage' import { getAction, postAction, httpAction, deleteAction } from '@/api/manage'
const columns = [ const columns = [
{ {
title: 'NAME', title: 'NAME',
align: 'center', align: 'center',
dataIndex: 'name' dataIndex: 'name',
},{ },
{
title: 'STATUS', title: 'STATUS',
align: 'center', align: 'center',
dataIndex: 'online', dataIndex: 'online',
scopedSlots: { scopedSlots: {
customRender: 'status' customRender: 'status',
} },
},{ },
{
title: 'ENABLE', title: 'ENABLE',
align: 'center', align: 'center',
dataIndex: 'enabled', dataIndex: 'enabled',
scopedSlots: { scopedSlots: {
customRender: 'enabled' customRender: 'enabled',
} },
},{ },
{
title: 'E-MAIL', title: 'E-MAIL',
align: 'center', align: 'center',
dataIndex: 'emailServerAddress' dataIndex: 'emailServerAddress',
},{ },
{
title: "TODAY'S TOTAL", title: "TODAY'S TOTAL",
align: 'center', align: 'center',
dataIndex: 'today', dataIndex: 'today',
scopedSlots: { scopedSlots: {
customRender: 'today' customRender: 'today',
} },
},{ },
{
title: "YESTERDAY'S TOTAL", title: "YESTERDAY'S TOTAL",
align: 'center', align: 'center',
dataIndex: 'yesterday', dataIndex: 'yesterday',
scopedSlots: { scopedSlots: {
customRender: 'yesterday' customRender: 'yesterday',
} },
},{ },
title: "WEEKLY TOTAL", {
title: 'WEEKLY TOTAL',
align: 'center', align: 'center',
dataIndex: 'weekly', dataIndex: 'weekly',
scopedSlots: { scopedSlots: {
customRender: 'weekly' customRender: 'weekly',
} },
},{ },
{
title: 'ALARMS', title: 'ALARMS',
align: 'center', align: 'center',
dataIndex: 'alarms', dataIndex: 'alarms',
scopedSlots: { scopedSlots: {
customRender: 'alarms', customRender: 'alarms',
} },
},{ },
title: "STOER CAPACITY", {
title: 'STOER CAPACITY',
align: 'center', align: 'center',
dataIndex: 'stoerCapacity', dataIndex: 'stoerCapacity',
scopedSlots: { scopedSlots: {
customRender: 'stoer', customRender: 'stoer',
} },
} },
] ]
export default { export default {
components: { components: {
@ -265,15 +264,15 @@ export default {
visible: false, visible: false,
form: this.$form.createForm(this), form: this.$form.createForm(this),
formVal: { formVal: {
name: "", name: '',
emailServerAddress: "", emailServerAddress: '',
username: "", username: '',
password: "", password: '',
emilType: "", emilType: '',
enabled: "", enabled: '',
port: "" port: '',
}, },
currentId:"", currentId: '',
columns, columns,
dataSource: [], dataSource: [],
ipagination: { ipagination: {
@ -286,36 +285,36 @@ export default {
}, },
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
total: 0 total: 0,
}, },
} }
}, },
computed: { computed: {
alarmTotal() { alarmTotal() {
let num = 0 let num = 0
this.dataSource.forEach(item => { this.dataSource.forEach((item) => {
num = item.alarmRed ? num + item.alarms : num num = item.alarmRed ? num + item.alarms : num
}); })
return num return num
} },
}, },
mounted() { mounted() {
this.getSysEmail(); this.getSysEmail()
}, },
methods: { methods: {
getSysEmail() { getSysEmail() {
this.loading = true this.loading = true
let params = { let params = {
pageNo: this.ipagination.current, pageNo: this.ipagination.current,
pageSize: this.ipagination.pageSize pageSize: this.ipagination.pageSize,
} }
getAction("/sysEmail/findPage", params).then(res => { getAction('/sysEmail/findPage', params).then((res) => {
this.loading = false this.loading = false
if (res.success) { if (res.success) {
this.ipagination.total = res.result.total this.ipagination.total = res.result.total
this.dataSource = res.result.records this.dataSource = res.result.records
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
@ -337,7 +336,7 @@ export default {
if (this.currentId) { if (this.currentId) {
this.isAdd = false this.isAdd = false
this.visible = true this.visible = true
getAction("/sysEmail/findInfo", {id:this.currentId}).then(res => { getAction('/sysEmail/findInfo', { id: this.currentId }).then((res) => {
if (res.success) { if (res.success) {
this.form.setFieldsValue({ this.form.setFieldsValue({
name: res.result.name, name: res.result.name,
@ -346,14 +345,14 @@ export default {
password: res.result.password, password: res.result.password,
emilType: res.result.emilType, emilType: res.result.emilType,
enabled: res.result.enabled, enabled: res.result.enabled,
port: res.result.port port: res.result.port,
}); })
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
} else { } else {
this.$message.info("Please select a piece of data") this.$message.info('Please select a piece of data')
} }
}, },
onDelete() { onDelete() {
@ -362,40 +361,40 @@ export default {
this.$confirm({ this.$confirm({
title: 'Are you sure to delete this item?', title: 'Are you sure to delete this item?',
onOk() { onOk() {
deleteAction("/sysEmail/deleteById", {id:_this.currentId}).then(res => { deleteAction('/sysEmail/deleteById', { id: _this.currentId }).then((res) => {
if (res.success) { if (res.success) {
_this.$message.success("success") _this.$message.success('success')
this.currentId="" this.currentId = ''
_this.getSysEmail() _this.getSysEmail()
} else { } else {
_this.$message.warning("This operation fails. Contact your system administrator") _this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
onCancel() { onCancel() {
console.log('Cancel'); console.log('Cancel')
}, },
}); })
} else { } else {
this.$message.info("Please select a piece of data") this.$message.info('Please select a piece of data')
} }
}, },
selectRow(record) { selectRow(record) {
this.currentId = record.id this.currentId = record.id
}, },
cancelRow() { cancelRow() {
this.currentId = "" this.currentId = ''
}, },
onSave() { onSave() {
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
if (!err) { if (!err) {
console.log('Received values of form: ', values); console.log('Received values of form: ', values)
if (this.isAdd) { if (this.isAdd) {
postAction("/sysEmail/create", values).then(res => { postAction('/sysEmail/create', values).then((res) => {
if (res.success) { if (res.success) {
this.form.resetFields() this.form.resetFields()
this.visible = false this.visible = false
this.$message.success("success") this.$message.success('success')
this.getSysEmail() this.getSysEmail()
} else { } else {
this.$message.info(res.result.message) this.$message.info(res.result.message)
@ -404,13 +403,13 @@ export default {
} else { } else {
let params = { let params = {
id: this.currentId, id: this.currentId,
...values ...values,
} }
httpAction("/sysEmail/update", params, "put").then(res => { httpAction('/sysEmail/update', params, 'put').then((res) => {
if (res.success) { if (res.success) {
this.form.resetFields() this.form.resetFields()
this.visible = false this.visible = false
this.$message.success("success") this.$message.success('success')
this.getSysEmail() this.getSysEmail()
} else { } else {
this.$message.info(res.result.message) this.$message.info(res.result.message)
@ -418,7 +417,7 @@ export default {
}) })
} }
} }
}); })
}, },
onCancel() { onCancel() {
this.form.resetFields() this.form.resetFields()
@ -426,13 +425,13 @@ export default {
}, },
onRowDbclick(record) { onRowDbclick(record) {
let query = { let query = {
emailId:record.id emailId: record.id,
} }
this.$router.push({ this.$router.push({
path: '/alarm/emailMonitor/instances', path: '/alarm/emailMonitor/instances',
query query,
}) })
} },
}, },
} }
</script> </script>
@ -466,7 +465,7 @@ export default {
color: #ffffff; color: #ffffff;
border: none; border: none;
margin-left: 20px; margin-left: 20px;
box-shadow: 0px 1px 1px 0px #000000;; box-shadow: 0px 1px 1px 0px #000000;
} }
} }
.view-main { .view-main {
@ -521,6 +520,6 @@ export default {
} }
.ant-input-number { .ant-input-number {
width: 100%; width: 100%;
background-color: #03353f !important background-color: #03353f !important;
} }
</style> </style>

View File

@ -152,7 +152,7 @@
</a-col> </a-col>
</a-row> </a-row>
</div> </div>
<a-modal :title="modalTitle" :width="1200" v-model="visible" @cancel="onCancel"> <a-modal :title="modalTitle" :width="1200" v-model="visible" :maskClosable="false" @cancel="onCancel">
<div class="modal-content" id="common_cpu"></div> <div class="modal-content" id="common_cpu"></div>
</a-modal> </a-modal>
<CreateRules <CreateRules

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<a-modal title="Add Rule" :width="845" v-model="visible" @cancel="onCancel"> <a-modal title="Add Rule" :width="845" v-model="visible" :maskClosable="false" @cancel="onCancel">
<a-form-model ref="al_ruleForm" :model="form" :rules="rules" layout="vertical"> <a-form-model ref="al_ruleForm" :model="form" :rules="rules" layout="vertical">
<a-row :gutter="[15, 0]"> <a-row :gutter="[15, 0]">
<a-col :span="12"> <a-col :span="12">

View File

@ -156,7 +156,7 @@
</a-col> </a-col>
</a-row> </a-row>
</div> </div>
<a-modal :title="modalTitle" :width="1200" v-model="visible" @cancel="onCancel"> <a-modal :title="modalTitle" :width="1200" v-model="visible" :maskClosable="false" @cancel="onCancel">
<div class="modal-content" id="common"></div> <div class="modal-content" id="common"></div>
</a-modal> </a-modal>
<CreateRules <CreateRules

View File

@ -1,31 +1,25 @@
<template> <template>
<div style="height: 100%;"> <div style="height: 100%">
<div class="view-header"> <div class="view-header">
<div class="view-num">Alarms<span>{{ alarmTotal }}</span></div> <div class="view-num">
Alarms<span>{{ alarmTotal }}</span>
</div>
<div> <div>
<a-button class="view-btn" @click="onAdd"> <a-button class="view-btn" @click="onAdd">
<img class="icon-add" src="@/assets/images/global/add.png" alt="" /> <img class="icon-add" src="@/assets/images/global/add.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Add </span>
Add
</span>
</a-button> </a-button>
<a-button class="view-btn" @click="onEdit"> <a-button class="view-btn" @click="onEdit">
<img class="icon-add" src="@/assets/images/global/edit.png" alt="" /> <img class="icon-add" src="@/assets/images/global/edit.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Edit </span>
Edit
</span>
</a-button> </a-button>
<a-button class="view-btn" @click="onDelete"> <a-button class="view-btn" @click="onDelete">
<img class="icon-add" src="@/assets/images/global/delete.png" alt="" /> <img class="icon-add" src="@/assets/images/global/delete.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Delete </span>
Delete
</span>
</a-button> </a-button>
<a-button class="view-btn" @click="getSysServer"> <a-button class="view-btn" @click="getSysServer">
<img class="icon-add" src="@/assets/images/global/reset-pwd.png" alt="" /> <img class="icon-add" src="@/assets/images/global/reset-pwd.png" alt="" />
<span style="margin-left: 10px;"> <span style="margin-left: 10px"> Refresh </span>
Refresh
</span>
</a-button> </a-button>
</div> </div>
</div> </div>
@ -44,8 +38,8 @@
> >
<template slot="status" slot-scope="{ text, record }"> <template slot="status" slot-scope="{ text, record }">
<div> <div>
<img v-if="record.online" src="@/assets/images/abnormalAlarm/on.png" alt=""> <img v-if="record.online" src="@/assets/images/abnormalAlarm/on.png" alt="" />
<img v-else src="@/assets/images/abnormalAlarm/off.png" alt=""> <img v-else src="@/assets/images/abnormalAlarm/off.png" alt="" />
<span :class="[record.online ? 'status-on' : 'status-off']">{{ text }}</span> <span :class="[record.online ? 'status-on' : 'status-off']">{{ text }}</span>
</div> </div>
</template> </template>
@ -53,13 +47,13 @@
<span :class="[record.alarmRed ? 'isAlarm' : '', 'alarm-text']">{{ text }}</span> <span :class="[record.alarmRed ? 'isAlarm' : '', 'alarm-text']">{{ text }}</span>
</template> </template>
<template slot="cpu" slot-scope="{ text, record }"> <template slot="cpu" slot-scope="{ text, record }">
<span :class="[record.cpuRed?'isRed':'','alarm-text']">{{ text?text:"--" }}</span> <span :class="[record.cpuRed ? 'isRed' : '', 'alarm-text']">{{ text ? text : '--' }}</span>
</template> </template>
<template slot="memory" slot-scope="{ text, record }"> <template slot="memory" slot-scope="{ text, record }">
<span :class="[record.memoryRed?'isRed':'','alarm-text']">{{ text?text:"--" }}</span> <span :class="[record.memoryRed ? 'isRed' : '', 'alarm-text']">{{ text ? text : '--' }}</span>
</template> </template>
<template slot="disk" slot-scope="{ text, record }"> <template slot="disk" slot-scope="{ text, record }">
<span :class="[record.diskRed?'isRed':'','alarm-text']">{{ text?text:"--" }}</span> <span :class="[record.diskRed ? 'isRed' : '', 'alarm-text']">{{ text ? text : '--' }}</span>
</template> </template>
</TableList> </TableList>
</div> </div>
@ -71,17 +65,16 @@
show-size-changer show-size-changer
show-quick-jumper show-quick-jumper
:total="ipagination.total" :total="ipagination.total"
:show-total="(total, range) => `Total ${total} items Page ${ipagination.current} / ${Math.ceil(total / ipagination.pageSize)}`" :show-total="
(total, range) =>
`Total ${total} items Page ${ipagination.current} / ${Math.ceil(total / ipagination.pageSize)}`
"
show-less-items show-less-items
@change="handlePageChange" @change="handlePageChange"
@showSizeChange="handleSizeChange" @showSizeChange="handleSizeChange"
/> />
</div> </div>
<a-modal <a-modal :title="isAdd ? 'Add' : 'Edit'" v-model="visible" :maskClosable="false" @cancel="onCancel">
:title="isAdd ? 'Add' : 'Edit'"
v-model="visible"
@cancel="onCancel"
>
<a-form :form="form" :label-col="{ span: 5 }" :wrapper-col="{ span: 17 }"> <a-form :form="form" :label-col="{ span: 5 }" :wrapper-col="{ span: 17 }">
<a-form-item label="Name"> <a-form-item label="Name">
<a-input <a-input
@ -89,8 +82,8 @@
'name', 'name',
{ {
rules: [{ required: true, message: 'Please input name!' }], rules: [{ required: true, message: 'Please input name!' }],
initialVale: this.formVal.name initialVale: this.formVal.name,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -100,8 +93,8 @@
'ipAddress', 'ipAddress',
{ {
rules: [{ required: true, message: 'Please input ip address!' }], rules: [{ required: true, message: 'Please input ip address!' }],
initialVale: this.formVal.ipAddress initialVale: this.formVal.ipAddress,
} },
]" ]"
/> />
</a-form-item> </a-form-item>
@ -123,46 +116,52 @@ const columns = [
{ {
title: 'NAME', title: 'NAME',
align: 'center', align: 'center',
dataIndex: 'name' dataIndex: 'name',
},{ },
{
title: 'STATUS', title: 'STATUS',
align: 'center', align: 'center',
dataIndex: 'serverInfo', dataIndex: 'serverInfo',
scopedSlots: { scopedSlots: {
customRender: 'status' customRender: 'status',
} },
},{ },
{
title: 'IP ADDRESS', title: 'IP ADDRESS',
align: 'center', align: 'center',
dataIndex: 'ipAddress' dataIndex: 'ipAddress',
},{ },
{
title: 'ALARMS', title: 'ALARMS',
align: 'center', align: 'center',
dataIndex: 'alarms', dataIndex: 'alarms',
scopedSlots: { scopedSlots: {
customRender: 'alarms', customRender: 'alarms',
} },
},{ },
{
title: 'CPU UTILIZATION', title: 'CPU UTILIZATION',
align: 'center', align: 'center',
dataIndex: 'cpuUutilzation', dataIndex: 'cpuUutilzation',
scopedSlots: { scopedSlots: {
customRender: 'cpu', customRender: 'cpu',
} },
},{ },
{
title: 'MEMORY USAGE', title: 'MEMORY USAGE',
align: 'center', align: 'center',
dataIndex: 'memoryUsage', dataIndex: 'memoryUsage',
scopedSlots: { scopedSlots: {
customRender: 'memory', customRender: 'memory',
} },
},{ },
{
title: 'DISK USAGE', title: 'DISK USAGE',
align: 'center', align: 'center',
dataIndex: 'diskUsage', dataIndex: 'diskUsage',
scopedSlots: { scopedSlots: {
customRender: 'disk', customRender: 'disk',
} },
}, },
] ]
export default { export default {
@ -176,10 +175,10 @@ export default {
visible: false, visible: false,
form: this.$form.createForm(this), form: this.$form.createForm(this),
formVal: { formVal: {
name: "", name: '',
ipAddress:"" ipAddress: '',
}, },
currentId:"", currentId: '',
columns, columns,
dataSource: [], dataSource: [],
ipagination: { ipagination: {
@ -192,36 +191,36 @@ export default {
}, },
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
total: 0 total: 0,
}, },
} }
}, },
computed: { computed: {
alarmTotal() { alarmTotal() {
let num = 0 let num = 0
this.dataSource.forEach(item => { this.dataSource.forEach((item) => {
num = item.alarmRed ? num + item.alarms : num num = item.alarmRed ? num + item.alarms : num
}); })
return num return num
} },
}, },
mounted() { mounted() {
this.getSysServer(); this.getSysServer()
}, },
methods: { methods: {
getSysServer() { getSysServer() {
this.loading = true this.loading = true
let params = { let params = {
pageNo: this.ipagination.current, pageNo: this.ipagination.current,
pageSize: this.ipagination.pageSize pageSize: this.ipagination.pageSize,
} }
getAction("/sysServer/findPage", params).then(res => { getAction('/sysServer/findPage', params).then((res) => {
this.loading = false this.loading = false
if (res.success) { if (res.success) {
this.ipagination.total = res.result.total this.ipagination.total = res.result.total
this.dataSource = res.result.records this.dataSource = res.result.records
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
@ -243,18 +242,18 @@ export default {
if (this.currentId) { if (this.currentId) {
this.isAdd = false this.isAdd = false
this.visible = true this.visible = true
getAction("/sysServer/findInfo", {id:this.currentId}).then(res => { getAction('/sysServer/findInfo', { id: this.currentId }).then((res) => {
if (res.success) { if (res.success) {
this.form.setFieldsValue({ this.form.setFieldsValue({
name: res.result.name, name: res.result.name,
ipAddress: res.result.ipAddress ipAddress: res.result.ipAddress,
}); })
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
} else { } else {
this.$message.info("Please select a piece of data") this.$message.info('Please select a piece of data')
} }
}, },
onDelete() { onDelete() {
@ -263,39 +262,39 @@ export default {
this.$confirm({ this.$confirm({
title: 'Are you sure to delete this item?', title: 'Are you sure to delete this item?',
onOk() { onOk() {
deleteAction("/sysServer/deleteById", {id:_this.currentId}).then(res => { deleteAction('/sysServer/deleteById', { id: _this.currentId }).then((res) => {
if (res.success) { if (res.success) {
_this.$message.success("success") _this.$message.success('success')
_this.currentId = "" _this.currentId = ''
_this.getSysServer() _this.getSysServer()
} else { } else {
_this.$message.warning("This operation fails. Contact your system administrator") _this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
onCancel() { onCancel() {
console.log('Cancel'); console.log('Cancel')
}, },
}); })
} else { } else {
this.$message.info("Please select a piece of data") this.$message.info('Please select a piece of data')
} }
}, },
selectRow(record) { selectRow(record) {
this.currentId = record.id this.currentId = record.id
}, },
cancelRow() { cancelRow() {
this.currentId = "" this.currentId = ''
}, },
onSave() { onSave() {
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
if (!err) { if (!err) {
if (this.isAdd) { if (this.isAdd) {
postAction("/sysServer/create", values).then(res => { postAction('/sysServer/create', values).then((res) => {
if (res.success) { if (res.success) {
this.form.resetFields() this.form.resetFields()
this.visible = false this.visible = false
this.$message.success("success") this.$message.success('success')
this.getSysServer() this.getSysServer()
} else { } else {
this.$message.info(res.result.message) this.$message.info(res.result.message)
@ -304,13 +303,13 @@ export default {
} else { } else {
let params = { let params = {
id: this.currentId, id: this.currentId,
...values ...values,
} }
httpAction("/sysServer/update", params, "put").then(res => { httpAction('/sysServer/update', params, 'put').then((res) => {
if (res.success) { if (res.success) {
this.form.resetFields() this.form.resetFields()
this.visible = false this.visible = false
this.$message.success("success") this.$message.success('success')
this.getSysServer() this.getSysServer()
} else { } else {
this.$message.info(res.result.message) this.$message.info(res.result.message)
@ -318,7 +317,7 @@ export default {
}) })
} }
} }
}); })
}, },
onCancel() { onCancel() {
this.form.resetFields() this.form.resetFields()
@ -326,13 +325,13 @@ export default {
}, },
onRowDbclick(record) { onRowDbclick(record) {
let query = { let query = {
serverId:record.id serverId: record.id,
} }
this.$router.push({ this.$router.push({
path: '/alarm/serverMonitor/instances', path: '/alarm/serverMonitor/instances',
query query,
}) })
} },
}, },
} }
</script> </script>
@ -366,7 +365,7 @@ export default {
color: #ffffff; color: #ffffff;
border: none; border: none;
margin-left: 20px; margin-left: 20px;
box-shadow: 0px 1px 1px 0px #000000;; box-shadow: 0px 1px 1px 0px #000000;
} }
} }
.view-main { .view-main {

View File

@ -1,5 +1,5 @@
<template> <template>
<div style="height: 100%;"> <div style="height: 100%">
<div class="header"> <div class="header">
<a-button type="primary" @click="handleAdd"> <a-button type="primary" @click="handleAdd">
<img src="@/assets/images/global/add.png" alt="" /> <img src="@/assets/images/global/add.png" alt="" />
@ -29,20 +29,14 @@
</custom-table> </custom-table>
</div> </div>
<!-- 列表结束 --> <!-- 列表结束 -->
<a-modal <a-modal title="Edit" :width="845" v-model="visible" :maskClosable="false" @ok="handleOk" destroy-on-close>
title='Edit'
:width="845"
v-model="visible"
@ok="handleOk"
destroy-on-close
>
<a-spin :spinning="spinning"> <a-spin :spinning="spinning">
<div class="group-assign"> <div class="group-assign">
<a-transfer <a-transfer
:dataSource="dataList" :dataSource="dataList"
:target-keys="targetKeys" :target-keys="targetKeys"
show-search show-search
:render="item => item.title" :render="(item) => item.title"
:operations="['Assign', 'Remove']" :operations="['Assign', 'Remove']"
:titles="['Total Nuclides', 'User Nuclides']" :titles="['Total Nuclides', 'User Nuclides']"
@change="handleChange" @change="handleChange"
@ -70,32 +64,32 @@ const columns = [
align: 'left', align: 'left',
width: 170, width: 170,
scopedSlots: { scopedSlots: {
customRender: 'index' customRender: 'index',
}, },
customHeaderCell: () => { customHeaderCell: () => {
return { return {
style: { style: {
'padding-left': '60px !important' 'padding-left': '60px !important',
} },
} }
}, },
customCell: () => { customCell: () => {
return { return {
style: { style: {
'padding-left': '60px !important' 'padding-left': '60px !important',
} },
}
} }
}, },
},
{ {
title: 'NUCLIDE NAME', title: 'NUCLIDE NAME',
align: 'left', align: 'left',
dataIndex: 'nuclideName' dataIndex: 'nuclideName',
}, },
{ {
title: 'CREATE TIME', title: 'CREATE TIME',
align: 'left', align: 'left',
dataIndex: 'createTime' dataIndex: 'createTime',
}, },
] ]
export default { export default {
@ -116,17 +110,17 @@ export default {
}, },
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
total: 0 total: 0,
}, },
loading: false, loading: false,
targetKeys: [], targetKeys: [],
visible: false, visible: false,
dataList: [], dataList: [],
spinning: false spinning: false,
} }
}, },
mounted() { mounted() {
this.getRulesList(); this.getRulesList()
}, },
methods: { methods: {
getRulesList() { getRulesList() {
@ -134,23 +128,22 @@ export default {
let params = { let params = {
pageNo: this.ipagination.current, pageNo: this.ipagination.current,
pageSize: this.ipagination.pageSize, pageSize: this.ipagination.pageSize,
useType: 2 useType: 2,
} }
getAction(this.url.list, params).then(res => { getAction(this.url.list, params).then((res) => {
this.loading = false this.loading = false
if (res.success) { if (res.success) {
this.dataSource = res.result.records this.dataSource = res.result.records
this.ipagination.total = res.result.total this.ipagination.total = res.result.total
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
handleTableChange(pagination, filters, sorter) { handleTableChange(pagination, filters, sorter) {
this.ipagination.current = pagination.current this.ipagination.current = pagination.current
this.ipagination.pageSize = pagination.pageSize this.ipagination.pageSize = pagination.pageSize
this.getRulesList(); this.getRulesList()
}, },
handleAdd() { handleAdd() {
this.visible = true this.visible = true
@ -159,39 +152,39 @@ export default {
this.getNuclideList() this.getNuclideList()
}, },
getNuclideListAll() { getNuclideListAll() {
getAction("/gardsNuclLib/allName").then(res => { getAction('/gardsNuclLib/allName').then((res) => {
this.spinning = false this.spinning = false
if (res.success) { if (res.success) {
if (res.result.length > 0) { if (res.result.length > 0) {
this.dataList = res.result.map((item, index) => { this.dataList = res.result.map((item, index) => {
return { return {
key: item, key: item,
title: item title: item,
} }
}) })
} else { } else {
this.dataList = [] this.dataList = []
} }
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
getNuclideList() { getNuclideList() {
getAction("/sys/defaultNuclide/allName",{useType:2}).then(res => { getAction('/sys/defaultNuclide/allName', { useType: 2 }).then((res) => {
if (res.success) { if (res.success) {
if (res.result.length > 0) { if (res.result.length > 0) {
this.targetKeys = res.result.map(item => item) this.targetKeys = res.result.map((item) => item)
} else { } else {
this.targetKeys = [] this.targetKeys = []
} }
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
handleChange(targetKeys, direction, moveKeys) { handleChange(targetKeys, direction, moveKeys) {
this.targetKeys= targetKeys; this.targetKeys = targetKeys
}, },
handleSearch(dir, value) { handleSearch(dir, value) {
console.log('search:', dir, value) console.log('search:', dir, value)
@ -199,15 +192,15 @@ export default {
handleOk() { handleOk() {
let params = { let params = {
nuclideNames: this.targetKeys, nuclideNames: this.targetKeys,
useType: 2 useType: 2,
} }
getAction("/sys/defaultNuclide/add",params).then(res => { getAction('/sys/defaultNuclide/add', params).then((res) => {
this.visible = false this.visible = false
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
this.getRulesList() this.getRulesList()
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },

View File

@ -1,10 +1,10 @@
<template> <template>
<div style="height: 100%;"> <div style="height: 100%">
<div class="header"> <div class="header">
<div> <div>
<span class="item-label">Nuclide Type</span> <span class="item-label">Nuclide Type</span>
<a-select <a-select
style="width: 180px;display: inline-block;" style="width: 180px; display: inline-block"
v-model="type" v-model="type"
:options="typeOptions" :options="typeOptions"
show-arrow show-arrow
@ -43,18 +43,12 @@
</custom-table> </custom-table>
</div> </div>
<!-- 列表结束 --> <!-- 列表结束 -->
<a-modal <a-modal title="Edit" :width="845" v-model="visible" :maskClosable="false" @ok="handleOk" destroy-on-close>
title='Edit'
:width="845"
v-model="visible"
@ok="handleOk"
destroy-on-close
>
<a-spin :spinning="spinning"> <a-spin :spinning="spinning">
<div style="padding-left: 52px;margin-bottom: 20px;"> <div style="padding-left: 52px; margin-bottom: 20px">
<span class="item-label">Nuclide Type</span> <span class="item-label">Nuclide Type</span>
<a-select <a-select
style="width: 180px;display: inline-block;" style="width: 180px; display: inline-block"
v-model="currType" v-model="currType"
:options="typeOptions" :options="typeOptions"
show-arrow show-arrow
@ -70,7 +64,7 @@
:dataSource="dataList" :dataSource="dataList"
:target-keys="targetKeys" :target-keys="targetKeys"
show-search show-search
:render="item => item.title" :render="(item) => item.title"
:operations="['Assign', 'Remove']" :operations="['Assign', 'Remove']"
:titles="['Total Nuclides', 'User Nuclides']" :titles="['Total Nuclides', 'User Nuclides']"
@change="handleChange" @change="handleChange"
@ -98,37 +92,37 @@ const columns = [
align: 'left', align: 'left',
width: 170, width: 170,
scopedSlots: { scopedSlots: {
customRender: 'index' customRender: 'index',
}, },
customHeaderCell: () => { customHeaderCell: () => {
return { return {
style: { style: {
'padding-left': '60px !important' 'padding-left': '60px !important',
} },
} }
}, },
customCell: () => { customCell: () => {
return { return {
style: { style: {
'padding-left': '60px !important' 'padding-left': '60px !important',
} },
}
} }
}, },
},
{ {
title: 'NUCLIDE NAME', title: 'NUCLIDE NAME',
align: 'left', align: 'left',
dataIndex: 'nuclideName' dataIndex: 'nuclideName',
}, },
{ {
title: 'NUCLIDE TYPE', title: 'NUCLIDE TYPE',
align: 'left', align: 'left',
dataIndex: 'nuclideType' dataIndex: 'nuclideType',
}, },
{ {
title: 'CREATE TIME', title: 'CREATE TIME',
align: 'left', align: 'left',
dataIndex: 'createTime' dataIndex: 'createTime',
}, },
] ]
export default { export default {
@ -149,29 +143,29 @@ export default {
}, },
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
total: 0 total: 0,
}, },
loading: false, loading: false,
typeOptions: [ typeOptions: [
{ {
label: "P", label: 'P',
value: "P" value: 'P',
}, },
{ {
label: "G", label: 'G',
value: "G" value: 'G',
} },
], ],
type: undefined, type: undefined,
currType: "P", currType: 'P',
targetKeys: [], targetKeys: [],
visible: false, visible: false,
dataList: [], dataList: [],
spinning: false spinning: false,
} }
}, },
mounted() { mounted() {
this.getAuroPeocessList(); this.getAuroPeocessList()
}, },
methods: { methods: {
getAuroPeocessList() { getAuroPeocessList() {
@ -180,27 +174,26 @@ export default {
pageNo: this.ipagination.current, pageNo: this.ipagination.current,
pageSize: this.ipagination.pageSize, pageSize: this.ipagination.pageSize,
useType: 1, useType: 1,
nuclideType: this.type || "" nuclideType: this.type || '',
} }
getAction(this.url.list, params).then(res => { getAction(this.url.list, params).then((res) => {
this.loading = false this.loading = false
if (res.success) { if (res.success) {
this.dataSource = res.result.records this.dataSource = res.result.records
this.ipagination.total = res.result.total this.ipagination.total = res.result.total
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
handleTableChange(pagination, filters, sorter) { handleTableChange(pagination, filters, sorter) {
this.ipagination.current = pagination.current this.ipagination.current = pagination.current
this.ipagination.pageSize = pagination.pageSize this.ipagination.pageSize = pagination.pageSize
this.getAuroPeocessList(); this.getAuroPeocessList()
}, },
onTypeChange(val) { onTypeChange(val) {
this.type = val this.type = val
this.getAuroPeocessList(); this.getAuroPeocessList()
}, },
onCurrTypeChange(val) { onCurrTypeChange(val) {
this.currType = val this.currType = val
@ -213,40 +206,40 @@ export default {
this.getNuclideList() this.getNuclideList()
}, },
getNuclideListAll() { getNuclideListAll() {
getAction("/gardsNuclLib/allName").then(res => { getAction('/gardsNuclLib/allName').then((res) => {
this.spinning = false this.spinning = false
if (res.success) { if (res.success) {
if (res.result.length > 0) { if (res.result.length > 0) {
this.dataList = res.result.map((item, index) => { this.dataList = res.result.map((item, index) => {
return { return {
key: item, key: item,
title: item title: item,
} }
}) })
} else { } else {
this.dataList = [] this.dataList = []
} }
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
getNuclideList() { getNuclideList() {
getAction("/sys/defaultNuclide/allName",{useType:1,nuclideType: this.currType}).then(res => { getAction('/sys/defaultNuclide/allName', { useType: 1, nuclideType: this.currType }).then((res) => {
if (res.success) { if (res.success) {
if (res.result.length > 0) { if (res.result.length > 0) {
this.targetKeys = res.result.map(item => item) this.targetKeys = res.result.map((item) => item)
} else { } else {
this.targetKeys = [] this.targetKeys = []
} }
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
handleChange(targetKeys, direction, moveKeys) { handleChange(targetKeys, direction, moveKeys) {
console.log(targetKeys, direction, moveKeys); console.log(targetKeys, direction, moveKeys)
this.targetKeys= targetKeys; this.targetKeys = targetKeys
}, },
handleSearch(dir, value) { handleSearch(dir, value) {
console.log('search:', dir, value) console.log('search:', dir, value)
@ -255,15 +248,15 @@ export default {
let params = { let params = {
nuclideNames: this.targetKeys, nuclideNames: this.targetKeys,
nuclideType: this.currType, nuclideType: this.currType,
useType: 1 useType: 1,
} }
getAction("/sys/defaultNuclide/add",params).then(res => { getAction('/sys/defaultNuclide/add', params).then((res) => {
this.visible = false this.visible = false
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
this.getAuroPeocessList() this.getAuroPeocessList()
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },