Commit d4c8c650 by 416409548@qq.com

bug优化,视频安防模块优化

parent cb12baa3
......@@ -4,15 +4,14 @@
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-col :md="4" :sm="8">
<a-form-item label="设备类型">
<j-dict-select-tag v-model="queryParam.type" placeholder="请选择设备类型" dict-code="alarm_query_equipmentType"/>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-col :md="4" :sm="8">
<a-space style="float: left">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button type="default" @click="searchReset">重置</a-button>
</a-space>
</a-col>
</a-row>
......@@ -141,9 +140,6 @@ export default {
})
});
},
searchReset() {
this.searchQuery();
},
floorImgLoadComplete() {
this.searchQuery();
}
......
......@@ -143,19 +143,23 @@ export default {
},
confirmLoading: false,
validatorRules: {
code: [
{
required: true,
message: '请输入设备编码',
trigger: 'blur'
}
},
{min: 0, max: 50, message: '长度不超过50个字符', trigger: 'blur' }
],
name: [
{
required: true,
message: '请输入设备名称',
trigger: 'blur'
}
},
{min: 0, max: 50, message: '长度不超过50个字符', trigger: 'blur' }
],
ip: [
{
......@@ -164,24 +168,19 @@ export default {
trigger: 'blur'
}
],
type: [
{
required: true,
message: '选择设备类型',
trigger: 'change'
}
],
buildingName: [
place: [
{
required: true,
message: '选择楼栋',
message: '选择设备位置',
trigger: 'change'
}
},
{min: 0, max: 50, message: '长度不超过50个字符', trigger: 'blur' }
],
floor: [
type: [
{
required: true,
message: '选择楼层',
message: '选择设备类型',
trigger: 'change'
}
],
......@@ -218,7 +217,9 @@ export default {
required: true,
message: '请输入生产厂商',
trigger: 'blur'
}
},
{min: 0, max: 50, message: '长度不超过50个字符', trigger: 'blur' }
],
warrantyPeriod: [
{
......
......@@ -5,7 +5,7 @@
<a-row>
<a-col :span="24">
<a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
<a-select placeholder="设备名称选择" v-model="model.settingId">
<a-select placeholder="设备名称选择" v-model="model.settingId">
<a-select-option v-for="route in routes" :key="route.id">
{{ route.name }}
</a-select-option>
......
......@@ -15,12 +15,12 @@
<a-col :span="4">
<a-form-model-item label="开始时间" prop="createTime">
<j-date v-model="queryParam.createTime" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"/>
<j-date v-model="queryParam.createTime" placeholder="请选择开始时间" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"/>
</a-form-model-item>
</a-col>
<a-col :span="4">
<a-form-model-item label="结束时间" prop="stopTime" >
<j-date v-model="queryParam.stopTime" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"/>
<j-date v-model="queryParam.stopTime" placeholder="请选择结束时间" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"/>
</a-form-model-item>
</a-col>
......
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-form-item label="选择楼栋">
<a-select placeholder="选择楼栋" v-model="queryParam.buildingName" @change="buildingChange">
<a-select-option v-for="buildingInfo in buildingInfos" :key="buildingInfo.name">
{{ buildingInfo.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-form-item label="选择楼层">
<a-select placeholder="选择楼层" v-model="queryParam.floor">
<a-select-option v-for="floor in targetFloorList" :key="floor">
{{ floor }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-space style="float: left">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button type="default" @click="searchReset">重置</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<!--<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('pm_access_control_device')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
&lt;!&ndash; 高级查询区域 &ndash;&gt;
<j-super-query :fieldList="superFieldList" ref="superQueryModal"
@handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel">
<a-icon type="delete"/>
删除
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>-->
<!-- table区域-begin -->
<div>
<a-row>
<a-col :span="24">
<div style="position: relative">
<img ref="floorImg" src="@/assets/floor.png" alt="floor" width="100%" height="100%"
@load="floorImgLoadComplete()"/>
<img v-for="(item, index) in list"
ref="icon"
:src="item.status === 'NORMAL'
? statusList[0].imgPath
: (item.status === 'OFFLINE' ? statusList[1].imgPath : statusList[2].imgPath)"
:alt="item.name + ':' + item.ip"/>
</div>
</a-col>
</a-row>
</div>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import {getAction} from '@/api/manage'
export default {
name: 'PmMonitoringDeviceOverview',
components: {},
data() {
return {
queryParam: {deleted: false},
description: 'pm_monitoring_device管理页面',
url: {
list: "/pm/pmMonitoringDevice/list",
delete: "/pm/pmMonitoringDevice/delete",
deleteBatch: "/pm/pmMonitoringDevice/deleteBatch",
exportXlsUrl: "/pm/pmMonitoringDevice/exportXls",
importExcelUrl: "pm/pmMonitoringDevice/importExcel",
},
list: [],
dictOptions: {},
superFieldList: [],
buildingInfos: [],
targetFloorList: [],
types: [],
statusList: [
{name: '正常', value: 'NORMAL', imgPath: require('@/assets/door-close.png')},
{name: '离线', value: 'OFFLINE', imgPath: require('@/assets/door-offline.png')},
{name: '损坏', value: 'BREAKDOWN', imgPath: require('@/assets/door-warning.png')}],
}
},
created() {
getAction('/pm/pmBuildingInfo/list')
.then(value => this.buildingInfos = value.result);
getAction('/pm/pmAccessControlDevice/types')
.then(value => this.types = value.result);
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig() {
},
buildingChange(value) {
let targetList = this.buildingInfos.filter(buildingInfo => buildingInfo.name === value);
if (targetList != null && targetList.length > 0) {
this.targetFloorList = targetList[0].floorList;
} else {
this.targetFloorList = [];
}
},
loadComplete() {
if (this.list.length > 0) {
this.list.forEach((item, index) => {
console.log(item);
let fixX = 20;
let fixY = 20;
let offsetWidth = this.$refs.floorImg.offsetWidth;
let offsetHeight = this.$refs.floorImg.offsetHeight;
this.$refs.icon[index].style.position = 'absolute';
this.$refs.icon[index].style.width = '40px';
this.$refs.icon[index].style.top = item.coordinate.y * offsetHeight - fixY + 'px';
this.$refs.icon[index].style.left = item.coordinate.x * offsetWidth - fixX + 'px';
});
}
},
searchQuery() {
getAction(this.url.list, this.queryParam)
.then(value => {
this.list = value.result.records;
this.$nextTick(()=>{
this.loadComplete();
})
});
},
searchReset() {
this.searchQuery();
},
floorImgLoadComplete() {
this.searchQuery();
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
\ No newline at end of file
......@@ -141,7 +141,7 @@ public class PmAccessControlDeviceController extends JeecgController<PmAccessCon
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, PmAccessControlDevice pmAccessControlDevice) {
return super.exportXls(request, pmAccessControlDevice, PmAccessControlDevice.class, "pm_access_control_device");
return super.exportXls(request, pmAccessControlDevice, PmAccessControlDevice.class, "门禁设备");
}
/**
......
package org.jeecg.pm.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
......@@ -10,9 +8,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.pm.entity.PmAccessControlDeviceRecord;
......
......@@ -72,7 +72,6 @@ public class AlarmQuery implements Serializable {
@ApiModelProperty(value = "修改时间")
private Date modifyTime;
/**删除状态*/
@Excel(name = "删除状态", width = 15)
@ApiModelProperty(value = "删除状态")
private Boolean deleted;
}
......@@ -39,7 +39,6 @@ public class PmAccessControlDeviceRecord implements Serializable {
/**
* 门禁设备Id
*/
@Excel(name = "门禁设备Id", width = 15)
@ApiModelProperty(value = "门禁设备Id")
private Long pmAccessControlDeviceId;
......@@ -59,7 +58,7 @@ public class PmAccessControlDeviceRecord implements Serializable {
/**
* 状态
*/
@Excel(name = "状态", width = 15,dicCode = "access_control_classify")
@Excel(name = "员工归类", width = 15,dicCode = "access_control_classify")
@Dict(dicCode = "access_control_classify")
@ApiModelProperty(value = "员工归类 1:员工 2:访客 3:租户")
private Integer classify;
......
package org.jeecg.pm.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Description: pm_monitoring_device
* @Author: jeecg-boot
* @Date: 2022-03-15
* @Date: 2022-05-25
* @Version: V1.0
*/
@Data
@TableName(value = "pm_monitoring_device", autoResultMap = true)
@TableName("pm_monitoring_device")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "pm_monitoring_device对象", description = "pm_monitoring_device")
@ApiModel(value="pm_monitoring_device对象", description="pm_monitoring_device")
public class PmMonitoringDevice implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private Long id;
/**
* 设备编码
*/
@Excel(name = "设备编码", width = 15)
/**区域名称*/
@Excel(name = "区域名称", width = 15)
@ApiModelProperty(value = "区域名称")
private String districtName;
/**设备名称*/
@Excel(name = "设备名称", width = 15)
@ApiModelProperty(value = "设备名称")
private String name;
/**设备编码*/
@Excel(name = "设备编码", width = 15)
@ApiModelProperty(value = "设备编码")
private String code;
/**
* 设备类型
*/
@Excel(name = "设备类型", width = 15)
/**设备类型*/
@Excel(name = "设备类型", width = 15,dicCode = "monitoring_type")
@ApiModelProperty(value = "设备类型")
@Dict(dicCode = "monitoring_type")
private String type;
/**
* 设备名称
*/
@Excel(name = "设备名称", width = 15)
@ApiModelProperty(value = "设备名称")
private String name;
/**
* 设备ip
*/
@Excel(name = "设备ip", width = 15)
/**设备ip*/
@Excel(name = "设备ip", width = 15)
@ApiModelProperty(value = "设备ip")
private String ip;
/**
* 楼栋
*/
@Excel(name = "楼栋", width = 15)
@ApiModelProperty(value = "楼栋")
private String buildingName;
/**
* 楼层
*/
@Excel(name = "楼层", width = 15)
@ApiModelProperty(value = "楼层")
private String floor;
/**
* 设备位置
*/
@Excel(name = "设备位置", width = 15)
@ApiModelProperty(value = "设备位置")
private String place;
/**
* xy值
*/
@Excel(name = "xy值", width = 15)
/**所属设备*/
@Excel(name = "所属设备", width = 15)
@ApiModelProperty(value = "所属设备")
private String theirEquipment;
/**xy值*/
@Excel(name = "xy值", width = 15)
@ApiModelProperty(value = "xy值")
@TableField(typeHandler = Coordinate.TypeHandler.class)
private Coordinate coordinate;
/**
* 生产日期
*/
@Excel(name = "生产日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "生产日期")
private Date dateOfProduction;
/**
* 安装日期
*/
@Excel(name = "安装日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "安装日期")
private Date installationDate;
/**
* 保修截止日期
*/
@Excel(name = "保修截止日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "保修截止日期")
private Date warrantyPeriod;
/**
* 生产厂商
*/
@Excel(name = "生产厂商", width = 15)
@ApiModelProperty(value = "生产厂商")
private String manufacturer;
/**
* 状态
*/
@Excel(name = "状态", width = 15)
@ApiModelProperty(value = "状态")
private Status status;
/**
* 创建人Id(sys_user)
*/
@Excel(name = "创建人Id(sys_user)", width = 15)
private String coordinate;
/**状态 1:正常 2:离线 3:维修*/
@Excel(name = "状态", width = 15,dicCode = "access_control_status")
@ApiModelProperty(value = "状态 1:正常 2:离线 3:维修")
@Dict(dicCode = "access_control_status")
private String status;
/**端口*/
@Excel(name = "端口", width = 15)
@ApiModelProperty(value = "端口")
private String port;
/**通道号*/
@Excel(name = "通道号", width = 15)
@ApiModelProperty(value = "通道号")
private String chanelNum;
/**创建人Id(sys_user)*/
@Excel(name = "创建人", width = 15,dictTable = "sys_user", dicText = "realname", dicCode = "id")
@ApiModelProperty(value = "创建人Id(sys_user)")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
private String createUserId;
/**
* 修改人Id(sys_user)
*/
@Excel(name = "修改人Id(sys_user)", width = 15)
/**修改人Id(sys_user)*/
@ApiModelProperty(value = "修改人Id(sys_user)")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
private String modifyUserId;
/**
* 删除状态
*/
@Excel(name = "删除状态", width = 15)
@ApiModelProperty(value = "删除状态")
private Boolean deleted;
/**
* 创建时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd hh:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd")
/**创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 修改时间
*/
@Excel(name = "修改时间", width = 15, format = "yyyy-MM-dd hh:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd hh:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd")
/**修改时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "修改时间")
private Date modifyTime;
public enum Status {
NORMAL,
OFFLINE,
BREAKDOWN
}
/**删除状态*/
@ApiModelProperty(value = "删除状态")
private Boolean deleted;
}
......@@ -6,7 +6,7 @@ import org.jeecg.pm.entity.PmMonitoringDevice;
/**
* @Description: pm_monitoring_device
* @Author: jeecg-boot
* @Date: 2022-03-15
* @Date: 2022-05-25
* @Version: V1.0
*/
public interface PmMonitoringDeviceMapper extends BaseMapper<PmMonitoringDevice> {
......
......@@ -3,14 +3,12 @@ package org.jeecg.pm.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.pm.entity.PmMonitoringDevice;
import java.util.List;
/**
* @Description: pm_monitoring_device
* @Author: jeecg-boot
* @Date: 2022-03-15
* @Date: 2022-05-25
* @Version: V1.0
*/
public interface IPmMonitoringDeviceService extends IService<PmMonitoringDevice> {
List<PmMonitoringDevice> listByFloorId(Long floorId);
}
package org.jeecg.pm.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.pm.entity.PmMonitoringDevice;
import org.jeecg.pm.hikvision.sdk.client.HikvisionClient;
import org.jeecg.pm.mapper.PmMonitoringDeviceMapper;
import org.jeecg.pm.service.IPmMonitoringDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: pm_monitoring_device
* @Author: jeecg-boot
* @Date: 2022-03-15
* @Date: 2022-05-25
* @Version: V1.0
*/
@Service
public class PmMonitoringDeviceServiceImpl extends ServiceImpl<PmMonitoringDeviceMapper, PmMonitoringDevice> implements IPmMonitoringDeviceService {
@Autowired
private HikvisionClient hikvisionClient;
@Override
public boolean save(PmMonitoringDevice entity) {
entity.setId(IdWorker.getId())
.setDeleted(false)
.setCreateTime(new Date())
.setModifyTime(new Date());
return super.save(entity);
}
@Override
public boolean updateById(PmMonitoringDevice entity) {
entity.setModifyTime(new Date());
return super.updateById(entity);
}
@Override
public boolean removeById(Serializable id) {
return update(
new UpdateWrapper<PmMonitoringDevice>()
.lambda()
.eq(PmMonitoringDevice::getId, id)
.set(PmMonitoringDevice::getDeleted, true)
.set(PmMonitoringDevice::getModifyTime, new Date()));
}
@Override
public List<PmMonitoringDevice> listByFloorId(Long floorId) {
new QueryWrapper<PmMonitoringDevice>()
.lambda()
.eq(PmMonitoringDevice::getFloor, floorId);
return null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment