Commit 9eb47dd7 authored by wanghao's avatar wanghao

1 扫码绑定托盘,上料,机械臂整体测试

parent 3efab788
...@@ -72,6 +72,14 @@ public class PalletDeviceBindingController extends BaseController ...@@ -72,6 +72,14 @@ public class PalletDeviceBindingController extends BaseController
return AjaxResult.success(palletDeviceBindingService.selectPalletDeviceBindingById(palletDeviceBindingId)); return AjaxResult.success(palletDeviceBindingService.selectPalletDeviceBindingById(palletDeviceBindingId));
} }
/**
* 重置所有托盘绑定的设备列
*/
@GetMapping("/resetAll/{trayId}")
public AjaxResult resetAll(@PathVariable("trayId") Long trayId) {
return AjaxResult.success(palletDeviceBindingService.resetAll(trayId));
}
/** /**
* 新增托盘绑定的设备列 * 新增托盘绑定的设备列
*/ */
......
...@@ -43,6 +43,14 @@ public class TEquipmentInfoController extends BaseController ...@@ -43,6 +43,14 @@ public class TEquipmentInfoController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
* 获取生产设备信息列表
*/
@GetMapping("/getAllEquipmentList")
public List<TEquipmentInfo> getAllEquipmentList() {
return tEquipmentInfoService.getAllEquipmentList();
}
/** /**
* 导出生产设备信息列表 * 导出生产设备信息列表
*/ */
......
package com.zehong.web.controller.equipment; package com.zehong.web.controller.equipment;
import java.util.List; import java.util.List;
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;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -11,10 +10,8 @@ import org.springframework.web.bind.annotation.PathVariable; ...@@ -11,10 +10,8 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController; import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult; import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TTrayInfo; import com.zehong.system.domain.TTrayInfo;
import com.zehong.system.service.ITTrayInfoService; import com.zehong.system.service.ITTrayInfoService;
import com.zehong.common.utils.poi.ExcelUtil; import com.zehong.common.utils.poi.ExcelUtil;
...@@ -36,7 +33,6 @@ public class TTrayInfoController extends BaseController ...@@ -36,7 +33,6 @@ public class TTrayInfoController extends BaseController
/** /**
* 查询托盘信息列表 * 查询托盘信息列表
*/ */
@PreAuthorize("@ss.hasPermi('tray:tray:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(TTrayInfo tTrayInfo) public TableDataInfo list(TTrayInfo tTrayInfo)
{ {
...@@ -48,8 +44,6 @@ public class TTrayInfoController extends BaseController ...@@ -48,8 +44,6 @@ public class TTrayInfoController extends BaseController
/** /**
* 导出托盘信息列表 * 导出托盘信息列表
*/ */
@PreAuthorize("@ss.hasPermi('tray:tray:export')")
@Log(title = "托盘信息", businessType = BusinessType.EXPORT)
@GetMapping("/export") @GetMapping("/export")
public AjaxResult export(TTrayInfo tTrayInfo) public AjaxResult export(TTrayInfo tTrayInfo)
{ {
...@@ -61,7 +55,6 @@ public class TTrayInfoController extends BaseController ...@@ -61,7 +55,6 @@ public class TTrayInfoController extends BaseController
/** /**
* 获取托盘信息详细信息 * 获取托盘信息详细信息
*/ */
@PreAuthorize("@ss.hasPermi('tray:tray:query')")
@GetMapping(value = "/{fTrayId}") @GetMapping(value = "/{fTrayId}")
public AjaxResult getInfo(@PathVariable("fTrayId") Long fTrayId) public AjaxResult getInfo(@PathVariable("fTrayId") Long fTrayId)
{ {
...@@ -71,8 +64,6 @@ public class TTrayInfoController extends BaseController ...@@ -71,8 +64,6 @@ public class TTrayInfoController extends BaseController
/** /**
* 新增托盘信息 * 新增托盘信息
*/ */
@PreAuthorize("@ss.hasPermi('tray:tray:add')")
@Log(title = "托盘信息", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TTrayInfo tTrayInfo) public AjaxResult add(@RequestBody TTrayInfo tTrayInfo)
{ {
...@@ -82,8 +73,6 @@ public class TTrayInfoController extends BaseController ...@@ -82,8 +73,6 @@ public class TTrayInfoController extends BaseController
/** /**
* 修改托盘信息 * 修改托盘信息
*/ */
@PreAuthorize("@ss.hasPermi('tray:tray:edit')")
@Log(title = "托盘信息", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody TTrayInfo tTrayInfo) public AjaxResult edit(@RequestBody TTrayInfo tTrayInfo)
{ {
...@@ -93,8 +82,6 @@ public class TTrayInfoController extends BaseController ...@@ -93,8 +82,6 @@ public class TTrayInfoController extends BaseController
/** /**
* 删除托盘信息 * 删除托盘信息
*/ */
@PreAuthorize("@ss.hasPermi('tray:tray:remove')")
@Log(title = "托盘信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{fTrayIds}") @DeleteMapping("/{fTrayIds}")
public AjaxResult remove(@PathVariable Long[] fTrayIds) public AjaxResult remove(@PathVariable Long[] fTrayIds)
{ {
......
...@@ -26,7 +26,7 @@ spring: ...@@ -26,7 +26,7 @@ spring:
# 国际化资源文件路径 # 国际化资源文件路径
basename: i18n/messages basename: i18n/messages
profiles: profiles:
active: dev active: test
# 文件上传 # 文件上传
servlet: servlet:
multipart: multipart:
......
...@@ -78,6 +78,11 @@ public class TEquipmentInfo extends BaseEntity ...@@ -78,6 +78,11 @@ public class TEquipmentInfo extends BaseEntity
@Excel(name = "状态:0空闲,1运行,2故障") @Excel(name = "状态:0空闲,1运行,2故障")
private String fStatus; private String fStatus;
/**
* 故障原因
*/
private String errorReason;
/** 报警时间 */ /** 报警时间 */
@Excel(name = "报警时间") @Excel(name = "报警时间")
private String fAlarmTime; private String fAlarmTime;
...@@ -250,6 +255,14 @@ public class TEquipmentInfo extends BaseEntity ...@@ -250,6 +255,14 @@ public class TEquipmentInfo extends BaseEntity
this.fPowerOutagePort = fPowerOutagePort; this.fPowerOutagePort = fPowerOutagePort;
} }
public String getErrorReason() {
return errorReason;
}
public void setErrorReason(String errorReason) {
this.errorReason = errorReason;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
...@@ -32,6 +32,8 @@ public class TTrayInfo extends BaseEntity ...@@ -32,6 +32,8 @@ public class TTrayInfo extends BaseEntity
@Excel(name = "状态:0.空闲 1.运行") @Excel(name = "状态:0.空闲 1.运行")
private String fStatus; private String fStatus;
/** 绑定设备数 */
private Long boardCount;
/** 绑定时间 */ /** 绑定时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "绑定时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "绑定时间", width = 30, dateFormat = "yyyy-MM-dd")
...@@ -111,6 +113,14 @@ public class TTrayInfo extends BaseEntity ...@@ -111,6 +113,14 @@ public class TTrayInfo extends BaseEntity
return fCreateTime; return fCreateTime;
} }
public Long getBoardCount() {
return boardCount;
}
public void setBoardCount(Long boardCount) {
this.boardCount = boardCount;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
...@@ -44,6 +44,8 @@ public interface PalletDeviceBindingMapper ...@@ -44,6 +44,8 @@ public interface PalletDeviceBindingMapper
*/ */
public int insertPalletDeviceBinding(PalletDeviceBinding palletDeviceBinding); public int insertPalletDeviceBinding(PalletDeviceBinding palletDeviceBinding);
public int resetAll(Long trayId);
public int batchInsertPalletDeviceBinding(@Param("palletDeviceBindingList") List<PalletDeviceBinding> palletDeviceBindingList); public int batchInsertPalletDeviceBinding(@Param("palletDeviceBindingList") List<PalletDeviceBinding> palletDeviceBindingList);
/** /**
......
...@@ -37,6 +37,8 @@ public interface TTrayInfoMapper ...@@ -37,6 +37,8 @@ public interface TTrayInfoMapper
*/ */
public int insertTTrayInfo(TTrayInfo tTrayInfo); public int insertTTrayInfo(TTrayInfo tTrayInfo);
public int batchInsertTTrayInfo(List<TTrayInfo> tTrayInfoList);
/** /**
* 修改托盘信息 * 修改托盘信息
* *
......
...@@ -175,14 +175,25 @@ public class Modbus4jUtils { ...@@ -175,14 +175,25 @@ public class Modbus4jUtils {
* @throws ModbusTransportException * @throws ModbusTransportException
* @throws ErrorResponseException * @throws ErrorResponseException
*/ */
public static boolean[] getRoboticArmEntryConveyorData() throws ModbusTransportException, ModbusInitException { public static boolean[] getRoboticArmEntryConveyorData(){
ModbusMaster master = getMaster("192.168.2.11", 502);
boolean[] booleans = readDiscreteInputs(master, 1, 0, 2);
if(master != null) { ModbusMaster master = null;
master.destroy(); try {
master = getMaster("192.168.2.11", 502);
boolean[] booleans = readDiscreteInputs(master, 1, 0, 2);
if(master != null) {
master.destroy();
}
return booleans;
} catch (ModbusTransportException | ModbusInitException e) {
return new boolean[]{false, false}; // 示例数据
} finally {
if(master != null) {
master.destroy();
}
} }
return booleans;
} }
/** /**
...@@ -193,14 +204,24 @@ public class Modbus4jUtils { ...@@ -193,14 +204,24 @@ public class Modbus4jUtils {
* @throws ModbusTransportException * @throws ModbusTransportException
* @throws ErrorResponseException * @throws ErrorResponseException
*/ */
public static boolean[] getRoboticArmExitConveyorData() throws ModbusTransportException, ModbusInitException { public static boolean[] getRoboticArmExitConveyorData() {
ModbusMaster master = getMaster("192.168.2.12", 502); ModbusMaster master = null;
boolean[] booleans = readDiscreteInputs(master, 1, 0, 2); try {
master = getMaster("192.168.2.12", 502);
boolean[] booleans = readDiscreteInputs(master, 1, 0, 2);
if(master != null) { if(master != null) {
master.destroy(); master.destroy();
}
return booleans;
} catch (ModbusTransportException | ModbusInitException e) {
return new boolean[]{false, false}; // 示例数据
} finally {
if(master != null) {
master.destroy();
}
} }
return booleans;
} }
/** /**
......
...@@ -35,6 +35,8 @@ public interface IPalletDeviceBindingService ...@@ -35,6 +35,8 @@ public interface IPalletDeviceBindingService
*/ */
public int insertPalletDeviceBinding(PalletDeviceBinding palletDeviceBinding); public int insertPalletDeviceBinding(PalletDeviceBinding palletDeviceBinding);
public int resetAll(Long trayId);
public int batchInsertPalletDeviceBinding(List<PalletDeviceBinding> palletDeviceBindingList); public int batchInsertPalletDeviceBinding(List<PalletDeviceBinding> palletDeviceBindingList);
public int batchUpdateDeviceCode(List<PalletDeviceBinding> palletDeviceBindingList); public int batchUpdateDeviceCode(List<PalletDeviceBinding> palletDeviceBindingList);
......
...@@ -30,6 +30,8 @@ public interface ITEquipmentInfoService ...@@ -30,6 +30,8 @@ public interface ITEquipmentInfoService
*/ */
public List<TEquipmentInfo> selectTEquipmentInfoList(TEquipmentInfo tEquipmentInfo); public List<TEquipmentInfo> selectTEquipmentInfoList(TEquipmentInfo tEquipmentInfo);
public List<TEquipmentInfo> getAllEquipmentList();
/** /**
* 查询老化柜、标定柜信息列表 * 查询老化柜、标定柜信息列表
* *
......
...@@ -35,6 +35,7 @@ public interface ITTrayInfoService ...@@ -35,6 +35,7 @@ public interface ITTrayInfoService
*/ */
public int insertTTrayInfo(TTrayInfo tTrayInfo); public int insertTTrayInfo(TTrayInfo tTrayInfo);
public int batchInsertTTrayInfo(List<TTrayInfo> tTrayInfoList);
/** /**
* 修改托盘信息 * 修改托盘信息
* *
......
...@@ -58,6 +58,17 @@ public class PalletDeviceBindingServiceImpl implements IPalletDeviceBindingServi ...@@ -58,6 +58,17 @@ public class PalletDeviceBindingServiceImpl implements IPalletDeviceBindingServi
return palletDeviceBindingMapper.insertPalletDeviceBinding(palletDeviceBinding); return palletDeviceBindingMapper.insertPalletDeviceBinding(palletDeviceBinding);
} }
/**
* 重置所有托盘绑定的设备列
*
* @param trayId 托盘ID
* @return 结果
*/
@Override
public int resetAll(Long trayId) {
return palletDeviceBindingMapper.resetAll(trayId);
}
/** /**
* 批量添加托盘绑定的设备列 * 批量添加托盘绑定的设备列
* *
...@@ -69,6 +80,7 @@ public class PalletDeviceBindingServiceImpl implements IPalletDeviceBindingServi ...@@ -69,6 +80,7 @@ public class PalletDeviceBindingServiceImpl implements IPalletDeviceBindingServi
palletDeviceBindingList.forEach(palletDeviceBinding -> { palletDeviceBindingList.forEach(palletDeviceBinding -> {
palletDeviceBinding.setUpdateTime(DateUtils.getNowDate()); palletDeviceBinding.setUpdateTime(DateUtils.getNowDate());
palletDeviceBinding.setCreateTime(DateUtils.getNowDate()); palletDeviceBinding.setCreateTime(DateUtils.getNowDate());
palletDeviceBinding.setBindingTime(DateUtils.getNowDate());
}); });
return palletDeviceBindingMapper.batchInsertPalletDeviceBinding(palletDeviceBindingList); return palletDeviceBindingMapper.batchInsertPalletDeviceBinding(palletDeviceBindingList);
} }
......
...@@ -12,6 +12,7 @@ import com.zehong.system.domain.TStoreyInfo; ...@@ -12,6 +12,7 @@ import com.zehong.system.domain.TStoreyInfo;
import com.zehong.system.domain.TTrayInfo; import com.zehong.system.domain.TTrayInfo;
import com.zehong.system.mapper.TStoreyInfoMapper; import com.zehong.system.mapper.TStoreyInfoMapper;
import com.zehong.system.mapper.TTrayInfoMapper; import com.zehong.system.mapper.TTrayInfoMapper;
import com.zehong.system.modbus.util.Modbus4jUtils;
import com.zehong.system.netty.handler.NettyUdpServerHandler; import com.zehong.system.netty.handler.NettyUdpServerHandler;
import com.zehong.system.service.websocket.RobotArmWebSocketHandler; import com.zehong.system.service.websocket.RobotArmWebSocketHandler;
import com.zehong.system.udp.UdpCommandSender; import com.zehong.system.udp.UdpCommandSender;
...@@ -76,15 +77,23 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService ...@@ -76,15 +77,23 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
List<RobotArmCommand> loadingCommands = List<RobotArmCommand> loadingCommands =
robotArmCommandMapper.selectPendingLoadingCommands(); robotArmCommandMapper.selectPendingLoadingCommands();
if (!loadingCommands.isEmpty()) { if (!loadingCommands.isEmpty()) {
sendCommand(loadingCommands.get(0), "LOAD");
return; boolean[] roboticArmEntryConveyorData = Modbus4jUtils.getRoboticArmEntryConveyorData();
if(roboticArmEntryConveyorData[1]) {
sendCommand(loadingCommands.get(0), "LOAD");
return;
}
} }
// 2. 处理待执行的下料指令 // 2. 处理待执行的下料指令
List<RobotArmCommand> unloadingCommands = List<RobotArmCommand> unloadingCommands =
robotArmCommandMapper.selectPendingUnloadingCommands(); robotArmCommandMapper.selectPendingUnloadingCommands();
if (!unloadingCommands.isEmpty()) { if (!unloadingCommands.isEmpty()) {
sendCommand(unloadingCommands.get(0), "UNLOAD");
boolean[] roboticArmExitConveyorData = Modbus4jUtils.getRoboticArmExitConveyorData();
if(roboticArmExitConveyorData[1]) {
sendCommand(unloadingCommands.get(0), "UNLOAD");
}
} }
} }
...@@ -200,6 +209,10 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService ...@@ -200,6 +209,10 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
TTrayInfo tTrayInfo = tTrayInfoMapper.selectTTrayInfoByCode(robotArmCommand.getTrayCode()); TTrayInfo tTrayInfo = tTrayInfoMapper.selectTTrayInfoByCode(robotArmCommand.getTrayCode());
if(tTrayInfo == null) {
throw new RuntimeException("托盘不存在");
}
if(!"0".equals(tTrayInfo.getfStatus())) { if(!"0".equals(tTrayInfo.getfStatus())) {
throw new RuntimeException("托盘未解绑,请联系管理员"); throw new RuntimeException("托盘未解绑,请联系管理员");
} }
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TTrayInfo;
import com.zehong.system.mapper.*;
import com.zehong.system.service.ITTrayInfoService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -17,14 +22,11 @@ import com.zehong.common.utils.StringUtils; ...@@ -17,14 +22,11 @@ import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.SysPost; import com.zehong.system.domain.SysPost;
import com.zehong.system.domain.SysUserPost; import com.zehong.system.domain.SysUserPost;
import com.zehong.system.domain.SysUserRole; import com.zehong.system.domain.SysUserRole;
import com.zehong.system.mapper.SysPostMapper;
import com.zehong.system.mapper.SysRoleMapper;
import com.zehong.system.mapper.SysUserMapper;
import com.zehong.system.mapper.SysUserPostMapper;
import com.zehong.system.mapper.SysUserRoleMapper;
import com.zehong.system.service.ISysConfigService; import com.zehong.system.service.ISysConfigService;
import com.zehong.system.service.ISysUserService; import com.zehong.system.service.ISysUserService;
import javax.annotation.Resource;
/** /**
* 用户 业务层处理 * 用户 业务层处理
* *
...@@ -53,6 +55,9 @@ public class SysUserServiceImpl implements ISysUserService ...@@ -53,6 +55,9 @@ public class SysUserServiceImpl implements ISysUserService
@Autowired @Autowired
private ISysConfigService configService; private ISysConfigService configService;
@Resource
private ITTrayInfoService trayInfoService;
/** /**
* 根据条件分页查询用户列表 * 根据条件分页查询用户列表
* *
......
...@@ -4,13 +4,15 @@ import java.util.ArrayList; ...@@ -4,13 +4,15 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import com.sun.org.apache.xpath.internal.operations.Mod;
import com.zehong.system.domain.modbus.ModbusDeviceData; import com.zehong.system.domain.modbus.ModbusDeviceData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TEquipmentInfoMapper; import com.zehong.system.mapper.TEquipmentInfoMapper;
import com.zehong.system.domain.TEquipmentInfo; import com.zehong.system.domain.TEquipmentInfo;
import com.zehong.system.service.ITEquipmentInfoService; import com.zehong.system.service.ITEquipmentInfoService;
import javax.annotation.Resource;
/** /**
* 生产设备信息Service业务层处理 * 生产设备信息Service业务层处理
* *
...@@ -20,7 +22,7 @@ import com.zehong.system.service.ITEquipmentInfoService; ...@@ -20,7 +22,7 @@ import com.zehong.system.service.ITEquipmentInfoService;
@Service @Service
public class TEquipmentInfoServiceImpl implements ITEquipmentInfoService public class TEquipmentInfoServiceImpl implements ITEquipmentInfoService
{ {
@Autowired @Resource
private TEquipmentInfoMapper tEquipmentInfoMapper; private TEquipmentInfoMapper tEquipmentInfoMapper;
/** /**
...@@ -47,6 +49,12 @@ public class TEquipmentInfoServiceImpl implements ITEquipmentInfoService ...@@ -47,6 +49,12 @@ public class TEquipmentInfoServiceImpl implements ITEquipmentInfoService
return tEquipmentInfoMapper.selectTEquipmentInfoList(tEquipmentInfo); return tEquipmentInfoMapper.selectTEquipmentInfoList(tEquipmentInfo);
} }
@Override
public List<TEquipmentInfo> getAllEquipmentList() {
return tEquipmentInfoMapper.selectTEquipmentInfoList(null);
}
/** /**
* 查询老化柜、标定柜信息列表 * 查询老化柜、标定柜信息列表
* *
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TTrayInfoMapper; import com.zehong.system.mapper.TTrayInfoMapper;
import com.zehong.system.domain.TTrayInfo; import com.zehong.system.domain.TTrayInfo;
import com.zehong.system.service.ITTrayInfoService; import com.zehong.system.service.ITTrayInfoService;
import javax.annotation.Resource;
/** /**
* 托盘信息Service业务层处理 * 托盘信息Service业务层处理
* *
...@@ -16,7 +17,7 @@ import com.zehong.system.service.ITTrayInfoService; ...@@ -16,7 +17,7 @@ import com.zehong.system.service.ITTrayInfoService;
@Service @Service
public class TTrayInfoServiceImpl implements ITTrayInfoService public class TTrayInfoServiceImpl implements ITTrayInfoService
{ {
@Autowired @Resource
private TTrayInfoMapper tTrayInfoMapper; private TTrayInfoMapper tTrayInfoMapper;
/** /**
...@@ -55,6 +56,17 @@ public class TTrayInfoServiceImpl implements ITTrayInfoService ...@@ -55,6 +56,17 @@ public class TTrayInfoServiceImpl implements ITTrayInfoService
return tTrayInfoMapper.insertTTrayInfo(tTrayInfo); return tTrayInfoMapper.insertTTrayInfo(tTrayInfo);
} }
/**
* 批量新增托盘信息
*
* @param tTrayInfoList 托盘信息
* @return 批量结果
*/
@Override
public int batchInsertTTrayInfo(List<TTrayInfo> tTrayInfoList) {
return tTrayInfoMapper.batchInsertTTrayInfo(tTrayInfoList);
}
/** /**
* 修改托盘信息 * 修改托盘信息
* *
......
...@@ -83,6 +83,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -83,6 +83,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) )
</foreach> </foreach>
</insert> </insert>
<update id="resetAll" parameterType="long">
update t_pallet_device_binding
set f_device_code = null,f_binding_time = null
where f_tray_id = #{trayId}
</update>
<insert id="insertPalletDeviceBinding" parameterType="PalletDeviceBinding" useGeneratedKeys="true" keyProperty="palletDeviceBindingId"> <insert id="insertPalletDeviceBinding" parameterType="PalletDeviceBinding" useGeneratedKeys="true" keyProperty="palletDeviceBindingId">
insert into t_pallet_device_binding insert into t_pallet_device_binding
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
......
...@@ -23,12 +23,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -23,12 +23,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="fAlarmTime" column="f_alarm_time" /> <result property="fAlarmTime" column="f_alarm_time" />
<result property="fPowerOutageIp" column="f_power_outage_ip" /> <result property="fPowerOutageIp" column="f_power_outage_ip" />
<result property="fPowerOutagePort" column="f_power_outage_port" /> <result property="fPowerOutagePort" column="f_power_outage_port" />
<result property="errorReason" column="f_error_Reason" />
</resultMap> </resultMap>
<sql id="selectTEquipmentInfoVo"> <sql id="selectTEquipmentInfoVo">
select f_equipment_id, f_equipment_code, f_equipment_name, f_equipment_type, f_equipment_factory, select f_equipment_id, f_equipment_code, f_equipment_name, f_equipment_type, f_equipment_factory,
f_beyong_department, f_ip, f_port, f_install_location, f_is_inspect, f_responsible_person, f_beyong_department, f_ip, f_port, f_install_location, f_is_inspect, f_responsible_person,
f_responsible_person_mobile, f_create_time, f_update_time, f_status, f_alarm_time, f_power_outage_ip, f_power_outage_port from t_equipment_info f_responsible_person_mobile, f_create_time, f_update_time, f_status, f_alarm_time, f_power_outage_ip,
f_power_outage_port,f_error_Reason from t_equipment_info
</sql> </sql>
<select id="selectTEquipmentInfoList" parameterType="TEquipmentInfo" resultMap="TEquipmentInfoResult"> <select id="selectTEquipmentInfoList" parameterType="TEquipmentInfo" resultMap="TEquipmentInfoResult">
...@@ -83,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -83,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fUpdateTime != null">f_update_time,</if> <if test="fUpdateTime != null">f_update_time,</if>
<if test="fStatus != null">f_status,</if> <if test="fStatus != null">f_status,</if>
<if test="fAlarmTime != null">f_alarm_time,</if> <if test="fAlarmTime != null">f_alarm_time,</if>
<if test="errorReason != null">f_error_Reason,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fEquipmentCode != null">#{fEquipmentCode},</if> <if test="fEquipmentCode != null">#{fEquipmentCode},</if>
...@@ -100,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -100,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fUpdateTime != null">#{fUpdateTime},</if> <if test="fUpdateTime != null">#{fUpdateTime},</if>
<if test="fStatus != null">#{fStatus},</if> <if test="fStatus != null">#{fStatus},</if>
<if test="fAlarmTime != null">#{fAlarmTime},</if> <if test="fAlarmTime != null">#{fAlarmTime},</if>
<if test="errorReason != null">#{errorReason},</if>
</trim> </trim>
</insert> </insert>
...@@ -121,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -121,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fUpdateTime != null">f_update_time = #{fUpdateTime},</if> <if test="fUpdateTime != null">f_update_time = #{fUpdateTime},</if>
<if test="fStatus != null">f_status = #{fStatus},</if> <if test="fStatus != null">f_status = #{fStatus},</if>
<if test="fAlarmTime != null">f_alarm_time = #{fAlarmTime},</if> <if test="fAlarmTime != null">f_alarm_time = #{fAlarmTime},</if>
<if test="errorReason != null">f_error_Reason = #{errorReason},</if>
</trim> </trim>
where f_equipment_id = #{fEquipmentId} where f_equipment_id = #{fEquipmentId}
</update> </update>
......
...@@ -15,13 +15,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -15,13 +15,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTTrayInfoVo"> <sql id="selectTTrayInfoVo">
select f_tray_id, f_tray_code, f_storey_code, f_status, f_binding_time, f_unbinding_time, f_create_time from t_tray_info SELECT
f_tray_id,
f_tray_code,
f_storey_code,
f_status,
f_binding_time,
f_unbinding_time,
f_create_time,
(
SELECT
count( 1 )
FROM
t_pallet_device_binding
WHERE
f_tray_id = t_tray_info.f_tray_id
AND ( f_device_code <![CDATA[<>]]> '' )
AND f_unbinding_time IS NULL
) AS boardCount
FROM
t_tray_info
</sql> </sql>
<select id="selectTTrayInfoList" parameterType="TTrayInfo" resultMap="TTrayInfoResult"> <select id="selectTTrayInfoList" parameterType="TTrayInfo" resultMap="TTrayInfoResult">
<include refid="selectTTrayInfoVo"/> <include refid="selectTTrayInfoVo"/>
<where> <where>
<if test="fTrayCode != null and fTrayCode != ''"> and f_tray_code = #{fTrayCode}</if> <if test="fTrayCode != null and fTrayCode != ''"> and f_tray_code like concat('%',#{fTrayCode},'%')</if>
<if test="fStoreyCode != null and fStoreyCode != ''"> and f_storey_code = #{fStoreyCode}</if> <if test="fStoreyCode != null and fStoreyCode != ''"> and f_storey_code = #{fStoreyCode}</if>
<if test="fStatus != null and fStatus != ''"> and f_status = #{fStatus}</if> <if test="fStatus != null and fStatus != ''"> and f_status = #{fStatus}</if>
<if test="fBindingTime != null "> and f_binding_time = #{fBindingTime}</if> <if test="fBindingTime != null "> and f_binding_time = #{fBindingTime}</if>
...@@ -59,6 +78,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -59,6 +78,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
</insert> </insert>
<insert id="batchInsertTTrayInfo" parameterType="list" >
insert into t_tray_info (f_tray_code, f_storey_code, f_status, f_binding_time, f_unbinding_time, f_create_time) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.fTrayCode}, #{item.fStoreyCode}, #{item.fStatus}, #{item.fBindingTime}, #{item.fUnbindingTime}, #{item.fCreateTime})
</foreach>
</insert>
<update id="updateTTrayInfo" parameterType="TTrayInfo"> <update id="updateTTrayInfo" parameterType="TTrayInfo">
update t_tray_info update t_tray_info
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
......
...@@ -9,6 +9,14 @@ export function listEquipment(query) { ...@@ -9,6 +9,14 @@ export function listEquipment(query) {
}) })
} }
// 查询生产设备信息列表
export function getAllEquipmentList() {
return request({
url: '/equipment/getAllEquipmentList',
method: 'get'
})
}
// 查询生产设备信息详细 // 查询生产设备信息详细
export function getEquipment(fEquipmentId) { export function getEquipment(fEquipmentId) {
return request({ return request({
......
...@@ -70,6 +70,14 @@ export function delBinding(palletDeviceBindingId) { ...@@ -70,6 +70,14 @@ export function delBinding(palletDeviceBindingId) {
}) })
} }
// 删除托盘绑定的设备列
export function resetAll(trayId) {
return request({
url: '/palletDevice/binding/resetAll/' + trayId,
method: 'get'
})
}
// 导出托盘绑定的设备列 // 导出托盘绑定的设备列
export function exportBinding(query) { export function exportBinding(query) {
return request({ return request({
......
...@@ -23,24 +23,29 @@ ...@@ -23,24 +23,29 @@
</div> </div>
</div> </div>
<div class="cabinet-content"> <!-- 全局加载动画:覆盖整个内容区域 -->
<!-- 渲染每一行 --> <div v-loading="pageLoading" element-loading-text="老化柜巡查中..."
<el-row :gutter="20" v-for="(row, rowIndex) in cabinetRows" :key="rowIndex"> element-loading-spinner="el-icon-loading"
<!-- 每行渲染6个卡片 --> element-loading-background="rgba(255, 255, 255, 0.1)">
<el-col
:span="4" <div class="cabinet-content">
v-for="item in row" <!-- 渲染每一行 -->
:key="item.id" <el-row :gutter="20" v-for="(row, rowIndex) in cabinetRows" :key="rowIndex">
style="margin-bottom: 20px; text-align: center;" <!-- 每行渲染6个卡片 -->
> <el-col
<!-- 使用 el-tooltip 来提供 hover 提示 --> :span="4"
<el-tooltip v-for="item in row"
:content="getTooltipContent(item)" :key="item.fEquipmentId"
placement="top" style="margin-bottom: 20px; text-align: center;"
> >
<el-card <!-- 使用 el-tooltip 来提供 hover 提示 -->
:class="statusMap[item.deviceStatus]" <el-tooltip
style=" :content="getTooltipContent(item)"
placement="top"
>
<el-card
:class="statusMap[item.fStatus]"
style="
width: 100px; width: 100px;
height: 100px; height: 100px;
margin: 0 auto; margin: 0 auto;
...@@ -49,13 +54,14 @@ ...@@ -49,13 +54,14 @@
justify-content: center; justify-content: center;
font-size: 18px; font-size: 18px;
font-weight: bold;" font-weight: bold;"
@click.native="handleCardClick(item)" @click.native="handleCardClick(item)"
> >
{{ item.id + "号柜" }} {{ item.fEquipmentId + "号柜" }}
</el-card> </el-card>
</el-tooltip> </el-tooltip>
</el-col> </el-col>
</el-row> </el-row>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -63,48 +69,49 @@ ...@@ -63,48 +69,49 @@
<script> <script>
import { getAgingCabinetAndPowerCheck } from "@/api/testScheduledTasks/testTasks"; import { getAgingCabinetAndPowerCheck } from "@/api/testScheduledTasks/testTasks";
import { getAllEquipmentList } from "@/api/equipment/equipment"
export default { export default {
name: "AgingCabinetBoard", name: "AgingCabinetBoard",
data() { data() {
return { return {
// 示例数据格式,实际从后端获取 // 示例数据格式,实际从后端获取
cabinets: [ cabinets: [
{ id: 1, deviceStatus: '1' }, // { id: 1, deviceStatus: '1' },
{ id: 2, deviceStatus: '2' }, // { id: 2, deviceStatus: '2' },
{ id: 3, deviceStatus: '0' }, // { id: 3, deviceStatus: '0' },
{ id: 4, deviceStatus: '0' }, // { id: 4, deviceStatus: '0' },
{ id: 5, deviceStatus: '0' }, // { id: 5, deviceStatus: '0' },
{ id: 6, deviceStatus: '0' }, // { id: 6, deviceStatus: '0' },
{ id: 7, deviceStatus: '0' }, // { id: 7, deviceStatus: '0' },
{ id: 8, deviceStatus: '0' }, // { id: 8, deviceStatus: '0' },
{ id: 9, deviceStatus: '0' }, // { id: 9, deviceStatus: '0' },
{ id: 10, deviceStatus: '0' }, // { id: 10, deviceStatus: '0' },
{ id: 11, deviceStatus: '0' }, // { id: 11, deviceStatus: '0' },
{ id: 12, deviceStatus: '0' }, // { id: 12, deviceStatus: '0' },
{ id: 13, deviceStatus: '0' }, // { id: 13, deviceStatus: '0' },
{ id: 14, deviceStatus: '0' }, // { id: 14, deviceStatus: '0' },
{ id: 15, deviceStatus: '0' }, // { id: 15, deviceStatus: '0' },
{ id: 16, deviceStatus: '0' }, // { id: 16, deviceStatus: '0' },
{ id: 17, deviceStatus: '0' }, // { id: 17, deviceStatus: '0' },
{ id: 18, deviceStatus: '0' }, // { id: 18, deviceStatus: '0' },
{ id: 19, deviceStatus: '0' }, // { id: 19, deviceStatus: '0' },
{ id: 20, deviceStatus: '0' }, // { id: 20, deviceStatus: '0' },
{ id: 21, deviceStatus: '0' }, // { id: 21, deviceStatus: '0' },
{ id: 22, deviceStatus: '0' }, // { id: 22, deviceStatus: '0' },
{ id: 23, deviceStatus: '0' }, // { id: 23, deviceStatus: '0' },
{ id: 24, deviceStatus: '0' }, // { id: 24, deviceStatus: '0' },
{ id: 25, deviceStatus: '0' }, // { id: 25, deviceStatus: '0' },
{ id: 26, deviceStatus: '0' }, // { id: 26, deviceStatus: '0' },
{ id: 27, deviceStatus: '0' }, // { id: 27, deviceStatus: '0' },
{ id: 28, deviceStatus: '0' }, // { id: 28, deviceStatus: '0' },
{ id: 29, deviceStatus: '0' }, // { id: 29, deviceStatus: '0' },
{ id: 30, deviceStatus: '0' }, // { id: 30, deviceStatus: '0' },
{ id: 31, deviceStatus: '0' }, // { id: 31, deviceStatus: '0' },
{ id: 32, deviceStatus: '0' }, // { id: 32, deviceStatus: '0' },
{ id: 33, deviceStatus: '0' }, // { id: 33, deviceStatus: '0' },
{ id: 34, deviceStatus: '0' }, // { id: 34, deviceStatus: '0' },
{ id: 35, deviceStatus: '0' }, // { id: 35, deviceStatus: '0' },
{ id: 36, deviceStatus: '0' }, // { id: 36, deviceStatus: '0' },
// 共36个 // 共36个
], ],
// 状态对应的颜色类名 // 状态对应的颜色类名
...@@ -113,7 +120,9 @@ export default { ...@@ -113,7 +120,9 @@ export default {
1: 'available', 1: 'available',
2: 'occupied' 2: 'occupied'
}, },
agingCabinetList: null agingCabinetList: null,
pageLoading: true, // 新增:页面全局加载状态
}; };
}, },
created() { created() {
...@@ -128,7 +137,7 @@ export default { ...@@ -128,7 +137,7 @@ export default {
} }
}, },
mounted() { mounted() {
// this.testAgingCabinetAndPowerCheck(); this.testAgingCabinetAndPowerCheck();
}, },
methods: { methods: {
handleCardClick(item) { handleCardClick(item) {
...@@ -137,7 +146,7 @@ export default { ...@@ -137,7 +146,7 @@ export default {
this.$emit('cabinet-click', item, 3); this.$emit('cabinet-click', item, 3);
}, },
getTooltipContent(item) { getTooltipContent(item) {
switch (item.deviceStatus) { switch (item.fStatus) {
case '2': case '2':
return item.errorReason || '无故障详情'; return item.errorReason || '无故障详情';
case '1': case '1':
...@@ -148,9 +157,17 @@ export default { ...@@ -148,9 +157,17 @@ export default {
} }
}, },
testAgingCabinetAndPowerCheck() { testAgingCabinetAndPowerCheck() {
getAgingCabinetAndPowerCheck().then(response => { // 开始加载:显示全局loading
this.pageLoading = true;
// getAgingCabinetAndPowerCheck().then(response => {
// this.cabinets = response;
// this.pageLoading = false;
// });
getAllEquipmentList().then(response => {
this.cabinets = response; this.cabinets = response;
}); this.pageLoading = false;
})
} }
} }
}; };
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<!-- 托盘信息展示区域 --> <!-- 托盘信息展示区域 -->
<div class="tray-header-inner"> <div class="tray-header-inner">
<span class="tray-label">托盘</span> <span class="tray-label">托盘</span>
<span class="tray-id">TP-{{ trayInfo.id || '--' }}</span> <span class="tray-id">{{ modbusDeviceData.fTrayCode }}</span>
</div> </div>
<div class="tray-info"> <div class="tray-info">
...@@ -59,10 +59,10 @@ ...@@ -59,10 +59,10 @@
<div class="info-label">所在柜体:</div> <div class="info-label">所在柜体:</div>
<div class="info-value">{{ modbusDeviceData.id }}号柜 - {{ trayInfo.layer.split("-")[1] || '--' }}</div> <div class="info-value">{{ modbusDeviceData.id }}号柜 - {{ trayInfo.layer.split("-")[1] || '--' }}</div>
</div> </div>
<div class="info-row"> <!-- <div class="info-row">-->
<div class="info-label">产品型号:</div> <!-- <div class="info-label">产品型号:</div>-->
<div class="info-value">{{ trayInfo.productModel || '--' }}</div> <!-- <div class="info-value">{{ trayInfo.productModel || '&#45;&#45;' }}</div>-->
</div> <!-- </div>-->
<div class="info-row"> <div class="info-row">
<div class="info-label">当前状态:</div> <div class="info-label">当前状态:</div>
<div class="info-value" :class="trayInfo.statusClass || 'status-idle'"> <div class="info-value" :class="trayInfo.statusClass || 'status-idle'">
...@@ -83,10 +83,7 @@ ...@@ -83,10 +83,7 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="tray-actions"> <div class="tray-actions">
<button class="btn-action btn-load" @click="loadTray"> <button class="btn-action btn-load" @click="loadTray">
<i class="icon-load"></i>上料 <i class="icon-load"></i>下料
</button>
<button class="btn-action btn-power" @click="powerOn">
<i class="icon-power"></i>上电
</button> </button>
</div> </div>
</div> </div>
...@@ -243,7 +240,7 @@ export default { ...@@ -243,7 +240,7 @@ export default {
// 操作按钮方法 // 操作按钮方法
loadTray() { loadTray() {
this.$message.success("料操作已执行"); this.$message.success("料操作已执行");
}, },
powerOn() { powerOn() {
...@@ -337,9 +334,11 @@ export default { ...@@ -337,9 +334,11 @@ export default {
/* 状态背景色 */ /* 状态背景色 */
.status-idle { .status-idle {
background: linear-gradient(to bottom, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.2)); background: linear-gradient(to bottom, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.2));
border-color: rgba(100, 180, 255, 0.6) !important; border-color: rgba(240, 240, 240, 1) !important;
} }
.status-running { .status-running {
background: linear-gradient(to bottom, rgba(100, 255, 100, 0.15), rgba(0, 80, 0, 0.2)) !important; background: linear-gradient(to bottom, rgba(100, 255, 100, 0.15), rgba(0, 80, 0, 0.2)) !important;
border-color: rgba(100, 255, 100, 0.8) !important; border-color: rgba(100, 255, 100, 0.8) !important;
......
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
<script> <script>
import {getAllBinding, batchAdd, batchUpdateDeviceCode} from "@/api/palletDeviceBinding/binding" import {getAllBinding, batchAdd, batchUpdateDeviceCode} from "@/api/palletDeviceBinding/binding"
import {resetAll} from "@/api/palletDeviceBinding/binding"
export default { export default {
name: "TrayBinding", name: "TrayBinding",
props: { props: {
...@@ -124,11 +124,31 @@ export default { ...@@ -124,11 +124,31 @@ export default {
handler(newVal) { handler(newVal) {
this.fTrayId = newVal.fTrayId; this.fTrayId = newVal.fTrayId;
this.fTrayCode = newVal.fTrayCode; this.fTrayCode = newVal.fTrayCode;
this.trayStatus = newVal.status; // 从父组件获取托盘状态 this.trayStatus = newVal.fStatus; // 从父组件获取托盘状态
// 查询托盘是否有绑定的设备数据 // 查询托盘是否有绑定的设备数据
this.getAllBindingData(newVal.fTrayId); this.getAllBindingData(newVal.fTrayId);
} }
}, },
// 监听输入框内容变化,实现手动输入自动触发
deviceInput(newVal) {
// 清除上一次的计时器
if (this.inputTimer) {
clearTimeout(this.inputTimer);
}
// 输入为空时不触发
if (!newVal.trim()) return;
// 500ms内无输入变化,则视为输入完成,自动触发addDevice
this.inputTimer = setTimeout(() => {
this.addDevice();
}, 500); // 可根据需求调整延迟时间(如300ms-1000ms)
},
},
beforeDestroy() {
// 组件销毁时清除计时器,避免内存泄漏
if (this.inputTimer) {
clearTimeout(this.inputTimer);
}
}, },
data() { data() {
return { return {
...@@ -156,7 +176,9 @@ export default { ...@@ -156,7 +176,9 @@ export default {
activeCell: 0, activeCell: 0,
// 设备输入 // 设备输入
deviceInput: '' deviceInput: '',
inputTimer: null, // 用于记录输入计时器
}; };
}, },
computed: { computed: {
...@@ -215,7 +237,7 @@ export default { ...@@ -215,7 +237,7 @@ export default {
// 计算初始异常设备数量(标检完成状态) // 计算初始异常设备数量(标检完成状态)
if (this.trayStatus === '2') { if (this.trayStatus === '2') {
this.abnormalCount = this.devices.filter( this.abnormalCount = this.devices.filter(
d => d.deviceCode && d.status === '0' d => d.deviceCode && d.fstatus != '1'
).length; ).length;
this.initialAbnormalCount = this.abnormalCount; this.initialAbnormalCount = this.abnormalCount;
} }
...@@ -264,6 +286,17 @@ export default { ...@@ -264,6 +286,17 @@ export default {
// 添加设备到当前激活单元格 // 添加设备到当前激活单元格
addDevice() { addDevice() {
// 清除计时器(避免重复触发)
if (this.inputTimer) {
clearTimeout(this.inputTimer);
this.inputTimer = null;
}
// 原有逻辑:如果输入为空则不处理
if (!this.deviceInput.trim()) return;
if (this.deviceInput) { if (this.deviceInput) {
// 标检完成状态下的特殊处理 // 标检完成状态下的特殊处理
if (this.trayStatus === '2') { if (this.trayStatus === '2') {
...@@ -349,17 +382,28 @@ export default { ...@@ -349,17 +382,28 @@ export default {
}) })
} }
}, },
// 重置所有数据 // 重置所有数据
resetAll() { resetAll() {
if (confirm('确定要重置所有数据吗?')) { this.$confirm('确定要重置所有数据吗?', '提示', {
this.deviceInput = ''; confirmButtonText: '确定',
this.devices = this.devices.map(d => ({ ...d, deviceCode: '' })); cancelButtonText: '取消',
this.activeCell = 0; type: 'warning'
this.$nextTick(() => { }).then(() => {
this.$refs.deviceInput.focus(); resetAll(this.fTrayId).then(res => {
}); if (res.code === 200) {
} this.deviceInput = '';
this.devices = this.devices.map(d => ({ ...d, deviceCode: '' }));
this.activeCell = 0;
this.$nextTick(() => {
this.$refs.deviceInput.focus();
});
this.msgSuccess("已重置");
} else {
this.msgError("重置失败");
}
})
}).catch(() => {
});
} }
}, },
mounted() { mounted() {
......
...@@ -292,7 +292,7 @@ export default { ...@@ -292,7 +292,7 @@ export default {
} }
} }
.content-area { .content-area {
padding: 20px 40px; padding: 20px 20px;
flex: 1; flex: 1;
min-height: calc(100vh - 150px); min-height: calc(100vh - 150px);
overflow-y: auto; overflow-y: auto;
...@@ -327,7 +327,7 @@ export default { ...@@ -327,7 +327,7 @@ export default {
.scroll-container { .scroll-container {
flex: 1; flex: 1;
max-height: calc(100vh - 150px); max-height: calc(100vh - 160px);
overflow-y: auto; overflow-y: auto;
padding: 0 0px; padding: 0 0px;
} }
......
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