'add:双工位堆垛机开发'

This commit is contained in:
2023-12-04 10:55:51 +08:00
36 changed files with 720 additions and 333 deletions

View File

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.Data; import lombok.Data;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.nl.acs.device.domain.Device; import org.nl.acs.device.domain.Device;
import org.nl.acs.device.domain.DeviceExtra; import org.nl.acs.device.domain.DeviceExtra;
import org.nl.acs.device.enums.DeviceType; import org.nl.acs.device.enums.DeviceType;
@@ -35,6 +36,7 @@ import org.nl.config.SpringContextHolder;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 双工位堆垛机驱动 * 双工位堆垛机驱动
@@ -57,6 +59,9 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
@Autowired @Autowired
DeviceExtraService deviceExtraService = SpringContextHolder.getBean(DeviceExtraServiceImpl.class); DeviceExtraService deviceExtraService = SpringContextHolder.getBean(DeviceExtraServiceImpl.class);
public static final Integer MAX_Y = 6;
public static final Integer MIN_Y = 1;
//心跳 //心跳
Integer heartbeat = 0; Integer heartbeat = 0;
Integer last_heartbeat = 0; Integer last_heartbeat = 0;
@@ -205,7 +210,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
} }
switch (command) { switch (front_command) {
case 0: case 0:
applyTask(); applyTask();
requireSucess = true; requireSucess = true;
@@ -215,7 +220,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
break; break;
case 2: case 2:
message = "取货完成"; message = "取货完成";
Instruction instruction = checkInst(); Instruction instruction = null;
String next_device_code = instruction.getNext_device_code(); String next_device_code = instruction.getNext_device_code();
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code); Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.conveyor.name())) { if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.conveyor.name())) {
@@ -233,14 +238,14 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
} }
} }
if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.storage.name())) { if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.storage.name())) {
map.put("to_y", inst.getFrom_z()); map.put("to_y", instruction.getFrom_z());
if (inst.getFrom_x().length() > 1) { if (instruction.getFrom_x().length() > 1) {
String substring = inst.getFrom_x().substring(1); String substring = instruction.getFrom_x().substring(1);
map.put("to_z", substring); map.put("to_z", substring);
} else { } else {
map.put("to_z", inst.getFrom_x()); map.put("to_z", instruction.getFrom_x());
} }
map.put("to_x", inst.getFrom_y()); map.put("to_x", instruction.getFrom_y());
} }
map.put("to_command", 2); map.put("to_command", 2);
requireSucess = true; requireSucess = true;
@@ -250,7 +255,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
break; break;
case 4: case 4:
message = "请求卸货(申请卸货)"; message = "请求卸货(申请卸货)";
Instruction instruction1 = checkInst(); Instruction instruction1 = null;
String next_device_code1 = instruction1.getNext_device_code(); String next_device_code1 = instruction1.getNext_device_code();
Device nextDevice1 = deviceAppService.findDeviceByCode(next_device_code1); Device nextDevice1 = deviceAppService.findDeviceByCode(next_device_code1);
if (ObjectUtil.isNotNull(instruction1)) { if (ObjectUtil.isNotNull(instruction1)) {
@@ -260,7 +265,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) nextDevice1.getDeviceDriver(); siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) nextDevice1.getDeviceDriver();
if (siemensConveyorDeviceDriver.getMode() != 2 || siemensConveyorDeviceDriver.getMove() == 1) { if (siemensConveyorDeviceDriver.getMode() != 2 || siemensConveyorDeviceDriver.getMove() == 1) {
notCreateInstMessage = "未下发电气信号原因->输送线-货架对接位:" + siemensConveyorDeviceDriver.getDevice_code() + notCreateInstMessage = "未下发电气信号原因->输送线-货架对接位:" + siemensConveyorDeviceDriver.getDevice_code() +
"有货或未联机,无法下发指令!指令号:" + inst.getInstruction_code(); "有货或未联机,无法下发指令!指令号:" ;
return; return;
} }
} }
@@ -271,7 +276,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
case 5: case 5:
message = "放货完成"; message = "放货完成";
map.put("to_command", 5); map.put("to_command", 5);
Instruction inst = checkInst(); Instruction inst = null;
try { try {
finish_instruction(inst); finish_instruction(inst);
} catch (Exception e) { } catch (Exception e) {
@@ -398,92 +403,134 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
Instruction instruction1 = new Instruction(); Instruction instruction1 = new Instruction();
instruction1.setInstruction_status("0"); instruction1.setInstruction_status("0");
List<Instruction> instructions = instructionService.findByDeviceCodes(instruction1, false); List<Instruction> instructions = instructionService.findByDeviceCodes(instruction1, false);
if (CollUtil.isEmpty(instructions) || instructions.size() < 1) {
return false;
}
List<Instruction> instructionList = new ArrayList<>(); List<Instruction> instructionList = new ArrayList<>();
for (Instruction instruction : instructions) { //根据路由过滤指令
List<RouteLineDto> routeLineDtos = routeLineService.selectDeviceCodeList(instruction.getStart_device_code()); if (checkRute(instructions, instructionList)) return false;
if (CollUtil.isEmpty(routeLineDtos) || routeLineDtos.size() < 1) {
message = "没有输送线到堆垛机的路由";
logServer.deviceExecuteLog(this.device_code, "", "", "没有" + instruction.getStart_device_code() + "->"
+ this.device_code + "的路由");
continue;
}
for (RouteLineDto routeLineDto : routeLineDtos) {
if (this.getDeviceCode().equals(routeLineDto.getNext_device_code())) {
List<RouteLineDto> routeLineDtoList = routeLineService.selectDeviceCodeList(this.getDeviceCode());
if (CollUtil.isEmpty(routeLineDtos) || routeLineDtos.size() < 1) {
message = "没有输送线到堆垛机的路由";
logServer.deviceExecuteLog(this.device_code, "", "", "没有" + instruction.getStart_device_code() + "->"
+ this.device_code + "的路由");
continue;
}
for (RouteLineDto routeLinedto : routeLineDtoList) {
if (instruction.getNext_device_code().equals(routeLinedto.getNext_device_code())) {
instructionList.add(instruction);
}
}
}
}
}
if (CollUtil.isEmpty(instructionList) || instructionList.size() < 1) { if (CollUtil.isEmpty(instructionList) || instructionList.size() < 1) {
return false; return false;
} }
instructionList = this.sortInst(instructionList); instructionList = this.sortInst(instructionList);
//筛选符合条件的指令 Instruction inst = instructionList.get(0);
for (Instruction instruction : instructionList) { List<Instruction> instructionsAll = new ArrayList<>();
instructions.add(inst);
//找出有相邻的列的指令,如果没有按照单叉走,有按照双叉走
if (findInstruction(instructionList, inst, instructionsAll)) return false;
if (instructionsAll.size()==0){
//写信号
if (wirteData(inst)) return false;
} }
inst = instructionList.get(0);
//指令未执行 }
if (StrUtil.equals(inst.getInstruction_status(), "0")) { return false;
String start_device_code = inst.getStart_device_code(); }
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
BeltConveyorDeviceDriver beltConveyorDeviceDriver; private boolean checkRute(List<Instruction> instructions, List<Instruction> instructionList) {
if (startDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) { if (CollUtil.isEmpty(instructions) || instructions.size() < 1) {
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) startDevice.getDeviceDriver(); return true;
if (beltConveyorDeviceDriver.getMode() != 2 || beltConveyorDeviceDriver.getMove() == 0) { }
notCreateInstMessage = "未下发电气信号原因->输送线-货架对接位:" + beltConveyorDeviceDriver.getDevice_code() + for (Instruction instruction : instructions) {
"无货或未联机,无法下发指令!指令号:" + inst.getInstruction_code(); List<RouteLineDto> routeLineDtos = routeLineService.selectDeviceCodeList(instruction.getStart_device_code());
return false; if (CollUtil.isEmpty(routeLineDtos) || routeLineDtos.size() < 1) {
message = "没有输送线到堆垛机的路由";
logServer.deviceExecuteLog(this.device_code, "", "", "没有" + instruction.getStart_device_code() + "->"
+ this.device_code + "的路由");
continue;
}
for (RouteLineDto routeLineDto : routeLineDtos) {
if (this.getDeviceCode().equals(routeLineDto.getNext_device_code())) {
List<RouteLineDto> routeLineDtoList = routeLineService.selectDeviceCodeList(this.getDeviceCode());
if (CollUtil.isEmpty(routeLineDtos) || routeLineDtos.size() < 1) {
message = "没有输送线到堆垛机的路由";
logServer.deviceExecuteLog(this.device_code, "", "", "没有" + instruction.getStart_device_code() + "->"
+ this.device_code + "的路由");
continue;
}
for (RouteLineDto routeLinedto : routeLineDtoList) {
if (instruction.getNext_device_code().equals(routeLinedto.getNext_device_code())) {
instructionList.add(instruction);
}
} }
} }
HashMap map = new HashMap(); }
map.put("to_device_code", this.getDevice().getAddress()); }
map.put("to_command", 1); return false;
}
private boolean wirteData(Instruction inst) {
if (StrUtil.equals(inst.getInstruction_status(), "0")) {
String start_device_code = inst.getStart_device_code();
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
BeltConveyorDeviceDriver beltConveyorDeviceDriver;
if (startDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) startDevice.getDeviceDriver();
if (beltConveyorDeviceDriver.getMode() != 2 || beltConveyorDeviceDriver.getMove() == 0) {
notCreateInstMessage = "未下发电气信号原因->输送线-货架对接位:" + beltConveyorDeviceDriver.getDevice_code() +
"无货或未联机,无法下发指令!指令号:" + inst.getInstruction_code();
return true;
}
}
HashMap map = new HashMap();
map.put("to_device_code", this.getDevice().getAddress());
map.put("to_command", 1);
// map.put("to_type", inst.getMaterial()); // map.put("to_type", inst.getMaterial());
map.put("to_task", inst.getInstruction_code()); map.put("to_task", inst.getInstruction_code());
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) { if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) {
List<DeviceExtra> list = deviceExtraService.list(Wrappers.lambdaQuery(DeviceExtra.class).eq(DeviceExtra::getDevice_code, start_device_code)); List<DeviceExtra> list = deviceExtraService.list(Wrappers.lambdaQuery(DeviceExtra.class).eq(DeviceExtra::getDevice_code, start_device_code));
for (DeviceExtra deviceExtra : list) { for (DeviceExtra deviceExtra : list) {
if ("x".equals(deviceExtra.getExtra_code()) && StrUtil.isNotEmpty(deviceExtra.getExtra_value())) { if ("x".equals(deviceExtra.getExtra_code()) && StrUtil.isNotEmpty(deviceExtra.getExtra_value())) {
map.put("to_x", deviceExtra.getExtra_value()); map.put("to_x", deviceExtra.getExtra_value());
} }
if ("z".equals(deviceExtra.getExtra_code()) && StrUtil.isNotEmpty(deviceExtra.getExtra_value())) { if ("z".equals(deviceExtra.getExtra_code()) && StrUtil.isNotEmpty(deviceExtra.getExtra_value())) {
map.put("to_z", deviceExtra.getExtra_value()); map.put("to_z", deviceExtra.getExtra_value());
} }
if ("y".equals(deviceExtra.getExtra_code()) && StrUtil.isNotEmpty(deviceExtra.getExtra_value())) { if ("y".equals(deviceExtra.getExtra_code()) && StrUtil.isNotEmpty(deviceExtra.getExtra_value())) {
map.put("to_y", deviceExtra.getExtra_value()); map.put("to_y", deviceExtra.getExtra_value());
}
} }
} }
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name())) {
map.put("to_y", inst.getFrom_z());
if (inst.getFrom_x().length() > 1) {
String substring = inst.getFrom_x().substring(1);
map.put("to_z", substring);
} else {
map.put("to_z", inst.getFrom_x());
}
map.put("to_x", inst.getFrom_y());
}
this.writing(map);
} }
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name())) {
map.put("to_y", inst.getFrom_z());
if (inst.getFrom_x().length() > 1) {
String substring = inst.getFrom_x().substring(1);
map.put("to_z", substring);
} else {
map.put("to_z", inst.getFrom_x());
}
map.put("to_x", inst.getFrom_y());
}
this.writing(map);
}
return false;
}
private boolean findInstruction(List<Instruction> instructionList, Instruction inst, List<Instruction> instructionsAll) {
if (StringUtils.isEmpty(inst.getNext_point_code())&&!StringUtils.contains(inst.getNext_point_code(),"-")){
return true;
}else {
String[] split = inst.getNext_point_code().split("-");
if (Integer.valueOf(split[1]).equals(MIN_Y)){
return true;
}
if (Integer.valueOf(split[1]).equals(MAX_Y)){
String nextPointCodeDown = split[0] + "-" + (Integer.parseInt(split[1]) - 1) + "-" + split[2];
List<Instruction> instructionNextPointList = instructionList.stream().filter(item -> item.getNext_point_code().equals(nextPointCodeDown)).collect(Collectors.toList());
if (instructionNextPointList.size()>0){
instructionsAll.add(instructionNextPointList.get(0));
}
}else {
String nextPointCodeUp = split[0] + "-" + (Integer.parseInt(split[1]) - 1) + "-" + split[2];
String nextPointCodeDown = split[0] + "-" + (Integer.parseInt(split[1]) - 1) + "-" + split[2];
List<Instruction> instructionNextPointList = instructionList.stream().filter(item -> item.getNext_point_code().equals(nextPointCodeDown)||item.getNext_point_code().equals(nextPointCodeUp)).collect(Collectors.toList());
if (instructionNextPointList.size()>0){
instructionsAll.add(instructionNextPointList.get(0));
}
}
} }
return false; return false;
} }
@@ -508,77 +555,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
return instructions; return instructions;
} }
/**
* 更新指令状态
*/
public synchronized void update_instruction_status() throws Exception {
Date date = new Date();
if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out);
} else {
this.instruction_update_time = date;
//更改指令状态
if (task > 0) {
//inst_message
Instruction inst = checkInst();
if (inst != null) {
if (StrUtil.equals(inst.getInstruction_status(), "0")) {
inst.setInstruction_status("1");
inst.setExecute_device_code(this.device_code);
instructionService.update(inst);
}
}
}
HashMap map = new HashMap();
//取货完成
if (command == 2) {
map.put("to_command", 2);
}
//请求卸货(申请卸货)
if (command == 4) {
Instruction instruction = checkInst();
if (ObjectUtil.isNotNull(instruction)) {
//指令为执行
String next_device_code = instruction.getNext_device_code();
Device startDevice = deviceAppService.findDeviceByCode(next_device_code);
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
if (startDevice.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) startDevice.getDeviceDriver();
if (siemensConveyorDeviceDriver.getMode() != 2 || siemensConveyorDeviceDriver.getMove() == 1) {
notCreateInstMessage = "未下发电气信号原因->输送线-货架对接位:" + siemensConveyorDeviceDriver.getDevice_code() +
"有货或未联机,无法下发指令!指令号:" + inst.getInstruction_code();
return;
}
}
map.put("to_command", 3);
}
}
//放货完成
if (command == 5) {
map.put("to_command", 5);
try {
finish_instruction(inst);
} catch (Exception e) {
e.printStackTrace();
}
}
//取货准备(回库台位)
if (command == 6) {
map.put("to_command", 6);
}
//召回
if (command == 7) {
map.put("to_command", 7);
}
//急停
if (command == 8) {
map.put("to_command", 8);
}
this.writing(map);
}
}
@Override @Override

View File

@@ -389,8 +389,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
} }
if (mode != 3) { if (mode != 3 || requireSucess) {
message = "未联机"; message = "未联机或已修改";
} else if (error != 0) { } else if (error != 0) {
message = "有报警"; message = "有报警";
@@ -417,8 +417,10 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
HashMap map = new HashMap(); HashMap map = new HashMap();
switch (command) { switch (command) {
case 0: case 0:
applyTask(); boolean b = applyTask();
requireSucess = true; if (b) {
requireSucess = true;
}
break; break;
case 1: case 1:
message = "取货中"; message = "取货中";
@@ -429,13 +431,13 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
String next_device_code = instruction.getNext_device_code(); String next_device_code = instruction.getNext_device_code();
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code); Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.conveyor.name())) { if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.conveyor.name())) {
if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("z")) && "z".equals(nextDevice.getExtraValue().get("z"))) { if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("z"))) {
map.put("to_x", nextDevice.getExtraValue().get("z")); map.put("to_x", nextDevice.getExtraValue().get("z"));
} }
if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("x")) && "x".equals(nextDevice.getExtraValue().get("x"))) { if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("x"))) {
map.put("to_z", nextDevice.getExtraValue().get("x")); map.put("to_z", nextDevice.getExtraValue().get("x"));
} }
if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("y")) && "y".equals(nextDevice.getExtraValue().get("y"))) { if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("y"))) {
map.put("to_y", nextDevice.getExtraValue().get("y")); map.put("to_y", nextDevice.getExtraValue().get("y"));
} }
} }
@@ -620,13 +622,13 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
map.put("to_task", inst.getInstruction_code()); map.put("to_task", inst.getInstruction_code());
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) { if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) {
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("x")) && "x".equals(startDevice.getExtraValue().get("x"))) { if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("x"))) {
map.put("to_x", startDevice.getExtraValue().get("x")); map.put("to_x", startDevice.getExtraValue().get("x"));
} }
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("z")) && "z".equals(startDevice.getExtraValue().get("z"))) { if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("z"))) {
map.put("to_z", startDevice.getExtraValue().get("z")); map.put("to_z", startDevice.getExtraValue().get("z"));
} }
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("y")) && "y".equals(startDevice.getExtraValue().get("y"))) { if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("y"))) {
map.put("to_y", startDevice.getExtraValue().get("y")); map.put("to_y", startDevice.getExtraValue().get("y"));
} }
} }
@@ -644,7 +646,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
this.writing(map); this.writing(map);
} }
} }
return false; return true;
} }
/** /**

View File

@@ -780,7 +780,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
throw new BadRequestException(LangProcess.msg("task_checkExist",device_code)); throw new BadRequestException(LangProcess.msg("task_checkExist",device_code));
} }
if (StrUtil.equals(material_type, "") || StrUtil.equals(quantity, "")) { if (StrUtil.equals(material_type, "") || StrUtil.equals(quantity, "")) {
throw new RuntimeException("请填写物料信息!"); throw new RuntimeException(LangProcess.msg("material_information"));
} }
dto.setStart_device_code(device_code); dto.setStart_device_code(device_code);
dto.setStart_point_code(device_code); dto.setStart_point_code(device_code);
@@ -805,7 +805,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
JSONArray array2 = json.getJSONArray("data2"); JSONArray array2 = json.getJSONArray("data2");
JSONArray array3 = json.getJSONArray("data3"); JSONArray array3 = json.getJSONArray("data3");
if (array.size() != 0 && array3.size() != 0) { if (array.size() != 0 && array3.size() != 0) {
throw new RuntimeException("只能选择一个终点"); throw new RuntimeException(LangProcess.msg("an_endpoint"));
} }
for (int i = 0; i < array2.size(); i++) { for (int i = 0; i < array2.size(); i++) {
@@ -1515,10 +1515,10 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
// 如果point_device为货架则不包含列层信息需要重新拼接 // 如果point_device为货架则不包含列层信息需要重新拼接
if (StrUtil.equals("storage", start_device)) { if (StrUtil.equals("storage", start_device)) {
if (StrUtil.isEmpty(task.getFrom_x())) { if (StrUtil.isEmpty(task.getFrom_x())) {
throw new BadRequestException("货位信息起点需要包含列信息"); throw new BadRequestException(LangProcess.msg("start_point_column"));
} }
if (StrUtil.isEmpty(task.getFrom_y())) { if (StrUtil.isEmpty(task.getFrom_y())) {
throw new BadRequestException("货位信息起点需要包含层信息"); throw new BadRequestException(LangProcess.msg("start_point_layer"));
} }
if (Integer.parseInt(task.getFrom_y()) < 10 && task.getFrom_y().length() == 1) { if (Integer.parseInt(task.getFrom_y()) < 10 && task.getFrom_y().length() == 1) {
from_y = "0" + task.getFrom_y(); from_y = "0" + task.getFrom_y();
@@ -1578,10 +1578,10 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
.name(); .name();
if (StrUtil.equals("storage", next_device)) { if (StrUtil.equals("storage", next_device)) {
if (StrUtil.isEmpty(task.getTo_x())) { if (StrUtil.isEmpty(task.getTo_x())) {
throw new BadRequestException("货位信息终点需要包含列信息"); throw new BadRequestException(LangProcess.msg("endpoint_column"));
} }
if (StrUtil.isEmpty(task.getTo_y())) { if (StrUtil.isEmpty(task.getTo_y())) {
throw new BadRequestException("货位信息终点需要包含层信息"); throw new BadRequestException(LangProcess.msg("endpoint_layer"));
} }
if (Integer.parseInt(task.getTo_y()) < 10 && task.getTo_y().length() == 1) { if (Integer.parseInt(task.getTo_y()) < 10 && task.getTo_y().length() == 1) {
to_y = "0" + task.getTo_y(); to_y = "0" + task.getTo_y();

View File

@@ -73,7 +73,8 @@ public class CreateDDJInst {
RouteLineDto routeLineDto = (RouteLineDto) list.get(0); RouteLineDto routeLineDto = (RouteLineDto) list.get(0);
String[] path = routeLineDto.getPath().split("->"); String[] path = routeLineDto.getPath().split("->");
List<String> pathlist = Arrays.asList(path); List<String> pathlist = Arrays.asList(path);
if (pathlist.size() < 3 || pathlist.get(1).equals(DeviceType.stacker.name())) { String deviceType = appService.findDeviceByCode(pathlist.get(1)).getDevice_type();
if (pathlist.size() < 3 || (!deviceType.equals(DeviceType.stacker.name()))) {
return; return;
} }
Device deviceByCode = appService.findDeviceByCode(pathlist.get(1)); Device deviceByCode = appService.findDeviceByCode(pathlist.get(1));
@@ -128,6 +129,46 @@ public class CreateDDJInst {
String start_height = taskDto.getStart_height(); String start_height = taskDto.getStart_height();
String next_height = taskDto.getNext_height(); String next_height = taskDto.getNext_height();
/**
* 开始平均分配
*/
String this_coevice_code = taskserver.queryAssignedByDevice(start_device_code, next_device_code);
if (StrUtil.isEmpty(this_coevice_code)) {
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
RouteLineDto routeLineDto1 = shortPathsList.get(0);
String path1 = routeLineDto1.getPath();
String type1 = routeLineDto1.getType();
String[] str = path1.split("->");
List<String> pathlist1 = Arrays.asList(str);
int index = 0;
for (int m = 0; m < pathlist1.size(); m++) {
String deviceType1 = appService.findDeviceByCode(pathlist1.get(m)).getDevice_type();
if(deviceType1.equals(DeviceType.stacker.name())){
index = m + 1;
break;
}
/*if (pathlist1.get(m).equals(start_device_code)) {
}*/
}
next_device_code = pathlist1.get(index);
} else {
next_device_code = this_coevice_code;
}
//校验路由关系
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
if (ObjectUtils.isEmpty(shortPathsList) || shortPathsList.size()<1) {
throw new RuntimeException("路由不通!");
}
// Device startdevice = appService.findDeviceByCode(start_device_code);
// Device nextdevice = appService.findDeviceByCode(next_device_code);
if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {
next_point_code = next_device_code + "-" + taskDto.getTo_y() + "-" + taskDto.getTo_z();
} else {
next_point_code = next_device_code;
}
//单台堆垛机最多只能创建固定数量指令 //单台堆垛机最多只能创建固定数量指令
Instruction instruction = new Instruction(); Instruction instruction = new Instruction();
instruction.setInstruction_status("1"); instruction.setInstruction_status("1");
@@ -234,7 +275,7 @@ public class CreateDDJInst {
String[] path1 = routeLineDto1.getPath().split("->"); String[] path1 = routeLineDto1.getPath().split("->");
List<String> pathlist1 = Arrays.asList(path1); List<String> pathlist1 = Arrays.asList(path1);
if (pathlist1.size() < 3 || pathlist1.get(1).equals(DeviceType.stacker.name())) { if (pathlist1.size() < 3 || pathlist1.get(1).equals(DeviceType.stacker.name())) {
return; //return;
} }
if (pathlist1.get(1).equals(pathlist.get(1))) { if (pathlist1.get(1).equals(pathlist.get(1))) {
max++; max++;

View File

@@ -3,3 +3,12 @@ task_insHas=指令已存在
task_insRun=有指令未完成 task_insRun=有指令未完成
task_isNull={0}查询信息不存在 task_isNull={0}查询信息不存在
starting_point_isNull=请选择起点 starting_point_isNull=请选择起点
endpoint_layer=货位信息终点需要包含层信息
endpoint_column=货位信息终点需要包含列信息
start_point_layer=货位信息起点需要包含层信息
start_point_column=货位信息起点需要包含列信息
an_endpoint=只能选择一个终点
material_information=请填写物料信息

View File

@@ -3,3 +3,9 @@ task_insHas=Instruction already exists
task_insRun=There are instructions that are not completed task_insRun=There are instructions that are not completed
task_isNull={0}query is null task_isNull={0}query is null
starting_point_isNull = Please select starting point starting_point_isNull = Please select starting point
endpoint_layer=The destination of the storage location information needs to include the floor information
endpoint_column=The location information endpoint needs to contain column information
start_point_layer=The starting point of the storage location information needs to include the floor information
start_point_column=The starting point of the storage location information needs to contain column information
an_endpoint=Only one endpoint can be selected
material_information=Please fill in the material information!

View File

@@ -3,3 +3,9 @@ task_insHas=Instruksi sudah ada
task_insRun=Ada instruksi yang belum selesai task_insRun=Ada instruksi yang belum selesai
task_isNull={0}Pertanyaan Tidak ada task_isNull={0}Pertanyaan Tidak ada
starting_point_isNull = Silakan pilih titik awal starting_point_isNull = Silakan pilih titik awal
endpoint_layer=Tujuan informasi lokasi penyimpanan perlu mencakup informasi lantai.
endpoint_column=Tujuan informasi lokasi penyimpanan perlu mencakup informasi kolom.
start_point_layer=Titik awal perlu mencakup informasi lantai.
start_point_column=Titik awal perlu mencakup informasi kolom.
an_endpoint=Hanya satu tujuan yang dapat dipilih.
material_information=Silakan isi informasi material!

View File

@@ -2,3 +2,10 @@ task_checkExist={0}任务已存在
task_insHas=指令已存在 task_insHas=指令已存在
task_insRun=有指令未完成 task_insRun=有指令未完成
task_isNull={0}查询信息不存在 task_isNull={0}查询信息不存在
starting_point_isNull=请选择起点
endpoint_layer=货位信息终点需要包含层信息
endpoint_column=货位信息终点需要包含列信息
start_point_layer=货位信息起点需要包含层信息
start_point_column=货位信息起点需要包含列信息
an_endpoint=只能选择一个终点
material_information=请填写物料信息

View File

@@ -1,17 +1,17 @@
export default { export default {
'Auto': { 'Auto': {
'table': { 'table': {
'name': 'name', 'name': 'name',
'code': 'code', 'code': 'code',
'status': 'status', 'status': 'status',
'thread_name': 'thread_name', 'thread_name': 'thread_name',
'thread_state': 'thread_state', 'thread_state': 'thread_state',
'usedStatus': 'usedStatus', 'usedStatus': 'usedStatus',
'stopMessage': 'stopMessage', 'stopMessage': 'stopMessage',
'operate': 'operate', 'operate': 'operate'
}, },
'msg': { 'msg': {
'stop_msg': 'Are you sure to stop this thread?' 'select_msg': 'Are you sure to stop this thread?'
}
} }
}
} }

View File

@@ -13,6 +13,9 @@ import storageCell from './storageCell/zh'
import route from './route/zh' import route from './route/zh'
import auto from './auto/zh' import auto from './auto/zh'
import customPolicy from './customPolicy/zh' import customPolicy from './customPolicy/zh'
import monitor from './monitor/zh'
import timing from './timing/zh'
import config from './config/zh'
export default { export default {
...zhLocale, ...zhLocale,
@@ -29,5 +32,9 @@ export default {
...task, ...task,
...history, ...history,
...auto, ...auto,
...customPolicy ...customPolicy,
...monitor,
...timing,
...config
} }

View File

@@ -0,0 +1,23 @@
export default {
'config': {
'table': {
'device_execution': 'Device execution',
'please_select': 'Please select',
'end_of_instruction': 'End of instructio',
'end_of_task': 'End of task',
'end_device': 'End device',
'max': 'Maximum quantity',
'allocation_ratio': 'Allocation ratio',
'cancel': 'Cancel',
'confirm': 'Confirm',
'device_code': 'Device code',
'destination_device': 'Destination device',
'inst_nextdevice_code': 'Command destination device',
'destination_configuration': 'Destination configuration',
'operation': 'Operation',
'device_is_not_null': 'Device code cannot be empty'
},
'rules': {
}
}
}

View File

@@ -0,0 +1,23 @@
export default {
'config': {
'table': {
'device_execution': 'Eksekusi perangkat',
'please_select': 'Silakan pilih',
'end_of_instruction': 'Akhir instruksi',
'end_of_task': 'Akhir tugas',
'end_device': 'Perangkat akhir',
'max': 'Jumlah maksimum',
'allocation_ratio': 'Rasio alokasi',
'cancel': 'Membatalkan',
'confirm': 'Mengonfirmasi',
'device_code': 'Kode perangkat',
'destination_device': 'Perangkat tujuan tugas',
'inst_nextdevice_code': 'Perangkat tujuan perintah',
'destination_configuration': 'Konfigurasi tujuan',
'operation': 'Operasi',
'device_is_not_null': 'Kode perangkat tidak boleh kosong'
},
'rules': {
}
}
}

View File

@@ -0,0 +1,23 @@
export default {
'config': {
'table': {
'device_execution': '执行设备',
'please_select': '请选择',
'end_of_instruction': '指令终点',
'end_of_task': '任务终点',
'end_device': '终点设备',
'max': '最大数量',
'allocation_ratio': '分配比例',
'cancel': '取消',
'confirm': '确定',
'device_code': '设备编码',
'destination_device': '任务终点设备',
'inst_nextdevice_code': '指令终点设备',
'destination_configuration': '终点配置',
'operation': '操作',
'device_is_not_null': '设备编码不能为空'
},
'rules': {
}
}
}

View File

@@ -12,6 +12,9 @@ import address from './address/en'
import storageCell from './storageCell/en' import storageCell from './storageCell/en'
import route from './route/en' import route from './route/en'
import auto from './auto/en' import auto from './auto/en'
import monitor from './monitor/en'
import timing from './timing/en'
import config from './config/en'
import customPolicy from './customPolicy/en' import customPolicy from './customPolicy/en'
export default { export default {
@@ -29,6 +32,9 @@ export default {
...storageCell, ...storageCell,
...route, ...route,
...auto, ...auto,
...customPolicy ...customPolicy,
...monitor,
...timing,
...config
} }

View File

@@ -12,6 +12,9 @@ import address from './address/in'
import storageCell from './storageCell/in' import storageCell from './storageCell/in'
import route from './route/in' import route from './route/in'
import auto from './auto/in' import auto from './auto/in'
import monitor from './monitor/in'
import timing from './timing/in'
import config from './config/in'
import customPolicy from './customPolicy/in' import customPolicy from './customPolicy/in'
export default { export default {
@@ -29,5 +32,9 @@ export default {
...storageCell, ...storageCell,
...route, ...route,
...auto, ...auto,
...customPolicy ...customPolicy,
...auto,
...monitor,
...config,
...timing
} }

View File

@@ -0,0 +1,43 @@
export default {
'monitor': {
'table': {
'clear': 'Clear',
'username': 'Username',
'IP_source': 'IP source',
'description': 'Description',
'browser': 'Browser',
'create_time': 'Creation time',
'exception_details': 'Exception details',
'view_details': 'View details',
'clear_log': 'Are you sure you want to clear all exception logs?',
'prompt': 'Prompt',
'confirm': 'Confirm',
'cancel': 'Cancel',
'request_time': 'Request Time',
'search': 'Please enter the content you want to search'
},
'lucence': {
'operate': 'Operation',
'device_code': 'Device number',
'task_code': 'Task code',
'instruct_code': 'Instruction code',
'method': 'Method',
'status_code': 'Status code',
'requestparam': 'Request parameter',
'responseparam': 'Return parameter',
'logTime': 'Timestamp',
'content': 'Content details',
'method_name': 'Please enter the method name you want to search.',
'search_status_code': 'Please enter the status code you want to search.',
'search_request_param': 'Please enter the request parameter you want to search.',
'search_response_param': 'Please enter the response parameter you want to search.',
'search_content': 'Please enter the details of the content you want to search.',
'until': 'Until',
'start_time': 'start date',
'end_time': 'End date',
'the_past_week': 'The past week',
'the_past_month': 'The past month',
'the_past_three_months': 'The past three months'
}
}
}

View File

@@ -0,0 +1,43 @@
export default {
'monitor': {
'table': {
'clear': 'Mengosongkan',
'username': 'Nama pengguna',
'IP_source': 'Sumber IP',
'description': 'Deskripsi',
'browser': 'Peramban',
'create_time': 'Waktu pembuatan',
'exception_details': 'Detail pengecualian',
'view_details': 'Lihat detail',
'clear_log': 'Anda yakin ingin menghapus semua log pengecualian?',
'prompt': 'Peringatan',
'confirm': 'Konfirmasi',
'cancel': 'Batal',
'request_time': 'Waktu Permintaan',
'search': 'Silakan masukkan konten yang ingin Anda cari'
},
'lucence': {
'operate': 'Operasi',
'device_code': 'Nomor perangkat',
'task_code': 'Kode tugas',
'instruct_code': 'Kode instruksi',
'method': 'Metode',
'status_code': 'Kode status',
'requestparam': 'Parameter permintaan',
'responseparam': 'Parameter pengembalian',
'logTime': 'Stempel waktu',
'content': 'Rincian konten',
'method_name': 'Silakan masukkan nama metode yang ingin Anda cari.',
'search_status_code': 'Silakan masukkan kode status yang ingin Anda cari.',
'search_request_param': 'Silakan masukkan parameter permintaan yang ingin Anda cari.',
'search_response_param': 'Silakan masukkan parameter respons yang ingin Anda cari.',
'search_content': 'Silakan masukkan rincian konten yang ingin Anda cari.',
'until': 'Sampai',
'start_time': 'Tanggal mulai',
'end_time': 'Tanggal berakhir',
'the_past_week': 'Minggu terakhir',
'the_past_month': 'Bulan terakhir',
'the_past_three_months': 'Tiga bulan terakhir'
}
}
}

View File

@@ -0,0 +1,43 @@
export default {
'monitor': {
'table': {
'clear': '清空',
'username': '用户名',
'IP_source': 'IP来源',
'description': '描述',
'browser': '浏览器',
'create_time': '创建时间',
'exception_details': '异常详情',
'view_details': '查看详情',
'clear_log': '确认清空所有异常日志吗?',
'prompt': '提示',
'confirm': '确认',
'cancel': '取消',
'request_time': '请求耗时',
'search': '请输入你要搜索的内容'
},
'lucence': {
'operate': '操作',
'device_code': '设备号',
'task_code': '任务编码',
'instruct_code': '指令编码',
'method': '方法',
'status_code': '状态码',
'requestparam': '请求参数',
'responseparam': '返回参数',
'logTime': '记录时间',
'content': '内容详情',
'method_name': '请输入你要搜索的方法名',
'search_status_code': '请输入你要搜索的状态码',
'search_request_param': '请输入你要搜索的请求参数',
'search_response_param': '请输入你要搜索的返回参数',
'search_content': '请输入你要搜索的内容详情',
'until': '至',
'start_time': '开始日期',
'end_time': '结束日期',
'the_past_week': '最近一周',
'the_past_month': '最近一个月',
'the_past_three_months': '最近三个月'
}
}
}

View File

@@ -35,7 +35,22 @@ export default {
'Creator': 'Creator', 'Creator': 'Creator',
'Create_time': 'Creation time', 'Create_time': 'Creation time',
'Operation': 'Operation', 'Operation': 'Operation',
'Create_command': 'Create command' 'Create_command': 'Create command',
'Reset': 'Reset',
'Void': 'Void',
'Starting_point': 'Starting point',
'Target_point': 'Target point',
'Is_it_completed': 'Is it completed',
'error_code': 'Error code',
'start_time': 'Start time',
'finish_time': 'Completion time',
'create_type': 'Create type',
'finish_type': 'Completion type',
'retry_times': 'Retry count',
'please_enter_origin-column': 'Please enter origin-column!',
'please_enter_origin_level': 'Please enter origin-level!',
'please_select_destination_column': 'Please select destination-column!',
'please_select_destination_level': 'Please select the destination floor!'
} }
} }
} }

View File

@@ -35,7 +35,22 @@ export default {
'Creator': 'Pencipta', 'Creator': 'Pencipta',
'Create_time': 'Waktu penciptaan', 'Create_time': 'Waktu penciptaan',
'Operation': 'Operasi', 'Operation': 'Operasi',
'Create_command': 'Perintah membuat' 'Create_command': 'Perintah membuat',
'Reset': 'Atur ulang',
'Void': 'Batal',
'Starting_point': 'Titik awal',
'Target_point': 'Titik tujuan',
'Is_it_completed': 'Apakah sudah selesai',
'error_code': 'Kode kesalahan',
'start_time': 'Waktu mulai',
'finish_time': 'Waktu penyelesaian',
'create_type': 'Jenis pembuatan',
'finish_type': 'Jenis penyelesaian',
'retry_times': 'Jumlah percobaan ulang',
'please_enter_origin_column': 'Silakan masukkan asal-kolom!',
'please_enter_origin_level': 'Silakan masukkan asal-level!',
'please_select_destination_column': 'Silakan pilih tujuan-kolom!',
'please_select_destination_level': 'Silakan pilih lantai tujuan!”'
} }
} }
} }

View File

@@ -35,7 +35,22 @@ export default {
'Creator': '创建者', 'Creator': '创建者',
'Create_time': '创建时间', 'Create_time': '创建时间',
'Operation': '操作', 'Operation': '操作',
'Create_command': '创建指令' 'Create_command': '创建指令',
'Reset': '重置',
'Void': '作废',
'Starting_point': '起始点位',
'Target_point': '目标点位',
'Is_it_completed': '是否完成',
'error_code': '错误编码',
'start_time': '开始时间',
'finish_time': '完成时间',
'create_type': '创建类型',
'finish_type': '完成类型',
'retry_times': '重试次数',
'please_enter_origin-column': '请输入起点-列!',
'please_enter_origin_level': '请输入起点-层!',
'please_select_destination_column': '请选择终点-列!',
'please_select_destination_level': '请选择终点-层!'
} }
} }
} }

View File

@@ -0,0 +1,25 @@
export default {
'Timing': {
'DB': {
'job_id': 'job_id',
'job_name': 'job_name',
'bean_name': 'bean_name',
'method_name': 'method_name',
'thread_state': 'thread_state',
'params': 'params',
'cron_expression': 'cron_expression',
'is_pause': 'is_pause',
'description': 'description',
'create_time': 'create_time',
'log': 'log',
'edit': 'edit',
'execute': 'execute',
'restore': 'restore',
'suspend': 'suspend'
},
'msg': {
'select_msg': 'Enter task name to search for',
'delete_msg': 'Are you sure to stop and delete this task?'
}
}
}

View File

@@ -0,0 +1,25 @@
export default {
'Timing': {
'DB': {
'job_id': 'ID Tugas',
'job_name': 'Tugas Nama',
'bean_name': 'Nama kacang',
'method_name': 'Metode eksekusi',
'thread_state': 'Status benang',
'params': 'parameter',
'cron_expression': 'ekspresi cron',
'is_pause': 'keadaan',
'description': 'deskripsikan',
'create_time': 'Tarikh penciptaan',
'log': 'jurnal',
'edit': 'edit',
'execute': 'implementasi',
'restore': 'Kembalikan',
'suspend': 'suspend'
},
'msg': {
'select_msg': 'Masukkan nama tugas untuk dicari',
'delete_msg': 'Apakah Anda yakin untuk menghentikan dan menghapus tugas ini?'
}
}
}

View File

@@ -0,0 +1,25 @@
export default {
'Timing': {
'DB': {
'job_id': '任务ID',
'job_name': '任务名称',
'bean_name': 'Bean名称',
'method_name': '执行方法',
'thread_state': '线程状态',
'params': '参数',
'cron_expression': 'cron表达式',
'is_pause': '状态',
'description': '描述',
'create_time': '创建日期',
'log': '日志',
'edit': '编辑',
'execute': '执行',
'restore': '恢复',
'suspend': '暂停'
},
'msg': {
'select_msg': '输入任务名称搜索',
'delete_msg': '确定停止并删除该任务吗?'
}
}
}

View File

@@ -8,16 +8,16 @@
<el-dialog <el-dialog
:close-on-click-modal="false" :close-on-click-modal="false"
:before-close="crud.cancelCU" :before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0" :visible.sync="crud.status.cu"
:title="crud.status.title" :title="crud.status.title"
width="800px" width="800px"
> >
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
<el-form-item label="执行设备" prop="device_code"> <el-form-item :label="$t('config.table.device_execution')" prop="device_code">
<el-select <el-select
v-model="form.device_code" v-model="form.device_code"
filterable filterable
placeholder="请选择" :placeholder="$t('config.table.please_select')"
style="width: 300px;" style="width: 300px;"
:disabled="crud.status.edit == 1" :disabled="crud.status.edit == 1"
> >
@@ -29,12 +29,12 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="指令终点" prop="inst_nextDevice_code"> <el-form-item :label="$t('config.table.end_of_instruction')" prop="inst_nextDevice_code">
<el-select <el-select
v-model="form.inst_nextdevice_code" v-model="form.inst_nextdevice_code"
multiple multiple
filterable filterable
placeholder="请选择" :placeholder="$t('config.table.please_select')"
style="width: 300px;" style="width: 300px;"
@change="getValue" @change="getValue"
> >
@@ -46,12 +46,12 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="任务终点" prop="task_nextDevice_code"> <el-form-item :label="$t('config.table.end_of_task')" prop="task_nextDevice_code">
<el-select <el-select
v-model="form.task_nextdevice_code" v-model="form.task_nextdevice_code"
filterable filterable
multiple multiple
placeholder="请选择" :placeholder="$t('config.table.please_select')"
style="width: 300px;" style="width: 300px;"
> >
<el-option <el-option
@@ -69,16 +69,16 @@
> >
<el-table-column <el-table-column
prop="device" prop="device"
label="终点设备" :label="$t('config.table.end_device')"
width="180" width="180"
/> />
<el-table-column prop="limit" label="最大数量"> <el-table-column prop="limit" :label="$t('config.table.max')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="form.tableData[scope.$index].limit" size="mini" class="edit-input" /> <el-input v-model="form.tableData[scope.$index].limit" size="mini" class="edit-input" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="scale" label="分配比例"> <el-table-column prop="scale" :label="$t('config.table.allocation_ratio')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="form.tableData[scope.$index].scale" size="mini" class="edit-input" /> <el-input v-model="form.tableData[scope.$index].scale" size="mini" class="edit-input" />
</template> </template>
@@ -87,8 +87,8 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button> <el-button type="text" @click="crud.cancelCU">{{ $t('config.table.cancel') }}</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button> <el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">{{ $t('config.table.confirm') }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!--表格渲染--> <!--表格渲染-->
@@ -103,13 +103,13 @@
<!-- <el-table-column type="selection" width="55" />--> <!-- <el-table-column type="selection" width="55" />-->
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="assigned_id" label="任务标识" /> <el-table-column v-if="false" prop="assigned_id" label="任务标识" />
<el-table-column prop="device_code" label="设备编码" /> <el-table-column prop="device_code" :label="$t('config.table.device_code')" />
<el-table-column prop="task_nextdevice_code" label="任务终点设备" /> <el-table-column prop="task_nextdevice_code" :label="$t('config.table.destination_device')" />
<el-table-column prop="inst_nextdevice_code" label="指令终点设备" /> <el-table-column prop="inst_nextdevice_code" :label="$t('config.table.inst_nextdevice_code')" />
<el-table-column prop="param" label="终点配置" :formatter="paramFormate" /> <el-table-column prop="param" :label="$t('config.table.destination_configuration')" :formatter="paramFormate" />
<el-table-column <el-table-column
v-permission="['admin','AcsDeviceAssigned:edit','AcsDeviceAssigned:del']" v-permission="['admin','AcsDeviceAssigned:edit','AcsDeviceAssigned:del']"
label="操作" :label="$t('config.table.operation')"
width="150px" width="150px"
align="center" align="center"
> >
@@ -170,7 +170,7 @@ export default {
deviceList: [], deviceList: [],
rules: { rules: {
device_code: [ device_code: [
{ required: true, message: '设备编码不能为空', trigger: 'blur' } { required: true, message: this.$t('config.table.device_is_not_null'), trigger: 'blur' }
] ]
} }
} }

View File

@@ -8,16 +8,16 @@
<el-dialog <el-dialog
:close-on-click-modal="false" :close-on-click-modal="false"
:before-close="crud.cancelCU" :before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0" :visible.sync="crud.status.cu"
:title="crud.status.title" :title="crud.status.title"
width="800px" width="800px"
> >
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
<el-form-item label="执行设备" prop="device_code"> <el-form-item :label="$t('config.table.device_execution')" prop="device_code">
<el-select <el-select
v-model="form.device_code" v-model="form.device_code"
filterable filterable
placeholder="请选择" :placeholder="$t('config.table.please_select')"
style="width: 300px;" style="width: 300px;"
:disabled="crud.status.edit == 1" :disabled="crud.status.edit == 1"
> >
@@ -29,12 +29,12 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="指令终点" prop="inst_nextDevice_code"> <el-form-item :label="$t('config.table.end_of_instruction')" prop="inst_nextDevice_code">
<el-select <el-select
v-model="form.inst_nextdevice_code" v-model="form.inst_nextdevice_code"
multiple multiple
filterable filterable
placeholder="请选择" :placeholder="$t('config.table.please_select')"
style="width: 300px;" style="width: 300px;"
@change="getValue" @change="getValue"
> >
@@ -46,12 +46,12 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="任务终点" prop="task_nextDevice_code"> <el-form-item :label="$t('config.table.end_of_task')" prop="task_nextDevice_code">
<el-select <el-select
v-model="form.task_nextdevice_code" v-model="form.task_nextdevice_code"
filterable filterable
multiple multiple
placeholder="请选择" :placeholder="$t('config.table.please_select')"
style="width: 300px;" style="width: 300px;"
> >
<el-option <el-option
@@ -69,16 +69,16 @@
> >
<el-table-column <el-table-column
prop="device" prop="device"
label="终点设备" :label="$t('config.table.end_device')"
width="180" width="180"
/> />
<el-table-column prop="limit" label="最大数量"> <el-table-column prop="limit" :label="$t('config.table.max')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="form.tableData[scope.$index].limit" size="mini" class="edit-input" /> <el-input v-model="form.tableData[scope.$index].limit" size="mini" class="edit-input" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="scale" label="分配比例"> <el-table-column prop="scale" :label="$t('config.table.allocation_ratio')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="form.tableData[scope.$index].scale" size="mini" class="edit-input" /> <el-input v-model="form.tableData[scope.$index].scale" size="mini" class="edit-input" />
</template> </template>
@@ -87,8 +87,8 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button> <el-button type="text" @click="crud.cancelCU">{{ $t('config.table.cancel') }}</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button> <el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">{{ $t('config.table.confirm') }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!--表格渲染--> <!--表格渲染-->
@@ -103,13 +103,13 @@
<!-- <el-table-column type="selection" width="55" />--> <!-- <el-table-column type="selection" width="55" />-->
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="assigned_id" label="任务标识" /> <el-table-column v-if="false" prop="assigned_id" label="任务标识" />
<el-table-column prop="device_code" label="设备编码" /> <el-table-column prop="device_code" :label="$t('config.table.device_code')" />
<el-table-column prop="task_nextdevice_code" label="任务终点设备" /> <el-table-column prop="task_nextdevice_code" :label="$t('config.table.destination_device')" />
<el-table-column prop="inst_nextdevice_code" label="指令终点设备" /> <el-table-column prop="inst_nextdevice_code" :label="$t('config.table.inst_nextdevice_code')" />
<el-table-column prop="param" label="终点配置" :formatter="paramFormate" /> <el-table-column prop="param" :label="$t('config.table.destination_configuration')" :formatter="paramFormate" />
<el-table-column <el-table-column
v-permission="['admin','AcsDeviceAssigned:edit','AcsDeviceAssigned:del']" v-permission="['admin','AcsDeviceAssigned:edit','AcsDeviceAssigned:del']"
label="操作" :label="$t('config.table.operation')"
width="150px" width="150px"
align="center" align="center"
> >
@@ -170,7 +170,7 @@ export default {
deviceList: [], deviceList: [],
rules: { rules: {
device_code: [ device_code: [
{ required: true, message: '设备编码不能为空', trigger: 'blur' } { required: true, message: this.$t('config.table.device_is_not_null'), trigger: 'blur' }
] ]
} }
} }

View File

@@ -84,7 +84,6 @@
v-model="form.put_device_code" v-model="form.put_device_code"
filterable filterable
reserve-keyword reserve-keyword
multiple
placeholder="请选择" placeholder="请选择"
> >
<el-option <el-option
@@ -288,7 +287,8 @@ export default {
props: { props: {
parentForm: { parentForm: {
type: Object, type: Object,
require: true require: true,
default: () => ({})
} }
}, },
data() { data() {

View File

@@ -88,7 +88,7 @@
icon="el-icon-refresh" icon="el-icon-refresh"
@click="reload" @click="reload"
> >
{{ $t('common.Synchronize') }} {{ $t('common.synchronous') }}
</el-button> </el-button>
</crudOperation> </crudOperation>
<!--表单组件--> <!--表单组件-->
@@ -387,6 +387,7 @@ import pagination from '@crud/Pagination'
import deviceCrud from '@/api/acs/device/device' import deviceCrud from '@/api/acs/device/device'
import routeCurd from '@/api/acs/route/routePlan' import routeCurd from '@/api/acs/route/routePlan'
import { getDicts } from '@/views/system/dict/dict' import { getDicts } from '@/views/system/dict/dict'
import i18n from '@/i18n'
export default { export default {
name: 'Task', name: 'Task',
@@ -394,7 +395,7 @@ export default {
dicts: ['task_status', 'task_type', 'agv_system_type', 'storage_task_type'], dicts: ['task_status', 'task_type', 'agv_system_type', 'storage_task_type'],
mixins: [presenter(), header(), crud()], mixins: [presenter(), header(), crud()],
cruds() { cruds() {
return CRUD({ title: '任务', url: 'api/task', idField: 'task_id', sort: 'task_id,desc', return CRUD({ title: i18n.t('task.txt_box.Task'), url: 'api/task', idField: 'task_id', sort: 'task_id,desc',
optShow: { optShow: {
add: false, add: false,
edit: true, edit: true,
@@ -408,7 +409,7 @@ export default {
const checkFromY = (rule, value, callback) => { const checkFromY = (rule, value, callback) => {
if (this.start_flag) { if (this.start_flag) {
if (!value) { if (!value) {
callback(new Error('请选择起点-列!')) callback(new Error(this.$t('task.select.please_enter_origin_column')))
} else { } else {
callback() callback()
} }
@@ -419,7 +420,7 @@ export default {
const checkFromZ = (rule, value, callback) => { const checkFromZ = (rule, value, callback) => {
if (this.start_flag) { if (this.start_flag) {
if (!value) { if (!value) {
callback(new Error('请选择起点-层!')) callback(new Error(this.$t('task.select.please_enter_origin_level')))
} else { } else {
callback() callback()
} }
@@ -430,7 +431,7 @@ export default {
const checkToY = (rule, value, callback) => { const checkToY = (rule, value, callback) => {
if (this.end_flag) { if (this.end_flag) {
if (!value) { if (!value) {
callback(new Error('请选择终点-列!')) callback(new Error(this.$t('task.select.please_select_destination_column')))
} else { } else {
callback() callback()
} }
@@ -441,7 +442,7 @@ export default {
const checkToZ = (rule, value, callback) => { const checkToZ = (rule, value, callback) => {
if (this.end_flag) { if (this.end_flag) {
if (!value) { if (!value) {
callback(new Error('请选择终点-列!')) callback(new Error(this.$t('task.select.please_select_destination_level')))
} else { } else {
callback() callback()
} }

View File

@@ -5,7 +5,7 @@
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'--> <!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" /> <crudOperation :permission="permission" />
<!--表单组件--> <!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu" :title="crud.status.title" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="任务反馈标识" prop="taskback_id"> <el-form-item label="任务反馈标识" prop="taskback_id">
<el-input v-model="form.taskback_id" style="width: 370px;" /> <el-input v-model="form.taskback_id" style="width: 370px;" />
@@ -91,37 +91,37 @@
<!--表格渲染--> <!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column v-permission="['admin','taskFeedback:edit','taskFeedback:del']" fixed="left" label="操作" width="100px" align="center"> <el-table-column v-permission="['admin','taskFeedback:edit','taskFeedback:del']" fixed="left" :label="$t('task.select.Operation')" width="100px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-dropdown trigger="click" @command="handleCommand"> <el-dropdown trigger="click" @command="handleCommand">
<span class="el-dropdown-link"> <span class="el-dropdown-link">
<i class="el-icon-menu" /> <i class="el-icon-menu" />
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">重置</el-dropdown-item> <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">{{ $t('task.select.Reset') }}</el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">作废</el-dropdown-item> <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">{{ $t('task.select.Void') }}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="false" prop="taskback_id" label="任务反馈标识" /> <el-table-column v-if="false" prop="taskback_id" label="任务反馈标识" />
<el-table-column v-if="false" prop="task_id" label="任务标识" /> <el-table-column v-if="false" prop="task_id" label="任务标识" />
<el-table-column prop="task_code" label="任务号" /> <el-table-column prop="task_code" :label="$t('task.txt_box.Task_code')" />
<el-table-column prop="task_type" label="任务类型" /> <el-table-column prop="task_type" :label="$t('task.txt_box.Task_type')" />
<el-table-column prop="task_status" label="任务状态" /> <el-table-column prop="task_status" :label="$t('task.txt_box.Task_status')" />
<el-table-column prop="start_point_code" label="起始点位" /> <el-table-column prop="start_point_code" :label="$t('task.select.Starting_point')" />
<el-table-column prop="next_point_code" label="目标点位" /> <el-table-column prop="next_point_code" :label="$t('task.select.Target_point')" />
<el-table-column prop="vehicle_code" label="载具号" /> <el-table-column prop="vehicle_code" :label="$t('task.txt_box.Vehicle_number')" />
<el-table-column prop="is_finished" label="是否完成" /> <el-table-column prop="is_finished" :label="$t('task.select.Is_it_completed')" />
<el-table-column prop="error_code" label="错误编码" /> <el-table-column prop="error_code" :label="$t('task.select.error_code')" />
<el-table-column prop="start_time" label="开始时间" /> <el-table-column prop="start_time" :label="$t('task.select.start_time')" />
<el-table-column prop="finish_time" label="完成时间" /> <el-table-column prop="finish_time" :label="$t('task.select.finish_time')" />
<el-table-column prop="create_type" label="创建类型" /> <el-table-column prop="create_type" :label="$t('task.select.create_type')" />
<el-table-column prop="finish_type" label="完成类型" /> <el-table-column prop="finish_type" :label="$t('task.select.finish_type')" />
<el-table-column prop="retry_times" label="重试次数" /> <el-table-column prop="retry_times" :label="$t('task.select.retry_times')" />
<el-table-column prop="remark" label="备注" /> <el-table-column prop="remark" :label="$t('task.select.Remark')" />
<el-table-column prop="create_by" label="创建者" /> <el-table-column prop="create_by" :label="$t('task.select.Creator')" />
<el-table-column prop="create_time" label="创建时间" /> <el-table-column prop="create_time" :label="$t('task.select.Create_time')" />
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
<pagination /> <pagination />
@@ -130,11 +130,11 @@
</template> </template>
<script> <script>
import crudTaskFeedback, { invalid } from '@/api/acs/task/taskFeedback' import crudTaskFeedback /* { invalid } */ from '@/api/acs/task/taskFeedback'
import CRUD, { presenter, header, form, crud } from '@crud/crud' import CRUD, { presenter, header, form, crud } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation' import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import crudTask from '@/api/acs/task/task' // import crudTask from '@/api/acs/task/task'
const defaultForm = { taskback_id: null, task_id: null, task_code: null, vehicle_code: null, vehicle_type: null, task_type: null, task_status: null, is_finished: null, error_code: null, start_time: null, finish_time: null, create_type: null, finish_type: null, retry_times: null, start_point_code: null, start_device_code: null, next_point_code: null, next_device_code: null, remark: null, is_active: null, is_delete: null, create_by: null, create_time: null, update_by: null, update_time: null } const defaultForm = { taskback_id: null, task_id: null, task_code: null, vehicle_code: null, vehicle_type: null, task_type: null, task_status: null, is_finished: null, error_code: null, start_time: null, finish_time: null, create_type: null, finish_type: null, retry_times: null, start_point_code: null, start_device_code: null, next_point_code: null, next_device_code: null, remark: null, is_active: null, is_delete: null, create_by: null, create_time: null, update_by: null, update_time: null }
export default { export default {

View File

@@ -12,7 +12,7 @@
:loading="crud.delAllLoading" :loading="crud.delAllLoading"
@click="confirmDelAll()" @click="confirmDelAll()"
> >
清空 {{ $t('monitor.table.clear') }}
</el-button> </el-button>
</crudOperation> </crudOperation>
</div> </div>
@@ -30,23 +30,23 @@
</el-form> </el-form>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="username" label="用户名" /> <el-table-column prop="username" :label="$t('monitor.table.username')" />
<el-table-column prop="request_ip" label="IP" /> <el-table-column prop="request_ip" label="IP" />
<el-table-column show-overflow-tooltip prop="address" label="IP来源" /> <el-table-column show-overflow-tooltip prop="address" :label="$t('monitor.table.IP_source')" />
<el-table-column prop="description" label="描述" show-overflow-tooltip /> <el-table-column prop="description" :label="$t('monitor.table.description')" show-overflow-tooltip />
<el-table-column prop="browser" label="浏览器" min-width="120" show-overflow-tooltip /> <el-table-column prop="browser" :label="$t('monitor.table.browser')" min-width="120" show-overflow-tooltip />
<el-table-column prop="create_time" label="创建日期" min-width="100" show-overflow-tooltip> <el-table-column prop="create_time" :label="$t('monitor.table.create_time')" min-width="100" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.create_time) }}</span> <span>{{ parseTime(scope.row.create_time) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="异常详情" width="100px"> <el-table-column :label="$t('monitor.table.exception_details')" width="100px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" @click="info(scope.row.log_id)">查看详情</el-button> <el-button size="mini" type="text" @click="info(scope.row.log_id)">{{ $t('monitor.table.view_details') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-dialog :visible.sync="dialog" title="异常详情" append-to-body top="30px" width="85%"> <el-dialog :visible.sync="dialog" :title="$t('monitor.table.exception_details')" append-to-body top="30px" width="85%">
<pre v-highlightjs="errorInfo"><code class="java" /></pre> <pre v-highlightjs="errorInfo"><code class="java" /></pre>
</el-dialog> </el-dialog>
<!--分页组件--> <!--分页组件-->
@@ -90,9 +90,9 @@ export default {
}) })
}, },
confirmDelAll() { confirmDelAll() {
this.$confirm(`确认清空所有异常日志吗?`, '提示', { this.$confirm(this.$t('monitor.table.clear_log'), this.$t('monitor.table.prompt'), {
confirmButtonText: '确定', confirmButtonText: this.$t('monitor.table.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('monitor.table.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.crud.delAllLoading = true this.crud.delAllLoading = true

View File

@@ -12,7 +12,7 @@
:loading="crud.delAllLoading" :loading="crud.delAllLoading"
@click="confirmDelAll()" @click="confirmDelAll()"
> >
清空 {{ $t('monitor.table.clear') }}
</el-button> </el-button>
</crudOperation> </crudOperation>
</div> </div>
@@ -30,19 +30,19 @@
</el-form> </el-form>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="username" label="用户名" /> <el-table-column prop="username" :label="$t('monitor.table.username')" />
<el-table-column prop="request_ip" label="IP" /> <el-table-column prop="request_ip" label="IP" />
<el-table-column show-overflow-tooltip prop="address" label="IP来源" /> <el-table-column show-overflow-tooltip prop="address" :label="$t('monitor.table.IP_source')" />
<el-table-column prop="description" label="描述" show-overflow-tooltip /> <el-table-column prop="description" :label="$t('monitor.table.description')" show-overflow-tooltip />
<el-table-column prop="browser" label="浏览器" min-width="120" show-overflow-tooltip /> <el-table-column prop="browser" :label="$t('monitor.table.browser')" min-width="120" show-overflow-tooltip />
<el-table-column prop="time" label="请求耗时" align="center"> <el-table-column prop="time" :label="$t('monitor.table.request_time')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag> <el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag>
<el-tag v-else-if="scope.row.time <= 1000" type="warning">{{ scope.row.time }}ms</el-tag> <el-tag v-else-if="scope.row.time <= 1000" type="warning">{{ scope.row.time }}ms</el-tag>
<el-tag v-else type="danger">{{ scope.row.time }}ms</el-tag> <el-tag v-else type="danger">{{ scope.row.time }}ms</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="create_time" label="创建日期" width="180px"> <el-table-column prop="create_time" :label="$t('monitor.table.create_time')" width="180px">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.create_time) }}</span> <span>{{ parseTime(scope.row.create_time) }}</span>
</template> </template>
@@ -77,9 +77,9 @@ export default {
}, },
methods: { methods: {
confirmDelAll() { confirmDelAll() {
this.$confirm(`确认清空所有操作日志吗?`, '提示', { this.$confirm(this.$t('monitor.table.clear_log'), this.$t('monitor.table.prompt'), {
confirmButtonText: '确定', confirmButtonText: this.$t('monitor.table.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('monitor.table.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.crud.delAllLoading = true this.crud.delAllLoading = true

View File

@@ -4,7 +4,7 @@
v-model="query.blurry" v-model="query.blurry"
clearable clearable
size="mini" size="mini"
placeholder="请输入你要搜索的内容" :placeholder="$t('monitor.table.search')"
style="width: 200px;" style="width: 200px;"
class="filter-item" class="filter-item"
/> />

View File

@@ -14,16 +14,16 @@
> >
<!-- <el-table-column type="selection" width="55"/>--> <!-- <el-table-column type="selection" width="55"/>-->
<!-- <el-table-column v-if="false" prop="id" label="id"/>--> <!-- <el-table-column v-if="false" prop="id" label="id"/>-->
<el-table-column prop="operate" width="50" label="操作" /> <el-table-column prop="operate" width="50" :label="$t('monitor.lucence.operate')" />
<el-table-column prop="device_code" label="设备号" min-width="130" show-overflow-tooltip /> <el-table-column prop="device_code" :label="$t('monitor.lucence.device_code')" min-width="130" show-overflow-tooltip />
<el-table-column prop="task_code" label="任务编号" /> <el-table-column prop="task_code" :label="$t('monitor.lucence.task_code')" />
<el-table-column prop="instruct_code" label="指令编号" /> <el-table-column prop="instruct_code" :label="$t('monitor.lucence.instruct_code')" />
<el-table-column prop="method" label="方法" /> <el-table-column prop="method" :label="$t('monitor.lucence.method')" />
<el-table-column prop="status_code" label="状态码" /> <el-table-column prop="status_code" :label="$t('monitor.lucence.status_code')" />
<el-table-column prop="requestparam" label="请求参数" /> <el-table-column prop="requestparam" :label="$t('monitor.lucence.requestparam')" />
<el-table-column prop="responseparam" label="返回参数" /> <el-table-column prop="responseparam" :label="$t('monitor.lucence.responseparam')" />
<el-table-column prop="logTime" width="170" label="记录时间" /> <el-table-column prop="logTime" width="170" :label="$t('monitor.lucence.logTime')" />
<el-table-column prop="content" width="500" label="内容详情" /> <el-table-column prop="content" width="500" :label="$t('monitor.lucence.content')" />
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
@@ -82,9 +82,9 @@ export default {
return true return true
}, },
confirmDelAll() { confirmDelAll() {
this.$confirm(`确认清空所有操作日志吗?`, '提示', { this.$confirm(this.$t('monitor.table.clear_log'), this.$t('monitor.table.prompt'), {
confirmButtonText: '确定', confirmButtonText: this.$t('monitor.table.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('monitor.table.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.crud.delAllLoading = true this.crud.delAllLoading = true

View File

@@ -27,7 +27,7 @@
filterable filterable
clearable clearable
reserve-keyword reserve-keyword
placeholder="设备号" :placeholder="$t('monitor.lucence.device_code')"
style="width: 190px;" style="width: 190px;"
@change="crud.toQuery" @change="crud.toQuery"
> >
@@ -43,7 +43,7 @@
v-model="query.method" v-model="query.method"
clearable clearable
size="small" size="small"
placeholder="请输入你要搜索的方法名" :placeholder="$t('monitor.lucence.method_name')"
style="width: 200px;" style="width: 200px;"
class="filter-item" class="filter-item"
/> />
@@ -51,7 +51,7 @@
v-model="query.status_code" v-model="query.status_code"
clearable clearable
size="small" size="small"
placeholder="请输入你要搜索的状态码" :placeholder="$t('monitor.lucence.search_status_code')"
style="width: 200px;" style="width: 200px;"
class="filter-item" class="filter-item"
/> />
@@ -59,7 +59,7 @@
v-model="query.requestparam" v-model="query.requestparam"
clearable clearable
size="small" size="small"
placeholder="请输入你要搜索的请求参数" :placeholder="$t('monitor.lucence.search_request_param')"
style="width: 200px;" style="width: 200px;"
class="filter-item" class="filter-item"
/> />
@@ -67,7 +67,7 @@
v-model="query.responseparam" v-model="query.responseparam"
clearable clearable
size="small" size="small"
placeholder="请输入你要搜索的返回参数" :placeholder="$t('monitor.lucence.search_response_param')"
style="width: 200px;" style="width: 200px;"
class="filter-item" class="filter-item"
/> />
@@ -75,7 +75,7 @@
v-model="query.blurry" v-model="query.blurry"
clearable clearable
size="small" size="small"
placeholder="请输入你要搜索的内容详情" :placeholder="$t('monitor.lucence.search_content')"
style="width: 200px;" style="width: 200px;"
class="filter-item" class="filter-item"
/> />
@@ -88,9 +88,9 @@
type="datetimerange" type="datetimerange"
:picker-options="pickerOptions" :picker-options="pickerOptions"
format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss"
range-separator="" :range-separator="$t('monitor.lucence.until')"
start-placeholder="开始日期" :start-placeholder="$t('monitor.lucence.start_time')"
end-placeholder="结束日期" :end-placeholder="$t('monitor.lucence.end_time')"
align="right" align="right"
/> />
<rrOperation /> <rrOperation />
@@ -110,7 +110,7 @@ export default {
return { return {
pickerOptions: { pickerOptions: {
shortcuts: [{ shortcuts: [{
text: '最近一周', text: this.$t('monitor.lucence.the_past_week'),
onClick(picker) { onClick(picker) {
const end = new Date() const end = new Date()
const start = new Date() const start = new Date()
@@ -118,7 +118,7 @@ export default {
picker.$emit('pick', [start, end]) picker.$emit('pick', [start, end])
} }
}, { }, {
text: '最近一个月', text: this.$t('monitor.lucence.the_past_month'),
onClick(picker) { onClick(picker) {
const end = new Date() const end = new Date()
const start = new Date() const start = new Date()
@@ -126,7 +126,7 @@ export default {
picker.$emit('pick', [start, end]) picker.$emit('pick', [start, end])
} }
}, { }, {
text: '最近三个月', text: this.$t('monitor.lucence.the_past_three_months'),
onClick(picker) { onClick(picker) {
const end = new Date() const end = new Date()
const start = new Date() const start = new Date()

View File

@@ -8,9 +8,9 @@
v-model="query.createTime" v-model="query.createTime"
type="datetimerange" type="datetimerange"
:picker-options="pickerOptions" :picker-options="pickerOptions"
range-separator="" :range-separator="$t('monitor.lucence.until')"
start-placeholder="开始日期" :start-placeholder="$t('monitor.lucence.start_time')"
end-placeholder="结束日期" :end-placeholder="$t('monitor.lucence.end_time')"
align="right" align="right"
/> />
<rrOperation /> <rrOperation />
@@ -29,7 +29,7 @@ export default {
return { return {
pickerOptions: { pickerOptions: {
shortcuts: [{ shortcuts: [{
text: '最近一周', text: this.$t('monitor.lucence.the_past_week'),
onClick(picker) { onClick(picker) {
const end = new Date() const end = new Date()
const start = new Date() const start = new Date()
@@ -37,7 +37,7 @@ export default {
picker.$emit('pick', [start, end]) picker.$emit('pick', [start, end])
} }
}, { }, {
text: '最近一个月', text: this.$t('monitor.lucence.the_past_month'),
onClick(picker) { onClick(picker) {
const end = new Date() const end = new Date()
const start = new Date() const start = new Date()
@@ -45,7 +45,7 @@ export default {
picker.$emit('pick', [start, end]) picker.$emit('pick', [start, end])
} }
}, { }, {
text: '最近三个月', text: this.$t('monitor.lucence.the_past_three_months'),
onClick(picker) { onClick(picker) {
const end = new Date() const end = new Date()
const start = new Date() const start = new Date()

View File

@@ -8,7 +8,7 @@
v-model="query.job_name" v-model="query.job_name"
clearable clearable
size="mini" size="mini"
placeholder="输入任务名称搜索" :placeholder="$t('Timing.msg.select_msg')"
style="width: 200px;" style="width: 200px;"
class="filter-item" class="filter-item"
@keyup.enter.native="toQuery" @keyup.enter.native="toQuery"
@@ -24,7 +24,7 @@
type="info" type="info"
icon="el-icon-tickets" icon="el-icon-tickets"
@click="doLog" @click="doLog"
>日志 >{{ $t('Timing.DB.log') }}
</el-button> </el-button>
</crudOperation> </crudOperation>
<Log ref="log" /> <Log ref="log" />
@@ -101,19 +101,19 @@
@selection-change="crud.selectionChangeHandler" @selection-change="crud.selectionChangeHandler"
> >
<el-table-column :selectable="checkboxT" type="selection" width="55" /> <el-table-column :selectable="checkboxT" type="selection" width="55" />
<el-table-column show-overflow-tooltip prop="job_id" label="任务ID" /> <el-table-column show-overflow-tooltip prop="job_id" :label="$t('Timing.DB.job_id')" />
<el-table-column show-overflow-tooltip prop="job_name" label="任务名称" min-width="120" /> <el-table-column show-overflow-tooltip prop="job_name" :label="$t('Timing.DB.job_name')" />
<el-table-column show-overflow-tooltip prop="bean_name" label="Bean名称" /> <el-table-column show-overflow-tooltip prop="bean_name" :label="$t('Timing.DB.bean_name')" />
<el-table-column show-overflow-tooltip prop="method_name" label="执行方法" /> <el-table-column show-overflow-tooltip prop="method_name" :label="$t('Timing.DB.method_name')" />
<el-table-column show-overflow-tooltip prop="params" label="参数" /> <el-table-column show-overflow-tooltip prop="params" :label="$t('Timing.DB.params')" />
<el-table-column <el-table-column
show-overflow-tooltip show-overflow-tooltip
prop="cron_expression" prop="cron_expression"
label="cron表达式" :label="$t('Timing.DB.cron_expression')"
min-width="100" min-width="100"
show-tooltip-when-overflow show-tooltip-when-overflow
/> />
<el-table-column show-overflow-tooltip prop="is_pause" width="90px" label="状态"> <el-table-column show-overflow-tooltip prop="is_pause" width="90px" :label="$t('Timing.DB.is_pause')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="scope.row.is_pause ? 'warning' : 'success'">{{ <el-tag :type="scope.row.is_pause ? 'warning' : 'success'">{{
scope.row.is_pause ? '已暂停' : '运行中' scope.row.is_pause ? '已暂停' : '运行中'
@@ -121,15 +121,15 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column show-overflow-tooltip prop="description" width="150px" label="描述" /> <el-table-column show-overflow-tooltip prop="description" width="150px" :label="$t('Timing.DB.description')" />
<el-table-column show-overflow-tooltip prop="create_time" width="136px" label="创建日期"> <el-table-column show-overflow-tooltip prop="create_time" width="136px" :label="$t('Timing.DB.create_time')">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.create_time) }}</span> <span>{{ parseTime(scope.row.create_time) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-permission="['admin','timing:edit','timing:del']" v-permission="['admin','timing:edit','timing:del']"
label="操作" :label="$t('common.Operate')"
width="170px" width="170px"
align="center" align="center"
fixed="right" fixed="right"
@@ -141,7 +141,7 @@
style="margin-right: 3px;" style="margin-right: 3px;"
type="text" type="text"
@click="crud.toEdit(scope.row)" @click="crud.toEdit(scope.row)"
>编辑 >{{ $t('Timing.DB.edit') }}
</el-button> </el-button>
<el-button <el-button
v-permission="['admin','timing:edit']" v-permission="['admin','timing:edit']"
@@ -149,16 +149,16 @@
type="text" type="text"
size="mini" size="mini"
@click="execute(scope.row.job_id)" @click="execute(scope.row.job_id)"
>执行 >{{ $t('Timing.DB.execute') }}
</el-button> </el-button>
<el-button <el-button
v-permission="['admin','timing:edit']" v-permission="['admin','timing:edit']"
style="margin-left: 3px" style="margin-left: 3px"
type="text" type="text"
size="mini" size="mini"
@click="updateStatus(scope.row.job_id,scope.row.is_pause ? '恢复' : '暂停')" @click="updateStatus(scope.row.job_id,scope.row.is_pause ? $t('Timing.DB.restore') $t('Timing.DB.suspend'))"
> >
{{ scope.row.is_pause ? '恢复' : '暂停' }} {{ scope.row.is_pause ? $t('Timing.DB.restore') : $t('Timing.DB.suspend') }}
</el-button> </el-button>
<el-popover <el-popover
:ref="scope.row.job_id" :ref="scope.row.job_id"
@@ -166,13 +166,13 @@
placement="top" placement="top"
width="200" width="200"
> >
<p>确定停止并删除该任务吗?</p> {{ $t('Timing.msg.delete_msg') }}
<div style="text-align: right; margin: 0"> <div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.job_id].doClose()">取消</el-button> <el-button size="mini" type="text" @click="$refs[scope.row.job_id].doClose()">{{ $t('common.Cancel') }}</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row.job_id)">确定 <el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row.job_id)">{{ $t('common.determine') }}
</el-button> </el-button>
</div> </div>
<el-button slot="reference" type="text" size="mini">删除</el-button> <el-button slot="reference" type="text" size="mini">{{ $t('common.Cancel') }}</el-button>
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>