|
@@ -75,90 +75,220 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="dark-el-dialog">
|
|
|
- <el-dialog width="60%" style="top:15%" :visible.sync="outerVisible" :close-on-click-modal="false">
|
|
|
- <div slot="title" class="dialog-title flex justify-between">
|
|
|
- <div>
|
|
|
- <el-button @click="acknowledgeAll()">全部确认</el-button>
|
|
|
- <el-button @click="getAbnormalAlarms('')">全部告警</el-button>
|
|
|
- <el-button @click="getAbnormalAlarms('E1')">通道告警</el-button>
|
|
|
- <el-button @click="getAbnormalAlarms('E2')">上报告警</el-button>
|
|
|
- <el-button @click="getAbnormalAlarms('E3')">站端硬件告警</el-button>
|
|
|
- <el-button @click="getAbnormalAlarms('E4')">中心解析告警</el-button>
|
|
|
- <el-button @click="getAbnormalAlarms('E5')">通用告警</el-button>
|
|
|
- <el-button @click="innerVisible = true">报警配置</el-button>
|
|
|
- </div>
|
|
|
- <div class="dialog-title-badge flex justify-between">
|
|
|
- <el-badge :value="this.badgeValue.alarm">
|
|
|
- <img src="../../assets/images/svg/remind.svg" width="20px"/>
|
|
|
- </el-badge>
|
|
|
-<!-- <el-badge :value="badgeValue.confirm">-->
|
|
|
-<!-- <img src="../../assets/images/svg/right.svg" width="20px"/>-->
|
|
|
-<!-- </el-badge>-->
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <el-table
|
|
|
- :data="tableDataAlarm"
|
|
|
- border max-height="300px"
|
|
|
- element-loading-background="rgba(8, 61, 92,1)"
|
|
|
- v-loading="loadingAlarm"
|
|
|
- style="width: 100%">
|
|
|
- <el-table-column label="序号" type="index" align="center" width="60"></el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="stationCode" align="center" :formatter="formatStation" :show-overflow-tooltip="true"
|
|
|
- label="场站名称"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="startTime" align="center"
|
|
|
- label="报警开始时间" :formatter="formatStartDate"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="endTime" align="center"
|
|
|
- label="报警结束时间" :formatter="formatEndDate"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="msg" align="center" :show-overflow-tooltip="true"
|
|
|
- label="报警描述">
|
|
|
- </el-table-column>\
|
|
|
- <el-table-column
|
|
|
- prop="alarmType" align="center" :formatter="formatAlarmSource"
|
|
|
- label="报警来源">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="operate" align="center"
|
|
|
- label="操作" width="80">
|
|
|
- <template v-slot="{ row }">
|
|
|
- <img src="../../assets/images/svg/remind.svg" @click="acknowledge(row)" width="20px"/>
|
|
|
-<!-- <img src="../../assets/images/svg/right.svg" width="20px"/>-->
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <div class="block flex" style="justify-content: end">
|
|
|
- <el-pagination
|
|
|
- popper-class="cpp-popper"
|
|
|
- @size-change="handleSizeChangeAlarm"
|
|
|
- @current-change="handleCurrentChangeAlarm"
|
|
|
- :current-page=this.alarmPage.currentPage
|
|
|
- :page-sizes="[10, 15, 30, 50]"
|
|
|
- :page-size=this.alarmPage.pageSize
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total=this.alarmPage.total>
|
|
|
- </el-pagination>
|
|
|
+ <div class="app-container">
|
|
|
+
|
|
|
+ <div class="dark-el-dialog">
|
|
|
+ <el-dialog width="60%" style="top:15%" :visible.sync="outerVisible" :close-on-click-modal="false">
|
|
|
+ <div slot="title" class="dialog-title flex justify-between">
|
|
|
+ <div>
|
|
|
+ <el-button @click="acknowledgeAll()">全部确认</el-button>
|
|
|
+ <el-button @click="getAbnormalAlarms('')">全部告警</el-button>
|
|
|
+ <el-button @click="getAbnormalAlarms('E1')">通道告警</el-button>
|
|
|
+ <el-button @click="getAbnormalAlarms('E2')">上报告警</el-button>
|
|
|
+ <el-button @click="getAbnormalAlarms('E3')">站端硬件告警</el-button>
|
|
|
+ <el-button @click="getAbnormalAlarms('E4')">中心解析告警</el-button>
|
|
|
+ <el-button @click="getAbnormalAlarms('E5')">通用告警</el-button>
|
|
|
+ <el-button @click="getAlarmConfs()">报警配置</el-button>
|
|
|
+ </div>
|
|
|
+ <div class="dialog-title-badge flex justify-between">
|
|
|
+ <el-badge :value="this.badgeValue.alarm">
|
|
|
+ <img src="../../assets/images/svg/remind.svg" width="20px"/>
|
|
|
+ </el-badge>
|
|
|
+ <!-- <el-badge :value="badgeValue.confirm">-->
|
|
|
+ <!-- <img src="../../assets/images/svg/right.svg" width="20px"/>-->
|
|
|
+ <!-- </el-badge>-->
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <el-dialog
|
|
|
- width="30%" style="top:15%"
|
|
|
- title="通道告警"
|
|
|
- :visible.sync="innerVisible"
|
|
|
- append-to-body>
|
|
|
- <!-- TODO 移植v3 -->
|
|
|
+ <div>
|
|
|
+ <el-table
|
|
|
+ :data="tableDataAlarm"
|
|
|
+ border max-height="300px"
|
|
|
+ element-loading-background="rgba(8, 61, 92,1)"
|
|
|
+ v-loading="loadingAlarm"
|
|
|
+ style="width: 100%">
|
|
|
+ <el-table-column label="序号" type="index" align="center" width="60"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="stationCode" align="center" :formatter="formatStation" :show-overflow-tooltip="true"
|
|
|
+ label="场站名称"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="startTime" align="center"
|
|
|
+ label="报警开始时间" :formatter="formatStartDate"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="endTime" align="center"
|
|
|
+ label="报警结束时间" :formatter="formatEndDate"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="msg" align="center" :show-overflow-tooltip="true"
|
|
|
+ label="报警描述">
|
|
|
+ </el-table-column>
|
|
|
+ \
|
|
|
+ <el-table-column
|
|
|
+ prop="alarmType" align="center" :formatter="formatAlarmSource"
|
|
|
+ label="报警来源">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="operate" align="center"
|
|
|
+ label="操作" width="80">
|
|
|
+ <template v-slot="{ row }">
|
|
|
+ <img src="../../assets/images/svg/remind.svg" @click="acknowledge(row)" width="20px"/>
|
|
|
+ <!-- <img src="../../assets/images/svg/right.svg" width="20px"/>-->
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="block flex" style="justify-content: end">
|
|
|
+ <el-pagination
|
|
|
+ popper-class="cpp-popper"
|
|
|
+ @size-change="handleSizeChangeAlarm"
|
|
|
+ @current-change="handleCurrentChangeAlarm"
|
|
|
+ :current-page=this.alarmPage.currentPage
|
|
|
+ :page-sizes="[10, 15, 30, 50]"
|
|
|
+ :page-size=this.alarmPage.pageSize
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total=this.alarmPage.total>
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
|
|
|
+ <el-dialog
|
|
|
+ width="40%" style="top:15%"
|
|
|
+ title="告警配置"
|
|
|
+ :visible.sync="innerVisible"
|
|
|
+ append-to-body>
|
|
|
+ <!-- TODO 移植v3 -->
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="el-icon-plus"
|
|
|
+ size="mini"
|
|
|
+ popper-class="cpp-popper"
|
|
|
+ @click="handleAdd"
|
|
|
+ >新增
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ icon="el-icon-edit"
|
|
|
+ size="mini"
|
|
|
+ popper-class="cpp-popper"
|
|
|
+ @click="handleUpdate"
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ plain
|
|
|
+ icon="el-icon-delete"
|
|
|
+ size="mini"
|
|
|
+ popper-class="cpp-popper"
|
|
|
+ @click="handleDelete"
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div style="padding-top: 10px">
|
|
|
+ <vxe-table
|
|
|
+ ref="xTable"
|
|
|
+ align="center"
|
|
|
+ class="mytable-style"
|
|
|
+ auto-resize
|
|
|
+ border
|
|
|
+ resizable
|
|
|
+ export-config
|
|
|
+ highlight-current-row
|
|
|
+ show-overflow
|
|
|
+ :data="tableDataAlarmConf"
|
|
|
+ :radio-config="{trigger: 'row'}">
|
|
|
+ <vxe-column type="radio" width="60"/>
|
|
|
+ <vxe-table-column field="stationCode" title="场站编号"
|
|
|
+ :formatter="alarmConfTypeStationFormat"></vxe-table-column>
|
|
|
+ <vxe-table-column field="keyword" title="关键词"></vxe-table-column>
|
|
|
+ <vxe-table-column field="type" title="类型" :formatter="alarmConfTypeFormat"></vxe-table-column>
|
|
|
+ <vxe-table-column field="expireTime" title="失效时间"></vxe-table-column>
|
|
|
+ </vxe-table>
|
|
|
+ <vxe-pager
|
|
|
+ background
|
|
|
+ :loading="loadingAlarmConf"
|
|
|
+ :current-page.sync="alarmConfPage.currentPage"
|
|
|
+ :page-size.sync="alarmConfPage.pageSize"
|
|
|
+ :total="alarmConfPage.total"
|
|
|
+ @page-change="handleSizeChangeAlarmConf"
|
|
|
+ :layouts="['PrevJump', 'PrevPage', 'JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']">
|
|
|
+ </vxe-pager>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="dark-el-dialog">
|
|
|
+ <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="850px"
|
|
|
+ height="600px"
|
|
|
+ append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" width="830px" label-width="150px">
|
|
|
+ <el-row class="mb4">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="场站" prop="stationCode">
|
|
|
+ <el-select v-model="form.stationCode" placeholder="请选择" style="width: 100%"
|
|
|
+ popper-class="cpp-popper">
|
|
|
+ <el-option
|
|
|
+ v-for="item in this.stationSelect()"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="关键词" prop="keyword">
|
|
|
+ <el-input style="width: 100%" v-model="form.keyword" maxlength="50"
|
|
|
+ popper-class="cpp-popper"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="mb4">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="类型" prop="type">
|
|
|
+ <el-select v-model="form.type" placeholder="请选择" style="width: 100%"
|
|
|
+ popper-class="cpp-popper">
|
|
|
+ <el-option
|
|
|
+ v-for="item in this.alarmConfType"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="失效时间" prop="expireTime">
|
|
|
+ <el-date-picker
|
|
|
+ :clearable="false"
|
|
|
+ v-model="form.expireTime"
|
|
|
+ type="datetime"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ placeholder="选择失效时间"
|
|
|
+ popper-class="cpp-popper">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="commitChannel">确 定</el-button>
|
|
|
+ <el-button @click="cancelChannel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
- </el-dialog>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -178,7 +308,9 @@ export default {
|
|
|
outerVisible: false,
|
|
|
innerVisible: false,
|
|
|
tableDataAlarm: [],
|
|
|
- loadingAlarm:false,
|
|
|
+ tableDataAlarmConf: [],
|
|
|
+ loadingAlarm: false,
|
|
|
+ loadingAlarmConf: false,
|
|
|
tableDataAlarmBak: [],
|
|
|
digitalDisk: [{
|
|
|
name: '实际功率',
|
|
@@ -220,10 +352,47 @@ export default {
|
|
|
currentPage: 1, // 当前页数
|
|
|
pageSize: 10 // 每页显示多少条
|
|
|
},
|
|
|
- stationList:[],
|
|
|
- alarmEnum:[],
|
|
|
- alarmType: ''
|
|
|
-
|
|
|
+ alarmConfPage: {
|
|
|
+ total: 0, // 总页数
|
|
|
+ currentPage: 1, // 当前页数
|
|
|
+ pageSize: 10 // 每页显示多少条
|
|
|
+ },
|
|
|
+ stationList: [],
|
|
|
+ alarmEnum: [],
|
|
|
+ alarmType: '',
|
|
|
+ form: {
|
|
|
+ stationCode: '',
|
|
|
+ keyword: '',
|
|
|
+ type: 1,
|
|
|
+ expireTime: undefined
|
|
|
+ },
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ stationCode: [
|
|
|
+ {required: true, message: "场站编号不能为空", trigger: "blur"}
|
|
|
+ ],
|
|
|
+ keyword: [
|
|
|
+ {required: true, message: "关键词", trigger: "blur"}
|
|
|
+ ],
|
|
|
+ type: [
|
|
|
+ {required: true, message: "类型不能为空", trigger: "blur"}
|
|
|
+ ],
|
|
|
+ expireTime: [
|
|
|
+ {required: true, message: "失效时间不能为空", trigger: "blur"}
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ title: '',
|
|
|
+ open: false,
|
|
|
+ alarmConfType: [
|
|
|
+ {
|
|
|
+ label: "等于",
|
|
|
+ value: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "包含",
|
|
|
+ value: 0
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -278,14 +447,31 @@ export default {
|
|
|
// this.badgeValue.confirm = this.tableDataAlarm.filter(w => w.operate === 0).length
|
|
|
// this.badgeValue.alarm = this.tableDataAlarm.filter(w => w.operate === 1).length
|
|
|
},
|
|
|
- getAlarmSize(){
|
|
|
+ getAlarmSize() {
|
|
|
this.$axios.get('/abnormalAlarm/alarmCountStatus1').then(response => {
|
|
|
this.badgeValue.alarm = response.data
|
|
|
}).catch(() => {
|
|
|
|
|
|
})
|
|
|
},
|
|
|
- getAbnormalAlarms(prop){
|
|
|
+ getAlarmConfs() {
|
|
|
+ this.loadingAlarmConf = true
|
|
|
+
|
|
|
+ let queryParams = {
|
|
|
+ currentPage: this.alarmConfPage.currentPage,
|
|
|
+ pageSize: this.alarmConfPage.pageSize,
|
|
|
+ time: new Date().getTime()
|
|
|
+ }
|
|
|
+ this.innerVisible = true
|
|
|
+ this.$axios.get('/alarmConf/pageByExpireTime', {params: queryParams}).then(response => {
|
|
|
+ this.tableDataAlarmConf = response.data.records
|
|
|
+ this.alarmConfPage.total = response.data.total
|
|
|
+ this.loadingAlarmConf = false
|
|
|
+ }).catch(() => {
|
|
|
+ this.loadingAlarmConf = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getAbnormalAlarms(prop) {
|
|
|
this.alarmPage = {
|
|
|
total: 0, // 总页数
|
|
|
currentPage: 1, // 当前页数
|
|
@@ -347,17 +533,17 @@ export default {
|
|
|
formatStartDate(row) {
|
|
|
return formatToDateTime(row.startTime)
|
|
|
},
|
|
|
- formatEndDate(row){
|
|
|
- if(row.endTime){
|
|
|
+ formatEndDate(row) {
|
|
|
+ if (row.endTime) {
|
|
|
return formatToDateTime(row.startTime)
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return "未结束"
|
|
|
}
|
|
|
},
|
|
|
formatStation(row) {
|
|
|
- let name= '未知场站名称'
|
|
|
- this.stationList.forEach(s=>{
|
|
|
- if(row.stationCode == s.value){
|
|
|
+ let name = '未知场站名称'
|
|
|
+ this.stationList.forEach(s => {
|
|
|
+ if (row.stationCode == s.value) {
|
|
|
name = s.label
|
|
|
return
|
|
|
}
|
|
@@ -365,9 +551,9 @@ export default {
|
|
|
return name
|
|
|
},
|
|
|
formatAlarmSource(row) {
|
|
|
- let name= '未知场站名称'
|
|
|
- this.alarmEnum.forEach(s=>{
|
|
|
- if(row.alarmType === s.value){
|
|
|
+ let name = '未知场站名称'
|
|
|
+ this.alarmEnum.forEach(s => {
|
|
|
+ if (row.alarmType === s.value) {
|
|
|
name = s.label
|
|
|
return name
|
|
|
}
|
|
@@ -384,7 +570,13 @@ export default {
|
|
|
this.alarmPage.currentPage = val
|
|
|
this.filterInfo()
|
|
|
},
|
|
|
- acknowledgeAll(){
|
|
|
+
|
|
|
+ handleSizeChangeAlarmConf({currentPage, pageSize}) {
|
|
|
+ this.currentPage = currentPage
|
|
|
+ this.pageSize = pageSize
|
|
|
+ this.getAlarmConfs();
|
|
|
+ },
|
|
|
+ acknowledgeAll() {
|
|
|
this.$confirm('是否确认执行"所有场站告警全部确认"操作?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
@@ -399,7 +591,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
acknowledge(row) {
|
|
|
- this.$confirm('是否对 【' + this.formatStation(row) + ':' +row.msg + '】进行"确认"操作?', '提示', {
|
|
|
+ this.$confirm('是否对 【' + this.formatStation(row) + ':' + row.msg + '】进行"确认"操作?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
@@ -412,7 +604,136 @@ export default {
|
|
|
this.loading = false
|
|
|
})
|
|
|
})
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.edit = false;
|
|
|
+ this.form = {
|
|
|
+ stationCode: '',
|
|
|
+ name: '',
|
|
|
+ electricFieldTypeEnum: '',
|
|
|
+ capacity: '',
|
|
|
+ longitude: '',
|
|
|
+ latitude: '',
|
|
|
+ provinceEnum: '',
|
|
|
+ ftpChanelId: '',
|
|
|
+ ftpUrl: '',
|
|
|
+ },
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancelChannel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ handleAdd() {
|
|
|
+ this.reset();
|
|
|
+ this.open = true;
|
|
|
+ this.title = "新增场站信息";
|
|
|
+ this.edit = false;
|
|
|
+ },
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate() {
|
|
|
+ this.title = "修改场站信息";
|
|
|
+ this.reset();
|
|
|
+ const _selectData = this.$refs.xTable.getRadioRecord(true)
|
|
|
+ if (_selectData == null) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请选择记录!'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.open = true;
|
|
|
+ this.edit = true;
|
|
|
+ this.form = JSON.parse(JSON.stringify(_selectData))
|
|
|
+ },
|
|
|
+ // 提交按钮
|
|
|
+ commitChannel() {
|
|
|
+ this.$refs["form"].validate(async valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id != undefined) {
|
|
|
+ // 更新操作
|
|
|
+ this.$axios.post('/alarmConf/updateById', this.form).then((res) => {
|
|
|
+ this.$message.success('修改成功')
|
|
|
+ this.open = false;
|
|
|
+ this.getAlarmConfs()
|
|
|
+ }).catch((error) => {
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // 新增操作
|
|
|
+ this.$axios.post('/alarmConf/save', this.form).then((res) => {
|
|
|
+ if (res == undefined) {
|
|
|
+ this.$message.success('新增失败')
|
|
|
+ } else {
|
|
|
+ this.$message.success('新增成功')
|
|
|
+ this.getAlarmConfs()
|
|
|
+ this.open = false;
|
|
|
+ }
|
|
|
+ }).catch((error) => {
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete() {
|
|
|
+ const _selectData = this.$refs.xTable.getRadioRecord(true)
|
|
|
+ if (_selectData == null) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请选择记录!'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$confirm('是否确认删除?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.doDelete(_selectData)
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 删除提交
|
|
|
+ */
|
|
|
+ doDelete(row) {
|
|
|
+ this.$axios.post('/alarmConf/remove', row).then((res) => {
|
|
|
+ this.$message.success('删除成功!')
|
|
|
+ this.getAlarmConfs()
|
|
|
+ }).catch((error) => {
|
|
|
+ })
|
|
|
+ this.loading = false
|
|
|
+ },
|
|
|
+ stationSelect() {
|
|
|
+ let a = [{label: '所有场站', value: 'all'}]
|
|
|
+ this.stationList.forEach(s => {
|
|
|
+ a.push(s)
|
|
|
+ })
|
|
|
+ return a
|
|
|
+ },
|
|
|
+ alarmConfTypeFormat({cellValue, row, column}) {
|
|
|
+ let result = '未知类型'
|
|
|
+ this.alarmConfType.forEach(a => {
|
|
|
+ if (a.value == cellValue) {
|
|
|
+ result = a.label
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return result
|
|
|
+ },
|
|
|
+ alarmConfTypeStationFormat({cellValue, row, column}) {
|
|
|
+ let result = '未知'
|
|
|
+ this.stationSelect().forEach(a => {
|
|
|
+ if (a.value == cellValue) {
|
|
|
+ result = a.label
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return result
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|