Commit a6f511f0 authored by zhangjianqian's avatar zhangjianqian

Merge remote-tracking branch 'origin/master'

parents 3b08e4b5 e3133339
package com.zehong.web.controller.map;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TMapDeviceInfo;
import com.zehong.system.service.ITMapDeviceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 上图设备信息Controller
*
* @author zehong
* @date 2022-10-08
*/
@RestController
@RequestMapping("/map/deviceInfo")
public class TMapDeviceInfoController extends BaseController
{
@Autowired
private ITMapDeviceInfoService tMapDeviceInfoService;
/**
* 查询上图设备信息列表
*/
@GetMapping("/list")
public TableDataInfo list(TMapDeviceInfo tMapDeviceInfo)
{
startPage();
List<TMapDeviceInfo> list = tMapDeviceInfoService.selectTMapDeviceInfoList(tMapDeviceInfo);
return getDataTable(list);
}
/**
* 获取所有上图设备信息
* @param tMapDeviceInfo
* @return
*/
@GetMapping("/deviceInfoLists")
public List<TMapDeviceInfo> deviceInfoLists(TMapDeviceInfo tMapDeviceInfo){
return tMapDeviceInfoService.deviceInfoLists(tMapDeviceInfo);
}
/**
* 导出上图设备信息列表
*/
@Log(title = "上图设备信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TMapDeviceInfo tMapDeviceInfo)
{
List<TMapDeviceInfo> list = tMapDeviceInfoService.selectTMapDeviceInfoList(tMapDeviceInfo);
ExcelUtil<TMapDeviceInfo> util = new ExcelUtil<TMapDeviceInfo>(TMapDeviceInfo.class);
return util.exportExcel(list, "上图设备信息数据");
}
/**
* 获取上图设备信息详细信息
*/
@GetMapping(value = "/{mapDeviceId}")
public AjaxResult getInfo(@PathVariable("mapDeviceId") Long mapDeviceId)
{
return AjaxResult.success(tMapDeviceInfoService.selectTMapDeviceInfoById(mapDeviceId));
}
/**
* 新增上图设备信息
*/
@Log(title = "上图设备信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TMapDeviceInfo tMapDeviceInfo)
{
return toAjax(tMapDeviceInfoService.insertTMapDeviceInfo(tMapDeviceInfo));
}
/**
* 修改上图设备信息
*/
@Log(title = "上图设备信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TMapDeviceInfo tMapDeviceInfo)
{
return toAjax(tMapDeviceInfoService.updateTMapDeviceInfo(tMapDeviceInfo));
}
/**
* 删除上图设备信息
*/
@Log(title = "上图设备信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{mapDeviceIds}")
public AjaxResult remove(@PathVariable Long[] mapDeviceIds)
{
return toAjax(tMapDeviceInfoService.deleteTMapDeviceInfoByIds(mapDeviceIds));
}
}
package com.zehong.web.controller.map;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TMapDeviceMonitor;
import com.zehong.system.service.ITMapDeviceMonitorService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 上图设备监测Controller
*
* @author zehong
* @date 2022-10-08
*/
@RestController
@RequestMapping("/map/monitor")
public class TMapDeviceMonitorController extends BaseController
{
@Autowired
private ITMapDeviceMonitorService tMapDeviceMonitorService;
/**
* 查询上图设备监测列表
*/
@PreAuthorize("@ss.hasPermi('system:monitor:list')")
@GetMapping("/list")
public TableDataInfo list(TMapDeviceMonitor tMapDeviceMonitor)
{
startPage();
List<TMapDeviceMonitor> list = tMapDeviceMonitorService.selectTMapDeviceMonitorList(tMapDeviceMonitor);
return getDataTable(list);
}
/**
* 导出上图设备监测列表
*/
@PreAuthorize("@ss.hasPermi('system:monitor:export')")
@Log(title = "上图设备监测", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TMapDeviceMonitor tMapDeviceMonitor)
{
List<TMapDeviceMonitor> list = tMapDeviceMonitorService.selectTMapDeviceMonitorList(tMapDeviceMonitor);
ExcelUtil<TMapDeviceMonitor> util = new ExcelUtil<TMapDeviceMonitor>(TMapDeviceMonitor.class);
return util.exportExcel(list, "上图设备监测数据");
}
/**
* 获取上图设备监测详细信息
*/
@PreAuthorize("@ss.hasPermi('system:monitor:query')")
@GetMapping(value = "/{monitorId}")
public AjaxResult getInfo(@PathVariable("monitorId") Long monitorId)
{
return AjaxResult.success(tMapDeviceMonitorService.selectTMapDeviceMonitorById(monitorId));
}
/**
* 新增上图设备监测
*/
@PreAuthorize("@ss.hasPermi('system:monitor:add')")
@Log(title = "上图设备监测", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TMapDeviceMonitor tMapDeviceMonitor)
{
return toAjax(tMapDeviceMonitorService.insertTMapDeviceMonitor(tMapDeviceMonitor));
}
/**
* 修改上图设备监测
*/
@PreAuthorize("@ss.hasPermi('system:monitor:edit')")
@Log(title = "上图设备监测", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TMapDeviceMonitor tMapDeviceMonitor)
{
return toAjax(tMapDeviceMonitorService.updateTMapDeviceMonitor(tMapDeviceMonitor));
}
/**
* 删除上图设备监测
*/
@PreAuthorize("@ss.hasPermi('system:monitor:remove')")
@Log(title = "上图设备监测", businessType = BusinessType.DELETE)
@DeleteMapping("/{monitorIds}")
public AjaxResult remove(@PathVariable Long[] monitorIds)
{
return toAjax(tMapDeviceMonitorService.deleteTMapDeviceMonitorByIds(monitorIds));
}
}
package com.zehong.system.domain;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
/**
* 上图设备信息对象 t_map_device_info
*
* @author zehong
* @date 2022-10-08
*/
public class TMapDeviceInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 上图设备id */
private Long mapDeviceId;
/** 上图设备名称 */
@Excel(name = "上图设备名称")
private String mapDeviceName;
/** 设备类型:1.工业探测器 2.温度变送器 3.压力监测设备 4.液位探测器 5.摄像头 */
@Excel(name = "设备类型:1.工业探测器 2.温度变送器 3.压力监测设备 4.液位探测器 5.摄像头")
private String mapDeviceType;
/** 设备编号 */
@Excel(name = "设备编号")
private String mapDeviceNum;
/** 检测介质 */
@Excel(name = "检测介质")
private String mapDeviceMedium;
/** 单位 */
@Excel(name = "单位")
private String mapDeviceUnit;
/** 经度 */
@Excel(name = "经度")
private BigDecimal longitude;
/** 纬度 */
@Excel(name = "纬度")
private BigDecimal latitude;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
//监测值
private BigDecimal monitorValue;
//设备状态
private String monitorDeviceStatus;
public BigDecimal getMonitorValue() {
return monitorValue;
}
public void setMonitorValue(BigDecimal monitorValue) {
this.monitorValue = monitorValue;
}
public String getMonitorDeviceStatus() {
return monitorDeviceStatus;
}
public void setMonitorDeviceStatus(String monitorDeviceStatus) {
this.monitorDeviceStatus = monitorDeviceStatus;
}
public void setMapDeviceId(Long mapDeviceId)
{
this.mapDeviceId = mapDeviceId;
}
public Long getMapDeviceId()
{
return mapDeviceId;
}
public void setMapDeviceName(String mapDeviceName)
{
this.mapDeviceName = mapDeviceName;
}
public String getMapDeviceName()
{
return mapDeviceName;
}
public void setMapDeviceType(String mapDeviceType)
{
this.mapDeviceType = mapDeviceType;
}
public String getMapDeviceType()
{
return mapDeviceType;
}
public void setMapDeviceNum(String mapDeviceNum)
{
this.mapDeviceNum = mapDeviceNum;
}
public String getMapDeviceNum()
{
return mapDeviceNum;
}
public void setMapDeviceMedium(String mapDeviceMedium)
{
this.mapDeviceMedium = mapDeviceMedium;
}
public String getMapDeviceMedium()
{
return mapDeviceMedium;
}
public void setMapDeviceUnit(String mapDeviceUnit)
{
this.mapDeviceUnit = mapDeviceUnit;
}
public String getMapDeviceUnit()
{
return mapDeviceUnit;
}
public void setLongitude(BigDecimal longitude)
{
this.longitude = longitude;
}
public BigDecimal getLongitude()
{
return longitude;
}
public void setLatitude(BigDecimal latitude)
{
this.latitude = latitude;
}
public BigDecimal getLatitude()
{
return latitude;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("mapDeviceId", getMapDeviceId())
.append("mapDeviceName", getMapDeviceName())
.append("mapDeviceType", getMapDeviceType())
.append("mapDeviceNum", getMapDeviceNum())
.append("mapDeviceMedium", getMapDeviceMedium())
.append("mapDeviceUnit", getMapDeviceUnit())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDel", getIsDel())
.append("remark", getRemark())
.toString();
}
}
package com.zehong.system.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 上图设备监测对象 t_map_device_monitor
*
* @author zehong
* @date 2022-10-08
*/
public class TMapDeviceMonitor extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 监测id */
private Long monitorId;
/** 监测值 */
@Excel(name = "监测值")
private BigDecimal monitorValue;
/** 监测设备状态 */
@Excel(name = "监测设备状态")
private String monitorDeviceStatus;
/** 监测设备编号 */
@Excel(name = "监测设备编号")
private String monitorDeviceNum;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
public void setMonitorId(Long monitorId)
{
this.monitorId = monitorId;
}
public Long getMonitorId()
{
return monitorId;
}
public void setMonitorValue(BigDecimal monitorValue)
{
this.monitorValue = monitorValue;
}
public BigDecimal getMonitorValue()
{
return monitorValue;
}
public void setMonitorDeviceStatus(String monitorDeviceStatus)
{
this.monitorDeviceStatus = monitorDeviceStatus;
}
public String getMonitorDeviceStatus()
{
return monitorDeviceStatus;
}
public void setMonitorDeviceNum(String monitorDeviceNum)
{
this.monitorDeviceNum = monitorDeviceNum;
}
public String getMonitorDeviceNum()
{
return monitorDeviceNum;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("monitorId", getMonitorId())
.append("monitorValue", getMonitorValue())
.append("monitorDeviceStatus", getMonitorDeviceStatus())
.append("monitorDeviceNum", getMonitorDeviceNum())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDel", getIsDel())
.append("remark", getRemark())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TMapDeviceInfo;
/**
* 上图设备信息Mapper接口
*
* @author zehong
* @date 2022-10-08
*/
public interface TMapDeviceInfoMapper
{
/**
* 查询上图设备信息
*
* @param mapDeviceId 上图设备信息ID
* @return 上图设备信息
*/
public TMapDeviceInfo selectTMapDeviceInfoById(Long mapDeviceId);
/**
* 查询上图设备信息列表
*
* @param tMapDeviceInfo 上图设备信息
* @return 上图设备信息集合
*/
public List<TMapDeviceInfo> selectTMapDeviceInfoList(TMapDeviceInfo tMapDeviceInfo);
/**
* 新增上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
public int insertTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo);
/**
* 修改上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
public int updateTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo);
/**
* 删除上图设备信息
*
* @param mapDeviceId 上图设备信息ID
* @return 结果
*/
public int deleteTMapDeviceInfoById(Long mapDeviceId);
/**
* 批量删除上图设备信息
*
* @param mapDeviceIds 需要删除的数据ID
* @return 结果
*/
public int deleteTMapDeviceInfoByIds(Long[] mapDeviceIds);
/**
* 获取所有上图设备信息
* @param tMapDeviceInfo
* @return
*/
List<TMapDeviceInfo> deviceInfoLists(TMapDeviceInfo tMapDeviceInfo);
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TMapDeviceMonitor;
/**
* 上图设备监测Mapper接口
*
* @author zehong
* @date 2022-10-08
*/
public interface TMapDeviceMonitorMapper
{
/**
* 查询上图设备监测
*
* @param monitorId 上图设备监测ID
* @return 上图设备监测
*/
public TMapDeviceMonitor selectTMapDeviceMonitorById(Long monitorId);
/**
* 查询上图设备监测列表
*
* @param tMapDeviceMonitor 上图设备监测
* @return 上图设备监测集合
*/
public List<TMapDeviceMonitor> selectTMapDeviceMonitorList(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 新增上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
public int insertTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 修改上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
public int updateTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 删除上图设备监测
*
* @param monitorId 上图设备监测ID
* @return 结果
*/
public int deleteTMapDeviceMonitorById(Long monitorId);
/**
* 批量删除上图设备监测
*
* @param monitorIds 需要删除的数据ID
* @return 结果
*/
public int deleteTMapDeviceMonitorByIds(Long[] monitorIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TMapDeviceInfo;
/**
* 上图设备信息Service接口
*
* @author zehong
* @date 2022-10-08
*/
public interface ITMapDeviceInfoService
{
/**
* 查询上图设备信息
*
* @param mapDeviceId 上图设备信息ID
* @return 上图设备信息
*/
public TMapDeviceInfo selectTMapDeviceInfoById(Long mapDeviceId);
/**
* 查询上图设备信息列表
*
* @param tMapDeviceInfo 上图设备信息
* @return 上图设备信息集合
*/
public List<TMapDeviceInfo> selectTMapDeviceInfoList(TMapDeviceInfo tMapDeviceInfo);
/**
* 新增上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
public int insertTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo);
/**
* 修改上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
public int updateTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo);
/**
* 批量删除上图设备信息
*
* @param mapDeviceIds 需要删除的上图设备信息ID
* @return 结果
*/
public int deleteTMapDeviceInfoByIds(Long[] mapDeviceIds);
/**
* 删除上图设备信息信息
*
* @param mapDeviceId 上图设备信息ID
* @return 结果
*/
public int deleteTMapDeviceInfoById(Long mapDeviceId);
/**
* 获取所有上图设备信息
* @param tMapDeviceInfo
* @return
*/
List<TMapDeviceInfo> deviceInfoLists(TMapDeviceInfo tMapDeviceInfo);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TMapDeviceMonitor;
/**
* 上图设备监测Service接口
*
* @author zehong
* @date 2022-10-08
*/
public interface ITMapDeviceMonitorService
{
/**
* 查询上图设备监测
*
* @param monitorId 上图设备监测ID
* @return 上图设备监测
*/
public TMapDeviceMonitor selectTMapDeviceMonitorById(Long monitorId);
/**
* 查询上图设备监测列表
*
* @param tMapDeviceMonitor 上图设备监测
* @return 上图设备监测集合
*/
public List<TMapDeviceMonitor> selectTMapDeviceMonitorList(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 新增上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
public int insertTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 修改上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
public int updateTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor);
/**
* 批量删除上图设备监测
*
* @param monitorIds 需要删除的上图设备监测ID
* @return 结果
*/
public int deleteTMapDeviceMonitorByIds(Long[] monitorIds);
/**
* 删除上图设备监测信息
*
* @param monitorId 上图设备监测ID
* @return 结果
*/
public int deleteTMapDeviceMonitorById(Long monitorId);
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TMapDeviceInfoMapper;
import com.zehong.system.domain.TMapDeviceInfo;
import com.zehong.system.service.ITMapDeviceInfoService;
/**
* 上图设备信息Service业务层处理
*
* @author zehong
* @date 2022-10-08
*/
@Service
public class TMapDeviceInfoServiceImpl implements ITMapDeviceInfoService
{
@Autowired
private TMapDeviceInfoMapper tMapDeviceInfoMapper;
/**
* 查询上图设备信息
*
* @param mapDeviceId 上图设备信息ID
* @return 上图设备信息
*/
@Override
public TMapDeviceInfo selectTMapDeviceInfoById(Long mapDeviceId)
{
return tMapDeviceInfoMapper.selectTMapDeviceInfoById(mapDeviceId);
}
/**
* 查询上图设备信息列表
*
* @param tMapDeviceInfo 上图设备信息
* @return 上图设备信息
*/
@Override
public List<TMapDeviceInfo> selectTMapDeviceInfoList(TMapDeviceInfo tMapDeviceInfo)
{
return tMapDeviceInfoMapper.selectTMapDeviceInfoList(tMapDeviceInfo);
}
/**
* 新增上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
@Override
public int insertTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo)
{
tMapDeviceInfo.setCreateTime(DateUtils.getNowDate());
return tMapDeviceInfoMapper.insertTMapDeviceInfo(tMapDeviceInfo);
}
/**
* 修改上图设备信息
*
* @param tMapDeviceInfo 上图设备信息
* @return 结果
*/
@Override
public int updateTMapDeviceInfo(TMapDeviceInfo tMapDeviceInfo)
{
tMapDeviceInfo.setUpdateTime(DateUtils.getNowDate());
return tMapDeviceInfoMapper.updateTMapDeviceInfo(tMapDeviceInfo);
}
/**
* 批量删除上图设备信息
*
* @param mapDeviceIds 需要删除的上图设备信息ID
* @return 结果
*/
@Override
public int deleteTMapDeviceInfoByIds(Long[] mapDeviceIds)
{
return tMapDeviceInfoMapper.deleteTMapDeviceInfoByIds(mapDeviceIds);
}
/**
* 删除上图设备信息信息
*
* @param mapDeviceId 上图设备信息ID
* @return 结果
*/
@Override
public int deleteTMapDeviceInfoById(Long mapDeviceId)
{
return tMapDeviceInfoMapper.deleteTMapDeviceInfoById(mapDeviceId);
}
/**
* 获取所有上图设备信息
* @param tMapDeviceInfo
* @return
*/
@Override
public List<TMapDeviceInfo> deviceInfoLists(TMapDeviceInfo tMapDeviceInfo){
return tMapDeviceInfoMapper.deviceInfoLists(tMapDeviceInfo);
}
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TMapDeviceMonitorMapper;
import com.zehong.system.domain.TMapDeviceMonitor;
import com.zehong.system.service.ITMapDeviceMonitorService;
/**
* 上图设备监测Service业务层处理
*
* @author zehong
* @date 2022-10-08
*/
@Service
public class TMapDeviceMonitorServiceImpl implements ITMapDeviceMonitorService
{
@Autowired
private TMapDeviceMonitorMapper tMapDeviceMonitorMapper;
/**
* 查询上图设备监测
*
* @param monitorId 上图设备监测ID
* @return 上图设备监测
*/
@Override
public TMapDeviceMonitor selectTMapDeviceMonitorById(Long monitorId)
{
return tMapDeviceMonitorMapper.selectTMapDeviceMonitorById(monitorId);
}
/**
* 查询上图设备监测列表
*
* @param tMapDeviceMonitor 上图设备监测
* @return 上图设备监测
*/
@Override
public List<TMapDeviceMonitor> selectTMapDeviceMonitorList(TMapDeviceMonitor tMapDeviceMonitor)
{
return tMapDeviceMonitorMapper.selectTMapDeviceMonitorList(tMapDeviceMonitor);
}
/**
* 新增上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
@Override
public int insertTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor)
{
tMapDeviceMonitor.setCreateTime(DateUtils.getNowDate());
return tMapDeviceMonitorMapper.insertTMapDeviceMonitor(tMapDeviceMonitor);
}
/**
* 修改上图设备监测
*
* @param tMapDeviceMonitor 上图设备监测
* @return 结果
*/
@Override
public int updateTMapDeviceMonitor(TMapDeviceMonitor tMapDeviceMonitor)
{
tMapDeviceMonitor.setUpdateTime(DateUtils.getNowDate());
return tMapDeviceMonitorMapper.updateTMapDeviceMonitor(tMapDeviceMonitor);
}
/**
* 批量删除上图设备监测
*
* @param monitorIds 需要删除的上图设备监测ID
* @return 结果
*/
@Override
public int deleteTMapDeviceMonitorByIds(Long[] monitorIds)
{
return tMapDeviceMonitorMapper.deleteTMapDeviceMonitorByIds(monitorIds);
}
/**
* 删除上图设备监测信息
*
* @param monitorId 上图设备监测ID
* @return 结果
*/
@Override
public int deleteTMapDeviceMonitorById(Long monitorId)
{
return tMapDeviceMonitorMapper.deleteTMapDeviceMonitorById(monitorId);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TMapDeviceInfoMapper">
<resultMap type="TMapDeviceInfo" id="TMapDeviceInfoResult">
<result property="mapDeviceId" column="map_device_id" />
<result property="mapDeviceName" column="map_device_name" />
<result property="mapDeviceType" column="map_device_type" />
<result property="mapDeviceNum" column="map_device_num" />
<result property="mapDeviceMedium" column="map_device_medium" />
<result property="mapDeviceUnit" column="map_device_unit" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="remark" column="remark" />
<result property="monitorDeviceStatus" column="monitor_device_status" />
<result property="monitorValue" column="monitor_value" />
</resultMap>
<sql id="selectTMapDeviceInfoVo">
select map_device_id, map_device_name, map_device_type, map_device_num, map_device_medium, map_device_unit, longitude, latitude, create_by, create_time, update_by, update_time, is_del, remark from t_map_device_info
</sql>
<select id="selectTMapDeviceInfoList" parameterType="TMapDeviceInfo" resultMap="TMapDeviceInfoResult">
<include refid="selectTMapDeviceInfoVo"/>
<where>
<if test="mapDeviceName != null and mapDeviceName != ''"> and map_device_name like concat('%', #{mapDeviceName}, '%')</if>
<if test="mapDeviceType != null and mapDeviceType != ''"> and map_device_type = #{mapDeviceType}</if>
<if test="mapDeviceNum != null and mapDeviceNum != ''"> and map_device_num = #{mapDeviceNum}</if>
<if test="mapDeviceMedium != null and mapDeviceMedium != ''"> and map_device_medium = #{mapDeviceMedium}</if>
<if test="mapDeviceUnit != null and mapDeviceUnit != ''"> and map_device_unit = #{mapDeviceUnit}</if>
<if test="longitude != null "> and longitude = #{longitude}</if>
<if test="latitude != null "> and latitude = #{latitude}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectTMapDeviceInfoById" parameterType="Long" resultMap="TMapDeviceInfoResult">
<include refid="selectTMapDeviceInfoVo"/>
where map_device_id = #{mapDeviceId}
</select>
<insert id="insertTMapDeviceInfo" parameterType="TMapDeviceInfo" useGeneratedKeys="true" keyProperty="mapDeviceId">
insert into t_map_device_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mapDeviceName != null">map_device_name,</if>
<if test="mapDeviceType != null">map_device_type,</if>
<if test="mapDeviceNum != null">map_device_num,</if>
<if test="mapDeviceMedium != null">map_device_medium,</if>
<if test="mapDeviceUnit != null">map_device_unit,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mapDeviceName != null">#{mapDeviceName},</if>
<if test="mapDeviceType != null">#{mapDeviceType},</if>
<if test="mapDeviceNum != null">#{mapDeviceNum},</if>
<if test="mapDeviceMedium != null">#{mapDeviceMedium},</if>
<if test="mapDeviceUnit != null">#{mapDeviceUnit},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateTMapDeviceInfo" parameterType="TMapDeviceInfo">
update t_map_device_info
<trim prefix="SET" suffixOverrides=",">
<if test="mapDeviceName != null">map_device_name = #{mapDeviceName},</if>
<if test="mapDeviceType != null">map_device_type = #{mapDeviceType},</if>
<if test="mapDeviceNum != null">map_device_num = #{mapDeviceNum},</if>
<if test="mapDeviceMedium != null">map_device_medium = #{mapDeviceMedium},</if>
<if test="mapDeviceUnit != null">map_device_unit = #{mapDeviceUnit},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where map_device_id = #{mapDeviceId}
</update>
<delete id="deleteTMapDeviceInfoById" parameterType="Long">
delete from t_map_device_info where map_device_id = #{mapDeviceId}
</delete>
<delete id="deleteTMapDeviceInfoByIds" parameterType="String">
delete from t_map_device_info where map_device_id in
<foreach item="mapDeviceId" collection="array" open="(" separator="," close=")">
#{mapDeviceId}
</foreach>
</delete>
<select id="deviceInfoLists" parameterType="TMapDeviceInfo" resultMap="TMapDeviceInfoResult">
SELECT
device.map_device_id,
device.map_device_name,
device.map_device_type,
device.map_device_num,
device.map_device_medium,
device.map_device_unit,
device.longitude,
device.latitude,
mon.monitor_device_status,
mon.monitor_value
FROM
t_map_device_info device
LEFT JOIN (
SELECT
max(monitor.monitor_id),
monitor.monitor_value,
monitor.monitor_device_status,
monitor.monitor_device_num
FROM
t_map_device_monitor monitor
GROUP BY
monitor.monitor_device_num
)mon ON device.map_device_num = mon.monitor_device_num;
<where>
<if test="mapDeviceName != null and mapDeviceName != ''"> and device.map_device_name like concat('%', #{mapDeviceName}, '%')</if>
<if test="mapDeviceType != null and mapDeviceType != ''"> and device.map_device_type = #{mapDeviceType}</if>
<if test="mapDeviceNum != null and mapDeviceNum != ''"> and device.map_device_num = #{mapDeviceNum}</if>
<if test="isDel != null and isDel != ''"> and device.is_del = #{isDel}</if>
</where>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TMapDeviceMonitorMapper">
<resultMap type="TMapDeviceMonitor" id="TMapDeviceMonitorResult">
<result property="monitorId" column="monitor_id" />
<result property="monitorValue" column="monitor_value" />
<result property="monitorDeviceStatus" column="monitor_device_status" />
<result property="monitorDeviceNum" column="monitor_device_num" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectTMapDeviceMonitorVo">
select monitor_id, monitor_value, monitor_device_status, monitor_device_num, create_by, create_time, update_by, update_time, is_del, remark from t_map_device_monitor
</sql>
<select id="selectTMapDeviceMonitorList" parameterType="TMapDeviceMonitor" resultMap="TMapDeviceMonitorResult">
<include refid="selectTMapDeviceMonitorVo"/>
<where>
<if test="monitorValue != null "> and monitor_value = #{monitorValue}</if>
<if test="monitorDeviceStatus != null and monitorDeviceStatus != ''"> and monitor_device_status = #{monitorDeviceStatus}</if>
<if test="monitorDeviceNum != null and monitorDeviceNum != ''"> and monitor_device_num = #{monitorDeviceNum}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectTMapDeviceMonitorById" parameterType="Long" resultMap="TMapDeviceMonitorResult">
<include refid="selectTMapDeviceMonitorVo"/>
where monitor_id = #{monitorId}
</select>
<insert id="insertTMapDeviceMonitor" parameterType="TMapDeviceMonitor" useGeneratedKeys="true" keyProperty="monitorId">
insert into t_map_device_monitor
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="monitorValue != null">monitor_value,</if>
<if test="monitorDeviceStatus != null">monitor_device_status,</if>
<if test="monitorDeviceNum != null">monitor_device_num,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="monitorValue != null">#{monitorValue},</if>
<if test="monitorDeviceStatus != null">#{monitorDeviceStatus},</if>
<if test="monitorDeviceNum != null">#{monitorDeviceNum},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateTMapDeviceMonitor" parameterType="TMapDeviceMonitor">
update t_map_device_monitor
<trim prefix="SET" suffixOverrides=",">
<if test="monitorValue != null">monitor_value = #{monitorValue},</if>
<if test="monitorDeviceStatus != null">monitor_device_status = #{monitorDeviceStatus},</if>
<if test="monitorDeviceNum != null">monitor_device_num = #{monitorDeviceNum},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where monitor_id = #{monitorId}
</update>
<delete id="deleteTMapDeviceMonitorById" parameterType="Long">
delete from t_map_device_monitor where monitor_id = #{monitorId}
</delete>
<delete id="deleteTMapDeviceMonitorByIds" parameterType="String">
delete from t_map_device_monitor where monitor_id in
<foreach item="monitorId" collection="array" open="(" separator="," close=")">
#{monitorId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -9,3 +9,4 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
#安全平台后台地址
VUE_APP_TARGET = 'http://36.138.181.113:8091/dangerManage'
/*
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-10-07 09:05:29
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-10-07 10:16:10
* @FilePath: /danger-manage-web/src/api/indexChars/chars.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import request from "@/utils/request";
// 人员配比图标
export function getRypbData(query) {
return request({
url: "system/dept/classification",
method: "get",
params: query,
});
}
import request from '@/utils/request'
// 查询上图设备信息列表
export function listInfo(query) {
return request({
url: '/map/deviceInfo/list',
method: 'get',
params: query
})
}
//获取所有上图设备信息
export function deviceInfoLists(query) {
return request({
url: '/map/deviceInfo/deviceInfoLists',
method: 'get',
params: query
})
}
// 查询上图设备信息详细
export function getInfo(mapDeviceId) {
return request({
url: '/map/deviceInfo/' + mapDeviceId,
method: 'get'
})
}
// 新增上图设备信息
export function addInfo(data) {
return request({
url: '/map/deviceInfo',
method: 'post',
data: data
})
}
// 修改上图设备信息
export function updateInfo(data) {
return request({
url: '/map/deviceInfo',
method: 'put',
data: data
})
}
// 删除上图设备信息
export function delInfo(mapDeviceId) {
return request({
url: '/map/deviceInfo/' + mapDeviceId,
method: 'delete'
})
}
// 导出上图设备信息
export function exportInfo(query) {
return request({
url: '/map/deviceInfo/export',
method: 'get',
params: query
})
}
import request from '@/utils/request'
// 查询上图设备监测列表
export function listMonitor(query) {
return request({
url: '/map/monitor/list',
method: 'get',
params: query
})
}
// 查询上图设备监测详细
export function getMonitor(monitorId) {
return request({
url: '/map/monitor/' + monitorId,
method: 'get'
})
}
// 新增上图设备监测
export function addMonitor(data) {
return request({
url: '/map/monitor',
method: 'post',
data: data
})
}
// 修改上图设备监测
export function updateMonitor(data) {
return request({
url: '/map/monitor',
method: 'put',
data: data
})
}
// 删除上图设备监测
export function delMonitor(monitorId) {
return request({
url: '/map/monitor/' + monitorId,
method: 'delete'
})
}
// 导出上图设备监测
export function exportMonitor(query) {
return request({
url: '/map/monitor/export',
method: 'get',
params: query
})
}
/*
* @Author: your name
* @Date: 2021-12-07 14:19:18
* @LastEditTime: 2022-09-30 16:21:39
* @LastEditTime: 2022-10-07 15:24:09
* @LastEditors: 纪泽龙 jizelong@qq.com
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /cesium-vue/src/utils/seieumClass.js
......@@ -276,7 +276,7 @@ export default class CreateCesium {
const longitudeString = Cesium.Math.toDegrees(cartographic.longitude);
const latitudeString = Cesium.Math.toDegrees(cartographic.latitude);
var gps = [longitudeString, latitudeString];
console.log("tileset加载完毕",gps);
console.log("tileset加载完毕", gps);
// 阻塞转换成高德坐标
let gaodeLnglat = (await this.gpsToGaode(gps))[0];
console.log("坐标换算完毕", gaodeLnglat);
......@@ -321,10 +321,8 @@ export default class CreateCesium {
setTimeout(() => {
this.viewer.scene.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(
// 114.08722973596568,
114.08026526196012,
38.25051773015095,
// 38.251679644548084,
114.08040670822453,
38.24912720167037,
784
), //定位坐标点,建议使用谷歌地球坐标位置无偏差
orientation: {
......@@ -338,7 +336,6 @@ export default class CreateCesium {
pitch: Cesium.Math.toRadians(-81.61), // 倾斜角度
// roll: 1.3,
},
duration: 0.1, //定位的时间间隔
});
setTimeout(() => {
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-06 10:42:53
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-13 10:00:52
* @LastEditTime: 2022-10-06 16:41:33
* @FilePath: /danger-manage-web/src/views/indexComponents/Left.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-06 13:42:45
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-09 10:38:00
* @LastEditTime: 2022-10-07 17:39:34
* @FilePath: /danger-manage-web/src/views/indexComponents/leftComponents/deviceYx.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -49,7 +49,7 @@ export default {
show: false,
},
min: 0,
max: 180,
max: 40,
// 文字样式
axisLabel: {
show: true,
......@@ -60,12 +60,12 @@ export default {
{
type: "category",
data: [
"气体报警器",
"摄像头",
"用电探测器",
"工业探测器",
"压力探测器",
"温度探测器",
],
"液位探测器",
"温度变送器",
"视频监控",
].reverse(),
// 轴线样式
axisLine: {
show: false,
......@@ -130,7 +130,8 @@ export default {
barWidth: 15,
name: "X",
type: "bar",
data: [70, 108, 65, 93, 105].reverse(),
data: [28, 7, 7, 7, 9].reverse(),
// data: [20, 7, 7, 7, 9],
// 柱形样式
itemStyle: {
color: "rgba(45, 207, 255, 1)",
......@@ -142,7 +143,7 @@ export default {
position: "right",
color: "#ffffff",
valueAnimation: true,
formatter: "{c} ",
formatter: "{c} ",
},
},
],
......
......@@ -2,14 +2,13 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-06 13:42:45
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-09 17:05:24
* @LastEditTime: 2022-10-06 16:46:44
* @FilePath: /danger-manage-web/src/views/indexComponents/leftComponents/deviceYx.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="first-wrapper flex">
<Title text="报警记录" />
<div class="two">
<Right/>
</div>
......
<!--
* @Author: your name
* @Date: 2022-04-11 15:07:47
* @LastEditTime: 2022-09-09 17:11:02
* @LastEditTime: 2022-10-06 16:45:49
* @LastEditors: 纪泽龙 jizelong@qq.com
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/xunjianxuncha/topChars/left.vue
......@@ -15,7 +15,7 @@
<div>工单状态</div>
</div>
<div class="scroll-wrapper">
<Scroll :dataList="arr">
<Scroll :dataList="arr1" v-if="arr1.length>0">
<template v-slot="{ dataList }">
<ScroItem
v-for="(item, index) in dataList"
......@@ -25,6 +25,11 @@
/>
</template>
</Scroll>
<div class="noDevice flex">
<div>
暂无报警记录
</div>
</div>
</div>
</div>
</div>
......@@ -40,6 +45,7 @@ export default {
},
data() {
return {
arr1:[],
arr: [
{
companyName: "北区气压",
......@@ -151,5 +157,12 @@ export default {
// overflow: hidden;
// position:relative;
}
.noDevice{
height: 100%;
color:#cccccc;
justify-content: center;
align-items: center;
}
}
</style>
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-06 13:42:45
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-09 17:55:24
* @LastEditTime: 2022-10-07 14:16:36
* @FilePath: /danger-manage-web/src/views/indexComponents/leftComponents/deviceYx.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -12,24 +12,50 @@
<div class="two">
<Chars :options="options" />
<div class="allNum flex">
<div class="num">137</div>
<div class="num">{{ peopleNum }}</div>
<div class="text">人数</div>
</div>
</div>
</div>
</template>
<script>
let arr = [
{ value: 1048, name: "管理人员" },
{ value: 735, name: "值班人员" },
{ value: 580, name: "巡检人员" },
{ value: 484, name: "维修人员" },
{ value: 300, name: "包养人员" },
{ value: 300, name: "应急抢救人员" },
{
value: 1,
name: "财务科",
},
{
value: 1,
name: "生产技术办公室",
},
{
value: 1,
name: "综合管理办公室",
},
{
value: 1,
name: "经营管理办公室",
},
{
value: 1,
name: "安全科",
},
{
value: 1,
name: "环保科",
},
{
value: 0,
name: "保卫科",
},
];
import Title from "@/views/indexComponents/allComponents/Title";
import Chars from "@/components/allCharsCom/Chars";
import { getRypbData } from "@/api/indexChars/chars";
export default {
name: "",
components: {
......@@ -56,12 +82,16 @@ export default {
formatter: (name) => {
// 第一个空格
let kg1 = "";
if (name.length == 6) {
for (let i = 0; i < 8; i++) {
if (name.length == this.maxNameLength) {
for (let i = 0; i < 7; i++) {
kg1 += " ";
}
} else {
for (let i = 0; i < 14; i++) {
for (
let i = 0;
i < 3 * (this.maxNameLength - name.length) + 7;
i++
) {
kg1 += " ";
}
}
......@@ -73,19 +103,18 @@ export default {
return a + b.value;
}, 0);
//第二个空格
const length = (obj.value + "").length;
let kg2 = "";
for (let i = 0; i < 15; i++) {
for (let i = 0; i < (this.maxValueLength - length) * 2 + 10; i++) {
kg2 += " ";
}
const length = (obj.value + "").length;
kg2 = kg2.slice(length);
console.log();
return (
name +
kg1 +
obj.value +
kg2 +
Math.round((obj.value / total) * 100) +
Math.floor((obj.value / total) * 100) / 100 +
"%"
);
},
......@@ -121,9 +150,145 @@ export default {
},
],
},
arr: [],
peopleNum: 0,
// 最长用户名
maxNameLength: 0,
// 最长数字
maxValueLength: 0,
};
},
methods: {},
created() {
// getRypbData().then((res) => {
// console.log("res",res)
// });
this.getRypbData();
},
methods: {
getRypbData() {
getRypbData().then((res) => {
const data = res.data;
this.arr = data.map((item) => {
return {
value: item.num,
name: this.trimSpecial(item.deptName),
};
});
console.log(this.arr);
this.peopleNum = data.reduce((pre, current) => {
return pre + current.num;
}, 0);
// 最长用户名
this.maxNameLength = Math.max.apply(
null,
this.arr.map((item) => item.name.length)
);
this.maxValueLength = Math.max.apply(
null,
this.arr.map((item) => (item.value + "").length)
);
this.charsChange(this.arr);
console.log("res", res);
});
},
charsChange(arr) {
this.options = {
// tooltip: {
// trigger: 'item'
// },
legend: {
type: "scroll",
orient: "vertical",
right: "2%",
top: 0,
bottom: 0,
textStyle: {
color: "#ffffff",
fontSize: 11,
},
icon: "diamond",
formatter: (name) => {
// 第一个空格
let kg1 = "";
if (name.length == this.maxNameLength) {
for (let i = 0; i < 7; i++) {
kg1 += " ";
}
} else {
for (
let i = 0;
i < 3 * (this.maxNameLength - name.length) + 7;
i++
) {
kg1 += " ";
}
}
let obj = arr.filter((item) => {
return name == item.name;
})[0];
var total = arr.reduce((a, b) => {
const value1 = b.value;
return a + b.value;
}, 0);
//第二个空格
const length = (obj.value + "").length;
let kg2 = "";
for (let i = 0; i < (this.maxValueLength - length) * 2 + 10; i++) {
kg2 += " ";
}
return (
name +
kg1 +
obj.value +
kg2 +
Math.floor((obj.value / total) * 1000)/10 +
"%"
);
},
},
series: [
{
name: "Access From",
type: "pie",
radius: ["65%", "75%"],
center: ["20%", "50%"],
avoidLabelOverlap: false,
label: {
show: false,
position: "center",
emphasis: {
formatter: "{b}\n{c}\n({d}%)",
show: false,
textStyle: {
fontSize: "16",
fontWeight: "bold",
color: "#fff",
},
},
},
itemStyle: {
borderWidth: 0,
borderRadius: 20,
},
labelLine: {
show: false,
},
data: arr,
},
],
};
},
trimSpecial(string) {
//替换字符串中的所有特殊字符(包含空格)
if (string != "") {
const pattern =
/[`~!@#$^\-&*()=|{}':;',\\\[\]\.<>\/?~!@#¥……&*()——|{}【】';:""'。,、?\s]/g;
string = string.replace(pattern, "");
}
return string;
},
},
};
</script>
......
......@@ -52,7 +52,7 @@
</el-row>
<el-table v-loading="loading" :data="enterpriseSystemList" >
<el-table-column label="法律法规标题" align="center" prop="systemTitle" />
<el-table-column label="法律法规标题" align="center" prop="systemTitle" width="260px"/>
<el-table-column label="颁布部门" align="center" prop="issueDept" />
<el-table-column label="文号" align="center" prop="referenceNum" />
<el-table-column label="层级" align="center" prop="hierarchy" :formatter="hierarchyFormat"/>
......@@ -69,7 +69,7 @@
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" width="120px" />
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
......
<template>
<div class="app-container">
<div class="app-container" >
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="4" :xs="24">
<div style="height: 810px; border: solid 1px #e6ebf5;">
<div style="height: 810px; border: solid 1px #e6ebf5;overflow-y:auto">
<div class="head-container" style = "padding: 10px">
<el-input
v-model="deptName"
......@@ -11,7 +11,6 @@
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container" style = "padding: 10px">
......@@ -106,7 +105,7 @@
<span v-if="scope.row.effectiveDate == null || scope.row.effectiveDate == ''">-</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" >
<el-table-column label="创建时间" align="center" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......
......@@ -35,6 +35,7 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: process.env.VUE_APP_TARGET,
// target: `http://192.168.2.16:8908/dangerManage`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
......
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