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; ...@@ -20,7 +20,7 @@ import com.zehong.framework.config.ServerConfig;
/** /**
* 通用请求处理 * 通用请求处理
* *
* @author zehong * @author zehong
*/ */
@RestController @RestController
...@@ -33,7 +33,7 @@ public class CommonController ...@@ -33,7 +33,7 @@ public class CommonController
/** /**
* 通用下载请求 * 通用下载请求
* *
* @param fileName 文件名称 * @param fileName 文件名称
* @param delete 是否删除 * @param delete 是否删除
*/ */
...@@ -75,8 +75,11 @@ public class CommonController ...@@ -75,8 +75,11 @@ public class CommonController
String filePath = GassafetyProgressConfig.getUploadPath(); String filePath = GassafetyProgressConfig.getUploadPath();
// 上传并返回新文件名称 // 上传并返回新文件名称
String fileName = file.getOriginalFilename(); String fileName = file.getOriginalFilename();
//本地存储地址
// String fileName=filePath+FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + FileUploadUtils.upload(filePath, file); String url = serverConfig.getUrl() + FileUploadUtils.upload(filePath, file);
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
// ajax.put("fileName", fileName);
ajax.put("fileName", fileName); ajax.put("fileName", fileName);
ajax.put("url", url); ajax.put("url", url);
return ajax; return ajax;
......
package com.zehong.web.controller.supervise; package com.zehong.web.controller.supervise;
import com.zehong.common.core.controller.BaseController;
import com.zehong.system.domain.*; import com.zehong.system.domain.*;
import com.zehong.system.service.IPipeInterfaceService; import com.zehong.system.service.IPipeInterfaceService;
import io.swagger.v3.oas.annotations.parameters.RequestBody; import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -15,7 +17,7 @@ import java.util.List; ...@@ -15,7 +17,7 @@ import java.util.List;
@Controller @Controller
@RestController @RestController
@RequestMapping("/pipe/pipe") @RequestMapping("/pipe/pipe")
public class PipeInterfaceController { public class PipeInterfaceController extends BaseController {
@Autowired @Autowired
IPipeInterfaceService iPipeInterfaceService; IPipeInterfaceService iPipeInterfaceService;
...@@ -60,27 +62,30 @@ public class PipeInterfaceController { ...@@ -60,27 +62,30 @@ public class PipeInterfaceController {
public DeviceList selectDeviceDatas(){ public DeviceList selectDeviceDatas(){
//最后返回的封装类型 //最后返回的封装类型
DeviceList deviceList=new DeviceList(); DeviceList deviceList=new DeviceList();
List<DeviceData> list=new ArrayList<>();
//调压箱数据查询方法 //调压箱数据查询方法
List<DeviceData> deviceData = iPipeInterfaceService.selectDeviceData(); List<DeviceData> deviceData = iPipeInterfaceService.selectDeviceData();
//查询下级全部数据方法
List<PressureFlow> pressureFlows1 = iPipeInterfaceService.selectPressureFlows("1");
for (int i=0;i<deviceData.size();i++){ for (int i=0;i<deviceData.size();i++){
deviceData.get(i).setIconType(2); boolean bo=false;
} for (int s=0;s<pressureFlows1.size();s++){
deviceList.setData(deviceData); 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; 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 { ...@@ -306,25 +311,40 @@ public class PipeInterfaceController {
TSiteStationInfoDataList tSiteStationInfoDataList=new TSiteStationInfoDataList(); TSiteStationInfoDataList tSiteStationInfoDataList=new TSiteStationInfoDataList();
//场站信息查询方法 //场站信息查询方法
List<TSiteStationInfoData> tSiteStationInfoData = iPipeInterfaceService.selectTSiteStationInfoData(); List<TSiteStationInfoData> tSiteStationInfoData = iPipeInterfaceService.selectTSiteStationInfoData();
//查询下级全部数据方法
List<PressureFlow> pressureFlows1 = iPipeInterfaceService.selectPressureFlows("2");
List<TSiteStationInfoData> list=new ArrayList<>();
for (int i=0;i<tSiteStationInfoData.size();i++){ 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; return tSiteStationInfoDataList;
} }
/** /**
* 查询场站下级设备关联数据接口 * 查询场站下级设备关联数据接口
* @param SiteStationId * @param deviceId
* @return * @return
*/ */
@RequestBody @RequestBody
@RequestMapping("/selecttSiteStationInfoData") @RequestMapping("/selecttSiteStationInfoData")
public TSiteStationInfoDataList selecttSiteStationInfoData(String SiteStationId){ public TSiteStationInfoDataList selecttSiteStationInfoData(String deviceId){
TSiteStationInfoDataList tSiteStationInfoDataList = new TSiteStationInfoDataList(); TSiteStationInfoDataList tSiteStationInfoDataList = new TSiteStationInfoDataList();
List<TSiteStationInfoData> TSiteStationInfoDataList=new ArrayList<>(); List<TSiteStationInfoData> TSiteStationInfoDataList=new ArrayList<>();
//查询场站下级设备数据 //查询场站下级设备数据
List<PressureFlow> pressureFlows = iPipeInterfaceService.selecttSiteStationInfoDataList(SiteStationId); List<PressureFlow> pressureFlows = iPipeInterfaceService.selecttSiteStationInfoDataList(deviceId);
//临时存储压力表数据数组 //临时存储压力表数据数组
List<PressureFlow> pressureList=new ArrayList<>(); List<PressureFlow> pressureList=new ArrayList<>();
//临时存储流量计数据数组 //临时存储流量计数据数组
...@@ -519,12 +539,25 @@ public class PipeInterfaceController { ...@@ -519,12 +539,25 @@ public class PipeInterfaceController {
public DeviceDataList selectvalveData(){ public DeviceDataList selectvalveData(){
//最后返回的封装类型 //最后返回的封装类型
DeviceDataList deviceDataList=new DeviceDataList(); DeviceDataList deviceDataList=new DeviceDataList();
List<DeviceData> list =new ArrayList<>();
//查询阀门井数据 //查询阀门井数据
List<DeviceData> pipeDates = iPipeInterfaceService.selectvalveData(); List<DeviceData> pipeDates = iPipeInterfaceService.selectvalveData();
//查询下级全部数据方法
List<PressureFlow> pressureFlows1 = iPipeInterfaceService.selectPressureFlows("1");
for (int i=0;i<pipeDates.size();i++){ 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; return deviceDataList;
} }
...@@ -579,4 +612,20 @@ public class PipeInterfaceController { ...@@ -579,4 +612,20 @@ public class PipeInterfaceController {
return deviceDataList; 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; ...@@ -2,9 +2,8 @@ package com.zehong.web.controller.supervise;
import java.io.File; import java.io.File;
import java.text.ParseException; import java.text.ParseException;
import java.util.List; 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.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -16,7 +15,7 @@ import com.zehong.system.domain.TEmployedPeopleInfo; ...@@ -16,7 +15,7 @@ import com.zehong.system.domain.TEmployedPeopleInfo;
import com.zehong.system.service.ITEmployedPeopleInfoService; import com.zehong.system.service.ITEmployedPeopleInfoService;
import com.zehong.common.utils.poi.ExcelUtil; import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo; import com.zehong.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/** /**
* 从业人员信息Controller * 从业人员信息Controller
...@@ -72,7 +71,7 @@ public class TEmployedPeopleInfoController extends BaseController ...@@ -72,7 +71,7 @@ public class TEmployedPeopleInfoController extends BaseController
@PreAuthorize("@ss.hasPermi('regulation:supervise:add')") @PreAuthorize("@ss.hasPermi('regulation:supervise:add')")
@Log(title = "从业人员信息", businessType = BusinessType.INSERT) @Log(title = "从业人员信息", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add( TEmployedPeopleInfo tEmployedPeopleInfo) throws ParseException { public AjaxResult add(@RequestBody TEmployedPeopleInfo tEmployedPeopleInfo) throws ParseException {
//根据企业id查询企业名称 //根据企业id查询企业名称
String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tEmployedPeopleInfo.getBeyondEnterpriseId()); String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tEmployedPeopleInfo.getBeyondEnterpriseId());
tEmployedPeopleInfo.setBeyondEnterpriseName(EnterpriseName); tEmployedPeopleInfo.setBeyondEnterpriseName(EnterpriseName);
...@@ -89,6 +88,20 @@ public class TEmployedPeopleInfoController extends BaseController ...@@ -89,6 +88,20 @@ public class TEmployedPeopleInfoController extends BaseController
//根据企业id查询企业名称 //根据企业id查询企业名称
String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tEmployedPeopleInfo.getBeyondEnterpriseId()); String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tEmployedPeopleInfo.getBeyondEnterpriseId());
tEmployedPeopleInfo.setBeyondEnterpriseName(EnterpriseName); 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)); return toAjax(tEmployedPeopleInfoService.updateTEmployedPeopleInfo(tEmployedPeopleInfo));
} }
...@@ -112,41 +125,5 @@ public class TEmployedPeopleInfoController extends BaseController ...@@ -112,41 +125,5 @@ public class TEmployedPeopleInfoController extends BaseController
return AjaxResult.success(tEmployedPeopleInfoService.selectTEnterprise()); 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; package com.zehong.web.controller.system;
import java.io.File;
import java.util.List; 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.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -20,6 +25,9 @@ import com.zehong.system.service.ITEnterpriseInfoService; ...@@ -20,6 +25,9 @@ import com.zehong.system.service.ITEnterpriseInfoService;
import com.zehong.common.utils.poi.ExcelUtil; import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo; 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 * 企业信息Controller
* *
...@@ -32,7 +40,8 @@ public class TEnterpriseInfoController extends BaseController ...@@ -32,7 +40,8 @@ public class TEnterpriseInfoController extends BaseController
{ {
@Autowired @Autowired
private ITEnterpriseInfoService tEnterpriseInfoService; private ITEnterpriseInfoService tEnterpriseInfoService;
@Autowired
private ServerConfig serverConfig;
/** /**
* 查询企业信息列表 * 查询企业信息列表
*/ */
...@@ -110,6 +119,20 @@ public class TEnterpriseInfoController extends BaseController ...@@ -110,6 +119,20 @@ public class TEnterpriseInfoController extends BaseController
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody TEnterpriseInfo tEnterpriseInfo) 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)); return toAjax(tEnterpriseInfoService.updateTEnterpriseInfo(tEnterpriseInfo));
} }
......
...@@ -7,6 +7,7 @@ import org.springframework.security.authentication.AuthenticationManager; ...@@ -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.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; 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.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UserDetailsService;
...@@ -20,7 +21,7 @@ import com.zehong.framework.security.handle.LogoutSuccessHandlerImpl; ...@@ -20,7 +21,7 @@ import com.zehong.framework.security.handle.LogoutSuccessHandlerImpl;
/** /**
* spring security配置 * spring security配置
* *
* @author zehong * @author zehong
*/ */
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
...@@ -31,7 +32,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter ...@@ -31,7 +32,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
*/ */
@Autowired @Autowired
private UserDetailsService userDetailsService; private UserDetailsService userDetailsService;
/** /**
* 认证失败处理类 * 认证失败处理类
*/ */
...@@ -55,7 +56,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter ...@@ -55,7 +56,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
*/ */
@Autowired @Autowired
private CorsFilter corsFilter; private CorsFilter corsFilter;
/** /**
* 解决 无法直接注入 AuthenticationManager * 解决 无法直接注入 AuthenticationManager
* *
...@@ -125,7 +126,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter ...@@ -125,7 +126,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class); httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class);
} }
/** /**
* 强散列哈希加密实现 * 强散列哈希加密实现
*/ */
...@@ -143,4 +144,14 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter ...@@ -143,4 +144,14 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
{ {
auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder()); 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 ...@@ -65,6 +65,17 @@ public class TEmployedPeopleInfo extends BaseEntity
@Excel(name = "备注") @Excel(name = "备注")
private String remarks; private String remarks;
/** 头像地址 */
private String avatarAddress;
public String getAvatarAddress() {
return avatarAddress;
}
public void setAvatarAddress(String avatarAddress) {
this.avatarAddress = avatarAddress;
}
public void setEmployedPeopleId(Long employedPeopleId) public void setEmployedPeopleId(Long employedPeopleId)
{ {
this.employedPeopleId = employedPeopleId; this.employedPeopleId = employedPeopleId;
...@@ -179,23 +190,20 @@ public class TEmployedPeopleInfo extends BaseEntity ...@@ -179,23 +190,20 @@ public class TEmployedPeopleInfo extends BaseEntity
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return "TEmployedPeopleInfo{" +
.append("employedPeopleId", getEmployedPeopleId()) "employedPeopleId=" + employedPeopleId +
.append("employedPeopleName", getEmployedPeopleName()) ", employedPeopleName='" + employedPeopleName + '\'' +
.append("idCard", getIdCard()) ", idCard='" + idCard + '\'' +
.append("certificateNum", getCertificateNum()) ", certificateNum='" + certificateNum + '\'' +
.append("beyondEnterpriseName", getBeyondEnterpriseName()) ", beyondEnterpriseName='" + beyondEnterpriseName + '\'' +
.append("beyondEnterpriseId", getBeyondEnterpriseId()) ", beyondEnterpriseId=" + beyondEnterpriseId +
.append("registerExaminationType", getRegisterExaminationType()) ", registerExaminationType='" + registerExaminationType + '\'' +
.append("peopleOccupation", getPeopleOccupation()) ", peopleOccupation='" + peopleOccupation + '\'' +
.append("issueDate", getIssueDate()) ", issueDate='" + issueDate + '\'' +
.append("certificateChange", getCertificateChange()) ", certificateChange='" + certificateChange + '\'' +
.append("createBy", getCreateBy()) ", isDel='" + isDel + '\'' +
.append("createTime", getCreateTime()) ", remarks='" + remarks + '\'' +
.append("updateBy", getUpdateBy()) ", avatarAddress='" + avatarAddress + '\'' +
.append("updateTime", getUpdateTime()) '}';
.append("isDel", getIsDel())
.append("remarks", getRemarks())
.toString();
} }
} }
...@@ -64,6 +64,32 @@ public class TEnterpriseInfo extends BaseEntity ...@@ -64,6 +64,32 @@ public class TEnterpriseInfo extends BaseEntity
@Excel(name = "备注") @Excel(name = "备注")
private String remarks; 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) public void setEnterpriseId(Long enterpriseId)
{ {
this.enterpriseId = enterpriseId; this.enterpriseId = enterpriseId;
...@@ -182,21 +208,22 @@ public class TEnterpriseInfo extends BaseEntity ...@@ -182,21 +208,22 @@ public class TEnterpriseInfo extends BaseEntity
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return "TEnterpriseInfo{" +
.append("enterpriseId", getEnterpriseId()) "enterpriseId=" + enterpriseId +
.append("enterpriseName", getEnterpriseName()) ", enterpriseName='" + enterpriseName + '\'' +
.append("registerAddress", getRegisterAddress()) ", registerAddress='" + registerAddress + '\'' +
.append("legalRepresentative", getLegalRepresentative()) ", legalRepresentative='" + legalRepresentative + '\'' +
.append("businessArea", getBusinessArea()) ", businessArea='" + businessArea + '\'' +
.append("licenseKey", getLicenseKey()) ", longitude=" + longitude +
.append("licenseValidityTime", getLicenseValidityTime()) ", latitude=" + latitude +
.append("annualSupervisionInspection", getAnnualSupervisionInspection()) ", iconType='" + iconType + '\'' +
.append("createBy", getCreateBy()) ", licenseKey='" + licenseKey + '\'' +
.append("createTime", getCreateTime()) ", licenseValidityTime='" + licenseValidityTime + '\'' +
.append("updateBy", getUpdateBy()) ", annualSupervisionInspection='" + annualSupervisionInspection + '\'' +
.append("updateTime", getUpdateTime()) ", isDel='" + isDel + '\'' +
.append("isDel", getIsDel()) ", remarks='" + remarks + '\'' +
.append("remarks", getRemarks()) ", doDusiness='" + doDusiness + '\'' +
.toString(); ", burl='" + burl + '\'' +
'}';
} }
} }
...@@ -101,4 +101,25 @@ public interface PipeInterfaceMapper { ...@@ -101,4 +101,25 @@ public interface PipeInterfaceMapper {
* @return * @return
*/ */
int selectInAlarm(List<PressureFlow> pressureList); 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 { ...@@ -98,4 +98,26 @@ public interface IPipeInterfaceService {
* @return * @return
*/ */
int selectInAlarm(List<PressureFlow> pressureList); 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 { ...@@ -161,4 +161,37 @@ public class PipeInterfaceServiceImpl implements IPipeInterfaceService {
int i = pipeInterfaceMapper.selectInAlarm(pressureList); int i = pipeInterfaceMapper.selectInAlarm(pressureList);
return i; 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 @@ ...@@ -83,6 +83,17 @@
<result property="enterpriseName" column="enterprise_name" /> <result property="enterpriseName" column="enterprise_name" />
</resultMap> </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 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 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 @@ ...@@ -181,4 +192,24 @@
</foreach> </foreach>
</select> </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> </mapper>
...@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="employedPeopleId" column="employed_people_id" /> <result property="employedPeopleId" column="employed_people_id" />
<result property="employedPeopleName" column="employed_people_name" /> <result property="employedPeopleName" column="employed_people_name" />
<result property="idCard" column="id_card" /> <result property="idCard" column="id_card" />
<result property="avatarAddress" column="avatar_address" />
<result property="certificateNum" column="certificate_num" /> <result property="certificateNum" column="certificate_num" />
<result property="beyondEnterpriseName" column="beyond_enterprise_name" /> <result property="beyondEnterpriseName" column="beyond_enterprise_name" />
<result property="beyondEnterpriseId" column="beyond_enterprise_id" /> <result property="beyondEnterpriseId" column="beyond_enterprise_id" />
...@@ -45,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -45,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectTEmployedPeopleInfoList" parameterType="TEmployedPeopleInfo" resultMap="TEmployedPeopleInfoResult"> <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> <where>
1=1 and is_del='0' 1=1 and is_del='0'
<if test="employedPeopleName != null and employedPeopleName != ''"> and employed_people_name like concat('%', #{employedPeopleName}, '%')</if> <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" ...@@ -56,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectTEmployedPeopleInfoById" parameterType="Long" resultMap="TEmployedPeopleInfoResult"> <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' where employed_people_id = #{employedPeopleId} and is_del='0'
</select> </select>
...@@ -78,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -78,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if> <if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if> <if test="remarks != null">remarks,</if>
<if test="avatarAddress != null">avatar_address,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="employedPeopleName != null">#{employedPeopleName},</if> <if test="employedPeopleName != null">#{employedPeopleName},</if>
...@@ -95,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -95,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if> <if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if> <if test="remarks != null">#{remarks},</if>
<if test="avatarAddress != null">#{avatarAddress},</if>
</trim> </trim>
</insert> </insert>
...@@ -116,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -116,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if> <if test="isDel != null">is_del = #{isDel},</if>
<if test="remarks != null">remarks = #{remarks},</if> <if test="remarks != null">remarks = #{remarks},</if>
<if test="avatarAddress != null">avatar_address = #{avatarAddress},</if>
</trim> </trim>
where employed_people_id = #{employedPeopleId} where employed_people_id = #{employedPeopleId}
</update> </update>
......
...@@ -22,12 +22,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -22,12 +22,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" /> <result property="isDel" column="is_del" />
<result property="remarks" column="remarks" /> <result property="remarks" column="remarks" />
<result property="doDusiness" column="do_business" />
</resultMap> </resultMap>
<sql id="selectTEnterpriseInfoVo"> <sql id="selectTEnterpriseInfoVo">
select enterprise_id, enterprise_name, register_address, legal_representative, select enterprise_id, enterprise_name, register_address, legal_representative,
business_area, longitude, latitude, icon_type, license_key, license_validity_time, annual_supervision_inspection, 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> </sql>
<select id="selectTEnterpriseInfoList" parameterType="TEnterpriseInfo" resultMap="TEnterpriseInfoResult"> <select id="selectTEnterpriseInfoList" parameterType="TEnterpriseInfo" resultMap="TEnterpriseInfoResult">
...@@ -70,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -70,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if> <if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if> <if test="remarks != null">remarks,</if>
<if test="doDusiness != null">do_business,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="enterpriseName != null">#{enterpriseName},</if> <if test="enterpriseName != null">#{enterpriseName},</if>
...@@ -88,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -88,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if> <if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if> <if test="remarks != null">#{remarks},</if>
<if test="doDusiness != null">#{doDusiness},</if>
</trim> </trim>
</insert> </insert>
...@@ -109,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -109,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remarks != null">remarks = #{remarks},</if> <if test="remarks != null">remarks = #{remarks},</if>
<if test="doDusiness != null">do_business=#{doDusiness},</if>
</trim> </trim>
where enterprise_id = #{enterpriseId} where enterprise_id = #{enterpriseId}
</update> </update>
......
/* /*
* @Author: your name * @Author: your name
* @Date: 2022-02-23 15:28:07 * @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 * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @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 * @FilePath: /newDev/gassafety-progress/gassafetyprogress-web/src/api/bigWindow/getdevice.js
...@@ -70,6 +70,21 @@ export function getCzDevice(query) { ...@@ -70,6 +70,21 @@ export function getCzDevice(query) {
params: 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) { export function getVideo(query) {
return request({ return request({
......
...@@ -18,17 +18,11 @@ export function getInfo(employedPeopleId) { ...@@ -18,17 +18,11 @@ export function getInfo(employedPeopleId) {
} }
// 新增从业人员信息 // 新增从业人员信息
export function addInfo(file,form) { export function addInfo(data) {
return request({ return request({
url: '/regulation/supervise', url: '/regulation/supervise',
method: 'post', method: 'post',
data: { data: data,
file:file,
tEmployedPeopleInfo:form,
},
headers: {
"Content-Type": "multipart/form-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 { ...@@ -121,7 +121,7 @@ export default {
}; };
</script> </script>
<style lang="scss" > <style lang="scss" scoped>
.myCenter { .myCenter {
// width: 978px; // width: 978px;
max-height: 600px; max-height: 600px;
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-01-26 20:07:52 * @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 * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
...@@ -52,8 +52,6 @@ ...@@ -52,8 +52,6 @@
{{ deviceData.remarks }} {{ deviceData.remarks }}
</div> </div>
</div> </div>
</div> </div>
</template> </template>
...@@ -90,7 +88,7 @@ export default { ...@@ -90,7 +88,7 @@ export default {
this.mapClass.infowindowClose(); this.mapClass.infowindowClose();
}, },
btnClick() { btnClick() {
this.vueRoot.centerDataFunc(this.deviceData.pressureFlows); // this.vueRoot.centerDataFunc(this.deviceData.pressureFlows);
}, },
}, },
}; };
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-01-26 20:07:52 * @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 * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
...@@ -105,12 +105,12 @@ export default { ...@@ -105,12 +105,12 @@ export default {
return { return {
companyType, companyType,
deviceType, deviceType,
profile: "暂无", profile: "暂无备注",
typeList: { typeList: {
// 1压力表 2流量计 3探测器 // 1压力表 2流量计 3探测器
1: "压力表", 1: "压力表",
2: "流量计", 2: "流量计",
3: "探测器", 3: "工业探测器",
}, },
list: [ list: [
// { // {
...@@ -167,7 +167,14 @@ export default { ...@@ -167,7 +167,14 @@ export default {
this.mapClass.infowindowClose(); this.mapClass.infowindowClose();
}, },
btnClick() { 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() { myHttp() {
getCzDevice({ deviceId: this.deviceData.siteStationId }).then((res) => { getCzDevice({ deviceId: this.deviceData.siteStationId }).then((res) => {
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-01-26 20:07:52 * @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 * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
...@@ -90,8 +90,8 @@ ...@@ -90,8 +90,8 @@
</template> </template>
</div> </div>
<div class="btn"> <div class="btn" v-if="list.length>0">
<!-- <div @click="btnClick">感知设备</div> --> <div @click="btnClick">感知设备</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -104,12 +104,12 @@ export default { ...@@ -104,12 +104,12 @@ export default {
return { return {
companyType, companyType,
deviceType, deviceType,
profile: "暂无", profile: "暂无备注",
typeList: { typeList: {
// 1压力表 2流量计 3探测器 // 1压力表 2流量计 3探测器
1: "压力表", 1: "压力表",
2: "流量计", 2: "流量计",
3: "探测器", 3: "工业探测器",
}, },
list: [ list: [
// { // {
...@@ -167,7 +167,15 @@ export default { ...@@ -167,7 +167,15 @@ export default {
this.mapClass.infowindowClose(); this.mapClass.infowindowClose();
}, },
btnClick() { 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() { myHttp() {
console.log(this.deviceData.iconType); 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 { ...@@ -143,7 +143,7 @@ export default {
}, },
close() { close() {
// this.fade = "fade"; // this.fade = "fade";
this.$parent.centerShow = false; this.$parent.userCenterShow = false;
}, },
}, },
}; };
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-01-11 13:44:17 * @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 * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/views/Home.vue * @FilePath: /test/hello-world/src/views/Home.vue
--> -->
<template> <template>
<div class="home bigwindow"> <div class="home bigwindow">
<div class="goSystem" @click="$router.push('/index')">进入管理系统</div> <div class="goSystem" @click="$router.push('/index')">进入管理系统</div>
<div id="map"></div> <div id="map"></div>
<Center :show="show" :centerData="centerData" /> <!-- <Center :show="show" :centerData="centerData" /> -->
<UserCenter <UserCenter
:title="centerTitle" :title="centerTitle"
:show="centerShow" :show="userCenterShow"
ref="userCenter" ref="userCenter"
:detcetorList="detcetorList" :detcetorList="detcetorList"
:userId="centerUserId" :userId="centerUserId"
:total="centerTotal" :total="centerTotal"
:pageSize="20" :pageSize="20"
/> />
<OtherCenter
:title="centerTitle"
:show="otherCenterShow"
ref="otherCenter"
:detcetorList="detcetorList"
:userId="centerUserId"
:total="centerTotal"
:pageSize="20"
/>
<PipeColor /> <PipeColor />
<!-- 底部按钮 --> <!-- 底部按钮 -->
<div class="home-div"> <div class="home-div">
...@@ -157,6 +164,7 @@ import { ...@@ -157,6 +164,7 @@ import {
getUser, getUser,
getEnterprise, getEnterprise,
userAlarm, userAlarm,
getTcqDevice,
} from "@/api/bigWindow/getDevice"; } from "@/api/bigWindow/getDevice";
import Line from "@/components/bigWindow/Line.vue"; import Line from "@/components/bigWindow/Line.vue";
import VideoView from "@/components/bigWindow/VideoView.vue"; import VideoView from "@/components/bigWindow/VideoView.vue";
...@@ -165,6 +173,7 @@ import Cz from "@/components/bigWindow/Cz.vue"; ...@@ -165,6 +173,7 @@ import Cz from "@/components/bigWindow/Cz.vue";
import User from "@/components/bigWindow/User.vue"; import User from "@/components/bigWindow/User.vue";
import Center from "@/components/bigWindow/Center.vue"; import Center from "@/components/bigWindow/Center.vue";
import UserCenter from "@/components/bigWindow/UserCenter.vue"; import UserCenter from "@/components/bigWindow/UserCenter.vue";
import OtherCenter from "@/components/bigWindow/OtherCenter.vue";
import Company from "@/components/bigWindow/Company.vue"; import Company from "@/components/bigWindow/Company.vue";
import PipeColor from "@/components/bigWindow/PipeColor.vue"; import PipeColor from "@/components/bigWindow/PipeColor.vue";
...@@ -176,16 +185,16 @@ export default { ...@@ -176,16 +185,16 @@ export default {
components: { components: {
leftBar, leftBar,
rightBar, rightBar,
Center, // Center,
UserCenter, UserCenter,
OtherCenter,
PipeColor, PipeColor,
}, },
data() { data() {
return { return {
map: null, map: null,
show: false, show: false,
centerData: null, // centerData: null,
selarr: [1, 2, 3], selarr: [1, 2, 3],
weather: "", weather: "",
lower: "", lower: "",
...@@ -250,9 +259,13 @@ export default { ...@@ -250,9 +259,13 @@ export default {
detcetorList: [], detcetorList: [],
centerUserId: null, centerUserId: null,
centerTotal: null, centerTotal: null,
centerShow: false, userCenterShow: false,
centerTitle: "", centerTitle: "",
// 其他设备的center数据
// 除了这个值,用来显示隐藏,其他值与user共用
otherCenterShow: false,
// 报警轮询timer // 报警轮询timer
alarmTimer: null, alarmTimer: null,
}; };
...@@ -309,7 +322,7 @@ export default { ...@@ -309,7 +322,7 @@ export default {
this.selarr = this.company.map((item) => item.conpanyId); this.selarr = this.company.map((item) => item.conpanyId);
this.selarr1 = this.arr.map((item) => item.val); this.selarr1 = this.arr.map((item) => item.val);
this.arr.forEach((item) => (item.ischeck = true)); this.arr.forEach((item) => (item.ischeck = true));
// getPipe() getTyx() getFm() getCz() getVideo() getUser() // getPipe() getTyx() getFm() getCz() getVideo() getUser()
await this.goMap(getEnterprise, this.addDevice, Company); await this.goMap(getEnterprise, this.addDevice, Company);
this.goMap(getPipe, this.addPipeLine, Line); this.goMap(getPipe, this.addPipeLine, Line);
...@@ -354,7 +367,7 @@ export default { ...@@ -354,7 +367,7 @@ export default {
}, },
goMap(httpFunc, addFunc, component) { goMap(httpFunc, addFunc, component) {
return httpFunc().then((res) => { return httpFunc().then((res) => {
// 给用户加icontype // 给用户加icontype
if (res.data && !res.data[0].iconType) { if (res.data && !res.data[0].iconType) {
res.data.forEach((item) => { res.data.forEach((item) => {
item.iconType = 6; item.iconType = 6;
...@@ -373,7 +386,7 @@ export default { ...@@ -373,7 +386,7 @@ export default {
} else { } else {
config = { data: res.data }; config = { data: res.data };
} }
console.log("reresresresresresresresresress",config) console.log("reresresresresresresresresress", config);
addFunc(config, component); addFunc(config, component);
return config.iconType; return config.iconType;
...@@ -396,11 +409,11 @@ export default { ...@@ -396,11 +409,11 @@ export default {
myCenterShow(boolean) { myCenterShow(boolean) {
this.show = boolean; this.show = boolean;
}, },
centerDataFunc(centerData) { // centerDataFunc(centerData) {
this.centerData = centerData; // this.centerData = centerData;
console.log(centerData); // console.log(centerData);
this.show = true; // this.show = true;
}, // },
allCompany() { allCompany() {
if (this.selarr.length == this.companyLength) { if (this.selarr.length == this.companyLength) {
...@@ -450,7 +463,7 @@ export default { ...@@ -450,7 +463,7 @@ export default {
this.map.allfilter(this.selarr, this.selarr1); this.map.allfilter(this.selarr, this.selarr1);
}, },
//用户的设备center //用户的设备center
getDetectorInfoList(httpFunc,queryParams, title) { getDetectorInfoList(httpFunc, queryParams, title) {
console.log(queryParams); console.log(queryParams);
return httpFunc(queryParams).then((res) => { return httpFunc(queryParams).then((res) => {
// console.log("queryParams", res); // console.log("queryParams", res);
...@@ -460,13 +473,34 @@ export default { ...@@ -460,13 +473,34 @@ export default {
// 总数据 // 总数据
this.centerTotal = res.total; this.centerTotal = res.total;
// this.$refs.userCenter.fade = "fade"; // this.$refs.userCenter.fade = "fade";
this.centerShow = true; this.otherCenterShow = false;
this.userCenterShow = true;
this.centerTitle = title; this.centerTitle = title;
// 传递回去 // 传递回去
return res.code; 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() { currentTime() {
setInterval(() => { setInterval(() => {
this.formatDate(); this.formatDate();
......
...@@ -75,6 +75,11 @@ ...@@ -75,6 +75,11 @@
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="企业id" align="center" prop="enterpriseId" />--> <!-- <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="enterpriseName" />
<el-table-column label="注册地址" align="center" prop="registerAddress" /> <el-table-column label="注册地址" align="center" prop="registerAddress" />
<el-table-column label="法定代表人" align="center" prop="legalRepresentative" /> <el-table-column label="法定代表人" align="center" prop="legalRepresentative" />
...@@ -83,6 +88,18 @@ ...@@ -83,6 +88,18 @@
<el-table-column label="许可证有效期" align="center" prop="licenseValidityTime" /> <el-table-column label="许可证有效期" align="center" prop="licenseValidityTime" />
<el-table-column label="年度监督检查情况" align="center" prop="annualSupervisionInspection" /> <el-table-column label="年度监督检查情况" align="center" prop="annualSupervisionInspection" />
<el-table-column label="备注" align="center" prop="remarks" /> <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"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
...@@ -129,6 +146,19 @@ ...@@ -129,6 +146,19 @@
</el-col> </el-col>
</el-row> </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-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="法定代表人" prop="legalRepresentative"> <el-form-item label="法定代表人" prop="legalRepresentative">
...@@ -190,13 +220,20 @@ ...@@ -190,13 +220,20 @@
<script> <script>
import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo } from "@/api/regulation/info"; import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo } from "@/api/regulation/info";
import FileUpload from '@/components/FileInfoUpload';
export default { export default {
name: "Info", name: "Info",
components: { components: {
FileUpload,
}, },
data() { data() {
return { return {
//图片
fileList: [],
//头像数据
fileo :{
name: "",
url:"" },
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 导出遮罩层 // 导出遮罩层
...@@ -254,6 +291,22 @@ export default { ...@@ -254,6 +291,22 @@ export default {
this.getList(); this.getList();
}, },
methods: { 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() { getList() {
this.loading = true; this.loading = true;
...@@ -284,7 +337,9 @@ export default { ...@@ -284,7 +337,9 @@ export default {
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
isDel: null, isDel: null,
remarks: null remarks: null,
dealPlan:null,
doDusiness: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -306,16 +361,25 @@ export default { ...@@ -306,16 +361,25 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.listRemove();
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加企业信息"; this.title = "添加企业信息";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.listRemove();
this.reset(); this.reset();
const enterpriseId = row.enterpriseId || this.ids const enterpriseId = row.enterpriseId || this.ids
getInfo(enterpriseId).then(response => { getInfo(enterpriseId).then(response => {
this.form = response.data; this.form = response.data;
//图片回显
if (this.form.doDusiness) {
this.fileList.push({
name: '营业执照',
url: this.form.doDusiness,
});
}
this.open = true; this.open = true;
this.title = "修改企业信息"; this.title = "修改企业信息";
}); });
...@@ -372,3 +436,20 @@ export default { ...@@ -372,3 +436,20 @@ export default {
} }
}; };
</script> </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 @@ ...@@ -83,6 +83,11 @@
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <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="employedPeopleName" />
<el-table-column label="身份证号" align="center" prop="idCard" /> <el-table-column label="身份证号" align="center" prop="idCard" />
<el-table-column label="技能岗位证书编号" align="center" prop="certificateNum" /> <el-table-column label="技能岗位证书编号" align="center" prop="certificateNum" />
...@@ -92,6 +97,18 @@ ...@@ -92,6 +97,18 @@
<el-table-column label="发证日期" align="center" prop="issueDate" /> <el-table-column label="发证日期" align="center" prop="issueDate" />
<el-table-column label="复检日期" align="center" prop="certificateChange" /> <el-table-column label="复检日期" align="center" prop="certificateChange" />
<el-table-column label="备注" align="center" prop="remarks" /> <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"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
...@@ -139,20 +156,13 @@ ...@@ -139,20 +156,13 @@
<el-row> <el-row>
<el-col :span="22"> <el-col :span="22">
<el-form-item label="上传头像" prop="idCard"> <el-form-item label="上传照片">
<el-upload <FileUpload
class="upload-demo" listType="picture"
:on-preview="handlePreview" @resFun="getFileInfo"
:on-remove="handleRemove" @remove="listRemove"
:on-change="fileChange" :fileArr="fileList">
:before-upload="beforeUploadFile" </FileUpload>
: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> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -232,10 +242,12 @@ ...@@ -232,10 +242,12 @@
<script> <script>
import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo, selectTEnterprise,addFile} from "@/api/regulation/supervise"; import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo, selectTEnterprise,addFile} from "@/api/regulation/supervise";
import FileUpload from '@/components/FileSuperviseUpload';
export default { export default {
name: "Info", name: "Info",
components: { components: {
FileUpload,
}, },
data() { data() {
return { return {
...@@ -297,48 +309,28 @@ export default { ...@@ -297,48 +309,28 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
/**上传头像方法*/ /**上传头像*/
handleRemove(file, fileList) { getFileInfo(res){
console.log(file, fileList); this.form.dealPlan = res.fileName;
}, this.form.avatarAddress = res.url;
handlePreview(file) { this.form.burl=res.burl;
console.log(file); this.fileList.push({
}, name: res.fileName,
handleExceed(files, fileList) { url: uploadfile,
this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`); burl:res.burl,
}, });
// 上传文件之前的钩子, 参数为上传的文件,若返回 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');
}
}, },
// 文件状态改变时的钩子 listRemove(e) {
fileChange(file, fileList) { this.form.dealPlan = "";
this.fileList = []; this.fileList = [];
this.fileo.name=file.name;
this.fileo.url=file.raw;
this.fileList.push(this.fileo);
}, },
beforeRemove(file, fileList) { checkFile(url) {
return this.$confirm(`确定移除 ${ file.name }?`); window.open(url,'_blank');
this.fileList = [];
}, },
/** 查询从业人员信息列表 */ /** 查询从业人员信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listInfo(this.queryParams).then(response => { listInfo(this.queryParams).then(response => {
console.log(response.rows)
this.infoList = response.rows; this.infoList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
...@@ -368,7 +360,8 @@ export default { ...@@ -368,7 +360,8 @@ export default {
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
isDel: null, isDel: null,
remarks: null remarks: null,
avatarAddress:null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -408,6 +401,13 @@ export default { ...@@ -408,6 +401,13 @@ export default {
const employedPeopleId = row.employedPeopleId || this.ids const employedPeopleId = row.employedPeopleId || this.ids
getInfo(employedPeopleId).then(response => { getInfo(employedPeopleId).then(response => {
this.form = response.data; this.form = response.data;
//图片回显
if (this.form.avatarAddress) {
this.fileList.push({
name: '照片',
url: this.form.avatarAddress,
});
}
this.open = true; this.open = true;
this.title = "修改从业人员信息"; this.title = "修改从业人员信息";
}); });
...@@ -423,40 +423,12 @@ export default { ...@@ -423,40 +423,12 @@ export default {
this.getList(); this.getList();
}); });
} else { } 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表单 //传form表单
addInfo(this.form).then(response => { addInfo(this.form).then(response => {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
});
// }
} }
} }
}); });
...@@ -491,89 +463,26 @@ export default { ...@@ -491,89 +463,26 @@ export default {
}).catch(() => {}); }).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> </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 = { ...@@ -34,8 +34,8 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://192.168.2.14:8903/gassafety`, // target: `http://192.168.2.14:8903/gassafety`,
// target: `http://222.223.203.154:8092/gassafety`, target: `http://222.223.203.154:8092/gassafety`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + 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