rev:设备驱动国际化以及设备监控国际化

This commit is contained in:
2024-05-13 14:22:29 +08:00
parent 756f7b47e0
commit 7de225053e
54 changed files with 1106 additions and 268 deletions

View File

@@ -813,6 +813,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String move = "";
String requireSucess = "0";
if (this.requireSucess) {
requireSucess = "1";
@@ -832,18 +833,22 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("message", LangProcess.msg(message));
jo.put("error", this.getError());
String move = "无货";
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
if (this.getMove() == 0) {
move = LangProcess.msg("universal_no");
jo.put("hasGoods", false);
if (this.move == 1) {
move = "有货";
} else if (this.getMove() == 1) {
move = LangProcess.msg("universal_yes");
jo.put("hasGoods", true);
} else if (this.getMove() == 2) {
move = LangProcess.msg("universal_two_yes");
jo.put("hasGoods", true);
}
String container_type = "";
if (this.container_type == 1) {
container_type = "小托盘";
container_type = LangProcess.msg("universal_small_pallets");
} else if (this.container_type == 2) {
container_type = "大托盘";
container_type = LangProcess.msg("universal_large_pallets");
}
jo.put("move", move);
jo.put("task", task);

View File

@@ -14,6 +14,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.history.ErrorUtil;
import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.monitor.DeviceStageMonitor;
@@ -28,6 +29,7 @@ import org.nl.acs.task.service.mapper.TaskMapper;
import org.nl.acs.utils.ConvertUtil;
import org.nl.common.utils.CodeUtil;
import org.nl.config.SpringContextHolder;
import org.nl.config.language.LangProcess;
import org.openscada.opc.lib.da.Server;
import java.util.Date;
@@ -418,23 +420,22 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
String action = "";
String move = "";
if (this.getMode() == 0) {
mode = "未联机";
mode = LangProcess.msg("universal_off-line");
} else if (this.getMode() == 1) {
mode = "单机";
mode = LangProcess.msg("universal_stand-alone");
} else if (this.getMode() == 2) {
mode = "联机";
mode = LangProcess.msg("universal_standby");
} else if (this.getMode() == 3) {
mode = "运行中";
mode = LangProcess.msg("universal_operation");
}
if (this.getMove() == 0) {
move = "无货";
move = LangProcess.msg("universal_no");
jo.put("hasGoods", false);
} else if (this.getMove() == 1) {
move = "有货";
move = LangProcess.msg("universal_yes");
jo.put("hasGoods", true);
} else if (this.getMove() == 2) {
move = "有托盘有货";
move = LangProcess.msg("universal_two_yes");
jo.put("hasGoods", true);
}
jo.put("device_name", this.getDevice().getDevice_name());
@@ -442,7 +443,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
jo.put("move", move);
jo.put("action", action);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("task", this.getTask());
return jo;

View File

@@ -10,12 +10,14 @@ import org.nl.acs.agv.server.NDCAgvService;
import org.nl.acs.common.base.CommonFinalParam;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device.service.dto.DeviceDto;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.history.ErrorUtil;
import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.log.service.DeviceExecuteLogService;
@@ -229,11 +231,11 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
String move = "";
String option = "";
if (this.getOption() == 0) {
option ="禁止进出";
action = LangProcess.msg("universal_actionMessage1");
} else if (this.getOption() == 1) {
option ="允许进入";
action = LangProcess.msg("universal_actionMessage2");
} else if (this.getOption() == 2) {
option ="允许离开";
action = LangProcess.msg("universal_actionMessage3");
}
if (this.getMode() == 0) {
mode = LangProcess.msg("universal_off-line");
@@ -256,13 +258,15 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
move = LangProcess.msg("universal_two_yes");
jo.put("hasGoods", true);
}
jo.put("device_name", this.getDevice().getDevice_name());
DeviceDto dto = deviceservice.findByCode(this.getDevice().getDevice_code());
jo.put("zh_device_name",dto.getZh_device_name());
jo.put("en_device_name",dto.getEn_device_name());
jo.put("in_device_name",dto.getIn_device_name());
jo.put("mode", mode);
jo.put("move", move);
jo.put("action", action);
jo.put("isOnline", true);
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("option", option);
jo.put("is_click", true);

View File

@@ -619,9 +619,9 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
}
if (this.carrier_direction == 1) {
carrier_direction = "正转";
carrier_direction = LangProcess.msg("universal_forward_rotation");
} else if (this.carrier_direction == 2) {
carrier_direction = "反转";
carrier_direction = LangProcess.msg("universal_rollback");
}
String requireSucess = "0";
if (this.requireSucess) {
@@ -637,7 +637,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
jo.put("inst_message", this.inst_message);
jo.put("last_inst_message", this.last_inst_message);
jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("hand_barcode", hand_barcode);

View File

@@ -333,7 +333,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
jo.put("inst_message", this.inst_message);
jo.put("last_inst_message", this.last_inst_message);
jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("hand_barcode", hand_barcode);

View File

@@ -640,9 +640,9 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
if (this.carrier_direction == 1) {
carrier_direction = "正转";
carrier_direction = LangProcess.msg("universal_forward_rotation");
} else if (this.carrier_direction == 2) {
carrier_direction = "反转";
carrier_direction = LangProcess.msg("universal_rollback");
}
String requireSucess = "0";
if (this.requireSucess) {
@@ -658,7 +658,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
jo.put("inst_message", this.inst_message);
jo.put("last_inst_message", this.last_inst_message);
jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("hand_barcode", hand_barcode);

View File

@@ -633,7 +633,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
jo.put("action", action);
jo.put("task", task);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("notCreateTaskMessage", notCreateTaskMessage);

View File

@@ -800,7 +800,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
jo.put("action", action);
jo.put("task", task);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("notCreateTaskMessage", notCreateTaskMessage);

View File

@@ -396,9 +396,9 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
if (this.carrier_direction == 1) {
carrier_direction = "正转";
carrier_direction = LangProcess.msg("universal_forward_rotation");
} else if (this.carrier_direction == 2) {
carrier_direction = "反转";
carrier_direction = LangProcess.msg("universal_rollback");
}
String requireSucess = "0";
if (this.requireSucess) {
@@ -414,7 +414,7 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
jo.put("inst_message", this.inst_message);
jo.put("last_inst_message", this.last_inst_message);
jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("hand_barcode", hand_barcode);

View File

@@ -631,7 +631,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
jo.put("task", task);
jo.put("walk_y", walk_y);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("notCreateTaskMessage", notCreateTaskMessage);

View File

@@ -583,7 +583,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
jo.put("action", action);
jo.put("task", task);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("notCreateTaskMessage", notCreateTaskMessage);

View File

@@ -597,7 +597,7 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
jo.put("action", action);
jo.put("task", task);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("notCreateTaskMessage", notCreateTaskMessage);

View File

@@ -616,7 +616,7 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
jo.put("action", action);
jo.put("task", task);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("notCreateTaskMessage", notCreateTaskMessage);

View File

@@ -635,7 +635,7 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi
jo.put("action", action);
jo.put("task", task);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("notCreateTaskMessage", notCreateTaskMessage);

View File

@@ -686,7 +686,7 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
map.put("device_name", this.getDevice().getDevice_name());
map.put("is_click", true);
map.put("mode", mode);
map.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
map.put("move", move);
map.put("isOnline", this.getIsonline());
map.put("out_seq_arr", this.getItem_out_seq_arr());

View File

@@ -5,7 +5,6 @@ import org.nl.acs.device.domain.Device;
import org.nl.acs.device.enums.DeviceType;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination;
import org.nl.acs.device_driver.two_conveyor.pull_head_manipulator.ItemProtocol;
import org.springframework.stereotype.Service;
import java.util.LinkedList;

View File

@@ -11,6 +11,7 @@ import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService;
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
import org.nl.acs.instruction.domain.Instruction;
@@ -23,6 +24,7 @@ import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.route.service.impl.RouteLineServiceImpl;
import org.nl.acs.task.service.TaskService;
import org.nl.config.SpringContextHolder;
import org.nl.config.language.LangProcess;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
@@ -214,13 +216,32 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String action = "";
String move = "";
if (this.getMode() == 0) {
mode = LangProcess.msg("universal_off-line");
} else if (this.getMode() == 1) {
mode = LangProcess.msg("universal_stand-alone");
} else if (this.getMode() == 2) {
mode = LangProcess.msg("universal_standby");
} else if (this.getMode() == 3) {
mode = LangProcess.msg("universal_operation");
}
if (this.getMove() == 0) {
move = LangProcess.msg("universal_no");
jo.put("hasGoods", false);
} else if (this.getMove() == 1) {
move = LangProcess.msg("universal_yes");
jo.put("hasGoods", true);
} else if (this.getMove() == 2) {
move = LangProcess.msg("universal_two_yes");
jo.put("hasGoods", true);
}
String action = "";
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", "联机");
jo.put("action", action);
jo.put("mode", mode);
jo.put("move", move);jo.put("action", action);
jo.put("isOnline", true);
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
return jo;
}

View File

@@ -317,19 +317,24 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
String action = "";
String walk_y = "";
if (this.getMode() == 0) {
mode = "脱机";
mode = LangProcess.msg("universal_off-line");
} else if (this.getMode() == 1) {
mode = "单机";
mode = LangProcess.msg("universal_stand-alone");
} else if (this.getMode() == 2) {
mode = "待机";
mode = LangProcess.msg("universal_standby");
} else if (this.getMode() == 3) {
mode = "运行中";
mode = LangProcess.msg("universal_operation");
}
if (this.getMove() == 0) {
move = "无货";
move = LangProcess.msg("universal_no");
jo.put("hasGoods", false);
} else if (this.getMove() == 1) {
move = "有货";
move = LangProcess.msg("universal_yes");
jo.put("hasGoods", true);
} else if (this.getMove() == 2) {
move = LangProcess.msg("universal_two_yes");
jo.put("hasGoods", true);
}
String requireSucess = "0";
@@ -338,13 +343,13 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
}
jo.put("requireSucess", requireSucess);
if (this.getAction() == 1) {
action = "取货中";
action = LangProcess.msg("universal_delivery");
} else if (this.getAction() == 2) {
action = "取货完成";
action = LangProcess.msg("universal_completed");
} else if (this.getAction() == 3) {
action = "放货中";
action = LangProcess.msg("universal_releasing");
} else if (this.getAction() == 4) {
action = "放货完成";
action = LangProcess.msg("universal_releasing_completed");
}
jo.put("device_name", this.getDevice().getDevice_name());
@@ -354,7 +359,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
jo.put("task", task);
jo.put("walk_y", walk_y);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", message);
jo.put("notCreateTaskMessage", notCreateTaskMessage);

View File

@@ -1070,25 +1070,25 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
}
String command = "";
if(this.command == 0){
command = "待机";
command = LangProcess.msg("universal_standby");
}else if(this.command == 1){
command = "取货中";
command = LangProcess.msg("universal_delivery");
}else if(this.command == 2){
command = "取货完成";
command = LangProcess.msg("universal_completed");
}else if(this.command == 3){
command = "放货中";
command = LangProcess.msg("universal_releasing");
}else if(this.command == 4){
command = "请求卸货(申请卸货)";
command = LangProcess.msg("one_message1");
}else if(this.command == 5){
command = "放货完成";
command = LangProcess.msg("universal_releasing_completed");
}else if(this.command == 6){
command = "取货准备(回库台)";
command = LangProcess.msg("one_message2");
}else if(this.command == 7){
command = "召回";
command = LangProcess.msg("one_message3");
}else if(this.command == 8){
command = "急停";
command = LangProcess.msg("one_message4");
}else if(this.command == 9){
command = "未知";
command = LangProcess.msg("one_message5");
}
jo.put("mode", mode);
jo.put("move", move);

View File

@@ -699,7 +699,7 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem
jo.put("task", task);
jo.put("walk_y", walk_y);
jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(this.getError())));
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("notCreateTaskMessage", notCreateTaskMessage);

View File

@@ -18,6 +18,7 @@ import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.data.BlankingButtonRequest;
import org.nl.acs.ext.wms.data.BlankingButtonResponse;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService;
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
import org.nl.acs.instruction.domain.Instruction;
@@ -320,19 +321,19 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev
String action = "";
String walk_y = "";
if (this.getMode() == 0) {
mode = "脱机";
mode = LangProcess.msg("universal_off-line");
} else if (this.getMode() == 1) {
mode = "单机";
mode = LangProcess.msg("universal_stand-alone");
} else if (this.getMode() == 2) {
mode = "待机";
mode = LangProcess.msg("universal_standby");
} else if (this.getMode() == 3) {
mode = "运行中";
mode = LangProcess.msg("universal_operation");
}
if (this.getMove() == 0) {
move = "无货";
move = LangProcess.msg("universal_no");
} else if (this.getMove() == 1) {
move = "有货";
move = LangProcess.msg("universal_yes");
}
String requireSucess = "0";
@@ -341,13 +342,13 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev
}
jo.put("requireSucess", requireSucess);
if (this.getAction() == 1) {
action = "取货中";
action = LangProcess.msg("universal_delivery");
} else if (this.getAction() == 2) {
action = "取货完成";
action = LangProcess.msg("universal_completed");
} else if (this.getAction() == 3) {
action = "放货中";
action = LangProcess.msg("universal_releasing");
} else if (this.getAction() == 4) {
action = "放货完成";
action = LangProcess.msg("universal_releasing_completed");
}
jo.put("device_name", this.getDevice().getDevice_name());
@@ -356,7 +357,7 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev
jo.put("action", action);
jo.put("walk_y", walk_y);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("driver_type", "siemens_conveyor");

View File

@@ -18,6 +18,7 @@ import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.data.ApplyGreenFoilButtonRequest;
import org.nl.acs.ext.wms.data.ApplyGreenFoilButtonResponse;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService;
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
import org.nl.acs.instruction.domain.Instruction;
@@ -263,19 +264,19 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem
String action = "";
String walk_y = "";
if (this.getMode() == 0) {
mode = "脱机";
mode = LangProcess.msg("universal_off-line");
} else if (this.getMode() == 1) {
mode = "单机";
mode = LangProcess.msg("universal_stand-alone");
} else if (this.getMode() == 2) {
mode = "待机";
mode = LangProcess.msg("universal_standby");
} else if (this.getMode() == 3) {
mode = "运行中";
mode = LangProcess.msg("universal_operation");
}
if (this.getMove() == 0) {
move = "无货";
move = LangProcess.msg("universal_no");
} else if (this.getMove() == 1) {
move = "有货";
move = LangProcess.msg("universal_yes");
}
String requireSucess = "0";
@@ -284,11 +285,11 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem
}
jo.put("requireSucess", requireSucess);
if (this.getAction() == 0) {
action = "不允许取放";
action = LangProcess.msg("universal_actionMessage1");
} else if (this.getAction() == 1) {
action = "允许取放";
action = LangProcess.msg("universal_actionMessage2");
} else if (this.getAction() == 2) {
action = "允许离开";
action = LangProcess.msg("universal_actionMessage3");
}
jo.put("device_name", this.getDevice().getDevice_name());
@@ -297,7 +298,7 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem
jo.put("action", action);
jo.put("walk_y", walk_y);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("driver_type", "siemens_conveyor");

View File

@@ -14,12 +14,14 @@ import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.history.ErrorUtil;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
import org.nl.config.language.LangProcess;
import org.nl.config.lucene.service.LuceneExecuteLogService;
import org.nl.config.lucene.service.dto.LuceneLogDto;
import org.nl.system.service.param.ISysParamService;
@@ -181,11 +183,30 @@ public class HongXiangStationDeviceDriver extends AbstractOpcDeviceDriver implem
if(error == 0 && iserror){
message = "universal_message11";
}
String mode = "";
String action = "";
if (this.getMode() == 0) {
mode = LangProcess.msg("universal_off-line");
} else if (this.getMode() == 1) {
mode = LangProcess.msg("universal_stand-alone");
} else if (this.getMode() == 2) {
mode = LangProcess.msg("universal_standby");
} else if (this.getMode() == 3) {
mode = LangProcess.msg("universal_operation");
}
if (this.getAction() == 0) {
action = LangProcess.msg("universal_actionMessage1");
} else if (this.getAction() == 1) {
action = LangProcess.msg("universal_actionMessage2");
} else if (this.getAction() == 2) {
action = LangProcess.msg("universal_actionMessage3");
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode ==2 ? "待机": "脱机");
jo.put("action", action == 1 ? "允许取放": "不允许取放");
jo.put("mode", mode);
jo.put("action", action);
jo.put("isOnline", true);
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("task", this.getTask());
return jo;
}

View File

@@ -27,6 +27,7 @@ import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
import org.nl.config.SpringContextHolder;
import org.nl.config.language.LangProcess;
import org.nl.config.lucene.service.LuceneExecuteLogService;
import org.nl.config.lucene.service.dto.LuceneLogDto;
import org.springframework.beans.factory.annotation.Autowired;
@@ -364,11 +365,13 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
String action = "";
String move = "";
if (this.getMode() == 0) {
mode = "未联机";
mode = LangProcess.msg("universal_off-line");
} else if (this.getMode() == 1) {
mode = "联机";
mode = LangProcess.msg("universal_stand-alone");
} else if (this.getMode() == 2) {
mode = "联机";
mode = LangProcess.msg("universal_standby");
} else if (this.getMode() == 3) {
mode = LangProcess.msg("universal_operation");
}
String requireSucess = "0";
if (this.requireSucess) {
@@ -377,13 +380,13 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
jo.put("requireSucess", requireSucess);
if (this.getMove() == 0) {
move = "无货";
move = LangProcess.msg("universal_no");
jo.put("hasGoods", false);
} else if (this.getMove() == 1) {
move = "有货";
move = LangProcess.msg("universal_yes");
jo.put("hasGoods", true);
} else if (this.getMove() == 2) {
move = "有托盘有货";
move = LangProcess.msg("universal_two_yes");
jo.put("hasGoods", true);
}
if(error == 0 && iserror){
@@ -393,7 +396,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
jo.put("temperature", temperature);
jo.put("finish", finish);
jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("hx_error_type", String.valueOf(this.getError())));
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("countdown_house", countdown_house);
jo.put("countdown_min", countdown_min);

View File

@@ -12,6 +12,7 @@ import org.nl.acs.device_driver.FeedLmsRealFailed;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService;
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
import org.nl.acs.instruction.service.InstructionService;
@@ -154,19 +155,19 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver
String action = "";
String walk_y = "";
if (this.getMode() == 0) {
mode = "脱机";
mode = LangProcess.msg("universal_off-line");
} else if (this.getMode() == 1) {
mode = "单机";
mode = LangProcess.msg("universal_stand-alone");
} else if (this.getMode() == 2) {
mode = "待机";
mode = LangProcess.msg("universal_standby");
} else if (this.getMode() == 3) {
mode = "运行中";
mode = LangProcess.msg("universal_operation");
}
if (this.getMove() == 0) {
move = "无货";
move = LangProcess.msg("universal_no");
} else if (this.getMove() == 1) {
move = "有货";
move = LangProcess.msg("universal_yes");
}
String requireSucess = "0";
@@ -175,13 +176,13 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver
}
jo.put("requireSucess", requireSucess);
if (this.getAction() == 1) {
action = "取货中";
action = LangProcess.msg("universal_delivery");
} else if (this.getAction() == 2) {
action = "取货完成";
action = LangProcess.msg("universal_completed");
} else if (this.getAction() == 3) {
action = "放货中";
action = LangProcess.msg("universal_releasing");
} else if (this.getAction() == 4) {
action = "放货完成";
action = LangProcess.msg("universal_releasing_completed");
}
jo.put("device_name", this.getDevice().getDevice_name());
@@ -190,7 +191,7 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver
jo.put("action", action);
jo.put("walk_y", walk_y);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("driver_type", "siemens_conveyor");

View File

@@ -24,6 +24,7 @@ import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.route.service.impl.RouteLineServiceImpl;
import org.nl.acs.task.service.TaskService;
import org.nl.config.SpringContextHolder;
import org.nl.config.language.LangProcess;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
@@ -189,8 +190,26 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i
if(iserror){
message = "universal_message11";
}
if (this.getMode() == 0) {
mode = LangProcess.msg("universal_off-line");
} else if (this.getMode() == 1) {
mode = LangProcess.msg("universal_stand-alone");
} else if (this.getMode() == 2) {
mode = LangProcess.msg("universal_standby");
} else if (this.getMode() == 3) {
mode = LangProcess.msg("universal_operation");
}
if (this.getAction() == 1) {
action = LangProcess.msg("universal_delivery");
} else if (this.getAction() == 2) {
action = LangProcess.msg("universal_completed");
} else if (this.getAction() == 3) {
action = LangProcess.msg("universal_releasing");
} else if (this.getAction() == 4) {
action = LangProcess.msg("universal_releasing_completed");
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", "联机");
jo.put("mode", mode);
jo.put("action", action);
jo.put("isOnline", true);
jo.put("isError", this.getIserror());

View File

@@ -1109,20 +1109,20 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
jo.put("requireSucess", requireSucess);
if (this.getAction() == 1) {
action = "取货中";
action = LangProcess.msg("universal_delivery");
} else if (this.getAction() == 2) {
action = "取货完成";
action = LangProcess.msg("universal_completed");
} else if (this.getAction() == 3) {
action = "放货中";
action = LangProcess.msg("universal_releasing");
} else if (this.getAction() == 4) {
action = "放货完成";
action = LangProcess.msg("universal_releasing_completed");
}
if (error == 0 && iserror) {
this.setMessage(LangProcess.msg("universal_message4"));
}
String requireActionSucess = "请求动作已复位";
String requireActionSucess = LangProcess.msg("universal_actionMessage4");
if(this.requireActionSucess){
requireActionSucess = "请求动作未复位";
requireActionSucess = LangProcess.msg("universal_actionMessage5");
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
@@ -1131,7 +1131,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
jo.put("task", task);
jo.put("walk_y", walk_y);
jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(this.getError())));
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", message);
jo.put("notCreateTaskMessage", notCreateTaskMessage);

View File

@@ -20,6 +20,7 @@ import org.nl.acs.ext.wms.data.ApplyPlugPullSitResponse;
import org.nl.acs.ext.wms.data.ApplyPlugPullSiteRequest;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.history.ErrorUtil;
import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.log.service.DeviceExecuteLogService;
@@ -613,6 +614,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
jo.put("mode", mode);
jo.put("move", move);
jo.put("action", action);
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isOnline", this.getIsonline());
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
@@ -624,6 +626,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
}
public void writing(String param, String value) {
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()

View File

@@ -664,7 +664,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
jo.put("task", task);
jo.put("walk_y", walkY);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", message);
jo.put("notCreateTaskMessage", notCreateTaskMessage);

View File

@@ -579,37 +579,37 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
String action = "";
String walk_y = "";
if (this.getMode() == 0) {
mode = "脱机";
mode = LangProcess.msg("universal_off-line");
} else if (this.getMode() == 1) {
mode = "单机";
mode = LangProcess.msg("universal_stand-alone");
} else if (this.getMode() == 2) {
mode = "待机";
mode = LangProcess.msg("universal_standby");
} else if (this.getMode() == 3) {
mode = "运行中";
mode = LangProcess.msg("universal_operation");
}
if (this.getMove() == 0) {
move = "无货";
move = LangProcess.msg("universal_no");
} else if (this.getMove() == 1) {
move = "有货";
move = LangProcess.msg("universal_yes");
}
String requireSucess = "0";
if (this.requireSucess) {
requireSucess = "1";
}
jo.put("requireSucess", requireSucess);
if (this.getAction() == 1) {
action = "取货中";
action = LangProcess.msg("universal_delivery");
} else if (this.getAction() == 2) {
action = "取货完成";
action = LangProcess.msg("universal_completed");
} else if (this.getAction() == 3) {
action = "放货中";
action = LangProcess.msg("universal_releasing");
} else if (this.getAction() == 4) {
action = "放货完成";
action = LangProcess.msg("universal_releasing_completed");
}
if(error == 0 && this.itemProtocol.isError){
message = "信号连接异常!";
iserror = true;
}else if(error == 0 && !this.itemProtocol.isError){
iserror = false;
@@ -621,7 +621,7 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
jo.put("task", task);
jo.put("walk_y", walk_y);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message));
jo.put("notCreateTaskMessage", notCreateTaskMessage);

View File

@@ -16,6 +16,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.history.ErrorUtil;
import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.enums.InstructionStatusEnum;
import org.nl.acs.instruction.service.InstructionService;
@@ -30,6 +31,7 @@ import org.nl.acs.task.service.dto.TaskDto;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
import org.nl.config.SpringContextHolder;
import org.nl.config.language.InitLocaleResolver;
import org.nl.config.language.LangProcess;
import org.nl.config.lucene.service.LuceneExecuteLogService;
import org.nl.config.lucene.service.dto.LuceneLogDto;
@@ -731,9 +733,9 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
if (this.getIs_disable() == 0) {
is_disable = "正常";
is_disable = LangProcess.msg("universal_normal");
} else if (this.getIs_disable() == 1) {
is_disable = "禁用";
is_disable = LangProcess.msg("universal_disable");
}
String requireSucess = "0";
@@ -755,7 +757,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
jo.put("move_2", move_2);
jo.put("action", action);
jo.put("walk_y", walk_y);
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("task", this.getTask());
jo.put("isOnline", this.getIsonline());
jo.put("isError", this.getIserror());

View File

@@ -14,6 +14,7 @@ import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.data.GetWasteFoilWeightRequest;
import org.nl.acs.ext.wms.data.GetWasteFoilWeightResponse;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService;
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
import org.nl.acs.instruction.domain.Instruction;
@@ -351,7 +352,7 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl
jo.put("mode", mode);
jo.put("move", move);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("weight", this.getWeight());
jo.put("old_weight", this.getOld_weight());

View File

@@ -3,6 +3,7 @@ package org.nl.acs.history;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import org.nl.config.SpringContextHolder;
import org.nl.config.language.InitLocaleResolver;
import org.nl.config.language.LangProcess;
import org.nl.system.service.dict.ISysDictService;
import org.nl.system.service.dict.dao.Dict;
@@ -27,6 +28,8 @@ public class ErrorUtil {
public static String getDictDetail(String type, String error_code) {
InitLocaleResolver initLocaleResolver = new InitLocaleResolver();
String language = initLocaleResolver.getLanguage();
getDict();
List<Dict> dictDetailDtos = dictMap.get(type);
String detail = null;
@@ -34,11 +37,25 @@ public class ErrorUtil {
for (int i = 0; i < dictDetailDtos.size(); i++) {
Dict dictDetailDto = dictDetailDtos.get(i);
String value = dictDetailDto.getValue();
String label = dictDetailDto.getLabel();
// String label = dictDetailDto.getLabel();
String en_label = dictDetailDto.getEn_label();
String in_label = dictDetailDto.getIn_label();
String zh_label = dictDetailDto.getZh_label();
if (StrUtil.equals(value, error_code)) {
detail = label;
if (language.contains("zh")){
detail = zh_label;
break;
}
if (language.contains("in")){
detail = in_label;
break;
}
if (language.contains("en")){
detail = en_label;
break;
}
}
}
}
return detail == null ? LangProcess.msg("error_not_configured") : detail;

View File

@@ -12,11 +12,14 @@ import java.util.Map;
public class InitLocaleResolver implements LocaleResolver {
public static Map<String,String> Language_Country = MapOf.of("id","in-ID","in","in-ID","en-US,en;q=0.9","en-US","en","en-US","zh","zh-CN");
public static String language = "";
@Override
public Locale resolveLocale(HttpServletRequest request) {
String header = request.getHeader("Accept-Language");
if (StringUtils.isNotEmpty(header)){
String lang = Language_Country.get(header);
language = lang;
System.out.println("lang的值为"+lang);
if (StringUtils.isNotEmpty(lang)){
String[] l = lang.split("-");
//印尼的ISO标准国家代码为id-ID
@@ -29,4 +32,7 @@ public class InitLocaleResolver implements LocaleResolver {
@Override
public void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) {
}
public String getLanguage(){
return language;
}
}

View File

@@ -104,4 +104,19 @@ public class Dict implements Serializable {
*/
private String update_time;
/**
* 中文字典标签
*/
private String zh_label;
/**
* 英文字典标签
*/
private String en_label;
/**
* 印尼字典标签
*/
private String in_label;
}

View File

@@ -74,5 +74,20 @@ public class Stage implements Serializable {
*/
private String update_time;
/**
* 舞台中文名称
*/
private String zh_stage_name;
/**
* 舞台英文名称
*/
private String en_stage_name;
/**
* 舞台印尼名称
*/
private String in_stage_name;
}

View File

@@ -5,6 +5,12 @@ universal_standby=\u5F85\u673A
universal_operation=\u8FD0\u884C\u4E2D
universal_no=\u65E0\u8D27
universal_yes=\u6709\u8D27
universal_normal=\u6B63\u5E38
universal_disable=\u7981\u7528
universal_large_pallets=\u5927\u6258\u76D8
universal_small_pallets=\u5C0F\u6258\u76D8
universal_forward_rotation=\u6B63\u8F6C
universal_rollback=\u53CD\u8F6C
universal_two_yes=\u6709\u6258\u76D8\u6709\u8D27
universal_delivery=\u53D6\u8D27\u4E2D
universal_completed=\u53D6\u8D27\u5B8C\u6210
@@ -47,6 +53,11 @@ universal_notCreateInstMessage3=\u8BBE\u5907\u5F85\u673A\u6216\u4E0D\u5141\u8BB8
universal_notCreateInstMessage4=ddj\u5BF9\u63A5\u4F4D\u6709\u8D27,\u65E0\u6CD5\u751F\u6210\u6307\u4EE4!
universal_notCreateInstMessage5=\u5B58\u5728\u76F8\u540C\u8DEF\u7EBF\u7684\u6307\u4EE4!
universal_notCreateInstMessage6=\u4E0B\u4E00\u4E2A\u8BBE\u5907\u4E0D\u662F\u8F93\u9001\u7EBF\u6307\u4EE4!
universal_actionMessage1=\u4E0D\u5141\u8BB8\u53D6\u653E
universal_actionMessage2=\u5141\u8BB8\u53D6\u653E
universal_actionMessage3=\u5141\u8BB8\u79BB\u5F00
universal_actionMessage4=\u8BF7\u6C42\u52A8\u4F5C\u5DF2\u590D\u4F4D
universal_actionMessage5=\u8BF7\u6C42\u52A8\u4F5C\u672A\u590D\u4F4D

View File

@@ -4,6 +4,12 @@ universal_standby=standby
universal_operation=operation
universal_no=Out of stock
universal_yes=In stock
universal_normal=normal
universal_disable=disable
universal_large_pallets=large pallets
universal_small_pallets=small pallets
universal_forward_rotation=forward rotation
universal_rollback=rollback
universal_two_yes=There are pallets and goods
universal_delivery=Taking delivery
universal_completed=Pick-up completed
@@ -46,3 +52,8 @@ universal_notCreateInstMessage3=The device is in standby mode or is not allowed
universal_notCreateInstMessage4=ddj interface bit is in stock, cannot generate command!
universal_notCreateInstMessage5=Instructions with the same route exist!
universal_notCreateInstMessage6=The next device is not a conveyor line directive!
universal_actionMessage1=Pick-and-place is not permitted
universal_actionMessage2=Pick-and-place is allowed
universal_actionMessage3=Permission to leave
universal_actionMessage4=The request action has been reset
universal_actionMessage5=The request action is not reset

View File

@@ -4,6 +4,12 @@ universal_standby=siaga
universal_operation=operasi
universal_no=bayar
universal_yes=Yang aku mau
universal_normal=biasa
universal_disable=menonaktifkan
universal_large_pallets=Palet besar
universal_small_pallets=Nampan kecil
universal_forward_rotation=Rotasi ke depan
universal_rollback=Rollback
universal_two_yes=Ada nampan dengan barang
universal_delivery=Mengambil barang
universal_completed=Pengambilan barang selesai
@@ -46,3 +52,8 @@ universal_notCreateInstMessage3=Siaga perangkat atau tidak diizinkan masuk
universal_notCreateInstMessage4=DDJ mendarat di dok, tidak ada perintah yang diberikan!
universal_notCreateInstMessage5=Ada instruksi tentang rute yang sama!
universal_notCreateInstMessage6=Perangkat berikutnya bukan arahan jalur konveyor!
universal_actionMessage1=Pick-and-place tidak diizinkan
universal_actionMessage2=Pick-and-place diperbolehkan
universal_actionMessage3=Izin untuk pergi
universal_actionMessage4=Tindakan permintaan telah disetel ulang
universal_actionMessage5=Tindakan permintaan tidak disetel ulang

View File

@@ -4,7 +4,13 @@ universal_standby=\u5F85\u673A
universal_operation=\u8FD0\u884C\u4E2D
universal_no=\u65E0\u8D27
universal_yes=\u6709\u8D27
universal_normal=\u6B63\u5E38
universal_disable=\u7981\u7528
universal_two_yes=\u6709\u6258\u76D8\u6709\u8D27
universal_large_pallets=\u5927\u6258\u76D8
universal_small_pallets=\u5C0F\u6258\u76D8
universal_forward_rotation=\u6B63\u8F6C
universal_rollback=\u53CD\u8F6C
universal_delivery=\u53D6\u8D27\u4E2D
universal_completed=\u53D6\u8D27\u5B8C\u6210
universal_releasing=\u653E\u8D27\u4E2D
@@ -33,6 +39,11 @@ universal_feedMessage3=\u5149\u7535\u4FE1\u53F7(move)\u4E0D\u4E3A\u65E0\u8D27\u7
universal_feedMessage4=\u5F53\u524D\u4E0A\u62A5\u4EFB\u52A1\u53F7(task)\u4E0D\u5E94\u8BE5\u4E3A0
universal_feedMessage5=\u884C\u67B6\u673A\u68B0\u624B
universal_feedMessage6=\u4EFB\u52A1\u5B8C\u6210
universal_actionMessage1=\u4E0D\u5141\u8BB8\u53D6\u653E
universal_actionMessage2=\u5141\u8BB8\u53D6\u653E
universal_actionMessage3=\u5141\u8BB8\u79BB\u5F00
universal_actionMessage4=\u8BF7\u6C42\u52A8\u4F5C\u5DF2\u590D\u4F4D
universal_actionMessage5=\u8BF7\u6C42\u52A8\u4F5C\u672A\u590D\u4F4D
universal_feedMessage7=move\u4E0D\u4E3A\u6709\u8D27\u72B6\u6001
universal_feedMessage8=\u4EFB\u52A1\u53F7\u4E3A0
universal_feedMessage9=\u52A8\u4F5C\u4FE1\u53F7\u4E0D\u662F\u4EFB\u52A1\u5B8C\u6210

View File

@@ -23,6 +23,7 @@ import department from './department/zh'
import dict from './dict/zh'
import angle from './angle/zh'
import regional from './regional/zh'
import stage from './stage/zh'
export default {
...zhLocale,
@@ -49,6 +50,7 @@ export default {
...department,
...dict,
...angle,
...regional
...regional,
...stage
}

View File

@@ -13,6 +13,9 @@ export default {
'other': {
'Dict_detail': 'Dict Detail',
'Department_label': 'Department Label',
'Department_label_zh': 'Chinese dictionary tags',
'Department_label_en': 'English dictionary tags',
'Department_label_in': 'Indonesian dictionary labels',
'Dictionary_value': 'Dictionary Value',
'Sort': 'Sort',
'Parameter1': 'Parameter1',

View File

@@ -13,6 +13,9 @@ export default {
'other': {
'Dict_detail': 'Detail Kamus',
'Department_label': 'Tag Kamus',
'Department_label_zh': 'Kamus Cina tags',
'Department_label_en': 'Kamus bahasa Inggris tags',
'Department_label_in': 'Label kamus bahasa Indonesia',
'Dictionary_value': 'Nilai Kamus',
'Sort': 'Jenis',
'Parameter1': 'Parameter 1',

View File

@@ -13,6 +13,9 @@ export default {
'other': {
'Dict_detail': '字典详情',
'Department_label': '字典标签',
'Department_label_zh': '中文字典标签',
'Department_label_en': '英文字典标签',
'Department_label_in': '印尼字典标签',
'Dictionary_value': '字典值',
'Sort': '排序',
'Parameter1': '参数1',

View File

@@ -23,6 +23,7 @@ import department from './department/en'
import dict from './dict/en'
import angle from './angle/en'
import regional from './regional/en'
import stage from './stage/en'
export default {
...enLocale,
@@ -49,6 +50,7 @@ export default {
...department,
...dict,
...angle,
...regional
...regional,
...stage
}

View File

@@ -23,6 +23,7 @@ import department from './department/in'
import dict from './dict/in'
import angle from './angle/in'
import regional from './regional/in'
import stage from './stage/in'
export default {
...idLocale,
@@ -50,5 +51,6 @@ export default {
...department,
...dict,
...angle,
...regional
...regional,
...stage
}

View File

@@ -0,0 +1,22 @@
export default {
'stage': {
'title': 'Stage',
'stage_table_title': {
'stage_uuid': 'Stage Signage',
'stage_code': 'Stage Coding',
'stage_name': 'Stage Name',
'in_stage_name': 'Indonesian Stage Name',
'en_stage_name': 'English Stage Name',
'zh_stage_name': 'Chinese Stage Name',
'stage_data': 'Stage Data',
'message1': 'Stage encoding cannot be empty',
'message2': 'The stage name cannot be empty'
},
'driver_configuration': {
'basic_information': 'Basic Information'
},
'msg': {
'delete_msg': 'Are You Sure To Delete It? If There Are Subordinate Nodes, they Will Be Deleted Together. This Operation Cannot Be Undone!'
}
}
}

View File

@@ -0,0 +1,23 @@
export default {
'stage': {
'title': 'Panggung',
'stage_table_title': {
'stage_uuid': 'Papan Nama Panggung',
'stage_code': 'Tahap Pengkodean',
'stage_name': 'Nama Panggung',
'in_stage_name': 'Nama Panggung Indonesia',
'en_stage_name': 'Nama Panggung Bahasa Inggris',
'zh_stage_name': 'Nama Panggung Cina',
'stage_data': 'Data Tahapan',
'message1': 'Pengkodean Tahap Tidak Boleh Kosong',
'message2': 'Nama Panggung Tidak Boleh Kosong'
},
'driver_configuration': {
'basic_information': 'Informasi Dasar'
},
'msg': {
'delete_msg': 'Apakah Anda Yakin Untuk Menghapusnya? Jika Ada Nod Subordinat, Mereka Akan Dihapus Bersama. Operasi Ini Tidak Dapat Dibatalkan!'
}
}
}

View File

@@ -0,0 +1,23 @@
export default {
'stage': {
'title': '舞台',
'stage_table_title': {
'stage_uuid': '舞台标识',
'stage_code': '舞台编码',
'stage_name': '舞台名字',
'in_stage_name': '印尼舞台名字',
'en_stage_name': '英文舞台名称',
'zh_stage_name': '中文舞台名称',
'stage_data': '舞台数据',
'message1': '舞台编码不能为空',
'message2': '舞台名字不能为空'
},
'driver_configuration': {
'basic_information': '基本信息'
},
'msg': {
'delete_msg': '确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!'
}
}
}

View File

@@ -116,6 +116,7 @@ import pull_tail_manipulator from '@/views/acs/device/driver/pull_tail_manipulat
import green_foil_machine_button from '@/views/acs/device/driver/green_foil_machine_button.vue'
import inflatable_shaft_library from '@/views/acs/device/driver/inflatable_shaft_library.vue'
import manipulator_agv_station from '@/views/acs/device/driver/manipulator_agv_station.vue'
import paper_tube_pick_size from '@/views/acs/device/driver/paper_tube_pick_size.vue'
import subvolume_weighing_station from '@/views/acs/device/driver/subvolume_weighing_station.vue'
import waste_foil_weighing_station from '@/views/acs/device/driver/waste_foil_weighing_station.vue'
import blank_manipulator from '@/views/acs/device/driver/blank_manipulator.vue'
@@ -192,7 +193,8 @@ export default {
oven_inspect_site,
manipulator_agv_station,
volume_two_manipulator,
manipulator_cache
manipulator_cache,
paper_tube_pick_size
},
dicts: ['device_type'],
mixins: [crud],

View File

@@ -0,0 +1,507 @@
<template>
<!--纸管抓取位-->
<div>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span">设备协议</span>
</div>
<el-row>
<el-col :span="12">
OpcServer:
<el-select
v-model="opc_id"
placeholder="无"
clearable
filterable
@change="changeOpc"
>
<el-option
v-for="item in dataOpcservers"
:key="item.opc_id"
:label="item.opc_name"
:value="item.opc_id"
/>
</el-select>
</el-col>
<el-col :span="12">
PLC:
<el-select
v-model="plc_id"
placeholder="无"
clearable
filterable
@change="changePlc"
>
<el-option
v-for="item in dataOpcPlcs"
:key="item.plc_id"
:label="item.plc_name"
:value="item.plc_id"
/>
</el-select>
</el-col>
</el-row>
</el-card>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span">输送系统</span>
</div>
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
<el-row>
<el-col :span="8">
<el-form-item label="电气调度号" label-width="150px">
<el-input v-model="form.address" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span">指令相关</span>
</div>
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
<el-row>
<el-col :span="8">
<el-form-item label="检验有货">
<el-switch v-model="form.inspect_in_stocck" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="取货校验" label-width="150px">
<el-switch v-model="form.ignore_pickup_check" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="放货校验" label-width="150px">
<el-switch v-model="form.ignore_release_check" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="呼叫">
<el-switch v-model="form.apply_task" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="响应" label-width="150px">
<el-switch v-model="form.manual_create_task" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="关联设备" prop="device_code">
<el-select
v-model="form.link_device_code"
filterable
multiple
placeholder="请选择"
>
<el-option
v-for="item in deviceList"
:key="item.device_code"
:label="item.device_name"
:value="item.device_code"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="关联三色灯" prop="device_code" label-width="100px">
<el-select
v-model="form.link_three_lamp"
filterable
clearable
placeholder="请选择"
>
<el-option
v-for="item in deviceList"
:key="item.device_code"
:label="item.device_name"
:value="item.device_code"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否输入物料" label-width="150px">
<el-switch v-model="form.input_material" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span">AGV相关</span>
</div>
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
<el-row>
<el-col :span="8">
<el-form-item label="取货">
<el-switch v-model="form.is_pickup" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="放货">
<el-switch v-model="form.is_release" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span">PLC读取字段</span>
</div>
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
<el-table
v-loading="false"
:data="data1"
:max-height="550"
size="small"
style="width: 100%;margin-bottom: 15px"
>
<el-table-column prop="name" label="用途" />
<el-table-column prop="code" label="别名要求" />
<el-table-column prop="db" label="DB块">
<template slot-scope="scope">
<el-input
v-model="data1[scope.$index].db"
size="mini"
class="edit-input"
@input="finishReadEdit(data1[scope.$index])"
/>
</template>
</el-table-column>
<el-table-column prop="dbr_value">
<template slot="header">
<el-link type="primary" :underline="false" @click.native="test_read1()">测试读</el-link>
</template>
<template slot-scope="scope">
<el-input v-model="data1[scope.$index].dbr_value" size="mini" class="edit-input" />
</template>
</el-table-column>
</el-table>
</el-form>
</el-card>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span">PLC写入字段</span>
</div>
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
<el-table
v-loading="false"
:data="data2"
:max-height="550"
size="small"
style="width: 100%;margin-bottom: 15px"
>
<el-table-column prop="name" label="用途" />
<el-table-column prop="code" label="别名要求" />
<el-table-column prop="db" label="DB块">
<template slot-scope="scope">
<el-input
v-model="data2[scope.$index].db"
size="mini"
class="edit-input"
@input="finishWriteEdit(data2[scope.$index])"
/>
</template>
</el-table-column>
<el-table-column prop="dbr_value2">
<template slot="header">
<el-link type="primary" :underline="false" @click.native="test_read2()">测试读</el-link>
</template>
<template slot-scope="scope">
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input" />
</template>
</el-table-column>
<el-table-column prop="dbw_value">
<template slot="header">
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
</template>
<template slot-scope="scope">
<el-input v-model="data2[scope.$index].dbw_value" size="mini" class="edit-input" />
</template>
</el-table-column>
</el-table>
</el-form>
</el-card>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span" />
<el-button
:loading="false"
icon="el-icon-check"
size="mini"
style="float: right; padding: 6px 9px"
type="primary"
@click="doSubmit"
>保存
</el-button>
</div>
</el-card>
</div>
</template>
<script>
import {
queryDriverConfig,
updateConfig,
testRead,
testwrite
} from '@/api/acs/device/driverConfig'
import { selectOpcList } from '@/api/acs/device/opc'
import { selectPlcList } from '@/api/acs/device/opcPlc'
import { selectListByOpcID } from '@/api/acs/device/opcPlc'
import crud from '@/mixins/crud'
import deviceCrud from '@/api/acs/device/device'
export default {
name: 'PaperTubePickSite',
mixins: [crud],
props: {
parentForm: {
type: Object,
required: true
}
},
data() {
return {
device_code: '',
device_id: '',
plc_id: '',
plc_code: '',
opc_id: '',
opc_code: '',
configLoading: false,
dataOpcservers: [],
dataOpcPlcs: [],
deviceList: [],
data1: [],
data2: [],
form: {
inspect_in_stocck: true,
ignore_pickup_check: true,
ignore_release_check: true,
apply_task: true,
link_three_lamp: '',
manual_create_task: true,
is_pickup: true,
is_release: true,
link_device_code: [],
address: ''
},
rules: {}
}
},
created() {
this.$nextTick(() => {
// 从父表单获取设备编码
this.device_id = this.$props.parentForm.device_id
this.device_code = this.$props.parentForm.device_code
queryDriverConfig(this.device_id, this.$props.parentForm.driver_code).then(data => {
// 给表单赋值,并且属性不能为空
if (data.form) {
const arr = Object.keys(data.form)
// 不为空
if (arr.length > 0) {
this.form = data.form
}
}
// 给表单赋值,并且属性不能为空
if (data.parentForm) {
const arr = Object.keys(data.parentForm)
// 不为空
if (arr.length > 0) {
this.opc_code = data.parentForm.opc_code
this.plc_code = data.parentForm.plc_code
}
}
this.data1 = data.rs
this.data2 = data.ws
this.sliceItem()
})
selectPlcList().then(data => {
this.dataOpcPlcs = data
this.plc_id = this.$props.parentForm.opc_plc_id
})
selectOpcList().then(data => {
this.dataOpcservers = data
this.opc_id = this.$props.parentForm.opc_server_id
})
deviceCrud.selectDeviceList().then(data => {
this.deviceList = data
})
})
},
methods: {
finishReadEdit(data) {
// 编辑的是code列,并且值包含mode
if (data.code.indexOf('mode') !== -1) {
debugger
const dbValue = data.db
// .之前的字符串
const beforeStr = dbValue.match(/(\S*)\./)[1]
// .之后的字符串
const afterStr = dbValue.match(/\.(\S*)/)[1]
// 取最后数字
const endNumber = afterStr.substring(1)
// 最后为非数字
if (isNaN(parseInt(endNumber))) {
return
}
for (const val in this.data1) {
if (this.data1[val].code.indexOf('move') !== -1) {
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 1)
}
if (this.data1[val].code.indexOf('error') !== -1) {
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 5)
}
if (this.data1[val].code.indexOf('task') !== -1) {
this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 7)
}
}
}
},
finishWriteEdit(data) {
// 编辑的是code列,并且值包含mode
if (data.code.indexOf('to_command') !== -1) {
const dbValue = data.db
// .之前的字符串
const beforeStr = dbValue.match(/(\S*)\./)[1]
// .之后的字符串
const afterStr = dbValue.match(/\.(\S*)/)[1]
// 取最后数字
const endNumber = afterStr.substring(1)
// 最后为非数字
if (isNaN(parseInt(endNumber))) {
return
}
for (const val in this.data2) {
if (this.data2[val].code.indexOf('to_target') !== -1) {
this.data2[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2)
}
if (this.data2[val].code.indexOf('to_task') !== -1) {
this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 6)
}
}
}
},
changeOpc(val) {
this.dataOpcservers.forEach(item => {
if (item.opc_id === val) {
this.opc_code = item.opc_code
}
})
selectListByOpcID(val).then(data => {
this.dataOpcPlcs = data
this.plc_id = ''
this.plc_code = ''
if (this.dataOpcPlcs && this.dataOpcPlcs.length > 0) {
this.plc_id = this.dataOpcPlcs[0].plc_id
this.plc_code = this.dataOpcPlcs[0].plc_code
}
this.sliceItem()
})
},
changePlc(val) {
this.dataOpcPlcs.forEach(item => {
if (item.plc_id === val) {
this.plc_code = item.plc_code
this.sliceItem()
return
}
})
},
test_read1() {
testRead(this.data1, this.opc_id).then(data => {
this.data1 = data
this.notify('操作成功!', 'success')
}).catch(err => {
console.log(err.response.data.message)
})
},
test_read2() {
testRead(this.data2, this.opc_id).then(data => {
this.data2 = data
console.log(this.data2)
this.notify('操作成功!', 'success')
}).catch(err => {
console.log(err.response.data.message)
})
},
test_write1() {
testwrite(this.data2, this.opc_id).then(data => {
this.notify('操作成功!', 'success')
}).catch(err => {
console.log(err.response.data.message)
})
},
doSubmit() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.configLoading = true
// 根据驱动类型判断是否为路由设备
const parentForm = this.parentForm
parentForm.is_route = true
parentForm.plc_id = this.plc_id
parentForm.opc_id = this.opc_id
updateConfig(parentForm, this.form, this.data1, this.data2).then(res => {
this.notify('保存成功', 'success')
this.configLoading = false
}).catch(err => {
this.configLoading = false
console.log(err.response.data.message)
})
}
})
},
sliceItem() { // 拼接DB的Item值
this.data1.forEach(item => {
const str = item.code
// 是否包含.
if (str.search('.') !== -1) {
// 截取最后一位
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + str.slice(str.lastIndexOf('.') + 1)
} else {
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + item.code
}
})
this.data2.forEach(item => {
const str = item.code
// 是否包含.
if (str.search('.') !== -1) {
// 截取最后一位
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + str.slice(str.lastIndexOf('.') + 1)
} else {
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + item.code
}
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -30,9 +30,18 @@
width="600px"
>
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="150px">
<el-form-item :label="$t('dict.other.Dict_detail')" prop="label">
<el-form-item :label="$t('dict.other.Department_label')" prop="label">
<el-input v-model="form.label" style="width: 370px;" />
</el-form-item>
<el-form-item :label="$t('dict.other.Department_label_zh')" prop="label">
<el-input v-model="form.zh_label" style="width: 370px;" />
</el-form-item>
<el-form-item :label="$t('dict.other.Department_label_en')" prop="label">
<el-input v-model="form.en_label" style="width: 370px;" />
</el-form-item>
<el-form-item :label="$t('dict.other.Department_label_in')" prop="label">
<el-input v-model="form.in_label" style="width: 370px;" />
</el-form-item>
<el-form-item :label="$t('dict.other.Dictionary_value')" prop="value">
<el-input v-model="form.value" style="width: 370px;" />
</el-form-item>

View File

@@ -12,20 +12,29 @@
:title="crud.status.title"
width="500px"
>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item v-if="false" label="舞台标识" prop="stage_uuid">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item v-if="false" :label="$t('stage.stage_table_title.stage_uuid')" prop="stage_uuid">
<el-input v-model="form.stage_uuid" style="width: 370px;" />
</el-form-item>
<el-form-item label="舞台编码" prop="stage_code">
<el-form-item :label="$t('stage.stage_table_title.stage_code')" prop="stage_code">
<el-input v-model="form.stage_code" style="width: 370px;" />
</el-form-item>
<el-form-item label="舞台名字" prop="stage_name">
<el-form-item :label="$t('stage.stage_table_title.stage_name')" prop="stage_name">
<el-input v-model="form.stage_name" style="width: 370px;" />
</el-form-item>
<el-form-item :label="$t('stage.stage_table_title.in_stage_name')" prop="in_stage_name">
<el-input v-model="form.in_stage_name" style="width: 370px;" />
</el-form-item>
<el-form-item :label="$t('stage.stage_table_title.en_stage_name')" prop="en_stage_name">
<el-input v-model="form.en_stage_name" style="width: 370px;" />
</el-form-item>
<el-form-item :label="$t('stage.stage_table_title.zh_stage_name')" prop="zh_stage_name">
<el-input v-model="form.zh_stage_name" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
<el-button type="text" @click="crud.cancelCU">{{ $t('auto.common.Cancel') }}</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">{{ $t('auto.common.Confirm') }}</el-button>
</div>
</el-dialog>
<!--表格渲染-->
@@ -38,15 +47,15 @@
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="stage_uuid" label="舞台标识" />
<el-table-column prop="stage_code" label="舞台编码" />
<el-table-column prop="stage_name" label="舞台名字" />
<el-table-column prop="stage_data" label="舞台数据" show-overflow-tooltip />
<el-table-column prop="create_name" label="创建者" />
<el-table-column prop="create_time" label="创建时间" min-width="135" />
<el-table-column v-if="false" prop="stage_uuid" :label="$t('stage.stage_table_title.stage_uuid')" />
<el-table-column prop="stage_code" :label="$t('stage.stage_table_title.stage_code')" :min-width="flexWidth('stage_code',crud.data,$t('stage.stage_table_title.stage_code'))" />
<el-table-column prop="stage_name" :label="$t('stage.stage_table_title.stage_name')" :min-width="flexWidth('stage_name',crud.data,$t('stage.stage_table_title.stage_name'))" />
<el-table-column prop="stage_data" :label="$t('stage.stage_table_title.stage_data')" show-overflow-tooltip />
<el-table-column prop="create_name" :label="$t('task.select.Creator')" :min-width="flexWidth('create_name',crud.data,$t('task.select.Creator'))" />
<el-table-column prop="create_time" :label="$t('task.select.Create_time')" :min-width="flexWidth('create_time',crud.data,$t('task.select.Create_time'))" />
<el-table-column prop="update_name" label="修改者" />
<el-table-column prop="update_time" label="修改时间" min-width="135" />
<el-table-column v-permission="['admin','stage:edit','stage:del']" label="操作" width="150px" align="center">
<el-table-column v-permission="['admin','stage:edit','stage:del']" :label="$t('task.select.Operation')" width="150px" align="center">
<template slot-scope="scope">
<udOperation
:data="scope.row"
@@ -67,10 +76,14 @@ import CRUD, { presenter, header, form, crud } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import i18n from '@/i18n'
const defaultForm = {
stage_uuid: null,
stage_code: null,
en_stage_name: null,
in_stage_name: null,
zh_stage_name: null,
stage_name: null,
stage_data: null,
is_active: null,
@@ -86,7 +99,7 @@ export default {
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
title: '舞台',
title: i18n.t('stage.title'),
url: 'api/stage',
idField: 'stage_uuid',
sort: 'stage_uuid,desc',
@@ -107,10 +120,10 @@ export default {
},
rules: {
stage_code: [
{ required: true, message: '舞台编码不能为空', trigger: 'blur' }
{ required: true, message: i18n.t('stage.stage_table_title.message1'), trigger: 'blur' }
],
stage_name: [
{ required: true, message: '舞台名字不能为空', trigger: 'blur' }
{ required: true, message: i18n.t('stage.stage_table_title.message2'), trigger: 'blur' }
]
}
}

View File

@@ -302,13 +302,13 @@ export default {
},
allDeviceMsg: [],
msgTop: '200px',
msgLeft: '200px'
msgLeft: '200px',
language: 'zh'
}
},
created() {
selectStageList().then(data => {
this.Stages = data
})
this.getStages()
this.language = localStorage.getItem('lang')
},
mounted() {
this.init()
@@ -387,6 +387,34 @@ export default {
lf.render(data)
this.initStageData()
},
getStages() {
selectStageList().then(data => {
for (let i = 0; i < data.length; i++) {
if (this.language === 'en') {
const tempObject = {
'stage_name': data[i].en_stage_name,
'stage_code': data[i].stage_code
}
this.Stages.push(tempObject)
}
if (this.language === 'zh') {
const tempObject = {
'stage_name': data[i].zh_stage_name,
'stage_code': data[i].stage_code
}
this.Stages.push(tempObject)
}
if (this.language === 'in') {
const tempObject = {
'stage_name': data[i].in_stage_name,
'stage_code': data[i].stage_code
}
this.Stages.push(tempObject)
}
}
console.log(this.Stages)
})
},
changeStage(var1) {
// 获取舞台数据
this.stage_code = var1
@@ -476,9 +504,21 @@ export default {
this.arr = [] // 清空
if (item.device_code && item.data) {
console.log('item', item)
let tempDeviceName = ''
if (this.language === 'zh') {
tempDeviceName = item.data.zh_device_name
}
if (this.language === 'en') {
tempDeviceName = item.data.en_device_name
}
if (this.language === 'in') {
tempDeviceName = item.data.in_device_name
}
this.arr = [
{name: i18n.t('monitor.click.equipment_number'), value: item.device_code},
{ name: i18n.t('monitor.click.device_name'), value: item.device_name }
// { name: tempDeviceName, value: item.device_name }
{name: i18n.t('monitor.click.device_name'), value: tempDeviceName}
// { name: i18n.t('monitor.click.device_name'), value: item.device_name }
]
const data = item.data
for (const val in data) {