权限控制更新
This commit is contained in:
parent
7316682e15
commit
5baec55fe7
@ -8,6 +8,7 @@ import com.inspur.industrial.domain.BottomCylData;
|
||||
import com.inspur.industrial.domain.IpcData;
|
||||
import com.inspur.industrial.domain.ScollerData;
|
||||
import com.inspur.industrial.service.IDataQueryService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -136,6 +137,7 @@ public class DataQueryController {
|
||||
/**
|
||||
* 超压底缸导出数据记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dataquery:bottomcyl:export')")
|
||||
@Log(title = "超压底缸数据记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/bottomCylExport")
|
||||
public void bottomCylExport(
|
||||
@ -152,7 +154,8 @@ public class DataQueryController {
|
||||
/**
|
||||
* 超压底缸导出数据记录
|
||||
*/
|
||||
@Log(title = "数据记录", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('dataquery:topscoller:export')")
|
||||
@Log(title = "中高辊顶辊数据记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/topScollerExport")
|
||||
public void topScollerExport(
|
||||
HttpServletResponse response,
|
||||
@ -168,7 +171,8 @@ public class DataQueryController {
|
||||
/**
|
||||
* 超压底缸导出数据记录
|
||||
*/
|
||||
@Log(title = "数据记录", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('dataquery:bottomscoller:export')")
|
||||
@Log(title = "中高辊底辊数据记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/bottomScollerExport")
|
||||
public void export(
|
||||
HttpServletResponse response,
|
||||
|
@ -37,7 +37,7 @@ public class IpcAlarmRulesController extends BaseController
|
||||
/**
|
||||
* 查询设备报警规则列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rules:list')")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:rules:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(IpcAlarmRules ipcAlarmRules)
|
||||
{
|
||||
@ -56,7 +56,7 @@ public class IpcAlarmRulesController extends BaseController
|
||||
/**
|
||||
* 导出设备报警规则列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rules:export')")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:rules:export')")
|
||||
@Log(title = "设备报警规则", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, IpcAlarmRules ipcAlarmRules)
|
||||
@ -69,7 +69,7 @@ public class IpcAlarmRulesController extends BaseController
|
||||
/**
|
||||
* 获取设备报警规则详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rules:query')")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:rules:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
@ -79,7 +79,7 @@ public class IpcAlarmRulesController extends BaseController
|
||||
/**
|
||||
* 新增设备报警规则
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rules:add')")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:rules:add')")
|
||||
@Log(title = "设备报警规则", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody IpcAlarmRules ipcAlarmRules)
|
||||
@ -90,7 +90,7 @@ public class IpcAlarmRulesController extends BaseController
|
||||
/**
|
||||
* 修改设备报警规则
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rules:edit')")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:rules:edit')")
|
||||
@Log(title = "设备报警规则", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody IpcAlarmRules ipcAlarmRules)
|
||||
@ -101,7 +101,7 @@ public class IpcAlarmRulesController extends BaseController
|
||||
/**
|
||||
* 删除设备报警规则
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:rules:remove')")
|
||||
@PreAuthorize("@ss.hasPermi('alarm:rules:remove')")
|
||||
@Log(title = "设备报警规则", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
|
@ -29,6 +29,7 @@
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleBottomCylExport"
|
||||
v-hasPermi="['dataquery:bottomcyl:export']"
|
||||
>导出</el-button>
|
||||
<div
|
||||
style="text-align:right;margin-bottom: 1%;"
|
||||
@ -312,6 +313,7 @@
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleTopScollerExport"
|
||||
v-hasPermi="['dataquery:topscoller:export']"
|
||||
>导出</el-button>
|
||||
<div
|
||||
style="text-align:right;margin-bottom: 1%;"
|
||||
@ -601,6 +603,7 @@
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleBottomScollerExport"
|
||||
v-hasPermi="['dataquery:bottomscoller:export']"
|
||||
>导出</el-button>
|
||||
<div
|
||||
style="text-align:right;margin-bottom: 1%;"
|
||||
|
@ -43,6 +43,7 @@
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="handleQuery"
|
||||
v-hasPermi="['ipc:faultTreeConfig:query']"
|
||||
>搜索</el-button>
|
||||
<el-button
|
||||
icon="el-icon-refresh"
|
||||
@ -87,6 +88,7 @@
|
||||
row-key="nodeId"
|
||||
:default-expand-all="isExpandAll"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
v-hasPermi="['ipc:faultTreeConfig:list']"
|
||||
>
|
||||
<el-table-column
|
||||
label="节点名称"
|
||||
|
@ -203,7 +203,7 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:rules:edit']"
|
||||
v-hasPermi="['alarm:rules:edit']"
|
||||
>修改</el-button>
|
||||
<!-- <el-button
|
||||
size="mini"
|
||||
@ -370,7 +370,7 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:rules:edit']"
|
||||
v-hasPermi="['alarm:rules:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -537,7 +537,7 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:rules:edit']"
|
||||
v-hasPermi="['alarm:rules:edit']"
|
||||
>修改</el-button>
|
||||
<!-- <el-button
|
||||
size="mini"
|
||||
@ -746,13 +746,7 @@ import {
|
||||
updateRules,
|
||||
} from "@/api/industrial/rules";
|
||||
|
||||
import {
|
||||
listInfo,
|
||||
getInfo,
|
||||
delInfo,
|
||||
addInfo,
|
||||
updateInfo,
|
||||
} from "@/api/equip/equip";
|
||||
import { listInfo } from "@/api/equip/equip";
|
||||
|
||||
import {
|
||||
listMonitorInfo,
|
@ -125,6 +125,7 @@
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:record:edit']"
|
||||
>批量处理</el-button>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
@ -211,7 +212,8 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
v-hasPermi="['system:record:edit']"
|
||||
>处理</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
|
@ -1,7 +1,17 @@
|
||||
<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="equipCode">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item
|
||||
label="设备编号"
|
||||
prop="equipCode"
|
||||
>
|
||||
<el-input
|
||||
v-model="queryParams.equipCode"
|
||||
placeholder="请输入设备编号"
|
||||
@ -9,7 +19,10 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备ID" prop="equipId">
|
||||
<el-form-item
|
||||
label="设备ID"
|
||||
prop="equipId"
|
||||
>
|
||||
<el-input
|
||||
v-model="queryParams.equipId"
|
||||
placeholder="请输入设备ID"
|
||||
@ -17,7 +30,10 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="测点ID" prop="measureId">
|
||||
<el-form-item
|
||||
label="测点ID"
|
||||
prop="measureId"
|
||||
>
|
||||
<el-input
|
||||
v-model="queryParams.measureId"
|
||||
placeholder="请输入测点ID"
|
||||
@ -25,7 +41,10 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="测点名称" prop="measureName">
|
||||
<el-form-item
|
||||
label="测点名称"
|
||||
prop="measureName"
|
||||
>
|
||||
<el-input
|
||||
v-model="queryParams.measureName"
|
||||
placeholder="请输入测点名称"
|
||||
@ -33,7 +52,10 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="指标名称" prop="indicatorName">
|
||||
<el-form-item
|
||||
label="指标名称"
|
||||
prop="indicatorName"
|
||||
>
|
||||
<el-input
|
||||
v-model="queryParams.indicatorName"
|
||||
placeholder="请输入指标名称"
|
||||
@ -41,7 +63,10 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-form-item
|
||||
label="单位"
|
||||
prop="unit"
|
||||
>
|
||||
<el-input
|
||||
v-model="queryParams.unit"
|
||||
placeholder="请输入单位"
|
||||
@ -49,7 +74,10 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="报警值低" prop="alarmMin">
|
||||
<el-form-item
|
||||
label="报警值低"
|
||||
prop="alarmMin"
|
||||
>
|
||||
<el-input
|
||||
v-model="queryParams.alarmMin"
|
||||
placeholder="请输入报警值低"
|
||||
@ -57,7 +85,10 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="报警值高" prop="alarmMax">
|
||||
<el-form-item
|
||||
label="报警值高"
|
||||
prop="alarmMax"
|
||||
>
|
||||
<el-input
|
||||
v-model="queryParams.alarmMax"
|
||||
placeholder="请输入报警值高"
|
||||
@ -65,7 +96,10 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警状态" prop="status">
|
||||
<el-form-item
|
||||
label="预警状态"
|
||||
prop="status"
|
||||
>
|
||||
<el-input
|
||||
v-model="queryParams.status"
|
||||
placeholder="请输入预警状态"
|
||||
@ -73,7 +107,10 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-form-item
|
||||
label="备注"
|
||||
prop="remark"
|
||||
>
|
||||
<el-input
|
||||
v-model="queryParams.remark"
|
||||
placeholder="请输入备注"
|
||||
@ -81,7 +118,10 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="equipName">
|
||||
<el-form-item
|
||||
label="设备名称"
|
||||
prop="equipName"
|
||||
>
|
||||
<el-input
|
||||
v-model="queryParams.equipName"
|
||||
placeholder="请输入设备名称"
|
||||
@ -89,7 +129,10 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="规则类型" prop="ruleType">
|
||||
<el-form-item
|
||||
label="规则类型"
|
||||
prop="ruleType"
|
||||
>
|
||||
<el-input
|
||||
v-model="queryParams.ruleType"
|
||||
placeholder="请输入规则类型"
|
||||
@ -98,12 +141,24 @@
|
||||
/>
|
||||
</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-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-row
|
||||
:gutter="10"
|
||||
class="mb8"
|
||||
>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
@ -156,25 +211,92 @@
|
||||
v-hasPermi="['system:rules:export']"
|
||||
>导入</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="rulesList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="设备编号" align="center" prop="equipCode" />
|
||||
<el-table-column label="设备ID" align="center" prop="equipId" />
|
||||
<el-table-column label="设备名称" align="center" prop="equipName" />
|
||||
<el-table-column label="测点ID" align="center" prop="measureId" />
|
||||
<el-table-column label="测点名称" align="center" prop="measureName" />
|
||||
<el-table-column label="指标名称" align="center" prop="indicatorName" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<el-table-column label="报警类型" align="center" prop="warnType" />
|
||||
<el-table-column label="报警值低" align="center" prop="alarmMin" />
|
||||
<el-table-column label="报警值高" align="center" prop="alarmMax" />
|
||||
<el-table-column label="预警状态" align="center" prop="status" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="规则类型" align="center" prop="ruleType" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="rulesList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
label="设备编号"
|
||||
align="center"
|
||||
prop="equipCode"
|
||||
/>
|
||||
<el-table-column
|
||||
label="设备ID"
|
||||
align="center"
|
||||
prop="equipId"
|
||||
/>
|
||||
<el-table-column
|
||||
label="设备名称"
|
||||
align="center"
|
||||
prop="equipName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="测点ID"
|
||||
align="center"
|
||||
prop="measureId"
|
||||
/>
|
||||
<el-table-column
|
||||
label="测点名称"
|
||||
align="center"
|
||||
prop="measureName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="指标名称"
|
||||
align="center"
|
||||
prop="indicatorName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="单位"
|
||||
align="center"
|
||||
prop="unit"
|
||||
/>
|
||||
<el-table-column
|
||||
label="报警类型"
|
||||
align="center"
|
||||
prop="warnType"
|
||||
/>
|
||||
<el-table-column
|
||||
label="报警值低"
|
||||
align="center"
|
||||
prop="alarmMin"
|
||||
/>
|
||||
<el-table-column
|
||||
label="报警值高"
|
||||
align="center"
|
||||
prop="alarmMax"
|
||||
/>
|
||||
<el-table-column
|
||||
label="预警状态"
|
||||
align="center"
|
||||
prop="status"
|
||||
/>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
align="center"
|
||||
prop="remark"
|
||||
/>
|
||||
<el-table-column
|
||||
label="规则类型"
|
||||
align="center"
|
||||
prop="ruleType"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -203,56 +325,156 @@
|
||||
/>
|
||||
|
||||
<!-- 添加或修改预警规则管理对话框 -->
|
||||
<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="equipCode">
|
||||
<el-input v-model="form.equipCode" placeholder="请输入设备编号" />
|
||||
<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="equipCode"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.equipCode"
|
||||
placeholder="请输入设备编号"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备ID" prop="equipId">
|
||||
<el-input v-model="form.equipId" placeholder="请输入设备ID" />
|
||||
<el-form-item
|
||||
label="设备ID"
|
||||
prop="equipId"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.equipId"
|
||||
placeholder="请输入设备ID"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="equipName">
|
||||
<el-input v-model="form.equipName" placeholder="请输入设备名称" />
|
||||
<el-form-item
|
||||
label="设备名称"
|
||||
prop="equipName"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.equipName"
|
||||
placeholder="请输入设备名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="测点ID" prop="measureId">
|
||||
<el-input v-model="form.measureId" placeholder="请输入测点ID" />
|
||||
<el-form-item
|
||||
label="测点ID"
|
||||
prop="measureId"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.measureId"
|
||||
placeholder="请输入测点ID"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="测点名称" prop="measureName">
|
||||
<el-input v-model="form.measureName" placeholder="请输入测点名称" />
|
||||
<el-form-item
|
||||
label="测点名称"
|
||||
prop="measureName"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.measureName"
|
||||
placeholder="请输入测点名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="指标名称" prop="indicatorName">
|
||||
<el-input v-model="form.indicatorName" placeholder="请输入指标名称" />
|
||||
<el-form-item
|
||||
label="指标名称"
|
||||
prop="indicatorName"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.indicatorName"
|
||||
placeholder="请输入指标名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="请输入单位" />
|
||||
<el-form-item
|
||||
label="单位"
|
||||
prop="unit"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.unit"
|
||||
placeholder="请输入单位"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="报警类型" prop="warnType">
|
||||
<el-input v-model="form.warnType" type="textarea" placeholder="请输入内容" />
|
||||
<el-form-item
|
||||
label="报警类型"
|
||||
prop="warnType"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.warnType"
|
||||
type="textarea"
|
||||
placeholder="请输入内容"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="报警值低" prop="alarmMin">
|
||||
<el-input v-model="form.alarmMin" placeholder="请输入报警值低" />
|
||||
<el-form-item
|
||||
label="报警值低"
|
||||
prop="alarmMin"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.alarmMin"
|
||||
placeholder="请输入报警值低"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="报警值高" prop="alarmMax">
|
||||
<el-input v-model="form.alarmMax" placeholder="请输入报警值高" />
|
||||
<el-form-item
|
||||
label="报警值高"
|
||||
prop="alarmMax"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.alarmMax"
|
||||
placeholder="请输入报警值高"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警状态" prop="status">
|
||||
<el-input v-model="form.status" placeholder="请输入预警状态" />
|
||||
<el-form-item
|
||||
label="预警状态"
|
||||
prop="status"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.status"
|
||||
placeholder="请输入预警状态"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
<el-form-item
|
||||
label="备注"
|
||||
prop="remark"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
placeholder="请输入备注"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="规则类型" prop="ruleType">
|
||||
<el-input v-model="form.ruleType" placeholder="请输入规则类型" />
|
||||
<el-form-item
|
||||
label="规则类型"
|
||||
prop="ruleType"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.ruleType"
|
||||
placeholder="请输入规则类型"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<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="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-dialog
|
||||
:title="upload.title"
|
||||
:visible.sync="upload.open"
|
||||
width="400px"
|
||||
append-to-body
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
@ -267,26 +489,45 @@
|
||||
>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<!-- <div class="el-upload__tip" slot="tip">-->
|
||||
<!-- <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据-->
|
||||
<!-- </div>-->
|
||||
<div
|
||||
class="el-upload__tip text-center"
|
||||
slot="tip"
|
||||
>
|
||||
<!-- <div class="el-upload__tip" slot="tip">-->
|
||||
<!-- <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据-->
|
||||
<!-- </div>-->
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
||||
<el-link
|
||||
type="primary"
|
||||
:underline="false"
|
||||
style="font-size:12px;vertical-align: baseline;"
|
||||
@click="importTemplate"
|
||||
>下载模板</el-link>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<div
|
||||
slot="footer"
|
||||
class="dialog-footer"
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="submitFileForm"
|
||||
>确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listRules, getRules, delRules, addRules, updateRules } from "@/api/warn/rules";
|
||||
import {
|
||||
listRules,
|
||||
getRules,
|
||||
delRules,
|
||||
addRules,
|
||||
updateRules,
|
||||
} from "@/api/warn/rules";
|
||||
import { getToken } from "@/utils/auth";
|
||||
|
||||
export default {
|
||||
@ -306,7 +547,7 @@ export default {
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + "/system/rules/import/rules"
|
||||
url: process.env.VUE_APP_BASE_API + "/system/rules/import/rules",
|
||||
},
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
@ -342,13 +583,12 @@ export default {
|
||||
status: null,
|
||||
remark: null,
|
||||
equipName: null,
|
||||
ruleType: null
|
||||
ruleType: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
rules: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -358,7 +598,7 @@ export default {
|
||||
/** 查询预警规则管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listRules(this.queryParams).then(response => {
|
||||
listRules(this.queryParams).then((response) => {
|
||||
this.rulesList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
@ -385,7 +625,7 @@ export default {
|
||||
status: null,
|
||||
remark: null,
|
||||
equipName: null,
|
||||
ruleType: null
|
||||
ruleType: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -401,9 +641,9 @@ export default {
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
@ -414,8 +654,8 @@ export default {
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getRules(id).then(response => {
|
||||
const id = row.id || this.ids;
|
||||
getRules(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改预警规则管理";
|
||||
@ -423,16 +663,16 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateRules(this.form).then(response => {
|
||||
updateRules(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addRules(this.form).then(response => {
|
||||
addRules(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
@ -444,18 +684,26 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除预警规则管理编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delRules(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$modal
|
||||
.confirm('是否确认删除预警规则管理编号为"' + ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delRules(ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/rules/export', {
|
||||
...this.queryParams
|
||||
}, `rules_${new Date().getTime()}.xlsx`)
|
||||
this.download(
|
||||
"system/rules/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`rules_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
@ -464,8 +712,11 @@ export default {
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
this.download('system/rules/importTemplate', {
|
||||
}, `rule_template_${new Date().getTime()}.xlsx`)
|
||||
this.download(
|
||||
"system/rules/importTemplate",
|
||||
{},
|
||||
`rule_template_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
@ -476,13 +727,19 @@ export default {
|
||||
this.upload.open = false;
|
||||
this.upload.isUploading = false;
|
||||
this.$refs.upload.clearFiles();
|
||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
||||
this.$alert(
|
||||
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
||||
response.msg +
|
||||
"</div>",
|
||||
"导入结果",
|
||||
{ dangerouslyUseHTMLString: true }
|
||||
);
|
||||
this.getList();
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user