Commit 9b5ca991 authored by zhangjianqian's avatar zhangjianqian

Merge remote-tracking branch 'origin/master'

parents 58f5e4b3 d5c8f9ad
......@@ -20,7 +20,7 @@ import com.zehong.framework.config.ServerConfig;
/**
* 通用请求处理
*
*
* @author zehong
*/
@RestController
......@@ -33,7 +33,7 @@ public class CommonController
/**
* 通用下载请求
*
*
* @param fileName 文件名称
* @param delete 是否删除
*/
......@@ -75,8 +75,11 @@ public class CommonController
String filePath = GassafetyProgressConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = file.getOriginalFilename();
//本地存储地址
// String fileName=filePath+FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + FileUploadUtils.upload(filePath, file);
AjaxResult ajax = AjaxResult.success();
// ajax.put("fileName", fileName);
ajax.put("fileName", fileName);
ajax.put("url", url);
return ajax;
......
package com.zehong.web.controller.supervise;
import com.zehong.common.core.controller.BaseController;
import com.zehong.system.domain.*;
import com.zehong.system.service.IPipeInterfaceService;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -15,7 +17,7 @@ import java.util.List;
@Controller
@RestController
@RequestMapping("/pipe/pipe")
public class PipeInterfaceController {
public class PipeInterfaceController extends BaseController {
@Autowired
IPipeInterfaceService iPipeInterfaceService;
......@@ -60,27 +62,30 @@ public class PipeInterfaceController {
public DeviceList selectDeviceDatas(){
//最后返回的封装类型
DeviceList deviceList=new DeviceList();
List<DeviceData> list=new ArrayList<>();
//调压箱数据查询方法
List<DeviceData> deviceData = iPipeInterfaceService.selectDeviceData();
//查询下级全部数据方法
List<PressureFlow> pressureFlows1 = iPipeInterfaceService.selectPressureFlows("1");
for (int i=0;i<deviceData.size();i++){
deviceData.get(i).setIconType(2);
}
deviceList.setData(deviceData);
boolean bo=false;
for (int s=0;s<pressureFlows1.size();s++){
if (pressureFlows1.get(s).getDeviceId().equals(deviceData.get(i).getDeviceId())){
bo=true;
break;
}
}
if (bo){
deviceData.get(i).setIconType(2);
list.add(deviceData.get(i));
}
}
deviceList.setData(list);
return deviceList;
}
/**
* 查询下级 调压箱/阀门井
* @param deviceId
* @return
*/
@RequestBody
@RequestMapping("/selectPressureFlowList")
public List<PressureFlowList> selectPressureFlowList(String deviceId){
List<PressureFlowList> lists=new ArrayList<>();
return lists;
}
/**
* 查询下级设备关联数据接口
......@@ -306,25 +311,40 @@ public class PipeInterfaceController {
TSiteStationInfoDataList tSiteStationInfoDataList=new TSiteStationInfoDataList();
//场站信息查询方法
List<TSiteStationInfoData> tSiteStationInfoData = iPipeInterfaceService.selectTSiteStationInfoData();
//查询下级全部数据方法
List<PressureFlow> pressureFlows1 = iPipeInterfaceService.selectPressureFlows("2");
List<TSiteStationInfoData> list=new ArrayList<>();
for (int i=0;i<tSiteStationInfoData.size();i++){
tSiteStationInfoData.get(i).setIconType(4);
boolean bo=false;
for (int s=0;s<pressureFlows1.size();s++){
if (pressureFlows1.get(s).getDeviceId()!=null){
if (pressureFlows1.get(s).getDeviceId().equals(tSiteStationInfoData.get(i).getSiteStationId())){
bo=true;
break;
}
}
}
if (bo){
tSiteStationInfoData.get(i).setIconType(4);
list.add(tSiteStationInfoData.get(i));
}
}
tSiteStationInfoDataList.setData(tSiteStationInfoData);
tSiteStationInfoDataList.setData(list);
return tSiteStationInfoDataList;
}
/**
* 查询场站下级设备关联数据接口
* @param SiteStationId
* @param deviceId
* @return
*/
@RequestBody
@RequestMapping("/selecttSiteStationInfoData")
public TSiteStationInfoDataList selecttSiteStationInfoData(String SiteStationId){
public TSiteStationInfoDataList selecttSiteStationInfoData(String deviceId){
TSiteStationInfoDataList tSiteStationInfoDataList = new TSiteStationInfoDataList();
List<TSiteStationInfoData> TSiteStationInfoDataList=new ArrayList<>();
//查询场站下级设备数据
List<PressureFlow> pressureFlows = iPipeInterfaceService.selecttSiteStationInfoDataList(SiteStationId);
List<PressureFlow> pressureFlows = iPipeInterfaceService.selecttSiteStationInfoDataList(deviceId);
//临时存储压力表数据数组
List<PressureFlow> pressureList=new ArrayList<>();
//临时存储流量计数据数组
......@@ -519,12 +539,25 @@ public class PipeInterfaceController {
public DeviceDataList selectvalveData(){
//最后返回的封装类型
DeviceDataList deviceDataList=new DeviceDataList();
List<DeviceData> list =new ArrayList<>();
//查询阀门井数据
List<DeviceData> pipeDates = iPipeInterfaceService.selectvalveData();
//查询下级全部数据方法
List<PressureFlow> pressureFlows1 = iPipeInterfaceService.selectPressureFlows("1");
for (int i=0;i<pipeDates.size();i++){
pipeDates.get(i).setIconType(3);
boolean bo=false;
for (int s=0;s<pressureFlows1.size();s++){
if (pressureFlows1.get(s).getDeviceId().equals(pipeDates.get(i).getDeviceId())){
bo=true;
break;
}
}
if (bo){
pipeDates.get(i).setIconType(3);
list.add(pipeDates.get(i));
}
}
deviceDataList.setData(pipeDates);
deviceDataList.setData(list);
return deviceDataList;
}
......@@ -579,4 +612,20 @@ public class PipeInterfaceController {
return deviceDataList;
}
/**
* 首页 场站/设备 感知设备信息列表查询接口
* @param devId
* @param relationDeviceType
* @return
*/
@RequestBody
@RequestMapping("/selectSensingDevice")
public List<TAssociatedEquipment> selectSensingDevice(@Param("devId") String devId,@Param("relationDeviceType") String relationDeviceType){
startPage();
//查询 场站/设备 列表信息方法
List<TAssociatedEquipment> tAssociatedEquipments = iPipeInterfaceService.selectSensingDevice(devId, relationDeviceType);
return tAssociatedEquipments;
}
}
......@@ -2,9 +2,8 @@ package com.zehong.web.controller.supervise;
import java.io.File;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.zehong.common.config.GassafetyProgressConfig;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -16,7 +15,7 @@ import com.zehong.system.domain.TEmployedPeopleInfo;
import com.zehong.system.service.ITEmployedPeopleInfoService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* 从业人员信息Controller
......@@ -72,7 +71,7 @@ public class TEmployedPeopleInfoController extends BaseController
@PreAuthorize("@ss.hasPermi('regulation:supervise:add')")
@Log(title = "从业人员信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add( TEmployedPeopleInfo tEmployedPeopleInfo) throws ParseException {
public AjaxResult add(@RequestBody TEmployedPeopleInfo tEmployedPeopleInfo) throws ParseException {
//根据企业id查询企业名称
String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tEmployedPeopleInfo.getBeyondEnterpriseId());
tEmployedPeopleInfo.setBeyondEnterpriseName(EnterpriseName);
......@@ -89,6 +88,20 @@ public class TEmployedPeopleInfoController extends BaseController
//根据企业id查询企业名称
String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tEmployedPeopleInfo.getBeyondEnterpriseId());
tEmployedPeopleInfo.setBeyondEnterpriseName(EnterpriseName);
//查询修改之前图片存储路径
TEmployedPeopleInfo tEmployedPeopleInfos = tEmployedPeopleInfoService.selectTEmployedPeopleInfoById(tEmployedPeopleInfo.getEmployedPeopleId());
//文件删除
if (tEmployedPeopleInfos.getAvatarAddress()!=null){
// 上传文件路径
String filePath = GassafetyProgressConfig.getUploadPath();
String[] strs = tEmployedPeopleInfos.getAvatarAddress().split("upload");
//删除图片
File file = new File(filePath+strs[1].toString());
// 上传文件路径
if(file.isFile()){
file.delete();
}
}
return toAjax(tEmployedPeopleInfoService.updateTEmployedPeopleInfo(tEmployedPeopleInfo));
}
......@@ -112,41 +125,5 @@ public class TEmployedPeopleInfoController extends BaseController
return AjaxResult.success(tEmployedPeopleInfoService.selectTEnterprise());
}
/**
* 图片上传接口
* @param file
* @return
*/
@ResponseBody
@RequestMapping("/addParent")
public String upFile(@RequestParam("file") MultipartFile file) {
String path = "D:\\img";
String fileName = file.getOriginalFilename();//获取文件名称
String suffixName=fileName.substring(fileName.lastIndexOf("."));//获取文件后缀
//uuid+文件名
fileName= UUID.randomUUID().toString().replace("-", "").toLowerCase()+suffixName;//重新生成文件名
System.out.println(fileName);
System.out.println("type::" + suffixName);
System.out.println("filename::" + fileName);
File targetFile = new File(path);
if (!targetFile.exists()) {
// 判断文件夹是否未空,空则创建
targetFile.mkdirs();
}
File saveFile = new File(targetFile, fileName);
try {
//指定本地存入路径
file.transferTo(saveFile);
System.out.println("执行成功");
String path1 = path + fileName;
//图片存储地址
System.out.println(path1);
return path1;
} catch (Exception e) {
e.printStackTrace();
System.out.println("执行失败");
return "failed";
}
}
}
package com.zehong.web.controller.system;
import java.io.File;
import java.util.List;
import com.zehong.common.config.GassafetyProgressConfig;
import com.zehong.common.utils.file.FileUploadUtils;
import com.zehong.framework.config.ServerConfig;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -20,6 +25,9 @@ import com.zehong.system.service.ITEnterpriseInfoService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
import static com.zehong.common.utils.file.FileUtils.deleteFile;
import static org.apache.tomcat.util.http.fileupload.FileUtils.deleteDirectory;
/**
* 企业信息Controller
*
......@@ -32,7 +40,8 @@ public class TEnterpriseInfoController extends BaseController
{
@Autowired
private ITEnterpriseInfoService tEnterpriseInfoService;
@Autowired
private ServerConfig serverConfig;
/**
* 查询企业信息列表
*/
......@@ -110,6 +119,20 @@ public class TEnterpriseInfoController extends BaseController
@PutMapping
public AjaxResult edit(@RequestBody TEnterpriseInfo tEnterpriseInfo)
{
//查询修改之前图片地址
TEnterpriseInfo tEnterpriseInfo1 = tEnterpriseInfoService.selectTEnterpriseInfoById(tEnterpriseInfo.getEnterpriseId());
//文件删除
if (tEnterpriseInfo1.getDoDusiness()!=null){
// 上传文件路径
String filePath = GassafetyProgressConfig.getUploadPath();
String[] strs = tEnterpriseInfo1.getDoDusiness().split("upload");
//删除图片
File file = new File(filePath+strs[1].toString());
// 上传文件路径
if(file.isFile()){
file.delete();
}
}
return toAjax(tEnterpriseInfoService.updateTEnterpriseInfo(tEnterpriseInfo));
}
......
......@@ -7,6 +7,7 @@ import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService;
......@@ -20,7 +21,7 @@ import com.zehong.framework.security.handle.LogoutSuccessHandlerImpl;
/**
* spring security配置
*
*
* @author zehong
*/
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
......@@ -31,7 +32,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
*/
@Autowired
private UserDetailsService userDetailsService;
/**
* 认证失败处理类
*/
......@@ -55,7 +56,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
*/
@Autowired
private CorsFilter corsFilter;
/**
* 解决 无法直接注入 AuthenticationManager
*
......@@ -125,7 +126,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class);
}
/**
* 强散列哈希加密实现
*/
......@@ -143,4 +144,14 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
{
auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder());
}
/**
* 静态资源放行
* @param web
*/
@Override
public void configure(WebSecurity web) {
web.ignoring().antMatchers("/static/**","/index.html","/login");
}
}
package com.zehong.system.domain;
/**
* 首页感知设备详情封装类
*/
public class TAssociatedEquipment {
//设备编号
private String deviceCode;
//设备名称
private String deviceName;
//探测介质
private String detectionMedium;
//联系人
private String linkman;
//联系电话
private String phone;
//设备状态 0在线 1掉线
private String detectorStatus;
//预警时间
private String createTime;
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDetectionMedium() {
return detectionMedium;
}
public void setDetectionMedium(String detectionMedium) {
this.detectionMedium = detectionMedium;
}
public String getLinkman() {
return linkman;
}
public void setLinkman(String linkman) {
this.linkman = linkman;
}
public String getDetectorStatus() {
return detectorStatus;
}
public void setDetectorStatus(String detectorStatus) {
this.detectorStatus = detectorStatus;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return "TAssociatedEquipment{" +
"deviceCode='" + deviceCode + '\'' +
", deviceName='" + deviceName + '\'' +
", detectionMedium='" + detectionMedium + '\'' +
", linkman='" + linkman + '\'' +
", phone='" + phone + '\'' +
", detectorStatus='" + detectorStatus + '\'' +
", createTime='" + createTime + '\'' +
'}';
}
}
......@@ -65,6 +65,17 @@ public class TEmployedPeopleInfo extends BaseEntity
@Excel(name = "备注")
private String remarks;
/** 头像地址 */
private String avatarAddress;
public String getAvatarAddress() {
return avatarAddress;
}
public void setAvatarAddress(String avatarAddress) {
this.avatarAddress = avatarAddress;
}
public void setEmployedPeopleId(Long employedPeopleId)
{
this.employedPeopleId = employedPeopleId;
......@@ -179,23 +190,20 @@ public class TEmployedPeopleInfo extends BaseEntity
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("employedPeopleId", getEmployedPeopleId())
.append("employedPeopleName", getEmployedPeopleName())
.append("idCard", getIdCard())
.append("certificateNum", getCertificateNum())
.append("beyondEnterpriseName", getBeyondEnterpriseName())
.append("beyondEnterpriseId", getBeyondEnterpriseId())
.append("registerExaminationType", getRegisterExaminationType())
.append("peopleOccupation", getPeopleOccupation())
.append("issueDate", getIssueDate())
.append("certificateChange", getCertificateChange())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDel", getIsDel())
.append("remarks", getRemarks())
.toString();
return "TEmployedPeopleInfo{" +
"employedPeopleId=" + employedPeopleId +
", employedPeopleName='" + employedPeopleName + '\'' +
", idCard='" + idCard + '\'' +
", certificateNum='" + certificateNum + '\'' +
", beyondEnterpriseName='" + beyondEnterpriseName + '\'' +
", beyondEnterpriseId=" + beyondEnterpriseId +
", registerExaminationType='" + registerExaminationType + '\'' +
", peopleOccupation='" + peopleOccupation + '\'' +
", issueDate='" + issueDate + '\'' +
", certificateChange='" + certificateChange + '\'' +
", isDel='" + isDel + '\'' +
", remarks='" + remarks + '\'' +
", avatarAddress='" + avatarAddress + '\'' +
'}';
}
}
......@@ -64,6 +64,32 @@ public class TEnterpriseInfo extends BaseEntity
@Excel(name = "备注")
private String remarks;
/** 营业执照图片地址*/
private String doDusiness;
/**本地存储图片路径*/
private String burl;
public String getBurl() {
return burl;
}
public void setBurl(String burl) {
this.burl = burl;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getDoDusiness() {
return doDusiness;
}
public void setDoDusiness(String doDusiness) {
this.doDusiness = doDusiness;
}
public void setEnterpriseId(Long enterpriseId)
{
this.enterpriseId = enterpriseId;
......@@ -182,21 +208,22 @@ public class TEnterpriseInfo extends BaseEntity
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("enterpriseId", getEnterpriseId())
.append("enterpriseName", getEnterpriseName())
.append("registerAddress", getRegisterAddress())
.append("legalRepresentative", getLegalRepresentative())
.append("businessArea", getBusinessArea())
.append("licenseKey", getLicenseKey())
.append("licenseValidityTime", getLicenseValidityTime())
.append("annualSupervisionInspection", getAnnualSupervisionInspection())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDel", getIsDel())
.append("remarks", getRemarks())
.toString();
return "TEnterpriseInfo{" +
"enterpriseId=" + enterpriseId +
", enterpriseName='" + enterpriseName + '\'' +
", registerAddress='" + registerAddress + '\'' +
", legalRepresentative='" + legalRepresentative + '\'' +
", businessArea='" + businessArea + '\'' +
", longitude=" + longitude +
", latitude=" + latitude +
", iconType='" + iconType + '\'' +
", licenseKey='" + licenseKey + '\'' +
", licenseValidityTime='" + licenseValidityTime + '\'' +
", annualSupervisionInspection='" + annualSupervisionInspection + '\'' +
", isDel='" + isDel + '\'' +
", remarks='" + remarks + '\'' +
", doDusiness='" + doDusiness + '\'' +
", burl='" + burl + '\'' +
'}';
}
}
......@@ -101,4 +101,25 @@ public interface PipeInterfaceMapper {
* @return
*/
int selectInAlarm(List<PressureFlow> pressureList);
/**
* 查询 场站/设备 列表信息方法
* @param devId
* @param relationDeviceType
* @return
*/
List<TAssociatedEquipment> selectSensingDevice(@Param("devId")String devId, @Param("relationDeviceType")String relationDeviceType);
/**
* 查询上级设备是否有下级设备
* @param deviceId
*/
int selectValveWellIsNUll(@Param("deviceId") String deviceId,@Param("type")int type);
/**
* 查询下级全部数据方法
* @param type
* @return
*/
List<PressureFlow> selectPressureFlows(String type);
}
......@@ -98,4 +98,26 @@ public interface IPipeInterfaceService {
* @return
*/
int selectInAlarm(List<PressureFlow> pressureList);
/**
* 查询 场站/设备 列表信息方法
* @param devId
* @param relationDeviceType
* @return
*/
List<TAssociatedEquipment> selectSensingDevice(String devId, String relationDeviceType);
/**
* 查询上级设备是否有下级设备
* @param deviceId
* @return
*/
int selectValveWellIsNUll(String deviceId,int type);
/**
* 查询下级全部数据方法
* @param type
* @return
*/
List<PressureFlow> selectPressureFlows(String type);
}
......@@ -161,4 +161,37 @@ public class PipeInterfaceServiceImpl implements IPipeInterfaceService {
int i = pipeInterfaceMapper.selectInAlarm(pressureList);
return i;
}
/**
* 查询 场站/设备 列表信息方法
* @param devId
* @param relationDeviceType
* @return
*/
@Override
public List<TAssociatedEquipment> selectSensingDevice(String devId, String relationDeviceType) {
List<TAssociatedEquipment> tAssociatedEquipments = pipeInterfaceMapper.selectSensingDevice(devId, relationDeviceType);
return tAssociatedEquipments;
}
/**
* 查询上级设备是否有下级设备
* @param deviceId
* @return
*/
@Override
public int selectValveWellIsNUll(String deviceId,int type) {
return pipeInterfaceMapper.selectValveWellIsNUll(deviceId,type);
}
/**
* 查询下级全部数据方法
* @param type
* @return
*/
@Override
public List<PressureFlow> selectPressureFlows(String type) {
List<PressureFlow> flows = pipeInterfaceMapper.selectPressureFlows(type);
return flows;
}
}
......@@ -83,6 +83,17 @@
<result property="enterpriseName" column="enterprise_name" />
</resultMap>
<!--感知设备列表-->
<resultMap type="TAssociatedEquipment" id="TAssociatedEquipmentResult">
<result property="deviceCode" column="device_code" />
<result property="deviceName" column="device_name" />
<result property="detectionMedium" column="detection_medium" />
<result property="linkman" column="linkman" />
<result property="phone" column="phone" />
<result property="detectorStatus" column="detector_status" />
<result property="createTime" column="alarm_time" />
</resultMap>
<!--查询管道数据列表-->
<select id="selectPipeData" parameterType="PipeDate" resultMap="PipeDateResult">
select beyond_enterprise_id,pipe_id,pipe_diameter,pipe_material,buried_depth,pipe_trend,build_date,pipe_addr,coordinates,remarks,build_unit,beyond_enterprise_name from t_pipe_info
......@@ -181,4 +192,24 @@
</foreach>
</select>
<!--查询 场站/设备 列表信息方法-->
<select id="selectSensingDevice" resultMap="TAssociatedEquipmentResult">
select b.iot_no device_code,b.device_name device_name,b.detection_medium,a.linkman,a.phone,c.detector_status,c.alarm_time
from t_device_info a
left join t_relation_device_detail_info b on a.device_id=b.relation_device_id
left join t_detector_info c on b.iot_no=c.detector_code
where a.device_id=#{devId} and b.relation_device_type=#{relationDeviceType}
</select>
<!--查询上级设备是否有下级设备-->
<select id="selectValveWellIsNUll" resultType="java.lang.Integer">
select count(relation_device_detail_id) from t_relation_device_detail_info where relation_device_id = #{deviceId} and relation_device_type=#{type}
</select>
<!--查询下级全部数据方法-->
<select id="selectPressureFlows" resultMap="PressureFlowResult">
select device_model,device_type,create_time,relation_device_id,iot_no from t_relation_device_detail_info
where relation_device_type=#{type}
</select>
</mapper>
......@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="employedPeopleId" column="employed_people_id" />
<result property="employedPeopleName" column="employed_people_name" />
<result property="idCard" column="id_card" />
<result property="avatarAddress" column="avatar_address" />
<result property="certificateNum" column="certificate_num" />
<result property="beyondEnterpriseName" column="beyond_enterprise_name" />
<result property="beyondEnterpriseId" column="beyond_enterprise_id" />
......@@ -45,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectTEmployedPeopleInfoList" parameterType="TEmployedPeopleInfo" resultMap="TEmployedPeopleInfoResult">
select employed_people_id, employed_people_name, id_card, certificate_num, beyond_enterprise_name, beyond_enterprise_id, register_examination_type,(CASE people_occupation WHEN '1' THEN '主要负责人' WHEN '2' THEN '安全管理人员' WHEN '3' THEN '运行维护和抢修人员'end ) as people_occupation, issue_date, certificate_change, create_by, create_time, update_by, update_time, is_del, remarks from t_employed_people_info
select employed_people_id, employed_people_name,avatar_address, id_card, certificate_num, beyond_enterprise_name, beyond_enterprise_id, register_examination_type,(CASE people_occupation WHEN '1' THEN '主要负责人' WHEN '2' THEN '安全管理人员' WHEN '3' THEN '运行维护和抢修人员'end ) as people_occupation, issue_date, certificate_change, create_by, create_time, update_by, update_time, is_del, remarks from t_employed_people_info
<where>
1=1 and is_del='0'
<if test="employedPeopleName != null and employedPeopleName != ''"> and employed_people_name like concat('%', #{employedPeopleName}, '%')</if>
......@@ -56,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectTEmployedPeopleInfoById" parameterType="Long" resultMap="TEmployedPeopleInfoResult">
select employed_people_id, employed_people_name, id_card, certificate_num, beyond_enterprise_name, beyond_enterprise_id, register_examination_type, people_occupation, issue_date, certificate_change, create_by, create_time, update_by, update_time, is_del, remarks from t_employed_people_info
select employed_people_id, employed_people_name, id_card, certificate_num, beyond_enterprise_name, beyond_enterprise_id, register_examination_type, people_occupation, issue_date, certificate_change, create_by, create_time, update_by, update_time, is_del, remarks,avatar_address from t_employed_people_info
where employed_people_id = #{employedPeopleId} and is_del='0'
</select>
......@@ -78,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if>
<if test="avatarAddress != null">avatar_address,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="employedPeopleName != null">#{employedPeopleName},</if>
......@@ -95,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if>
<if test="avatarAddress != null">#{avatarAddress},</if>
</trim>
</insert>
......@@ -116,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remarks != null">remarks = #{remarks},</if>
<if test="avatarAddress != null">avatar_address = #{avatarAddress},</if>
</trim>
where employed_people_id = #{employedPeopleId}
</update>
......
......@@ -22,12 +22,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
<result property="doDusiness" column="do_business" />
</resultMap>
<sql id="selectTEnterpriseInfoVo">
select enterprise_id, enterprise_name, register_address, legal_representative,
business_area, longitude, latitude, icon_type, license_key, license_validity_time, annual_supervision_inspection,
create_by, create_time, update_by, update_time, remarks from t_enterprise_info
create_by, create_time, update_by, update_time, remarks,do_business from t_enterprise_info
</sql>
<select id="selectTEnterpriseInfoList" parameterType="TEnterpriseInfo" resultMap="TEnterpriseInfoResult">
......@@ -70,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if>
<if test="doDusiness != null">do_business,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="enterpriseName != null">#{enterpriseName},</if>
......@@ -88,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if>
<if test="doDusiness != null">#{doDusiness},</if>
</trim>
</insert>
......@@ -109,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remarks != null">remarks = #{remarks},</if>
<if test="doDusiness != null">do_business=#{doDusiness},</if>
</trim>
where enterprise_id = #{enterpriseId}
</update>
......
/*
* @Author: your name
* @Date: 2022-02-23 15:28:07
* @LastEditTime: 2022-03-04 17:16:53
* @LastEditTime: 2022-03-08 14:52:13
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /newDev/gassafety-progress/gassafetyprogress-web/src/api/bigWindow/getdevice.js
......@@ -70,6 +70,21 @@ export function getCzDevice(query) {
params: query
})
}
// 设备id :devId 类型 relationDeviceType 1调压箱/阀门井 2场站
export function getTcqDevice(query) {
return request({
url: '/pipe/pipe/selectSensingDevice',
method: 'get',
params: {
pageNum: 1,
pageSize: 20,
...query,
},
})
}
// 监控
export function getVideo(query) {
return request({
......
......@@ -18,17 +18,11 @@ export function getInfo(employedPeopleId) {
}
// 新增从业人员信息
export function addInfo(file,form) {
export function addInfo(data) {
return request({
url: '/regulation/supervise',
method: 'post',
data: {
file:file,
tEmployedPeopleInfo:form,
},
headers: {
"Content-Type": "multipart/form-data"
},
data: data,
})
}
//传图片
......
<template>
<div class="upload-file">
<el-upload
:action="uploadFileUrl"
:before-upload="handleBeforeUpload"
:file-list="fileArr"
:limit="1"
:list-type="listType"
:on-error="handleUploadError"
:on-exceed="handleExceed"
:on-success="handleUploadSuccess"
:on-remove="handleRemove"
:on-preview="handleFileClick"
:on-change="fileChange"
:show-file-list="true"
:headers="headers"
class="upload-file-uploader"
:class="{ hide: fileArr.length>0 ||addShow }"
ref="upload"
>
<!-- 上传按钮 -->
<el-button plain type="primary">选取文件</el-button>
<!--<i class="el-icon-plus"></i>-->
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip">
请上传
<template v-if="fileSize">
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
</template>
<template v-if="fileType">
格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
</template>
的文件,且不超过一个
</div>
</el-upload>
<el-image v-show="false"
id="img"
ref="previewImg"
:src="dialogImageUrl"
:preview-src-list="bigImageArr"
:z-index="9999999"
></el-image>
<!-- <el-dialog
:center="true"
width="50%"
:modal="modal"
:visible.sync="dialogVisible"
>
<img :src="dialogImageUrl" alt="" />
</el-dialog> -->
<!-- 文件列表 -->
<!-- <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in list">
<el-link :href="file.url" :underline="false" target="_blank">
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
</el-link>
<div class="ele-upload-list__item-content-action">
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
</div>
</li>
</transition-group> -->
</div>
</template>
<script>
import { getToken } from "@/utils/auth";
export default {
props: {
// 值
value: [String, Object, Array],
listType: {
type: String,
defaule: "text",
},
// 大小限制(MB)
fileSize: {
type: Number,
default: 5,
},
fileArr: {
type: Array,
default: [],
},
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ['png', 'jpg', 'jpeg'],
},
// 是否显示提示
isShowTip: {
type: Boolean,
default: true,
},
},
data() {
return {
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
headers: {
Authorization: "Bearer " + getToken(),
},
fileList: [],
modal: false,
dialogVisible: false,
dialogImageUrl: "",
addShow: true,
};
},
computed: {
// 是否显示提示
showTip() {
return this.isShowTip && (this.fileType || this.fileSize);
},
// 列表
list() {
let temp = 1;
if (this.value) {
// 首先将值转为数组
const list = Array.isArray(this.value) ? this.value : [this.value];
// 然后将数组转为对象数组
return list.map((item) => {
if (typeof item === "string") {
item = { name: item, url: item };
}
item.uid = item.uid || new Date().getTime() + temp++;
return item;
});
} else {
this.fileList = [];
return [];
}
},
bigImageArr() {
return [this.dialogImageUrl]
},
},
methods: {
// 上传前校检格式和大小
handleBeforeUpload(file) {
// 校检文件类型
if (this.fileType) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
const isTypeOk = this.fileType.some((type) => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
if (!isTypeOk) {
this.$message.error(
`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
);
return false;
}
}
// 校检文件大小
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`);
return false;
}
}
return true;
},
// 文件个数超出
handleExceed() {
this.$message.error(`只允许上传单个文件`);
},
// 上传失败
handleUploadError(err) {
this.$message.error("上传失败, 请重试");
},
// 上传成功回调
handleUploadSuccess(res, file) {
this.$message.success("上传成功");
this.$emit("resFun", res);
},
// 文件列表移除文件
handleRemove(file, fileList) {
console.log("列表移除", file, fileList);
this.addShow = fileList.length > 0 ? true : false;
this.$emit("remove", file);
},
// 删除文件
handleDelete(index) {
this.fileList.splice(index, 1);
this.$emit("input", "");
// let that = this,
// param;
// param = file.response ? file.response.fileName.replace(/\\/g, "%")
// : file.response.url.replace(/\\/g, "%").slice(9);
// $.ajax({
// type: "GET",
// url: process.env.VUE_APP_BASE_API + "/common/deleteFile",
// data: {savePath: param},
// dataType: "json",
// success: function(data){
// if (data) that.$message.success("删除成功");
// else return false;
// }
// });
},
handleFileClick(file, fileList) {
this.dialogImageUrl = file.response ? file.response.url : file.url;
// this.dialogImageUrl =if(this.fileArr) this.fileArr[0].url;
// this.dialogVisible = true;
this.$refs.previewImg.showViewer = false;
console.log(file);
// console.log(file.response.url)
},
// 获取文件名称
getFileName(name) {
if (name.lastIndexOf("/") > -1) {
return name.slice(name.lastIndexOf("/") + 1).toLowerCase();
} else {
return "";
}
},
// 当改变列表改变时
fileChange(file, fileList) {
this.addShow = fileList.length > 0 ? true : false;
},
},
created() {
// this.fileList = this.list;
this.addShow = this.fileArr.length > 0 ? true : false;
},
};
</script>
<style scoped lang="scss">
img {
width: 100%;
}
.upload-file-uploader {
margin-bottom: 5px;
}
.upload-file-list .el-upload-list__item {
border: 1px solid #e4e7ed;
line-height: 2;
margin-bottom: 10px;
position: relative;
}
.upload-file-list .ele-upload-list__item-content {
display: flex;
justify-content: space-between;
align-items: center;
color: inherit;
}
.ele-upload-list__item-content-action .el-link {
margin-right: 10px;
}
</style>
<template>
<div class="upload-file">
<el-upload
:action="uploadFileUrl"
:before-upload="handleBeforeUpload"
:file-list="fileArr"
:limit="1"
:list-type="listType"
:on-error="handleUploadError"
:on-exceed="handleExceed"
:on-success="handleUploadSuccess"
:on-remove="handleRemove"
:on-preview="handleFileClick"
:on-change="fileChange"
:show-file-list="true"
:headers="headers"
class="upload-file-uploader"
:class="{ hide: fileArr.length>0 ||addShow }"
ref="upload"
>
<!-- 上传按钮 -->
<el-button plain type="primary">选取文件</el-button>
<!--<i class="el-icon-plus"></i>-->
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip">
请上传
<template v-if="fileSize">
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
</template>
<template v-if="fileType">
格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
</template>
的文件,且不超过一个
</div>
</el-upload>
<el-image v-show="false"
id="img"
ref="previewImg"
:src="dialogImageUrl"
:preview-src-list="bigImageArr"
:z-index="9999999"
></el-image>
<!-- <el-dialog
:center="true"
width="50%"
:modal="modal"
:visible.sync="dialogVisible"
>
<img :src="dialogImageUrl" alt="" />
</el-dialog> -->
<!-- 文件列表 -->
<!-- <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in list">
<el-link :href="file.url" :underline="false" target="_blank">
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
</el-link>
<div class="ele-upload-list__item-content-action">
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
</div>
</li>
</transition-group> -->
</div>
</template>
<script>
import { getToken } from "@/utils/auth";
export default {
props: {
// 值
value: [String, Object, Array],
listType: {
type: String,
defaule: "text",
},
// 大小限制(MB)
fileSize: {
type: Number,
default: 5,
},
fileArr: {
type: Array,
default: [],
},
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ['png', 'jpg', 'jpeg'],
},
// 是否显示提示
isShowTip: {
type: Boolean,
default: true,
},
},
data() {
return {
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
headers: {
Authorization: "Bearer " + getToken(),
},
fileList: [],
modal: false,
dialogVisible: false,
dialogImageUrl: "",
addShow: true,
};
},
computed: {
// 是否显示提示
showTip() {
return this.isShowTip && (this.fileType || this.fileSize);
},
// 列表
list() {
let temp = 1;
if (this.value) {
// 首先将值转为数组
const list = Array.isArray(this.value) ? this.value : [this.value];
// 然后将数组转为对象数组
return list.map((item) => {
if (typeof item === "string") {
item = { name: item, url: item };
}
item.uid = item.uid || new Date().getTime() + temp++;
return item;
});
} else {
this.fileList = [];
return [];
}
},
bigImageArr() {
return [this.dialogImageUrl]
},
},
methods: {
// 上传前校检格式和大小
handleBeforeUpload(file) {
// 校检文件类型
if (this.fileType) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
const isTypeOk = this.fileType.some((type) => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
if (!isTypeOk) {
this.$message.error(
`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
);
return false;
}
}
// 校检文件大小
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`);
return false;
}
}
return true;
},
// 文件个数超出
handleExceed() {
this.$message.error(`只允许上传单个文件`);
},
// 上传失败
handleUploadError(err) {
this.$message.error("上传失败, 请重试");
},
// 上传成功回调
handleUploadSuccess(res, file) {
this.$message.success("上传成功");
this.$emit("resFun", res);
},
// 文件列表移除文件
handleRemove(file, fileList) {
console.log("列表移除", file, fileList);
this.addShow = fileList.length > 0 ? true : false;
this.$emit("remove", file);
},
// 删除文件
handleDelete(index) {
this.fileList.splice(index, 1);
this.$emit("input", "");
// let that = this,
// param;
// param = file.response ? file.response.fileName.replace(/\\/g, "%")
// : file.response.url.replace(/\\/g, "%").slice(9);
// $.ajax({
// type: "GET",
// url: process.env.VUE_APP_BASE_API + "/common/deleteFile",
// data: {savePath: param},
// dataType: "json",
// success: function(data){
// if (data) that.$message.success("删除成功");
// else return false;
// }
// });
},
handleFileClick(file, fileList) {
this.dialogImageUrl = file.response ? file.response.url : file.url;
// this.dialogImageUrl =if(this.fileArr) this.fileArr[0].url;
// this.dialogVisible = true;
this.$refs.previewImg.showViewer = false;
console.log(file);
// console.log(file.response.url)
},
// 获取文件名称
getFileName(name) {
if (name.lastIndexOf("/") > -1) {
return name.slice(name.lastIndexOf("/") + 1).toLowerCase();
} else {
return "";
}
},
// 当改变列表改变时
fileChange(file, fileList) {
this.addShow = fileList.length > 0 ? true : false;
},
},
created() {
// this.fileList = this.list;
this.addShow = this.fileArr.length > 0 ? true : false;
},
};
</script>
<style scoped lang="scss">
img {
width: 100%;
}
.upload-file-uploader {
margin-bottom: 5px;
}
.upload-file-list .el-upload-list__item {
border: 1px solid #e4e7ed;
line-height: 2;
margin-bottom: 10px;
position: relative;
}
.upload-file-list .ele-upload-list__item-content {
display: flex;
justify-content: space-between;
align-items: center;
color: inherit;
}
.ele-upload-list__item-content-action .el-link {
margin-right: 10px;
}
</style>
......@@ -121,7 +121,7 @@ export default {
};
</script>
<style lang="scss" >
<style lang="scss" scoped>
.myCenter {
// width: 978px;
max-height: 600px;
......
<!--
* @Author: your name
* @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-03-01 16:29:17
* @LastEditTime: 2022-03-08 16:16:39
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
......@@ -52,8 +52,6 @@
{{ deviceData.remarks }}
</div>
</div>
</div>
</template>
......@@ -90,7 +88,7 @@ export default {
this.mapClass.infowindowClose();
},
btnClick() {
this.vueRoot.centerDataFunc(this.deviceData.pressureFlows);
// this.vueRoot.centerDataFunc(this.deviceData.pressureFlows);
},
},
};
......
<!--
* @Author: your name
* @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-03-07 18:09:02
* @LastEditTime: 2022-03-10 10:33:35
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
......@@ -105,12 +105,12 @@ export default {
return {
companyType,
deviceType,
profile: "暂无",
profile: "暂无备注",
typeList: {
// 1压力表 2流量计 3探测器
1: "压力表",
2: "流量计",
3: "探测器",
3: "工业探测器",
},
list: [
// {
......@@ -167,7 +167,14 @@ export default {
this.mapClass.infowindowClose();
},
btnClick() {
this.vueRoot.centerDataFunc(this.deviceData.pressureFlows);
const title = this.deviceData.deviceName
? this.deviceData.deviceName
: this.deviceData.stationName;
this.vueRoot.getTcqDevice(
{ devId: this.deviceData.siteStationId, relationDeviceType: 2 },
title
);
},
myHttp() {
getCzDevice({ deviceId: this.deviceData.siteStationId }).then((res) => {
......
<!--
* @Author: your name
* @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-03-07 18:06:31
* @LastEditTime: 2022-03-10 10:33:28
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
......@@ -90,8 +90,8 @@
</template>
</div>
<div class="btn">
<!-- <div @click="btnClick">感知设备</div> -->
<div class="btn" v-if="list.length>0">
<div @click="btnClick">感知设备</div>
</div>
</div>
</template>
......@@ -104,12 +104,12 @@ export default {
return {
companyType,
deviceType,
profile: "暂无",
profile: "暂无备注",
typeList: {
// 1压力表 2流量计 3探测器
1: "压力表",
2: "流量计",
3: "探测器",
3: "工业探测器",
},
list: [
// {
......@@ -167,7 +167,15 @@ export default {
this.mapClass.infowindowClose();
},
btnClick() {
this.vueRoot.centerDataFunc(this.deviceData.pressureFlows);
// this.vueRoot.centerDataFunc(this.deviceData.pressureFlows);
const title = this.deviceData.deviceName
? this.deviceData.deviceName
: this.deviceData.stationName;
this.vueRoot.getTcqDevice(
{ devId: this.deviceData.deviceId, relationDeviceType: 1 },
title
);
},
myHttp() {
console.log(this.deviceData.iconType);
......
<template>
<transition>
<div v-show="show" class="wrapper myCenter">
<div class="left">
<div class="title-wrapper">
<div class="title">{{ title }}报警器列表</div>
<div class="close" @click="close">
<img src="@/assets/mapImages/closeBtn.png" alt="" />
</div>
</div>
<div class="bottom right-bottom-data-left">
<el-table
size="mini"
:data="tableData"
style="width: 100%"
class="el-bottom"
:key="Math.random()"
>
<!-- :height="tableHeight" -->
<el-table-column prop="deviceCode" label="设备编号" width="180">
<template slot-scope="scope">
<div :title="scope.row.deviceCode" class="ddd" v-unValue>
{{ scope.row.deviceCode }}
</div>
</template>
</el-table-column>
<el-table-column prop="deviceName" label="设备名称" width="150">
<template slot-scope="scope">
<div :title="scope.row.deviceName" class="ddd" v-unValue>
{{ scope.row.deviceName }}
</div>
</template>
</el-table-column>
<el-table-column prop="detectionMedium" label="监测介质" width="">
<template slot-scope="scope">
<div v-unValue>{{ scope.row.detectionMedium }}</div>
</template>
</el-table-column>
<el-table-column prop="linkman" label="联系人" width="100">
<template slot-scope="scope">
<div v-unValue>{{ scope.row.linkman }}</div>
</template>
</el-table-column>
<el-table-column prop="phone" label="联系电话" width="">
</el-table-column>
<el-table-column prop="detectorStatus" label="设备状态" width="100">
<template slot-scope="scope">
<div v-unValue>{{ detectorStatusList[scope.row.detectorStatus] }}</div>
</template>
</el-table-column>
<el-table-column prop="createTime" label="预警时间" width="180">
<template slot-scope="scope">
<div v-unValue>{{ scope.row.createTime }}</div>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination
@current-change="handleCurrentChangvale"
:page-size="pageSize"
layout="prev, pager, next, jumper"
:total="total"
:hide-on-single-page="total <= pageSize"
:key="total + '' + pageSize"
>
</el-pagination>
</div>
</div>
</div>
</div>
</transition>
</template>
<script>
// import Velocity from "velocity-animate";
// import { listDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";
import { listDetectorInfo } from "@/api/detector/detectorInfo";
export default {
props: {
detcetorList: {
type: Array,
default: () => [],
},
show: {
type: Boolean,
},
title: {
type: String,
},
userId: {
type: [Number, String],
},
total: {
type: Number,
},
pageSize: {
type: Number,
},
},
data() {
return {
// 动画效果的切换
// tableHeight: 600,
tableData: [
// {
// deviceCode: "2016-05-05",
// name: "王小虎",
// province: "上海",
// city: "普陀区",
// address: "上海市普陀区金沙江路",
// },
],
detectorStatusList:{
"0":"在线",
"1":"离线",
}
};
},
created() {
console.log("list", this.detcetorList);
// this.getList();
},
watch: {
// 当组件显示的时候
detcetorList(newData) {
// console.log(bol);
// if (bol) {
console.log(newData);
this.tableData = [...newData];
// }
},
},
methods: {
handleSizeChange(val) {
console.log(val);
},
handleCurrentChangvale(val) {
this.$parent.getTcqDevice(
{
devId: this.userId,
pageNum: val,
pageSize: this.pageSize,
},
this.title
);
},
close() {
// this.fade = "fade";
this.$parent.otherCenterShow = false;
},
},
};
</script>
<style lang="scss" scoped>
.wrapper {
// width: 978px;
max-height: 600px;
position: fixed;
top: 50%;
left: 50%;
margin-top: -300px;
margin-left: -500px;
// background-color: #fff;
display: flex;
justify-content: space-between;
z-index: 9999;
& > div {
}
.left {
// width: 100px;
max-height: 598px;
margin-right: 12px;
// box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.16);
// background-color: #fff;
// color: #fff;
font-size: 14px;
font-weight: 400;
.title-wrapper {
width: 100%;
height: 30px;
display: flex;
justify-content: space-between;
background: #1890ff;
padding: 5px;
.title {
width: 100%;
color: #fff;
text-align: center;
}
.close {
box-sizing: border-box;
padding-top: 2px;
padding-right: 5px;
cursor: pointer;
}
}
.el-table__body-wrappe {
height: 140px !important;
}
.top {
height: 19px;
// background-color: #053b6a;
color: #fff;
// line-height: 32px;
// padding-left: 12px;
position: relative;
.title {
position: absolute;
left: 50%;
margin-left: -92px;
top: -5px;
}
.repeat {
position: absolute;
top: -5px;
right: 160px;
color: #fff;
cursor: pointer;
&:hover {
color: #2788ea;
}
}
.repeat2 {
position: absolute;
right: 206px;
color: #67c23a;
}
.more {
position: absolute;
right: 38px;
top: -5px;
color: #fff;
float: right;
margin-right: 20px;
cursor: pointer;
&:hover {
color: #2788ea;
}
}
}
.bottom {
width: 1000px;
margin: 0 auto;
position: relative;
}
}
.right {
width: 740px;
display: flex;
flex-wrap: wrap;
// justify-content: space-between;
align-content: flex-start;
// margin-top: 7px;
& > .right-content {
background-color: #fff;
width: 238px;
height: 82px;
margin-bottom: 29px;
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.16);
margin-right: 10px;
display: flex;
&.three {
margin-right: 0px;
}
// align-items: center;
.text-icon {
line-height: 82px;
padding-left: 22px;
margin-right: 22px;
i {
color: #053b6a;
font-size: 60px;
}
}
.text {
font-size: 14px;
padding-top: 16px;
.top {
color: #000;
margin-bottom: 10px;
font-weight: 600;
}
.bottom {
color: #2788ea;
}
}
}
}
.iconfont {
cursor: pointer;
}
// 单独调整下最后一个icon的大小
.iconFontSize {
font-size: 50px !important;
}
}
</style>
\ No newline at end of file
......@@ -143,7 +143,7 @@ export default {
},
close() {
// this.fade = "fade";
this.$parent.centerShow = false;
this.$parent.userCenterShow = false;
},
},
};
......
<template>
<div style="height: 100%">
<!-- 预警信息 -->
<div>
<div class="item1">
<span class="dot">
<span class="dot-inner"></span>
</span>
<span style="letter-spacing: 3px; color: #cddbe4;cursor: pointer;" @click="$router.push('/operationMonitor/operationMonitor')">预警信息</span>
<span
style="letter-spacing: 3px; color: #cddbe4; cursor: pointer"
@click="$router.push('/operationMonitor/operationMonitor')"
>预警信息</span
>
<div
class="fong-div"
style="
......@@ -92,8 +95,6 @@
</div>
</div>
<!-- 用户安全监控设备 -->
<div>
<div class="item1">
......@@ -140,63 +141,109 @@
></div>
</div>
</div>
<div class="outuser">
<div class="outuserone">
<p>燃气用户数量</p>
<span class="outuserspan">{{ diviceNum.userNum }}</span>
</div>
<div class="outusertwo">
<p>安全设备数量</p>
<span class="outuserspan">{{
diviceNum.baoNum + diviceNum.changNum + diviceNum.liNum
}}</span>
</div>
</div>
<div id="huan" style="width: 450px; height: 170px"></div>
<div class="inyuan">
<div style="letter-spacing: 2px">设备总数</div>
<span
style="
font-family: 'arialbd';
letter-spacing: 2px;
color: #00ffff;
font-size: 20px;
"
>{{ diviceNum.baoNum + diviceNum.changNum + diviceNum.liNum }}</span
>
</div>
<div class="usernum">
<div class="usernumin in1">
<span></span>
<span style="color: #cddbe4">在线数量 </span>
<span style="font-family: 'arialbd'; letter-spacing: 2px">
: {{ diviceNum.changNum }}</span
>
</div>
<div class="usernumin in2">
<span></span>
<span style="color: #cddbe4">离线数量 </span>
<span style="font-family: 'arialbd'; letter-spacing: 2px">
: {{ diviceNum.liNum }}</span
>
<div class="inuser">
<div class="outuserleft">
<div class="outuserone">
<p>燃气用户数量</p>
<!-- <span class="outuserspan">{{ diviceNum.userNum }}</span> -->
</div>
<div id="huanleft" style="width: 235px; height: 170px"></div>
<div class="inyuan">
<div style="letter-spacing: 2px">用户总数</div>
<span
style="
font-family: 'arialbd';
letter-spacing: 2px;
color: #00ffff;
font-size: 20px;
"
>{{
diviceNum.juminNum + diviceNum.shangNum + diviceNum.gongNum
}}</span
>
</div>
<div class="usernum">
<div class="usernumin in4">
<span></span>
<span style="color: #cddbe4">居民用户 </span>
<span style="font-family: 'arialbd'; letter-spacing: 2px">
: {{ diviceNum.juminNum }}</span
>
</div>
<div class="usernumin in5">
<span></span>
<span style="color: #cddbe4">商业用户 </span>
<span style="font-family: 'arialbd'; letter-spacing: 2px">
: {{ diviceNum.shangNum }}</span
>
</div>
<div class="usernumin in6">
<span></span>
<span style="color: #cddbe4">工业用户 </span>
<span style="font-family: 'arialbd'; letter-spacing: 2px">
: {{ diviceNum.gongNum }}</span
>
</div>
</div>
</div>
<div class="usernumin in3">
<span></span>
<span style="color: #cddbe4">报警数量 </span>
<span style="font-family: 'arialbd'; letter-spacing: 2px">
: {{ diviceNum.baoNum }}</span
>
<div class="outuserright">
<div class="outusertwo">
<p>安全设备数量</p>
<!-- <span class="outuserspan">{{
diviceNum.baoNum + diviceNum.changNum + diviceNum.liNum
}}</span> -->
</div>
<div id="huanright" style="width: 235px; height: 170px"></div>
<div class="inyuan">
<div style="letter-spacing: 2px">设备总数</div>
<span
style="
font-family: 'arialbd';
letter-spacing: 2px;
color: #00ffff;
font-size: 20px;
"
>{{ diviceNum.baoNum + diviceNum.changNum + diviceNum.liNum }}</span
>
</div>
<div class="usernum">
<div class="usernumin in1">
<span></span>
<span style="color: #cddbe4">在线 </span>
<span style="font-family: 'arialbd'; letter-spacing: 2px">
: {{ diviceNum.changNum }}</span
>
</div>
<div class="usernumin in2">
<span></span>
<span style="color: #cddbe4">离线 </span>
<span style="font-family: 'arialbd'; letter-spacing: 2px">
: {{ diviceNum.liNum }}</span
>
</div>
<div class="usernumin in3">
<span></span>
<span style="color: #cddbe4">报警 </span>
<span style="font-family: 'arialbd'; letter-spacing: 2px">
: {{ diviceNum.baoNum }}</span
>
</div>
</div>
</div>
</div>
<!-- 资源统计 -->
<div>
<div class="item1" style="margin-top: 15px">
<span class="dot">
<span class="dot-inner"></span>
</span>
<span style="letter-spacing: 3px; color: #cddbe4;cursor: pointer;" @click="$router.push('/regulation/station')">资源统计</span>
<span
style="letter-spacing: 3px; color: #cddbe4; cursor: pointer"
@click="$router.push('/regulation/station')"
>资源统计</span
>
<div
class="fong-div"
style="
......@@ -240,9 +287,6 @@
>
<div id="myChartone" :style="{ width: '420px', height: '240px' }"></div>
</div>
</div>
</template>
......@@ -314,7 +358,7 @@ export default {
);
// 列表
const select = this.$refs.table.$el
.querySelector(".el-table__body-wrapper")
?.querySelector(".el-table__body-wrapper")
.querySelector(".el-table__body");
setTimeout(() => {
......@@ -330,7 +374,7 @@ export default {
console.log("滚动");
} else {
this.alarmTimerAni();
console.log("不滚动");
console.log("不滚动-----------------------------");
}
// 列表大的时候鼠标移入移出就会触发暂停,否则就return
this.changeTimer = heightSelect > heightWrapper;
......@@ -395,7 +439,7 @@ export default {
top: "8%",
left: "8%",
right: "4%",
bottom: "7%",
bottom: "10%",
containLabel: true,
},
xAxis: {
......@@ -506,12 +550,96 @@ export default {
});
},
drawLine3() {
// 基于准备好的dom,初始化echarts实例
let myChart31 = echarts.init(document.getElementById("huan"));
// let myChart32 = echarts.init(document.getElementById('main32'))
let myChart31 = echarts.init(document.getElementById("huanleft"));
let myChart32 = echarts.init(document.getElementById('huanright'))
// 绘制图表
myChart31.setOption({
color: ["#91cc75", "#5470c6", "#fa8167" ],
grid: {
left: 0,
// right: 0,
bottom: 0,
top: 0,
containLabel: true,
},
// grid: {
// bottom: 150,
// left: 100,
// right: '10%'
// },
series: [
// 主要展示层的
{
radius: ["75%", "65%"],
center: ["50%", "50%"],
type: "pie",
itemStyle: {
borderRadius: 20,
},
label: {
normal: {
show: false,
textStyle: {
fontSize: 13,
},
position: "outside",
},
emphasis: {
show: false,
},
},
labelLine: {
normal: {
show: false,
length: 20,
length2: 35,
},
emphasis: {
show: true,
},
},
name: "民警训练总量",
data: [
{ name: "居民用户", value: this.diviceNum.juminNum },
{ name: "商业用户", value: this.diviceNum.shangNum },
{ name: "工业用户", value: this.diviceNum.gongNum },
],
},
// 边框的设置
{
name: "外边框",
type: "pie",
clockWise: false, //顺时加载
hoverAnimation: false, //鼠标移入变大
center: ["50%", "50%"],
radius: ["80%", "80%"],
label: {
normal: {
show: false,
},
},
data: [
{
value: 9,
name: "",
itemStyle: {
normal: {
borderWidth: 2,
borderColor: "#61bad3",
},
},
},
],
},
],
});
myChart32.setOption({
color: ["#FF4040", "#F0C41B", "#188DF0"],
grid: {
left: 0,
......@@ -722,22 +850,30 @@ export default {
transform: scale(2.4);
}
}
.outuser {
width: 450px;
height: 60px;
.inuser {
width: 100%;
height: 265px;
}
.outuserone {
.outuserleft {
width: 50%;
height: 100%;
text-align: center;
float: left;
color: #cddbe4;
}
.outusertwo {
.outuserright {
width: 50%;
height: 100%;
text-align: center;
float: right;
}
.outuserone {
width: 100%;
height: 20px;
text-align: center;
color: #cddbe4;
}
.outusertwo {
width: 100%;
height: 20px;
text-align: center;
color: #cddbe4;
}
.outuserspan {
......@@ -748,9 +884,7 @@ export default {
}
.usernum {
width: 100%;
height: 20px;
display: flex;
justify-content: space-around;
text-align: center;
}
.usernumin {
font-size: 15px;
......@@ -764,6 +898,15 @@ export default {
.in3 {
color: #ff4040;
}
.in4 {
color: #91cc75;
}
.in5 {
color: #5470c6;
}
.in6 {
color: #fa8167;
}
.inyuan {
width: 106px;
height: 106px;
......@@ -772,7 +915,7 @@ export default {
position: fixed;
margin-bottom: 10px;
margin-top: -138px;
margin-left: 172px;
margin-left: 64px;
font-size: 15px;
color: #cddbe4;
text-align: center;
......
<!--
* @Author: your name
* @Date: 2022-01-11 13:44:17
* @LastEditTime: 2022-03-07 15:40:59
* @LastEditTime: 2022-03-10 09:12:48
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/views/Home.vue
-->
<template>
<div class="home bigwindow">
<div class="goSystem" @click="$router.push('/index')">进入管理系统</div>
<div id="map"></div>
<Center :show="show" :centerData="centerData" />
<!-- <Center :show="show" :centerData="centerData" /> -->
<UserCenter
:title="centerTitle"
:show="centerShow"
:show="userCenterShow"
ref="userCenter"
:detcetorList="detcetorList"
:userId="centerUserId"
:total="centerTotal"
:pageSize="20"
/>
<OtherCenter
:title="centerTitle"
:show="otherCenterShow"
ref="otherCenter"
:detcetorList="detcetorList"
:userId="centerUserId"
:total="centerTotal"
:pageSize="20"
/>
<PipeColor />
<!-- 底部按钮 -->
<div class="home-div">
......@@ -157,6 +164,7 @@ import {
getUser,
getEnterprise,
userAlarm,
getTcqDevice,
} from "@/api/bigWindow/getDevice";
import Line from "@/components/bigWindow/Line.vue";
import VideoView from "@/components/bigWindow/VideoView.vue";
......@@ -165,6 +173,7 @@ import Cz from "@/components/bigWindow/Cz.vue";
import User from "@/components/bigWindow/User.vue";
import Center from "@/components/bigWindow/Center.vue";
import UserCenter from "@/components/bigWindow/UserCenter.vue";
import OtherCenter from "@/components/bigWindow/OtherCenter.vue";
import Company from "@/components/bigWindow/Company.vue";
import PipeColor from "@/components/bigWindow/PipeColor.vue";
......@@ -176,16 +185,16 @@ export default {
components: {
leftBar,
rightBar,
Center,
// Center,
UserCenter,
OtherCenter,
PipeColor,
},
data() {
return {
map: null,
show: false,
centerData: null,
// centerData: null,
selarr: [1, 2, 3],
weather: "",
lower: "",
......@@ -250,9 +259,13 @@ export default {
detcetorList: [],
centerUserId: null,
centerTotal: null,
centerShow: false,
userCenterShow: false,
centerTitle: "",
// 其他设备的center数据
// 除了这个值,用来显示隐藏,其他值与user共用
otherCenterShow: false,
// 报警轮询timer
alarmTimer: null,
};
......@@ -309,7 +322,7 @@ export default {
this.selarr = this.company.map((item) => item.conpanyId);
this.selarr1 = this.arr.map((item) => item.val);
this.arr.forEach((item) => (item.ischeck = true));
// getPipe() getTyx() getFm() getCz() getVideo() getUser()
await this.goMap(getEnterprise, this.addDevice, Company);
this.goMap(getPipe, this.addPipeLine, Line);
......@@ -354,7 +367,7 @@ export default {
},
goMap(httpFunc, addFunc, component) {
return httpFunc().then((res) => {
// 给用户加icontype
// 给用户加icontype
if (res.data && !res.data[0].iconType) {
res.data.forEach((item) => {
item.iconType = 6;
......@@ -373,7 +386,7 @@ export default {
} else {
config = { data: res.data };
}
console.log("reresresresresresresresresress",config)
console.log("reresresresresresresresresress", config);
addFunc(config, component);
return config.iconType;
......@@ -396,11 +409,11 @@ export default {
myCenterShow(boolean) {
this.show = boolean;
},
centerDataFunc(centerData) {
this.centerData = centerData;
console.log(centerData);
this.show = true;
},
// centerDataFunc(centerData) {
// this.centerData = centerData;
// console.log(centerData);
// this.show = true;
// },
allCompany() {
if (this.selarr.length == this.companyLength) {
......@@ -450,7 +463,7 @@ export default {
this.map.allfilter(this.selarr, this.selarr1);
},
//用户的设备center
getDetectorInfoList(httpFunc,queryParams, title) {
getDetectorInfoList(httpFunc, queryParams, title) {
console.log(queryParams);
return httpFunc(queryParams).then((res) => {
// console.log("queryParams", res);
......@@ -460,13 +473,34 @@ export default {
// 总数据
this.centerTotal = res.total;
// this.$refs.userCenter.fade = "fade";
this.centerShow = true;
this.otherCenterShow = false;
this.userCenterShow = true;
this.centerTitle = title;
// 传递回去
return res.code;
}
});
},
// 调压箱,阀门,场站睇下的设备
getTcqDevice(queryParams, title) {
console.log(queryParams);
return getTcqDevice(queryParams).then((res) => {
// console.log("queryParams", res);
console.log("resresresresreszzzzzzzzzzzzzzz", res);
this.detcetorList = res;
this.centerUserId = queryParams.devId;
// 总数据
this.centerTotal = res.length;
// this.$refs.userCenter.fade = "fade";
this.userCenterShow = false;
this.otherCenterShow = true;
this.centerTitle = title;
// 传递回去
return res.code;
});
},
currentTime() {
setInterval(() => {
this.formatDate();
......
......@@ -75,6 +75,11 @@
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="企业id" align="center" prop="enterpriseId" />-->
<el-table-column label="营业执照" align="center" >
<template scope="List">
<img :src="List.row.doDusiness" width="100px">
</template>
</el-table-column>
<el-table-column label="企业名称" align="center" prop="enterpriseName" />
<el-table-column label="注册地址" align="center" prop="registerAddress" />
<el-table-column label="法定代表人" align="center" prop="legalRepresentative" />
......@@ -83,6 +88,18 @@
<el-table-column label="许可证有效期" align="center" prop="licenseValidityTime" />
<el-table-column label="年度监督检查情况" align="center" prop="annualSupervisionInspection" />
<el-table-column label="备注" align="center" prop="remarks" />
<el-table-column label="营业执照" align="center" >
<template slot-scope="List">
<span
class="dbtn"
@click="checkFile(List.row.doDusiness)"
v-if="List.row.doDusiness != ''"
>
<i class="el-icon el-icon-view"></i>查看/下载
</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -129,6 +146,19 @@
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="营业执照">
<FileUpload
listType="picture"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileList">
</FileUpload>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="法定代表人" prop="legalRepresentative">
......@@ -190,13 +220,20 @@
<script>
import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo } from "@/api/regulation/info";
import FileUpload from '@/components/FileInfoUpload';
export default {
name: "Info",
components: {
FileUpload,
},
data() {
return {
//图片
fileList: [],
//头像数据
fileo :{
name: "",
url:"" },
// 遮罩层
loading: true,
// 导出遮罩层
......@@ -254,6 +291,22 @@ export default {
this.getList();
},
methods: {
/**上传营业执照照片*/
getFileInfo(res){
this.form.dealPlan = res.fileName;
this.form.doDusiness = res.url;
this.fileList.push({
name: res.fileName,
url: uploadfile,
});
},
listRemove(e) {
this.form.dealPlan = "";
this.fileList = [];
},
checkFile(url) {
window.open(url,'_blank');
},
/** 查询企业信息列表 */
getList() {
this.loading = true;
......@@ -284,7 +337,9 @@ export default {
updateBy: null,
updateTime: null,
isDel: null,
remarks: null
remarks: null,
dealPlan:null,
doDusiness: null,
};
this.resetForm("form");
},
......@@ -306,16 +361,25 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.listRemove();
this.reset();
this.open = true;
this.title = "添加企业信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.listRemove();
this.reset();
const enterpriseId = row.enterpriseId || this.ids
getInfo(enterpriseId).then(response => {
this.form = response.data;
//图片回显
if (this.form.doDusiness) {
this.fileList.push({
name: '营业执照',
url: this.form.doDusiness,
});
}
this.open = true;
this.title = "修改企业信息";
});
......@@ -372,3 +436,20 @@ export default {
}
};
</script>
<style>
.dbtn {
display: inline-block;
line-height: normal;
padding-left: 2px;
padding-right: 2px;
cursor: pointer;
border-radius: 3px;
border-style: solid;
border-width: 0;
color: rgb(48, 180, 107);
}
.dbtn:hover {
border-width: 1px;
border-color: rgb(48, 180, 107);
}
</style>
......@@ -83,6 +83,11 @@
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="照片" align="center" >
<template scope="List">
<img :src="List.row.avatarAddress" width="100px">
</template>
</el-table-column>
<el-table-column label="姓名" align="center" prop="employedPeopleName" />
<el-table-column label="身份证号" align="center" prop="idCard" />
<el-table-column label="技能岗位证书编号" align="center" prop="certificateNum" />
......@@ -92,6 +97,18 @@
<el-table-column label="发证日期" align="center" prop="issueDate" />
<el-table-column label="复检日期" align="center" prop="certificateChange" />
<el-table-column label="备注" align="center" prop="remarks" />
<el-table-column label="照片" align="center" >
<template slot-scope="List">
<span
class="dbtn"
@click="checkFile(List.row.avatarAddress)"
v-if="List.row.avatarAddress != ''"
>
<i class="el-icon el-icon-view"></i>查看/下载
</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -139,20 +156,13 @@
<el-row>
<el-col :span="22">
<el-form-item label="上传头像" prop="idCard">
<el-upload
class="upload-demo"
:on-preview="handlePreview"
:on-remove="handleRemove"
:on-change="fileChange"
:before-upload="beforeUploadFile"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/jpeg/png格式,且不超过10MB</div>
</el-upload>
<el-form-item label="上传照片">
<FileUpload
listType="picture"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileList">
</FileUpload>
</el-form-item>
</el-col>
</el-row>
......@@ -232,10 +242,12 @@
<script>
import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo, selectTEnterprise,addFile} from "@/api/regulation/supervise";
import FileUpload from '@/components/FileSuperviseUpload';
export default {
name: "Info",
components: {
FileUpload,
},
data() {
return {
......@@ -297,48 +309,28 @@ export default {
this.getList();
},
methods: {
/**上传头像方法*/
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
},
// 上传文件之前的钩子, 参数为上传的文件,若返回 false 或者返回 Promise 且被 reject,则停止上传
beforeUploadFile(file) {
let extension = file.name.substring(file.name.lastIndexOf('.') + 1);
let size = file.size / 1024 / 1024;
const isIMG =
file.type === 'image/jpg' ||
file.type === 'image/jpeg' ||
file.type === 'image/png'
if (!isIMG) {
this.$message.error('上传头像图片只支持jpg、jpeg、png格式!')
}
if (size > 10) {
this.$message.warning('图片大小不得超过10M');
}
/**上传头像*/
getFileInfo(res){
this.form.dealPlan = res.fileName;
this.form.avatarAddress = res.url;
this.form.burl=res.burl;
this.fileList.push({
name: res.fileName,
url: uploadfile,
burl:res.burl,
});
},
// 文件状态改变时的钩子
fileChange(file, fileList) {
listRemove(e) {
this.form.dealPlan = "";
this.fileList = [];
this.fileo.name=file.name;
this.fileo.url=file.raw;
this.fileList.push(this.fileo);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${ file.name }?`);
this.fileList = [];
checkFile(url) {
window.open(url,'_blank');
},
/** 查询从业人员信息列表 */
getList() {
this.loading = true;
listInfo(this.queryParams).then(response => {
console.log(response.rows)
this.infoList = response.rows;
this.total = response.total;
this.loading = false;
......@@ -368,7 +360,8 @@ export default {
updateBy: null,
updateTime: null,
isDel: null,
remarks: null
remarks: null,
avatarAddress:null,
};
this.resetForm("form");
},
......@@ -408,6 +401,13 @@ export default {
const employedPeopleId = row.employedPeopleId || this.ids
getInfo(employedPeopleId).then(response => {
this.form = response.data;
//图片回显
if (this.form.avatarAddress) {
this.fileList.push({
name: '照片',
url: this.form.avatarAddress,
});
}
this.open = true;
this.title = "修改从业人员信息";
});
......@@ -423,40 +423,12 @@ export default {
this.getList();
});
} else {
// if (this.fileList.length === 0) {
// this.$message.warning('请上传图片');
// } else {
let file= new FormData();
file.append('file', this.fileList[0]);
// axios({
// method: "post",
// url: `${this.url}/transferRelationshipFile`,
// headers: {
// 'Content-type': 'multipart/form-data'
// },
// data: form
// }).then(function (response) {
// loading.close()
// that.$message({
// message: '图片上传完成',
// type: 'success'
// });
// })
//先传图片 返回图片存储地址
addFile(file).then(response => {
//传form表单
addInfo(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
// }
}
}
});
......@@ -491,89 +463,26 @@ export default {
}).catch(() => {});
},
/**
* 文件提交方法
*/
uploadFile() {
let that = this;
//是否清空数据
let accumulate;
if (this.fileList.length === 0) {
this.$message.warning('请上传文件');
} else {
this.$confirm('是否清空现有数据?', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
/**
* 这个是清空方法 走这个
*/
}).then(() => {
accumulate = 0;
this.$message({
type: 'success',
message: '已清空'
});
let form = new FormData();
form.append('file', this.fileList[0]);
const loading = this.$loading({
lock: true,
text: '数据正在上传中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
axios({
method: "post",
url: `${this.url}/transferRelationshipFile?Accumulate=` + accumulate,
headers: {
'Content-type': 'multipart/form-data'
},
data: form
}).then(function (response) {
loading.close()
that.$message({
message: '数据上传完成',
type: 'success'
});
})
/**
* 这个是取消清空方法 走这个
*/
}).catch(() => {
accumulate = 1;
this.$message({
type: 'success',
message: '取消清空',
});
let form = new FormData();
form.append('file', this.fileList[0]);
const loading = this.$loading({
lock: true,
text: '数据正在上传中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
axios({
method: "post",
url: `${this.url}/transferRelationshipFile?Accumulate=` + accumulate,
headers: {
'Content-type': 'multipart/form-data'
},
data: form
}).then(function (response) {
loading.close()
that.$message({
message: '数据上传完成',
type: 'success'
});
})
});
}
},
}
};
</script>
<style>
.dbtn {
display: inline-block;
line-height: normal;
padding-left: 2px;
padding-right: 2px;
cursor: pointer;
border-radius: 3px;
border-style: solid;
border-width: 0;
color: rgb(48, 180, 107);
}
.dbtn:hover {
border-width: 1px;
border-color: rgb(48, 180, 107);
}
</style>
......@@ -34,8 +34,8 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://192.168.2.14:8903/gassafety`,
// target: `http://222.223.203.154:8092/gassafety`,
// target: `http://192.168.2.14:8903/gassafety`,
target: `http://222.223.203.154:8092/gassafety`,
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