Compare commits

...

2 Commits

4 changed files with 504 additions and 1 deletions

View File

@ -8,6 +8,8 @@ import com.god.common.enums.BusinessType;
import com.god.common.utils.poi.ExcelUtil;
import com.god.gcjxAlarmInformationProcessing.domain.GcjxAlarmInformationProcessing;
import com.god.gcjxAlarmInformationProcessing.service.IGcjxAlarmInformationProcessingService;
import com.god.gcjxPeriodicAlarmDevice.domain.GcjxPeriodicAlarmDevice;
import com.god.gcjxPeriodicAlarmDevice.service.IGcjxPeriodicAlarmDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -27,6 +29,36 @@ public class GcjxAlarmInformationProcessingController extends BaseController
{
@Autowired
private IGcjxAlarmInformationProcessingService gcjxAlarmInformationProcessingService;
// @Autowired
// private IGcjxPeriodicAlarmDeviceService gcjxPeriodicAlarmDeviceService;
/**
* 增加处理按钮
*/
/**
* 查询周期预警查询列表
*/
// @PreAuthorize("@ss.hasPermi('device:gcjxPeriodicAlarmDevice:list')")
// @GetMapping("/list")
// public TableDataInfo list(GcjxPeriodicAlarmDevice gcjxPeriodicAlarmDevice)
// {
// startPage();
// List<GcjxPeriodicAlarmDevice> list = gcjxPeriodicAlarmDeviceService.selectGcjxPeriodicAlarmDeviceList(gcjxPeriodicAlarmDevice);
// return getDataTable(list);
// }
/**
* 增加处理按钮
*/
@PreAuthorize("@ss.hasPermi('gcjxAlarmInformationProcessing:processing:addhandle')")
@Log(title = "处理按钮", businessType = BusinessType.INSERT)
@PostMapping("/addhandle")
public AjaxResult addhandle(@RequestBody GcjxAlarmInformationProcessing gcjxAlarmInformationProcessing)
{
return toAjax(gcjxAlarmInformationProcessingService.updateGcjxAlarmInformationProcessing(gcjxAlarmInformationProcessing));
}
/**
* 查询报警信息处理列表

View File

@ -17,7 +17,7 @@
<sql id="selectGcjxPeriodicAlarmDeviceVo">
select id, device_name, period_type, device_status, responsible_person, responsible_phone, remark from gcjx_periodic_alarm_device
</sql>
h
<select id="selectGcjxPeriodicAlarmDeviceList" parameterType="GcjxPeriodicAlarmDevice" resultMap="GcjxPeriodicAlarmDeviceResult">
<include refid="selectGcjxPeriodicAlarmDeviceVo"/>
<where>

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 查询报警信息处理列表
export function listProcessing(query) {
return request({
url: '/gcjxAlarmInformationProcessing/processing/list',
method: 'get',
params: query
})
}
// 查询报警信息处理详细
export function getProcessing(id) {
return request({
url: '/gcjxAlarmInformationProcessing/processing/' + id,
method: 'get'
})
}
// 新增报警信息处理
export function addProcessing(data) {
return request({
url: '/gcjxAlarmInformationProcessing/processing',
method: 'post',
data: data
})
}
// 修改报警信息处理
export function updateProcessing(data) {
return request({
url: '/gcjxAlarmInformationProcessing/processing',
method: 'put',
data: data
})
}
// 删除报警信息处理
export function delProcessing(id) {
return request({
url: '/gcjxAlarmInformationProcessing/processing/' + id,
method: 'delete'
})
}
// 增加处理信息
export function addhandleProcessing(data) {
return request({
url: '/gcjxAlarmInformationProcessing/processing/addhandle',
method: 'post',
data: data
})
}

View File

@ -0,0 +1,417 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="报警设备" prop="alertName">
<el-input
v-model="queryParams.alertName"
placeholder="请输入报警设备"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="报警类型" prop="alertType">
<el-input
v-model="queryParams.alertType"
placeholder="请输入报警类型"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="报警级别" prop="alertLevel">
<el-input
v-model="queryParams.alertLevel"
placeholder="请输入报警级别"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="报警来源" prop="alarmSource">
<el-input
v-model="queryParams.alarmSource"
placeholder="请输入报警来源"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['gcjxAlarmInformationProcessing:processing:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['gcjxAlarmInformationProcessing:processing:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['gcjxAlarmInformationProcessing:processing:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['gcjxAlarmInformationProcessing:processing:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="processingList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键" align="center" prop="id" /> -->
<el-table-column label="报警设备" align="center" prop="alertName" />
<el-table-column label="报警类型" align="center" prop="alertType" />
<el-table-column label="报警级别" align="center" prop="alertLevel" />
<el-table-column label="报警消息内容" align="center" prop="alertMessage" />
<el-table-column label="报警来源" align="center" prop="alarmSource" />
<el-table-column label="处理时间" align="center" prop="processingTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.processingTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="处理内容" align="center" prop="processingContent" />
<el-table-column label="处理人" align="center" prop="handlePeople" />
<el-table-column label="处理状态" align="center" prop="handleStatus" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleLoad(scope.row)"
v-hasPermi="['device:gcjxPeriodicAlarmDevice:edit']"
>周期预警</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit-outline"
@click="handleAddhandle(scope.row)"
v-hasPermi="['gcjxAlarmInformationProcessing:processing:addhandle']"
>处理</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['gcjxAlarmInformationProcessing:processing:remove']"
>删除</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['gcjxAlarmInformationProcessing:processing:edit']"
>修改</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改报警信息处理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="报警设备" prop="alertName">
<el-input v-model="form.alertName" placeholder="请输入报警设备" />
</el-form-item>
<el-form-item label="报警类型" prop="alertType">
<el-input v-model="form.alertType" placeholder="请输入报警类型" />
</el-form-item>
<el-form-item label="报警级别" prop="alertLevel">
<el-input v-model="form.alertLevel" placeholder="请输入报警级别" />
</el-form-item>
<el-form-item label="报警消息内容" prop="alertMessage">
<el-input v-model="form.alertMessage" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="报警来源" prop="alarmSource">
<el-input v-model="form.alarmSource" placeholder="请输入报警来源" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 处理按钮-->
<el-dialog :title="title" :visible.sync="handle" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="处理时间" prop="processingTime">
<el-date-picker clearable
v-model="form.processingTime"
type="datetime"
value-format="yyyy-MM-dd hh:mm:ss"
placeholder="请选择处理时间">
</el-date-picker>
</el-form-item>
<el-form-item label="处理内容" prop="processingContent">
<el-input v-model="form.processingContent" placeholder="请输入处理内容" />
</el-form-item>
<el-form-item label="处理人" prop="handlePeople">
<el-input v-model="form.handlePeople" placeholder="请输入处理人" />
</el-form-item>
<el-form-item label="处理状态" prop="handleStatus">
<el-input v-model="form.handleStatus" placeholder="请输入处理状态" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 加载按钮-->
<el-dialog :title="title" :visible.sync="load" width="800px" append-to-body>
<el-table v-loading="loading" :data="gcjxPeriodicAlarmDeviceList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<!-- <el-table-column label="主键" align="center" prop="id" /> -->
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="周期类型" align="center" prop="periodType" />
<el-table-column label="设备状态" align="center" prop="deviceStatus" />
<el-table-column label="负责人" align="center" prop="responsiblePerson" />
<el-table-column label="负责人电话" align="center" prop="responsiblePhone" />
<el-table-column label="备注" align="center" prop="remark" />
</el-table>
</el-dialog>
</div>
</template>
<script>
import { listProcessing, getProcessing, delProcessing, addProcessing, updateProcessing,addhandleProcessing } from "@/api/gcjxAlarmInformationProcessing/processing";
import { listGcjxPeriodicAlarmDevice } from "@/api/device/gcjxPeriodicAlarmDevice";
export default {
name: "Processing",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
processingList: [],
//
gcjxPeriodicAlarmDeviceList: [],
//
title: "",
//
open: false,
//
handle: false,
//
load : false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
alertName: null,
alertType: null,
alertLevel: null,
alertMessage: null,
alarmSource: null,
},
//
queryParamsLoad: {
pageNum: 1,
pageSize: 10,
deviceName: null,
periodType: null,
deviceStatus: null,
responsiblePerson: null,
responsiblePhone: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询报警信息处理列表 */
getList() {
this.loading = true;
listProcessing(this.queryParams).then(response => {
this.processingList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.load = false;
this.handle = false;
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
alertName: null,
alertType: null,
alertLevel: null,
alertMessage: null,
alarmSource: null,
processingTime: null,
processingContent: null,
handlePeople: null,
handleStatus: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 加载周期预警数据 */
handleUpdateDevice(row) {
this.reset();
const alertName = row.alertName || this.alertName;
this.queryParams.alertName=alertName;
listGcjxPeriodicAlarmDevice(this.queryParams).then(response => {
this.gcjxPeriodicAlarmDeviceList = response.rows;
this.total = response.total;
this.loading = false;
this.title = "修改周期预警查询";
});
},
/** 加载按钮操作 */
handleLoad(row) {
this.load = true;
this.title = "查看周期预警查询";
const alertName = row.alertName || this.alertName;
this.queryParamsLoad.deviceName=alertName;
listGcjxPeriodicAlarmDevice(this.queryParamsLoad).then(response => {
this.gcjxPeriodicAlarmDeviceList = response.rows;
});
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加报警信息处理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getProcessing(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改报警信息处理";
});
},
handleAddhandle(row){
this.reset();
const id = row.id || this.ids
getProcessing(id).then(response => {
this.form = response.data;
this.handle = true;
this.title = "修改报警信息处理";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateProcessing(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.load = false,
this.handle = false;
this.open = false;
this.getList();
});
} else {
addProcessing(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.load = false,
this.handle = false;
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除报警信息处理编号为"' + ids + '"的数据项?').then(function() {
return delProcessing(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('gcjxAlarmInformationProcessing/processing/export', {
...this.queryParams
}, `processing_${new Date().getTime()}.xlsx`)
}
}
};
</script>