diff --git a/src/views/abnormalAlarm/analysisMonitor/alarmRules/index.vue b/src/views/abnormalAlarm/analysisMonitor/alarmRules/index.vue index 88116cc..ca39c41 100644 --- a/src/views/abnormalAlarm/analysisMonitor/alarmRules/index.vue +++ b/src/views/abnormalAlarm/analysisMonitor/alarmRules/index.vue @@ -25,20 +25,12 @@ - + Data Sources - - - + Nuclide @@ -68,67 +60,69 @@
-
+
-
asdfsd
+
{{ item.name }}
Qualifier: - FULL + {{ item.spectralQualifier.join("/") }}
-
- {{ 1==1?"Enable":"Disabled" }} -
- +
-
@@ -168,8 +162,8 @@ /> - - + - - + - - - {{ item.text || item.label }} - - + + + + + + import { ajaxGetDictItems } from '@/api/api' import { getAction, postAction, httpAction, deleteAction } from '@/api/manage' +import DicSelect from '../../components/dicSelect.vue'; export default { + components: { + DicSelect, + }, data() { return { isAdd: true, @@ -280,7 +298,7 @@ export default { queryParams: { station: undefined, source: undefined, - buclide: undefined + nuclide: undefined }, sourceOptions: [ { @@ -307,9 +325,9 @@ export default { total: 0 }, labelCol: { span: 4 }, - wrapperCol: { span: 14 }, + wrapperCol: { span: 18 }, form: this.$form.createForm(this), - dictOptions: [], + contactGroupOptions: [], formVal: { name: "", source: [], @@ -317,13 +335,17 @@ export default { nuclide: [], qualifier: [], condition: [], + contactGroup: undefined, desc: "" - } + }, + monitorList: [], + currId:"", } }, created () { - this.getCondition(); this.getStationList(); + this.getAlarmGroup(); + this.getAlarmRulesPage() }, methods: { getStationList() { @@ -354,44 +376,125 @@ export default { ); }, onStationChange(val) { - console.log(val); + this.queryParams.station = val }, onSourceChange(val) { - console.log(val); + this.queryParams.source = val }, onNuclideChange(val) { - console.log(val); + this.queryParams.nuclide = val + }, + getAlarmRulesPage() { + this.spinning = true + let params = { + pageNo: this.ipagination.current, + pageSize: this.ipagination.pageSize, + // stations: this.queryParams.station, + // source: this.queryParams.source, + source: [1,2], + stations: [101,102], + } + getAction("/alarmAnalysisRule/findPage", params).then(res => { + this.spinning = false + if (res.success) { + this.monitorList = res.result.records + this.ipagination.total = res.result.total + } else { + this.$message.warning("This operation fails. Contact your system administrator") + } + }) }, onSearch() { - // this.getAlarmRulesPage() + this.getAlarmRulesPage() }, - editItem(id) { }, - deleteItem(id) { }, + editItem(id) { + this.currId = id + }, + deleteItem(id) { + let _this = this + this.$confirm({ + title: 'Are you sure to delete this item?', + onOk() { + deleteAction("/alarmAnalysisRule/delete", {id:id}).then(res => { + if (res.success) { + _this.$message.success("success") + _this.getAlarmRulesPage() + } else { + _this.$message.warning("This operation fails. Contact your system administrator") + } + }) + }, + onCancel() { + console.log('Cancel'); + }, + }); + }, changeItemStatus(id, isEnabled) { }, handlePageChange(page, pageSize) { this.ipagination.current = page this.ipagination.pageSize = pageSize - // this.getAlarmRulesPage() + this.getAlarmRulesPage() }, handleSizeChange(current, size) { this.ipagination.current = current this.ipagination.pageSize = size - // this.getAlarmRulesPage() + this.getAlarmRulesPage() }, - getCondition() { - //根据字典Code, 初始化字典数组 - ajaxGetDictItems("alarm_analyse_rule_condition", null).then((res) => { + getAlarmGroup() { + let params = { + pageNo: 1, + pageSize: 9999 + } + getAction("/alarmContactGroup/findPage", params).then(res => { if (res.success) { - this.dictOptions = res.result; + this.contactGroupOptions = res.result.records.map(item => { + return { + label: item.name, + value: item.id + } + }) + } else { + this.$message.warning("This operation fails. Contact your system administrator") } }) }, onSave() { this.form.validateFields((err, values) => { - console.log('Received values of form: ', values); - if (!err) { - this.visible = false - } + // if (!err) { + let params = { + conditions:values.condition, + name:values.name, + remark:values.remark, + stations:values.station.join(","), + source: values.source, + enabled: 1, + // nuclides:values.nuclide.join(","), + nuclides:"A406,Bu12", + contactGroup:values.contactGroup, + spectralQualifier: values.qualifier, + } + if (this.isAdd) { + postAction("/alarmAnalysisRule/add", params).then(res => { + if (res.success) { + this.visible = false + this.$message.success("success") + this.getAlarmRulesPage() + } else { + this.$message.warning("This operation fails. Contact your system administrator") + } + }) + } else { + httpAction("/alarmAnalysisRule/edit", {...params,id: this.currId}, "put").then(res => { + if (res.success) { + this.visible = false + this.$message.success("success") + this.getAlarmRulesPage() + } else { + this.$message.warning("This operation fails. Contact your system administrator") + } + }) + } + // } }) }, onCancel() { @@ -406,6 +509,12 @@ export default { .ant-row-flex{ flex-flow: nowrap; } +.ant-select{ + width: 206px; +} +.form-select{ + width: 100%; +} .operators { width: 100%; justify-content: center; @@ -508,9 +617,17 @@ export default { font-family: ArialMT; font-size: 16px; color: #ade6ee; - // span{ - // display: block; - // } + &-key{ + // display: inline-block; + // width: 120px; + // vertical-align: middle; + } + &-val{ + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + vertical-align: middle; + } } &-btn{ margin-top: 10px; diff --git a/src/views/abnormalAlarm/components/dicSelect.vue b/src/views/abnormalAlarm/components/dicSelect.vue new file mode 100644 index 0000000..4007ce8 --- /dev/null +++ b/src/views/abnormalAlarm/components/dicSelect.vue @@ -0,0 +1,141 @@ + + +