|
|
@@ -0,0 +1,135 @@
|
|
|
+<template>
|
|
|
+ <confirm-dialog
|
|
|
+ ref="configDialog"
|
|
|
+ :title="title"
|
|
|
+ @confirm="onSave"
|
|
|
+ >
|
|
|
+ <div class="u-align-self--center">
|
|
|
+ <div
|
|
|
+ v-if="type === 'exception_continued_seconds'"
|
|
|
+ class="c-sibling-item--v far"
|
|
|
+ >
|
|
|
+ <div class="l-flex--row c-sibling-item--v">
|
|
|
+ <div class="c-sibling-item far">网络通畅但持续</div>
|
|
|
+ <el-input-number
|
|
|
+ v-model="config.paramValue"
|
|
|
+ class="c-sibling-item far u-width--xs"
|
|
|
+ controls-position="right"
|
|
|
+ :min="30"
|
|
|
+ step-strictly
|
|
|
+ />
|
|
|
+ <div class="c-sibling-item far">秒未上线则判定为异常状态</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="type === 'exception_again_trigger_seconds'"
|
|
|
+ class="c-sibling-item--v far"
|
|
|
+ >
|
|
|
+ <div class="l-flex--row c-sibling-item--v u-line-height--md">
|
|
|
+ <div class="c-sibling-item far">
|
|
|
+ <el-radio
|
|
|
+ v-model="enabled"
|
|
|
+ :label="false"
|
|
|
+ >
|
|
|
+ 方式1:
|
|
|
+ </el-radio>
|
|
|
+ </div>
|
|
|
+ <div class="c-sibling-item far">仅初次检测到时预警,不重复预警</div>
|
|
|
+ </div>
|
|
|
+ <div class="l-flex--row c-sibling-item--v u-line-height--md">
|
|
|
+ <div class="c-sibling-item far">
|
|
|
+ <el-radio
|
|
|
+ v-model="enabled"
|
|
|
+ :label="true"
|
|
|
+ >
|
|
|
+ 方式2:
|
|
|
+ </el-radio>
|
|
|
+ </div>
|
|
|
+ <div class="c-sibling-item far">持续预警,间隔</div>
|
|
|
+ <el-input-number
|
|
|
+ v-model="config.paramValue"
|
|
|
+ class="c-sibling-item far u-width--xs"
|
|
|
+ controls-position="right"
|
|
|
+ :min="60"
|
|
|
+ step-strictly
|
|
|
+ :disabled="!enabled"
|
|
|
+ />
|
|
|
+ <div class="c-sibling-item far">秒后再次预警</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="type === 'exception_intervene_seconds'"
|
|
|
+ class="c-sibling-item--v far"
|
|
|
+ >
|
|
|
+ <div class="l-flex--row c-sibling-item--v">
|
|
|
+ <span class="c-grid-form__label c-sibling-item">开启</span>
|
|
|
+
|
|
|
+ <el-switch
|
|
|
+ v-model="enabled"
|
|
|
+ class="c-sibling-item"
|
|
|
+ active-color="#13ce66"
|
|
|
+ inactive-color="#ff4949"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ :style="{ visibility: enabled ? 'visible' : 'hidden' }"
|
|
|
+ class="l-flex--row c-sibling-item--v"
|
|
|
+ >
|
|
|
+ <div class="c-sibling-item far">持续</div>
|
|
|
+ <div class="c-sibling-item far">
|
|
|
+ <el-input-number
|
|
|
+ v-model="config.paramValue"
|
|
|
+ controls-position="right"
|
|
|
+ :min="60"
|
|
|
+ step-strictly
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="c-sibling-item far">秒后触发重启</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </confirm-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {
|
|
|
+ getExceptionOfflineConfig,
|
|
|
+ updateExceptionOfflineConfig
|
|
|
+} from '../api'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'ErrorOfflineAlarmConfigDialog',
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ type: '',
|
|
|
+ title: '',
|
|
|
+ config: {},
|
|
|
+ enabled: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ show (type, title) {
|
|
|
+ this.type = type
|
|
|
+ this.title = title
|
|
|
+ getExceptionOfflineConfig().then(({ data }) => {
|
|
|
+ this.config = data?.filter(i => i.paramKey === type)[0] || {}
|
|
|
+ this.$refs.configDialog.show()
|
|
|
+ if (this.config.paramValue === '-1') {
|
|
|
+ this.enabled = false
|
|
|
+ this.config.paramValue = '0'
|
|
|
+ } else {
|
|
|
+ this.enabled = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onSave (done) {
|
|
|
+ updateExceptionOfflineConfig({
|
|
|
+ id: this.config.id,
|
|
|
+ paramValue: this.enabled ? `${this.config.paramValue}` : '-1'
|
|
|
+ }).then(() => {
|
|
|
+ done()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|