提交代码
|
@ -43,15 +43,15 @@ public class RyTask
|
|||
*/
|
||||
public void expiredTowerData()
|
||||
{
|
||||
Calendar cal = Calendar.getInstance();
|
||||
Date date = new Date();
|
||||
cal.setTime(date);
|
||||
cal.add(Calendar.DATE,-15);
|
||||
String dateStr = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,cal.getTime());
|
||||
Long maxId = taskService.findTowerMaxIdByDate(dateStr);
|
||||
if(maxId!=null){
|
||||
taskService.deleteDevTowerDataRunByMaxId(maxId);
|
||||
}
|
||||
// Calendar cal = Calendar.getInstance();
|
||||
// Date date = new Date();
|
||||
// cal.setTime(date);
|
||||
// cal.add(Calendar.DATE,-15);
|
||||
// String dateStr = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,cal.getTime());
|
||||
// Long maxId = taskService.findTowerMaxIdByDate(dateStr);
|
||||
// if(maxId!=null){
|
||||
taskService.deleteDevTowerDataRunByMaxId(0L);
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -150,7 +150,7 @@
|
|||
</select>
|
||||
|
||||
<delete id="deleteDevTowerDataRunByMaxId" parameterType="Long">
|
||||
delete from dev_tower_data_run where id <![CDATA[ < ]]> #{id} and
|
||||
delete from dev_tower_data_run where create_time <![CDATA[ < ]]> CURDATE() - INTERVAL 15 DAY;
|
||||
</delete>
|
||||
|
||||
<select id="findAllTowerMaxId" resultType="Map">
|
||||
|
|
After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 441 KiB After Width: | Height: | Size: 23 KiB |
|
@ -0,0 +1,52 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询配电箱配置列表
|
||||
export function listIotConfig(query) {
|
||||
return request({
|
||||
url: '/device/iotConfig/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询配电箱配置详细
|
||||
export function getIotConfig(id) {
|
||||
return request({
|
||||
url: '/device/iotConfig/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 配电箱配的点位信息
|
||||
export function findIotConfigPoint(id) {
|
||||
return request({
|
||||
url: '/device/iotConfig/findIotConfigPoint/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增配电箱配置
|
||||
export function addIotConfig(data) {
|
||||
return request({
|
||||
url: '/device/iotConfig',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改配电箱配置
|
||||
export function updateIotConfig(data) {
|
||||
return request({
|
||||
url: '/device/iotConfig',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除配电箱配置
|
||||
export function delIotConfig(id) {
|
||||
return request({
|
||||
url: '/device/iotConfig/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询配电箱配置列表
|
||||
export function listIotConfigPoint(query) {
|
||||
return request({
|
||||
url: '/device/iotConfigPoint/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询配电箱配置详细
|
||||
export function getIotConfigPoint(id) {
|
||||
return request({
|
||||
url: '/device/iotConfigPoint/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增配电箱配置
|
||||
export function addIotConfigPoint(data) {
|
||||
return request({
|
||||
url: '/device/iotConfigPoint',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改配电箱配置
|
||||
export function updateIotConfigPoint(data) {
|
||||
return request({
|
||||
url: '/device/iotConfigPoint',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除配电箱配置
|
||||
export function delIotConfigPoint(id) {
|
||||
return request({
|
||||
url: '/device/iotConfigPoint/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询配电箱数据列表
|
||||
export function listIotDatas(query) {
|
||||
return request({
|
||||
url: '/device/iotDatas/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询配电箱数据详细
|
||||
export function getIotDatas(id) {
|
||||
return request({
|
||||
url: '/device/iotDatas/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增配电箱数据
|
||||
export function addIotDatas(data) {
|
||||
return request({
|
||||
url: '/device/iotDatas',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改配电箱数据
|
||||
export function updateIotDatas(data) {
|
||||
return request({
|
||||
url: '/device/iotDatas',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除配电箱数据
|
||||
export function delIotDatas(id) {
|
||||
return request({
|
||||
url: '/device/iotDatas/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询配电箱预警列表
|
||||
export function listIotWarning(query) {
|
||||
return request({
|
||||
url: '/device/iotWarning/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询配电箱预警详细
|
||||
export function getIotWarning(id) {
|
||||
return request({
|
||||
url: '/device/iotWarning/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增配电箱预警
|
||||
export function addIotWarning(data) {
|
||||
return request({
|
||||
url: '/device/iotWarning',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改配电箱预警
|
||||
export function updateIotWarning(data) {
|
||||
return request({
|
||||
url: '/device/iotWarning',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除配电箱预警
|
||||
export function delIotWarning(id) {
|
||||
return request({
|
||||
url: '/device/iotWarning/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
Before Width: | Height: | Size: 441 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 460 KiB |
|
@ -1,5 +1,6 @@
|
|||
import hasRole from './permission/hasRole'
|
||||
import hasPermi from './permission/hasPermi'
|
||||
import notHasPermi from './permission/notHasPermi'
|
||||
import dialogDrag from './dialog/drag'
|
||||
import dialogDragWidth from './dialog/dragWidth'
|
||||
import dialogDragHeight from './dialog/dragHeight'
|
||||
|
@ -9,6 +10,7 @@ import Move from './move'
|
|||
const install = function(Vue) {
|
||||
Vue.directive('hasRole', hasRole)
|
||||
Vue.directive('hasPermi', hasPermi)
|
||||
Vue.directive('notHasPermi', notHasPermi)
|
||||
Vue.directive('clipboard', clipboard)
|
||||
Vue.directive('dialogDrag', dialogDrag)
|
||||
Vue.directive('dialogDragWidth', dialogDragWidth)
|
||||
|
@ -19,7 +21,8 @@ const install = function(Vue) {
|
|||
|
||||
if (window.Vue) {
|
||||
window['hasRole'] = hasRole
|
||||
window['hasPermi'] = hasPermi
|
||||
window['hasPermi'] = hasPermi
|
||||
window['notHasPermi'] = hasPermi
|
||||
Vue.use(install); // eslint-disable-line
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
/**
|
||||
* v-hasPermi 操作权限处理
|
||||
* Copyright (c) 2019 ruoyi
|
||||
*/
|
||||
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
export default {
|
||||
mounted(el, binding, vnode) {
|
||||
const { value } = binding
|
||||
const all_permission = "*:*:*";
|
||||
const permissions = useUserStore().permissions
|
||||
|
||||
if (value && value instanceof Array && value.length > 0) {
|
||||
const permissionFlag = value
|
||||
|
||||
const hasPermissions = permissions.some(permission => {
|
||||
return !(all_permission === permission || permissionFlag.includes(permission))
|
||||
})
|
||||
|
||||
if (!hasPermissions) {
|
||||
el.parentNode && el.parentNode.removeChild(el)
|
||||
}
|
||||
} else {
|
||||
throw new Error(`请设置操作权限标签值`)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,16 +2,12 @@
|
|||
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
|
||||
<transition name="sidebarLogoFade">
|
||||
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
|
||||
<img src="@/assets/logo/logo_min.png" class="sidebar-logo" style="width: 80%;margin-top: 10px;"/>
|
||||
<!--
|
||||
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
|
||||
-->
|
||||
<img src="@/assets/logo/logo_min.png" class="sidebar-logo" style="width: 80%;margin-top: 6px;"/>
|
||||
<!-- <h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1> -->
|
||||
</router-link>
|
||||
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
||||
<img src="@/assets/logo/logo.png" class="sidebar-logo" style="width: 80%;margin-top: 10px;"/>
|
||||
<!--
|
||||
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
|
||||
-->
|
||||
<img src="@/assets/logo/logo.png" class="sidebar-logo" style="width: 80%;margin-top: 6px;"/>
|
||||
<!-- <h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1> -->
|
||||
</router-link>
|
||||
</transition>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,456 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input
|
||||
v-model="queryParams.projectName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备厂商" prop="factoryName">
|
||||
<el-select
|
||||
v-model="queryParams.factoryName"
|
||||
placeholder="请选择设备厂商"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.iot_factory_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</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="['manage:iotConfig: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="['manage:towerDataWarning: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="['manage:iotConfig: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="['manage:iotConfig:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-refresh"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleRefreshPoint"
|
||||
v-hasPermi="['manage:iotConfig:edit']"
|
||||
>刷新设备</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-alert title="配置说明" type="success">
|
||||
<template slot="default">
|
||||
<div>1、新增的配置自动刷新设备。</div>
|
||||
<div>2、修改配置后手动刷新设备或等待设备心跳后更新点位。</div>
|
||||
<div>3、初始化失败的配置,常见原因为通信账号、通信密码不匹配!</div>
|
||||
</template>
|
||||
</el-alert>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="iotConfigList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||
<el-table-column label="总包单位" align="center" prop="comName" />
|
||||
<el-table-column label="通信账号" align="center" prop="signalName" />
|
||||
<el-table-column label="通信密码" align="center" prop="signalCode" />
|
||||
<el-table-column label="设备厂商" align="center" prop="factoryName" width="120">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.iot_factory_type"
|
||||
:value="scope.row.factoryName"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="是否启用"
|
||||
align="center"
|
||||
prop="isDel"
|
||||
width="120"
|
||||
v-hasPermi="['manage:iotConfig:edit']"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.isDel != '99'"
|
||||
:content="scope.row.isDel == '0' ? '启用' : '停用'"
|
||||
placement="top"
|
||||
>
|
||||
<el-switch
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
v-model="scope.row.isDel"
|
||||
@change="setStatus($event, scope.row)"
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-button v-else type="danger" link disabled>初始化失败</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="是否启用"
|
||||
align="center"
|
||||
prop="isDel"
|
||||
width="120"
|
||||
v-notHasPermi="['manage:iotConfig:edit']"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
v-if="scope.row.isDel != '99'"
|
||||
:options="dict.type.sys_normal_disable"
|
||||
:value="scope.row.isDel"
|
||||
/>
|
||||
<el-button v-else type="danger" link disabled>初始化失败</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['manage:iotConfig:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['manage:iotConfig:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改配电箱配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="680px" append-to-body>
|
||||
<el-form ref="iotConfigRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="所属项目" prop="projectId">
|
||||
<el-select v-model="form.projectId" placeholder="请选择所属项目" style="width:100%">
|
||||
<el-option
|
||||
v-for="(item, index) in projectOptions"
|
||||
:key="index"
|
||||
:label="item.projectName"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="通信账号" prop="signalName">
|
||||
<el-input
|
||||
v-model="form.signalName"
|
||||
placeholder="请输入通信账号"
|
||||
maxlength="64"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="通信密码" prop="signalCode">
|
||||
<el-input
|
||||
v-model="form.signalCode"
|
||||
placeholder="请输入通信密码"
|
||||
maxlength="64"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备厂商" prop="factoryName">
|
||||
<el-select
|
||||
v-model="form.factoryName"
|
||||
placeholder="请选择设备厂商"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.iot_factory_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template slot="footer">
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listIotConfig,
|
||||
getIotConfig,
|
||||
delIotConfig,
|
||||
addIotConfig,
|
||||
updateIotConfig,
|
||||
findIotConfigPoint,
|
||||
} from "@/api/device/iotConfig";
|
||||
|
||||
export default {
|
||||
name: "IotConfig",
|
||||
dicts: ["sys_normal_disable", "iot_factory_type"],
|
||||
data() {
|
||||
return {
|
||||
iotConfigList: [],
|
||||
open: false,
|
||||
loading: true,
|
||||
showSearch: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
total: 0,
|
||||
title: "",
|
||||
form: {
|
||||
id: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
signalName: null,
|
||||
signalCode: null,
|
||||
factoryName: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null,
|
||||
},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
signalName: null,
|
||||
signalCode: null,
|
||||
factoryName: null,
|
||||
isDel: null,
|
||||
},
|
||||
rules: {
|
||||
projectId: [{ required: true, message: "所属项目不能为空", trigger: "change" }],
|
||||
signalName: [{ required: true, message: "通信账号不能为空", trigger: "blur" }],
|
||||
signalCode: [{ required: true, message: "通信密码不能为空", trigger: "blur" }],
|
||||
factoryName: [{ required: true, message: "设备厂商不能为空", trigger: "change" }],
|
||||
},
|
||||
projectOptions: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.$api.publics.getMyProjectList({}).then((response) => {
|
||||
this.projectOptions = response.rows;
|
||||
});
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询配电箱配置列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listIotConfig(this.queryParams).then((response) => {
|
||||
this.iotConfigList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
signalName: null,
|
||||
signalCode: null,
|
||||
factoryName: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null,
|
||||
};
|
||||
this.$refs.iotConfigRef && this.$refs.iotConfigRef.resetFields();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.$refs.queryRef && this.$refs.queryRef.resetFields();
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加配电箱配置";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const _id = row.id || this.ids;
|
||||
getIotConfig(_id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改配电箱配置";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs.iotConfigRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id !== null) {
|
||||
updateIotConfig(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addIotConfig(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getIotConfigPoint(response.data.id);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 状态滑块控制 */
|
||||
setStatus(val, row) {
|
||||
this.$modal
|
||||
.confirm(`是否确认${val === "0" ? "启用" : "停用"}当前数据项?`)
|
||||
.then(() => {
|
||||
const _data = { id: row.id, isDel: val };
|
||||
return updateIotConfig(_data);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
})
|
||||
.catch(() => {
|
||||
// 取消时恢复原始开关状态
|
||||
if (val === "0") {
|
||||
row.isDel = "1";
|
||||
} else {
|
||||
row.isDel = "0";
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 配电箱配的点位 */
|
||||
getIotConfigPoint(id) {
|
||||
findIotConfigPoint(id).then((res) => {
|
||||
this.getList();
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess("初始化配置点位成功!!!");
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 刷新点位操作 */
|
||||
handleRefreshPoint() {
|
||||
this.getIotConfigPoint(this.ids);
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const _ids = row.id || this.ids;
|
||||
this.$modal
|
||||
.confirm('是否确认删除配电箱配置编号为"' + _ids + '"的数据项?')
|
||||
.then(() => {
|
||||
return delIotConfig(_ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download(
|
||||
"manage/iotConfig/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`iotConfig_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,590 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input
|
||||
v-model="queryParams.projectName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编号" prop="deviceSn">
|
||||
<el-input
|
||||
v-model="queryParams.deviceSn"
|
||||
placeholder="请输入设备编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="deviceName">
|
||||
<el-input
|
||||
v-model="queryParams.deviceName"
|
||||
placeholder="请输入设备名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备厂商" prop="factoryName">
|
||||
<el-select
|
||||
v-model="queryParams.factoryName"
|
||||
placeholder="请选择设备厂商"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.iot_factory_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</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="['manage:iotConfigPoint: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="['manage:iotConfigPoint: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="['manage:iotConfigPoint: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="['manage:iotConfigPoint:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-alert title="配置点位说明" type="success">
|
||||
<template slot="default">
|
||||
<div>1、配电箱点位依赖于配电箱配置。</div>
|
||||
<div>2、手动新增的设备可能获取不到数据。</div>
|
||||
<div>3、配电箱点位每小时获取设备心跳、获取不到心跳则设备自动离线!</div>
|
||||
</template>
|
||||
</el-alert>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="iotConfigPointList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||
<el-table-column label="设备编号" align="center" prop="deviceSn" />
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName" width="100" />
|
||||
<el-table-column label="设备厂商" align="center" prop="factoryName" width="88">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.iot_factory_type"
|
||||
:value="scope.row.factoryName"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系人" align="center" prop="contactPerson" width="120">
|
||||
<template slot-scope="scope">
|
||||
<div>{{ scope.row.contactPerson }}</div>
|
||||
<div>{{ scope.row.contactPersonPhone }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="配电箱等级" align="center" prop="levels" width="120" />
|
||||
<el-table-column label="漏电电流" align="center" prop="leakageCurrent" width="88" />
|
||||
<el-table-column
|
||||
label="额定温度"
|
||||
align="center"
|
||||
prop="ratedTemperature"
|
||||
width="88"
|
||||
/>
|
||||
<el-table-column
|
||||
label="短路电流"
|
||||
align="center"
|
||||
prop="shortCircuitCurrent"
|
||||
width="88"
|
||||
/>
|
||||
<el-table-column label="额定电流" align="center" prop="ratedCurrent" width="88" />
|
||||
<el-table-column label="额定电压" align="center" prop="ratedVoltage" width="88" />
|
||||
<el-table-column label="设备状态" align="center" prop="onlineStatus" width="88">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.iot_online_status"
|
||||
:value="scope.row.onlineStatus"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="是否启用"
|
||||
align="center"
|
||||
prop="isDel"
|
||||
width="100"
|
||||
v-hasPermi="['manage:iotConfig:edit']"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip :content="scope.row.isDel == '0' ? '启用' : '停用'" placement="top">
|
||||
<el-switch
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
v-model="scope.row.isDel"
|
||||
@change="setStatus($event, scope.row)"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="是否启用"
|
||||
align="center"
|
||||
prop="isDel"
|
||||
width="100"
|
||||
v-notHasPermi="['manage:iotConfig:edit']"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.isDel" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="130">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['manage:iotConfigPoint:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['manage:iotConfigPoint:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改配电箱配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="680px" append-to-body>
|
||||
<el-form ref="iotConfigPointRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="项目名称" v-if="form.projectId">
|
||||
<el-tag effect="plain">{{ form.projectName }}</el-tag>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属配置" prop="cfgId">
|
||||
<el-select
|
||||
v-model="form.cfgId"
|
||||
placeholder="请选择所属配置"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="cfg in cfgList"
|
||||
:key="cfg.id"
|
||||
:label="cfg.signalName"
|
||||
:value="cfg.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编号" prop="deviceSn">
|
||||
<el-input
|
||||
v-model="form.deviceSn"
|
||||
placeholder="请输入设备编号"
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="deviceName">
|
||||
<el-input
|
||||
v-model="form.deviceName"
|
||||
placeholder="请输入设备名称"
|
||||
maxlength="16"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备厂商" prop="factoryName">
|
||||
<el-select
|
||||
v-model="form.factoryName"
|
||||
placeholder="请选择设备厂商"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.iot_factory_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="contactPerson">
|
||||
<el-input
|
||||
v-model="form.contactPerson"
|
||||
placeholder="请输入联系人"
|
||||
maxlength="16"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人电话" prop="contactPersonPhone">
|
||||
<el-input
|
||||
v-model="form.contactPersonPhone"
|
||||
placeholder="请输入联系人电话"
|
||||
maxlength="11"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="配电箱等级" prop="levels">
|
||||
<el-select
|
||||
v-model="form.levels"
|
||||
placeholder="请选择配电箱等级"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.dev_iot_levels"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="漏电电流" prop="leakageCurrent">
|
||||
<el-input
|
||||
v-model="form.leakageCurrent"
|
||||
placeholder="请输入漏电电流"
|
||||
maxlength="16"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="额定温度" prop="ratedTemperature">
|
||||
<el-input
|
||||
v-model="form.ratedTemperature"
|
||||
placeholder="请输入额定温度"
|
||||
maxlength="16"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="短路电流" prop="shortCircuitCurrent">
|
||||
<el-input
|
||||
v-model="form.shortCircuitCurrent"
|
||||
placeholder="请输入短路电流"
|
||||
maxlength="16"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="额定电流" prop="ratedCurrent">
|
||||
<el-input
|
||||
v-model="form.ratedCurrent"
|
||||
placeholder="请输入额定电流"
|
||||
maxlength="16"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="额定电压" prop="ratedVoltage">
|
||||
<el-input
|
||||
v-model="form.ratedVoltage"
|
||||
placeholder="请输入额定电压"
|
||||
maxlength="16"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template slot="footer">
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listIotConfig } from "@/api/device/iotConfig";
|
||||
import {
|
||||
listIotConfigPoint,
|
||||
getIotConfigPoint,
|
||||
delIotConfigPoint,
|
||||
addIotConfigPoint,
|
||||
updateIotConfigPoint,
|
||||
} from "@/api/device/iotConfigPoint";
|
||||
|
||||
export default {
|
||||
name: "IotConfigPoint",
|
||||
dicts: [
|
||||
"sys_normal_disable",
|
||||
"iot_factory_type",
|
||||
"dev_iot_levels",
|
||||
"iot_online_status",
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
iotConfigPointList: [],
|
||||
open: false,
|
||||
loading: true,
|
||||
showSearch: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
total: 0,
|
||||
title: "",
|
||||
cfgList: [],
|
||||
form: {
|
||||
id: null,
|
||||
cfgId: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
deviceSn: null,
|
||||
deviceName: null,
|
||||
factoryName: null,
|
||||
contactPerson: null,
|
||||
contactPersonPhone: null,
|
||||
levels: null,
|
||||
leakageCurrent: null,
|
||||
ratedTemperature: null,
|
||||
shortCircuitCurrent: null,
|
||||
ratedCurrent: null,
|
||||
ratedVoltage: null,
|
||||
onlineStatus: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null,
|
||||
},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
cfgId: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
deviceSn: null,
|
||||
deviceName: null,
|
||||
factoryName: null,
|
||||
onlineStatus: null,
|
||||
isDel: null,
|
||||
},
|
||||
rules: {
|
||||
cfgId: [{ required: true, message: "所属配置不能为空", trigger: "change" }],
|
||||
deviceSn: [{ required: true, message: "设备编号不能为空", trigger: "blur" }],
|
||||
deviceName: [{ required: true, message: "设备名称不能为空", trigger: "blur" }],
|
||||
factoryName: [{ required: true, message: "设备厂商不能为空", trigger: "change" }],
|
||||
contactPerson: [{ required: false, message: "联系人不能为空", trigger: "blur" }],
|
||||
contactPersonPhone: [
|
||||
{ required: false, message: "联系人电话不能为空", trigger: "blur" },
|
||||
],
|
||||
levels: [{ required: true, message: "配电箱等级不能为空", trigger: "change" }],
|
||||
leakageCurrent: [
|
||||
{ required: true, message: "漏电电流不能为空", trigger: "blur" },
|
||||
],
|
||||
ratedTemperature: [
|
||||
{ required: true, message: "额定温度不能为空", trigger: "blur" },
|
||||
],
|
||||
shortCircuitCurrent: [
|
||||
{ required: true, message: "短路电流不能为空", trigger: "blur" },
|
||||
],
|
||||
ratedCurrent: [{ required: true, message: "额定电流不能为空", trigger: "blur" }],
|
||||
ratedVoltage: [{ required: true, message: "额定电压不能为空", trigger: "blur" }],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询配电箱配置点位列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listIotConfigPoint(this.queryParams).then((response) => {
|
||||
this.iotConfigPointList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
cfgId: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
deviceSn: null,
|
||||
deviceName: null,
|
||||
factoryName: null,
|
||||
contactPerson: null,
|
||||
contactPersonPhone: null,
|
||||
levels: null,
|
||||
leakageCurrent: null,
|
||||
ratedTemperature: null,
|
||||
shortCircuitCurrent: null,
|
||||
ratedCurrent: null,
|
||||
ratedVoltage: null,
|
||||
onlineStatus: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null,
|
||||
};
|
||||
this.$refs.iotConfigPointRef && this.$refs.iotConfigPointRef.resetFields();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.$refs.queryRef && this.$refs.queryRef.resetFields();
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加配电箱点位";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const _id = row.id || this.ids;
|
||||
getIotConfigPoint(_id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改配电箱点位";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs.iotConfigPointRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id !== null) {
|
||||
updateIotConfigPoint(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addIotConfigPoint(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 状态滑块控制 */
|
||||
setStatus(val, row) {
|
||||
this.$modal
|
||||
.confirm(`是否确认${val === "0" ? "启用" : "停用"}当前数据项?`)
|
||||
.then(() => {
|
||||
const _data = { id: row.id, isDel: val };
|
||||
return updateIotConfigPoint(_data);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
})
|
||||
.catch(() => {
|
||||
// 取消时恢复原始开关状态
|
||||
if (val === "0") {
|
||||
row.isDel = "1";
|
||||
} else {
|
||||
row.isDel = "0";
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const _ids = row.id || this.ids;
|
||||
this.$modal
|
||||
.confirm('是否确认删除配电箱配置编号为"' + _ids + '"的数据项?')
|
||||
.then(() => {
|
||||
return delIotConfigPoint(_ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download(
|
||||
"manage/iotConfigPoint/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`iotConfigPoint_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
/** 初始化获取配置列表 */
|
||||
init() {
|
||||
const _param = { pageNum: 1, pageSize: 10 };
|
||||
listIotConfig(_param).then((res) => {
|
||||
this.cfgList = res.rows;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,444 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input
|
||||
v-model="queryParams.projectName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编号" prop="deviceSn">
|
||||
<el-input
|
||||
v-model="queryParams.deviceSn"
|
||||
placeholder="请输入设备编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="上报时间">
|
||||
<el-date-picker
|
||||
v-model="daterangeCreateTime"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</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 v-if="false" :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['manage:iotDatas: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="['manage:iotDatas: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="['manage:iotDatas: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="['manage:iotDatas:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="iotDatasList">
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||
<el-table-column label="设备编号" align="center" prop="deviceSn" width="88"/>
|
||||
<el-table-column label="实时温度" align="center" prop="temperature" width="88"/>
|
||||
<el-table-column label="漏电监测" align="center" prop="leakage" width="88"/>
|
||||
<el-table-column label="A相电压" align="center" prop="voltageA" width="100" />
|
||||
<el-table-column label="B相电压" align="center" prop="voltageB" width="100" />
|
||||
<el-table-column label="C相电压" align="center" prop="voltageC" width="100" />
|
||||
<el-table-column label="A相电流" align="center" prop="currentA" width="98" />
|
||||
<el-table-column label="B相电流" align="center" prop="currentB" width="98" />
|
||||
<el-table-column label="C相电流" align="center" prop="currentC" width="98" />
|
||||
<el-table-column label="A相功率" align="center" prop="powerA" width="88" />
|
||||
<el-table-column label="B相功率" align="center" prop="powerB" width="88" />
|
||||
<el-table-column label="C相功率" align="center" prop="powerC" width="88" />
|
||||
<el-table-column label="A相频率" align="center" prop="frequencyA" width="88" v-if="false"/>
|
||||
<el-table-column label="B相频率" align="center" prop="frequencyB" width="88" v-if="false"/>
|
||||
<el-table-column label="C相频率" align="center" prop="frequencyC" width="88" v-if="false"/>
|
||||
<el-table-column label="上报时间" align="center" prop="createTime" width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="false"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['manage:iotDatas:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['manage:iotDatas:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改配电箱数据对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="iotDatasRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="配置主键" prop="cfgId">
|
||||
<el-input v-model="form.cfgId" placeholder="请输入配置主键" />
|
||||
</el-form-item>
|
||||
<el-form-item label="点位主键" prop="pointId">
|
||||
<el-input v-model="form.pointId" placeholder="请输入点位主键" />
|
||||
</el-form-item>
|
||||
<el-form-item label="公司主键" prop="comId">
|
||||
<el-input v-model="form.comId" placeholder="请输入公司主键" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目主键" prop="projectId">
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目主键" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备序列号" prop="deviceSn">
|
||||
<el-input v-model="form.deviceSn" placeholder="请输入设备序列号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开关位_交流" prop="switchesAc">
|
||||
<el-input v-model="form.switchesAc" placeholder="请输入开关位_交流" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开关位" prop="switchesSwitch">
|
||||
<el-input v-model="form.switchesSwitch" placeholder="请输入开关位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开关位状态" prop="switchesSwitches">
|
||||
<el-input v-model="form.switchesSwitches" placeholder="请输入开关位状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="温度监测数据" prop="temperature">
|
||||
<el-input v-model="form.temperature" placeholder="请输入温度监测数据" />
|
||||
</el-form-item>
|
||||
<el-form-item label="漏电监测数据" prop="leakage">
|
||||
<el-input v-model="form.leakage" placeholder="请输入漏电监测数据" />
|
||||
</el-form-item>
|
||||
<el-form-item label="A相电压" prop="voltageA">
|
||||
<el-input v-model="form.voltageA" placeholder="请输入A相电压" />
|
||||
</el-form-item>
|
||||
<el-form-item label="B相电压" prop="voltageB">
|
||||
<el-input v-model="form.voltageB" placeholder="请输入B相电压" />
|
||||
</el-form-item>
|
||||
<el-form-item label="C相电压" prop="voltageC">
|
||||
<el-input v-model="form.voltageC" placeholder="请输入C相电压" />
|
||||
</el-form-item>
|
||||
<el-form-item label="A相与B相之间的电压" prop="voltageAb">
|
||||
<el-input v-model="form.voltageAb" placeholder="请输入A相与B相之间的电压" />
|
||||
</el-form-item>
|
||||
<el-form-item label="B相与C相之间的电压" prop="voltageBc">
|
||||
<el-input v-model="form.voltageBc" placeholder="请输入B相与C相之间的电压" />
|
||||
</el-form-item>
|
||||
<el-form-item label="C相与A相之间的电压" prop="voltageCa">
|
||||
<el-input v-model="form.voltageCa" placeholder="请输入C相与A相之间的电压" />
|
||||
</el-form-item>
|
||||
<el-form-item label="A相电流" prop="currentA">
|
||||
<el-input v-model="form.currentA" placeholder="请输入A相电流" />
|
||||
</el-form-item>
|
||||
<el-form-item label="B相电流" prop="currentB">
|
||||
<el-input v-model="form.currentB" placeholder="请输入B相电流" />
|
||||
</el-form-item>
|
||||
<el-form-item label="C相电流" prop="currentC">
|
||||
<el-input v-model="form.currentC" placeholder="请输入C相电流" />
|
||||
</el-form-item>
|
||||
<el-form-item label="A相功率" prop="powerA">
|
||||
<el-input v-model="form.powerA" placeholder="请输入A相功率" />
|
||||
</el-form-item>
|
||||
<el-form-item label="B相功率" prop="powerB">
|
||||
<el-input v-model="form.powerB" placeholder="请输入B相功率" />
|
||||
</el-form-item>
|
||||
<el-form-item label="C相功率" prop="powerC">
|
||||
<el-input v-model="form.powerC" placeholder="请输入C相功率" />
|
||||
</el-form-item>
|
||||
<el-form-item label="A相累计能量" prop="energyA">
|
||||
<el-input v-model="form.energyA" placeholder="请输入A相累计能量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="B相累计能量" prop="energyB">
|
||||
<el-input v-model="form.energyB" placeholder="请输入B相累计能量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="C相累计能量" prop="energyC">
|
||||
<el-input v-model="form.energyC" placeholder="请输入C相累计能量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="A相功率因数" prop="factorA">
|
||||
<el-input v-model="form.factorA" placeholder="请输入A相功率因数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="B相功率因数" prop="factorB">
|
||||
<el-input v-model="form.factorB" placeholder="请输入B相功率因数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="C相功率因数" prop="factorC">
|
||||
<el-input v-model="form.factorC" placeholder="请输入C相功率因数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="A相频率" prop="frequencyA">
|
||||
<el-input v-model="form.frequencyA" placeholder="请输入A相频率" />
|
||||
</el-form-item>
|
||||
<el-form-item label="B相频率" prop="frequencyB">
|
||||
<el-input v-model="form.frequencyB" placeholder="请输入B相频率" />
|
||||
</el-form-item>
|
||||
<el-form-item label="C相频率" prop="frequencyC">
|
||||
<el-input v-model="form.frequencyC" placeholder="请输入C相频率" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template slot="footer">
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listIotDatas, getIotDatas, delIotDatas, addIotDatas, updateIotDatas
|
||||
} from "@/api/device/iotDatas";
|
||||
|
||||
export default {
|
||||
name: "IotDatas",
|
||||
|
||||
data() {
|
||||
return {
|
||||
iotDatasList: [],
|
||||
open: false,
|
||||
loading: true,
|
||||
showSearch: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
total: 0,
|
||||
title: "",
|
||||
daterangeCreateTime: [],
|
||||
form: {
|
||||
id: null,
|
||||
cfgId: null,
|
||||
pointId: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
deviceSn: null,
|
||||
switchesAc: null,
|
||||
switchesSwitch: null,
|
||||
switchesSwitches: null,
|
||||
switchesSwitchstatus: null,
|
||||
temperature: null,
|
||||
leakage: null,
|
||||
voltageA: null,
|
||||
voltageB: null,
|
||||
voltageC: null,
|
||||
voltageAb: null,
|
||||
voltageBc: null,
|
||||
voltageCa: null,
|
||||
currentA: null,
|
||||
currentB: null,
|
||||
currentC: null,
|
||||
powerA: null,
|
||||
powerB: null,
|
||||
powerC: null,
|
||||
energyA: null,
|
||||
energyB: null,
|
||||
energyC: null,
|
||||
factorA: null,
|
||||
factorB: null,
|
||||
factorC: null,
|
||||
frequencyA: null,
|
||||
frequencyB: null,
|
||||
frequencyC: null,
|
||||
createTime: null
|
||||
},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
cfgId: null,
|
||||
pointId: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
deviceSn: null,
|
||||
createTime: null
|
||||
},
|
||||
rules: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询配电箱数据列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
const params = {};
|
||||
if (this.daterangeCreateTime && this.daterangeCreateTime.length > 0) {
|
||||
params["beginCreateTime"] = this.daterangeCreateTime[0];
|
||||
params["endCreateTime"] = this.daterangeCreateTime[1];
|
||||
}
|
||||
this.queryParams.params = params;
|
||||
listIotDatas(this.queryParams).then(response => {
|
||||
this.iotDatasList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
cfgId: null,
|
||||
pointId: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
deviceSn: null,
|
||||
switchesAc: null,
|
||||
switchesSwitch: null,
|
||||
switchesSwitches: null,
|
||||
switchesSwitchstatus: null,
|
||||
temperature: null,
|
||||
leakage: null,
|
||||
voltageA: null,
|
||||
voltageB: null,
|
||||
voltageC: null,
|
||||
voltageAb: null,
|
||||
voltageBc: null,
|
||||
voltageCa: null,
|
||||
currentA: null,
|
||||
currentB: null,
|
||||
currentC: null,
|
||||
powerA: null,
|
||||
powerB: null,
|
||||
powerC: null,
|
||||
energyA: null,
|
||||
energyB: null,
|
||||
energyC: null,
|
||||
factorA: null,
|
||||
factorB: null,
|
||||
factorC: null,
|
||||
frequencyA: null,
|
||||
frequencyB: null,
|
||||
frequencyC: null,
|
||||
createTime: null
|
||||
};
|
||||
this.$refs.iotDatasRef && this.$refs.iotDatasRef.resetFields();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.daterangeCreateTime = [];
|
||||
this.$refs.queryRef && this.$refs.queryRef.resetFields();
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加配电箱数据";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const _id = row.id || this.ids;
|
||||
getIotDatas(_id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改配电箱数据";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs.iotDatasRef.validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id !== null) {
|
||||
updateIotDatas(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addIotDatas(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const _ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除配电箱数据编号为"' + _ids + '"的数据项?').then(() => {
|
||||
return delIotDatas(_ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('manage/iotDatas/export', {
|
||||
...this.queryParams
|
||||
}, `iotDatas_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,303 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input
|
||||
v-model="queryParams.projectName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编号" prop="deviceSn">
|
||||
<el-input
|
||||
v-model="queryParams.deviceSn"
|
||||
placeholder="请输入设备编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警时间">
|
||||
<el-date-picker
|
||||
v-model="daterangeCreateTime"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</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 v-if="false" :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['manage:iotWarning: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="['manage:iotWarning: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="['manage:iotWarning: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="['manage:iotWarning:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="iotWarningList">
|
||||
<el-table-column label="预警编号" align="center" prop="id" width="88"/>
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||
<el-table-column label="设备编号" align="center" prop="deviceSn" width="100"/>
|
||||
<el-table-column label="预警类型" align="center" prop="warningType" />
|
||||
<el-table-column label="预警内容" align="center" prop="warningContent" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="false"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['manage:iotWarning:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['manage:iotWarning:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改配电箱预警对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="iotWarningRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="配置主键" prop="cfgId">
|
||||
<el-input v-model="form.cfgId" placeholder="请输入配置主键" />
|
||||
</el-form-item>
|
||||
<el-form-item label="点位主键" prop="pointId">
|
||||
<el-input v-model="form.pointId" placeholder="请输入点位主键" />
|
||||
</el-form-item>
|
||||
<el-form-item label="公司主键" prop="comId">
|
||||
<el-input v-model="form.comId" placeholder="请输入公司主键" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目主键" prop="projectId">
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目主键" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备序列号" prop="deviceSn">
|
||||
<el-input v-model="form.deviceSn" placeholder="请输入设备序列号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="预警内容">
|
||||
<editor v-model="form.warningContent" :min-height="192"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template slot="footer">
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listIotWarning, getIotWarning, delIotWarning, addIotWarning, updateIotWarning
|
||||
} from "@/api/device/iotWarning";
|
||||
|
||||
export default {
|
||||
name: "IotWarning",
|
||||
data() {
|
||||
return {
|
||||
iotWarningList: [],
|
||||
open: false,
|
||||
loading: true,
|
||||
showSearch: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
total: 0,
|
||||
title: "",
|
||||
daterangeCreateTime: [],
|
||||
form: {
|
||||
id: null,
|
||||
cfgId: null,
|
||||
pointId: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
deviceSn: null,
|
||||
warningType: null,
|
||||
warningContent: null,
|
||||
createTime: null
|
||||
},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
cfgId: null,
|
||||
pointId: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
deviceSn: null,
|
||||
warningType: null,
|
||||
warningContent: null
|
||||
},
|
||||
rules: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询配电箱预警列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
const params = {};
|
||||
if (this.daterangeCreateTime && this.daterangeCreateTime.length > 0) {
|
||||
params["beginCreateTime"] = this.daterangeCreateTime[0];
|
||||
params["endCreateTime"] = this.daterangeCreateTime[1];
|
||||
}
|
||||
this.queryParams.params = params;
|
||||
|
||||
listIotWarning(this.queryParams).then(response => {
|
||||
this.iotWarningList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
cfgId: null,
|
||||
pointId: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
deviceSn: null,
|
||||
warningType: null,
|
||||
warningContent: null,
|
||||
createTime: null
|
||||
};
|
||||
this.$refs.iotWarningRef && this.$refs.iotWarningRef.resetFields();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.$refs.queryRef && this.$refs.queryRef.resetFields();
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加配电箱预警";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const _id = row.id || this.ids;
|
||||
getIotWarning(_id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改配电箱预警";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs.iotWarningRef.validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id !== null) {
|
||||
updateIotWarning(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addIotWarning(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const _ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除配电箱预警编号为"' + _ids + '"的数据项?').then(() => {
|
||||
return delIotWarning(_ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('manage/iotWarning/export', {
|
||||
...this.queryParams
|
||||
}, `iotWarning_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -9,14 +9,6 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位名称" prop="deptName">
|
||||
<el-input
|
||||
v-model="queryParams.deptName"
|
||||
placeholder="请输入单位名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="daterangeCreateTime"
|
||||
|
@ -82,26 +74,11 @@
|
|||
|
||||
<el-table v-loading="loading" :data="towerDataWarningList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||
<el-table-column label="总包单位" align="center" prop="deptName" />
|
||||
<el-table-column label="设备序列号" align="center" prop="deviceKey" />
|
||||
<el-table-column label="设备来源" align="center" prop="deviceSource" />
|
||||
<el-table-column label="塔机编号" align="center" prop="towerId" />
|
||||
<el-table-column label="预警类型" align="center" prop="warnType" />
|
||||
<el-table-column label="预警名称" align="center" prop="warnName" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" width="200"/>
|
||||
<el-table-column label="总包单位" align="center" prop="deptName" width="200"/>
|
||||
<el-table-column label="设备序列号" align="center" prop="deviceKey" width="180"/>
|
||||
<el-table-column label="预警内容" align="center" prop="warnNote" />
|
||||
<el-table-column label="预警值" align="center" prop="warnData" />
|
||||
<el-table-column label="实际值" align="center" prop="realData" />
|
||||
<el-table-column label="是否有效" align="center" prop="isDel">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_common_isdel" :value="scope.row.isDel"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button
|
||||
|
|
|
@ -34,7 +34,7 @@ module.exports = {
|
|||
open: true,
|
||||
proxy: {
|
||||
[process.env.VUE_APP_BASE_API]: {
|
||||
target: `http://106.55.153.13:8888/jhapi/`,
|
||||
target: `http://106.55.153.13/prod-api/`,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||
|
@ -42,7 +42,7 @@ module.exports = {
|
|||
},
|
||||
'/profile':{
|
||||
//target: `http://szgc.jhncidg.com/jhapi/profile`,
|
||||
target: `http://62.234.3.186/profile/`,
|
||||
target: `http://106.55.153.13/profile/`,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/profile':'/'
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.ruoyi.common.core.text.Convert;
|
|||
import com.ruoyi.common.enums.PublicStateEnum;
|
||||
import com.yanzhu.jh.device.domain.DevTowerDataLimit;
|
||||
import com.yanzhu.jh.device.domain.DevTowerDataRun;
|
||||
import com.yanzhu.jh.device.domain.DevTowerDataWarning;
|
||||
import com.yanzhu.jh.device.domain.DevTowerProjectConfig;
|
||||
import com.yanzhu.jh.device.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -47,6 +48,9 @@ public class TowerCraneController extends BaseController {
|
|||
@Autowired
|
||||
private IDevTowerDataCollideService devTowerDataCollideService;
|
||||
|
||||
@Autowired
|
||||
private IDevTowerDataWarningService devTowerDataWarningService;
|
||||
|
||||
@Autowired
|
||||
private IDevTowerProjectConfigService devTowerProjectConfigService;
|
||||
|
||||
|
@ -54,7 +58,7 @@ public class TowerCraneController extends BaseController {
|
|||
* 查询塔基配置列表
|
||||
*/
|
||||
@GetMapping("/findTowerConfigGroupOnline")
|
||||
public AjaxResult findTowerConfigGroupOnline(String deptId, String projectId)
|
||||
public AjaxResult findTowerConfigGroupOnline(String projectId)
|
||||
{
|
||||
String key = "bgscreen.tower.findtowerConfigGroupOnline."+projectId;
|
||||
Object obj=redisCache.getCacheObject(key);
|
||||
|
@ -72,7 +76,7 @@ public class TowerCraneController extends BaseController {
|
|||
* 查询塔基配置列表
|
||||
*/
|
||||
@GetMapping("/findTowerConfigListByProjectId")
|
||||
public AjaxResult findTowerConfigListByProjectId(String deptId, String projectId)
|
||||
public AjaxResult findTowerConfigListByProjectId(String projectId)
|
||||
{
|
||||
String key = "bgscreen.tower.findtowerConfigListByProjectId."+projectId;
|
||||
Object obj=redisCache.getCacheObject(key);
|
||||
|
@ -109,7 +113,7 @@ public class TowerCraneController extends BaseController {
|
|||
@GetMapping("/selectDevTowerDataLimitList")
|
||||
public AjaxResult selectDevTowerDataLimitList(DevTowerDataLimit devTowerDataLimit)
|
||||
{
|
||||
startPage();
|
||||
startPage(1,1);
|
||||
List<DevTowerDataLimit> list = devTowerDataLimitService.selectDevTowerDataLimitList(devTowerDataLimit);
|
||||
return success(list);
|
||||
}
|
||||
|
@ -120,8 +124,19 @@ public class TowerCraneController extends BaseController {
|
|||
@GetMapping("/selectDevTowerDataRunList")
|
||||
public AjaxResult selectDevTowerDataRunList(DevTowerDataRun devTowerDataRun)
|
||||
{
|
||||
startPage();
|
||||
startPage(1,10);
|
||||
List<DevTowerDataRun> list = devTowerDataRunService.selectDevTowerDataRunList(devTowerDataRun);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询塔基实时数据
|
||||
*/
|
||||
@GetMapping("/findDevTowerDataWarningDatas")
|
||||
public AjaxResult findDevTowerDataWarningDatas(DevTowerDataWarning devTowerDataWarning)
|
||||
{
|
||||
startPage(1,10);
|
||||
List<DevTowerDataWarning> list = devTowerDataWarningService.selectDevTowerDataWarningList(devTowerDataWarning);
|
||||
return success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
package com.ruoyi.domain.vo;
|
||||
|
||||
import com.yanzhu.manage.domain.TowerContentReqVo;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 塔吊检测推送信息 请求参数
|
||||
*
|
||||
* @author: JiangYuQi
|
||||
* @date: 2024/01/13 12:21
|
||||
*/
|
||||
@Data
|
||||
public class TowerReqVo {
|
||||
|
||||
/**
|
||||
* 上报类型
|
||||
*/
|
||||
@NotNull(message = "上报类型不能为空")
|
||||
private int type;
|
||||
|
||||
/**
|
||||
* 上报内容
|
||||
*/
|
||||
@NotNull(message = "上报内容不能为空")
|
||||
private TowerContentReqVo content;
|
||||
|
||||
}
|
|
@ -34,7 +34,7 @@ import java.util.stream.Collectors;
|
|||
* @date 2025-04-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/iotConfig")
|
||||
@RequestMapping("/device/iotConfig")
|
||||
public class DevIotConfigController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.List;
|
|||
* @date 2025-04-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/iotConfigPoint")
|
||||
@RequestMapping("/device/iotConfigPoint")
|
||||
public class DevIotConfigPointController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.util.Map;
|
|||
* @date 2025-04-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/iotDatas")
|
||||
@RequestMapping("/device/iotDatas")
|
||||
public class DevIotDatasController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.List;
|
|||
* @date 2025-04-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/iotWarning")
|
||||
@RequestMapping("/device/iotWarning")
|
||||
public class DevIotWarningController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
|
|
|
@ -7,6 +7,8 @@ import com.ruoyi.common.utils.StringUtils;
|
|||
import com.yanzhu.jh.device.domain.DevIotConfig;
|
||||
import com.yanzhu.jh.device.mapper.DevIotConfigMapper;
|
||||
import com.yanzhu.jh.device.service.IDevIotConfigService;
|
||||
import com.yanzhu.jh.project.domain.SurProject;
|
||||
import com.yanzhu.jh.project.mapper.SurProjectMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -21,6 +23,9 @@ import java.util.List;
|
|||
@Service
|
||||
public class DevIotConfigServiceImpl implements IDevIotConfigService
|
||||
{
|
||||
@Autowired
|
||||
private SurProjectMapper surProjectMapper;
|
||||
|
||||
@Autowired
|
||||
private DevIotConfigMapper devIotConfigMapper;
|
||||
|
||||
|
@ -66,6 +71,8 @@ public class DevIotConfigServiceImpl implements IDevIotConfigService
|
|||
if(list.size()>0){
|
||||
throw new ServiceException("配置信息重复添加!");
|
||||
}
|
||||
SurProject surProject = surProjectMapper.selectSurProjectById(devIotConfig.getProjectId());
|
||||
devIotConfig.setComId(surProject.getDeptId());
|
||||
devIotConfig.setIsDel("99");
|
||||
devIotConfig.setCreateBy(SecurityUtils.getUsername());
|
||||
devIotConfig.setCreateTime(DateUtils.getNowDate());
|
||||
|
|
|
@ -122,13 +122,15 @@ PublicsController extends BaseController {
|
|||
@GetMapping("/findMyProjectList")
|
||||
public TableDataInfo findMyProjectList(SurProject surProject)
|
||||
{
|
||||
surProject.setNowRole(Convert.toStr(getUserFirstRole()));
|
||||
if(SysRoleEnum.ZGS.getCode().equals(surProject.getNowRole())){
|
||||
surProject.setNowDept(Convert.toStr(deptService.getZGSDeptId(getDeptId())));
|
||||
}else{
|
||||
surProject.setNowDept(Convert.toStr(getDeptId()));
|
||||
if(SysUser.isAdmin(SecurityUtils.getUserId())){
|
||||
surProject.setNowRole(Convert.toStr(getUserFirstRole()));
|
||||
if(SysRoleEnum.ZGS.getCode().equals(surProject.getNowRole())){
|
||||
surProject.setNowDept(Convert.toStr(deptService.getZGSDeptId(getDeptId())));
|
||||
}else{
|
||||
surProject.setNowDept(Convert.toStr(getDeptId()));
|
||||
}
|
||||
surProject.setNowUser(Convert.toStr(getUserId()));
|
||||
}
|
||||
surProject.setNowUser(Convert.toStr(getUserId()));
|
||||
List<SurProject> list = surProjectService.selectSurProjectList(surProject);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
|
@ -57,8 +57,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="pointId != null "> and did.point_id = #{pointId}</if>
|
||||
<if test="comId != null "> and did.com_id = #{comId}</if>
|
||||
<if test="projectId != null "> and did.project_id = #{projectId}</if>
|
||||
<if test="activeComId != null "> and did.com_id = #{activeComId}</if>
|
||||
<if test="activeProjectId != null "> and did.project_id = #{activeProjectId}</if>
|
||||
<if test="deviceSn != null and deviceSn != ''"> and did.device_sn = #{deviceSn}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and did.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
</where>
|
||||
|
|
|
@ -62,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from dev_tower_data_warning dtdw
|
||||
left join sur_project sp on sp.id = dtdw.project_id
|
||||
left join sys_dept sd on sd.dept_id = dtdw.dept_id
|
||||
left join sys_dict_data sdd on sdd.dict_value = dtdw.warn_type and sdd.dict_type = 'device_tower_warning'
|
||||
</sql>
|
||||
|
||||
<select id="selectDevTowerDataWarningList" parameterType="DevTowerDataWarning" resultMap="DevTowerDataWarningResult">
|
||||
|
|
|
@ -78,7 +78,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<!--普通用户查询项目人员-->
|
||||
<if test='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'> left join sur_project_userinfo spu on spu.project_id = sp.id</if>
|
||||
<where>
|
||||
sp.isDel = 0
|
||||
<if test="deptId != null "> and sp.deptId like concat('%', #{deptId}, '%')</if>
|
||||
<if test="projectName != null and projectName != ''"> and sp.projectName like concat('%', #{projectName}, '%')</if>
|
||||
<if test="projectCode != null and projectCode != ''"> and sp.projectCode = #{projectCode}</if>
|
||||
|
@ -125,6 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> and spui.unitId = #{nowDept}</if>
|
||||
<!--普通用户查询项目人员-->
|
||||
<if test='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'> and spu.user_id = #{nowUser} and spu.is_del=0</if>
|
||||
and sp.isDel = 0
|
||||
</where>
|
||||
order by sp.projectSort ASC,sp.projectName
|
||||
</select>
|
||||
|
|