@@ -33,7 +33,7 @@ public interface AcsConfig {
|
|||||||
//指定AGV系统
|
//指定AGV系统
|
||||||
String AGVTYPE = "agvType";
|
String AGVTYPE = "agvType";
|
||||||
//WMS系统接口地址
|
//WMS系统接口地址
|
||||||
String WMSURL = "wmsurl";
|
String WMSURL = "lmsurl";
|
||||||
//WCS系统接口地址
|
//WCS系统接口地址
|
||||||
String WCSURL = "wcsurl";
|
String WCSURL = "wcsurl";
|
||||||
|
|
||||||
@@ -41,8 +41,10 @@ public interface AcsConfig {
|
|||||||
|
|
||||||
String ERPURL = "erpurl";
|
String ERPURL = "erpurl";
|
||||||
//是否存在wms系统
|
//是否存在wms系统
|
||||||
String HASWMS = "hasWms";
|
String HASWMS = "hasLms";
|
||||||
String ISTEST = "isTest";
|
String KZPLAN = "kzPlan";
|
||||||
|
//lucene日志索引目录
|
||||||
|
String LUCENEURL = "luceneUrl";
|
||||||
String ISFEEDDEVICESTATUS = "isFeedDeviceStatus";
|
String ISFEEDDEVICESTATUS = "isFeedDeviceStatus";
|
||||||
//路由选择
|
//路由选择
|
||||||
String ROUTE = "route";
|
String ROUTE = "route";
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ public enum AgvTypeEnum {
|
|||||||
PS_TYPE_1("6", "PS20称重任务(刻字-包装)", "1"),
|
PS_TYPE_1("6", "PS20称重任务(刻字-包装)", "1"),
|
||||||
PS_TYPE_2("7", "PS20不称重任务(刻字-包装)", "2"),
|
PS_TYPE_2("7", "PS20不称重任务(刻字-包装)", "2"),
|
||||||
RT_TYPE_1("8", "RT20任务(货架)", "3"),
|
RT_TYPE_1("8", "RT20任务(货架)", "3"),
|
||||||
OTHERS_TYPE_1("9", "错误任务类型", "9");
|
OTHERS_TYPE_1("9", "错误任务类型", "9"),
|
||||||
|
HAIROU_TYPE_1("18", "立库任务", "1");
|
||||||
|
|
||||||
private String taskType;
|
private String taskType;
|
||||||
private String taskName;
|
private String taskName;
|
||||||
|
|||||||
@@ -57,6 +57,20 @@ public enum StatusEnum {
|
|||||||
QXXL_COMPEL_REQ("11", "强制搬出请求(清洗下料)", ""),
|
QXXL_COMPEL_REQ("11", "强制搬出请求(清洗下料)", ""),
|
||||||
KZSL_EMPTY_REQ("12","取空框请求(刻字上料)",""),
|
KZSL_EMPTY_REQ("12","取空框请求(刻字上料)",""),
|
||||||
|
|
||||||
|
HAIROU_IN_REQ("13","半成品入库(海柔)",""),
|
||||||
|
HAIROU_OUT_REQ("14","半成品出库(海柔)",""),
|
||||||
|
HAIROU_INVENTORY_REQ("15","盘点(海柔)",""),
|
||||||
|
HAIROU_EMPTY_OUT_REQ("16","空载具出库(海柔)",""),
|
||||||
|
HAIROU_EMPTY_IN_REQ("17","空载具入库(海柔)",""),
|
||||||
|
|
||||||
|
HAIROU_LIKU_REQ("18","半成品库任务(海柔)",""),
|
||||||
|
|
||||||
|
TOTE_INBOUND("1","容器入库","tote_inbound"),
|
||||||
|
TOTE_OUTBOUND("2","容器出库","tote_outbound"),
|
||||||
|
TOTE_RELOCATION("3","容器移库","tote_relocation"),
|
||||||
|
TOTE_CARRY("4","容器搬运","tote_carry"),
|
||||||
|
TOTE_CHECK("5","容器盘库","tote_check"),
|
||||||
|
|
||||||
//指令状态
|
//指令状态
|
||||||
INST_READY("0", "就绪", ""),
|
INST_READY("0", "就绪", ""),
|
||||||
INST_RUNNING("1", "执行中", ""),
|
INST_RUNNING("1", "执行中", ""),
|
||||||
@@ -67,7 +81,8 @@ public enum StatusEnum {
|
|||||||
TASK_READY("0", "就绪", ""),
|
TASK_READY("0", "就绪", ""),
|
||||||
TASK_RUNNING("1", "执行中", "6"),
|
TASK_RUNNING("1", "执行中", "6"),
|
||||||
TASK_FINISH("2", "完成", "7"),
|
TASK_FINISH("2", "完成", "7"),
|
||||||
TASK_CANCEL("3", "取消", "8");
|
TASK_CANCEL("3", "取消", "8"),
|
||||||
|
TASK_FULL_IN("4","满入","");
|
||||||
|
|
||||||
private String code;
|
private String code;
|
||||||
private String desc;
|
private String desc;
|
||||||
|
|||||||
Binary file not shown.
@@ -110,7 +110,8 @@ public enum DriverTypeEnum {
|
|||||||
HAILIANG_CLEANING_PUT_LINE(48, "hailiang_cleaning_put_line", "海亮-清洗下料", "conveyor"),
|
HAILIANG_CLEANING_PUT_LINE(48, "hailiang_cleaning_put_line", "海亮-清洗下料", "conveyor"),
|
||||||
|
|
||||||
HAILIANG_ENGRAVING_IN(49, "hailiang_engraving_in", "海亮-刻字上料线体", "conveyor"),
|
HAILIANG_ENGRAVING_IN(49, "hailiang_engraving_in", "海亮-刻字上料线体", "conveyor"),
|
||||||
HAILIANG_FRAME_WEIGHING(50, "hailiang_frame_weighing", "海亮-合框称重", "conveyor");
|
HAILIANG_FRAME_WEIGHING(50, "hailiang_frame_weighing", "海亮-合框称重", "conveyor"),
|
||||||
|
HAILIANG_WITH_STATION(51, "hailiang_with_station", "海亮-关联站点", "conveyor");
|
||||||
//驱动索引
|
//驱动索引
|
||||||
private int index;
|
private int index;
|
||||||
//驱动编码
|
//驱动编码
|
||||||
|
|||||||
@@ -68,24 +68,25 @@ public class LiKuDeviceDriver extends AbstractDeviceDriver implements DeviceDriv
|
|||||||
String containerCode = "";
|
String containerCode = "";
|
||||||
List<String> taskCodes=null;
|
List<String> taskCodes=null;
|
||||||
String positionCode = "";
|
String positionCode = "";
|
||||||
public JSONObject getDeviceStatusName() {
|
|
||||||
JSONObject jo = new JSONObject();
|
public JSONObject getDeviceStatusName() {
|
||||||
jo.put("robotCode",robotCode);
|
JSONObject jo = new JSONObject();
|
||||||
jo.put("robotTypeCode", robotTypeCode);
|
jo.put("robotCode",robotCode);
|
||||||
jo.put("pointCode", pointCode);
|
jo.put("robotTypeCode", robotTypeCode);
|
||||||
jo.put("positionX",this.getPositionX());
|
jo.put("pointCode", pointCode);
|
||||||
jo.put("positionY",this. getPositionY());
|
jo.put("positionX",this.getPositionX());
|
||||||
jo.put("theta", this.getTheta());
|
jo.put("positionY",this. getPositionY());
|
||||||
jo.put("forkHeight", this.getForkHeight());
|
jo.put("theta", this.getTheta());
|
||||||
jo.put("forkLength", this.getForkLength());
|
jo.put("forkHeight", this.getForkHeight());
|
||||||
jo.put("forkTheta", this.getForkTheta());
|
jo.put("forkLength", this.getForkLength());
|
||||||
jo.put("stationCode", stationCode);
|
jo.put("forkTheta", this.getForkTheta());
|
||||||
jo.put("locationCode", locationCode);
|
jo.put("stationCode", stationCode);
|
||||||
jo.put("state", state);
|
jo.put("locationCode", locationCode);
|
||||||
jo.put("hardwareState",hardwareState);
|
jo.put("state", state);
|
||||||
jo.put("trays", this.getTrayList());
|
jo.put("hardwareState",hardwareState);
|
||||||
return jo;
|
jo.put("trays", this.getTrayList());
|
||||||
}
|
return jo;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDeviceStatus(JSONObject data) {
|
public void setDeviceStatus(JSONObject data) {
|
||||||
|
|||||||
@@ -6,4 +6,5 @@ package org.nl.acs.device_driver.basedriver.hailiang_one;
|
|||||||
*/
|
*/
|
||||||
public class ApplyTaskTime {
|
public class ApplyTaskTime {
|
||||||
public final static long APPLY_TIME = 60l;
|
public final static long APPLY_TIME = 60l;
|
||||||
|
public final static long APPLY_TIME_TEN = 30l;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ public class PhotoelectricInspectionSiteDeviceDriver extends AbstractOpcDeviceDr
|
|||||||
dto.setCreate_time(now);
|
dto.setCreate_time(now);
|
||||||
|
|
||||||
WQLObject wo = WQLObject.getWQLObject("acs_task");
|
WQLObject wo = WQLObject.getWQLObject("acs_task");
|
||||||
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||||
|
|
||||||
wo.insert(json);
|
wo.insert(json);
|
||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
|
|||||||
@@ -423,7 +423,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
|||||||
WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder");
|
WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder");
|
||||||
dto.setOrder_status(status);
|
dto.setOrder_status(status);
|
||||||
dto.setUpdate_time(DateUtil.now());
|
dto.setUpdate_time(DateUtil.now());
|
||||||
dto.setUpdate_by("mes");
|
dto.setUpdate_by("lms");
|
||||||
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||||
wo.update(json);
|
wo.update(json);
|
||||||
this.order.removeIf(o -> o.getOrder_code().equals(dto.getOrder_code()));
|
this.order.removeIf(o -> o.getOrder_code().equals(dto.getOrder_code()));
|
||||||
@@ -472,7 +472,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
|
|||||||
HailiangStackingStationDriver hailiangStackingStationDriver;
|
HailiangStackingStationDriver hailiangStackingStationDriver;
|
||||||
HailiangOldSpecialDeviceDriver hailiangOldSpecialDeviceDriver;
|
HailiangOldSpecialDeviceDriver hailiangOldSpecialDeviceDriver;
|
||||||
Device device = deviceAppService.findDeviceByCode(dto.getDevice_code());
|
Device device = deviceAppService.findDeviceByCode(dto.getDevice_code());
|
||||||
String upName = SecurityUtils.getCurrentUsername() == null ? "mes" : SecurityUtils.getCurrentUsername();
|
String upName = SecurityUtils.getCurrentUsername() == null ? "lms" : SecurityUtils.getCurrentUsername();
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
map.put("online_id", IdUtil.simpleUUID());
|
map.put("online_id", IdUtil.simpleUUID());
|
||||||
map.put("device_code", device_code);
|
map.put("device_code", device_code);
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ import org.nl.acs.task.service.dto.TaskFeedbackDto;
|
|||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.common.utils.FileUtil;
|
import org.nl.modules.common.utils.FileUtil;
|
||||||
import org.nl.modules.common.utils.SecurityUtils;
|
import org.nl.modules.common.utils.SecurityUtils;
|
||||||
|
import org.nl.modules.lucene.service.LuceneExecuteLogService;
|
||||||
|
import org.nl.modules.lucene.service.dto.LuceneLogDto;
|
||||||
import org.nl.modules.system.service.ParamService;
|
import org.nl.modules.system.service.ParamService;
|
||||||
import org.nl.modules.system.util.CodeUtil;
|
import org.nl.modules.system.util.CodeUtil;
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
@@ -75,7 +77,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
private DeviceAssignedService deviceAssignedService;
|
private DeviceAssignedService deviceAssignedService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private InstructionService instructionService;
|
private InstructionService instructionService;
|
||||||
|
// private LuceneExecuteLogService lucene = SpringContextHolder.getBean(LuceneExecuteLogService.class);
|
||||||
@Override
|
@Override
|
||||||
public void autoInitial() throws Exception {
|
public void autoInitial() throws Exception {
|
||||||
this.reload();
|
this.reload();
|
||||||
@@ -561,9 +563,15 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
TaskDto entity = this.findById(id);
|
TaskDto entity = this.findById(id);
|
||||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
InstructionDto instdto = instructionService.findByTaskId(id, "instruction_status <2 ");
|
InstructionDto instdto = instructionService.findByTaskId(id, "instruction_status <2 ");
|
||||||
if (instdto != null) throw new BadRequestException("有指令未完成!");
|
if (instdto != null) {
|
||||||
entity.setTask_status(StatusEnum.INST_FINISH.getCode());
|
// lucene.deviceExecuteLog(new LuceneLogDto(id,"任务号关联的指令状态instruction_status <2:"+instdto.getInstruction_status()));
|
||||||
this.update(entity);
|
log.info("任务号{}关联的指令状态instruction_status <2:{}",id,instdto.getInstruction_status());
|
||||||
|
throw new BadRequestException("有指令未完成!");
|
||||||
|
}else {
|
||||||
|
entity.setTask_status(StatusEnum.INST_FINISH.getCode());
|
||||||
|
this.update(entity);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<appender name="FILE12" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="FILE12" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
<!--日志文件输出的文件名-->
|
<!--日志文件输出的文件名-->
|
||||||
<FileNamePattern>${LOG_HOME}/ACS请求MES/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
<FileNamePattern>${LOG_HOME}/ACS请求LMS/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||||
<!--日志文件保留天数-->
|
<!--日志文件保留天数-->
|
||||||
<maxHistory>15</maxHistory>
|
<maxHistory>15</maxHistory>
|
||||||
<!--单个日志最大容量 至少10MB才能看得出来-->
|
<!--单个日志最大容量 至少10MB才能看得出来-->
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<appender name="FILE13" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="FILE13" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
<!--日志文件输出的文件名-->
|
<!--日志文件输出的文件名-->
|
||||||
<FileNamePattern>${LOG_HOME}/MES下发ACS/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
<FileNamePattern>${LOG_HOME}/LMS下发ACS/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||||
<!--日志文件保留天数-->
|
<!--日志文件保留天数-->
|
||||||
<maxHistory>15</maxHistory>
|
<maxHistory>15</maxHistory>
|
||||||
<!--单个日志最大容量 至少10MB才能看得出来-->
|
<!--单个日志最大容量 至少10MB才能看得出来-->
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import request from '@/utils/request'
|
|||||||
|
|
||||||
export function add(data) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/stageActor',
|
url: 'api/new/stageActor',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -10,7 +10,7 @@ export function add(data) {
|
|||||||
|
|
||||||
export function del(ids) {
|
export function del(ids) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/stageActor/',
|
url: 'api/new/stageActor/',
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
@@ -18,7 +18,7 @@ export function del(ids) {
|
|||||||
|
|
||||||
export function edit(data) {
|
export function edit(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/stageActor',
|
url: 'api/new/stageActor',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -26,7 +26,7 @@ export function edit(data) {
|
|||||||
|
|
||||||
export function saveData(data) {
|
export function saveData(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/stageActor/saveData',
|
url: 'api/new/stageActor/saveData',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -34,7 +34,7 @@ export function saveData(data) {
|
|||||||
|
|
||||||
export function queryStageActor(stage_code) {
|
export function queryStageActor(stage_code) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/stageActor/queryStageActor/' + stage_code,
|
url: 'api/new/stageActor/queryStageActor/' + stage_code,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ import hailiang_old_package_receiving_machine from '@/views/acs/device/driver/ha
|
|||||||
import hailiang_cleaning_put_line from '@/views/acs/device/driver/hailiang_one/hailiang_cleaning_put_line'
|
import hailiang_cleaning_put_line from '@/views/acs/device/driver/hailiang_one/hailiang_cleaning_put_line'
|
||||||
import hailiang_engraving_in from '@/views/acs/device/driver/hailiang_one/hailiang_engraving_in'
|
import hailiang_engraving_in from '@/views/acs/device/driver/hailiang_one/hailiang_engraving_in'
|
||||||
import hailiang_frame_weighing from '@/views/acs/device/driver/hailiang_one/hailiang_frame_weighing'
|
import hailiang_frame_weighing from '@/views/acs/device/driver/hailiang_one/hailiang_frame_weighing'
|
||||||
|
import hailiang_with_station from '@/views/acs/device/driver/hailiang_old/hailiang_with_station'
|
||||||
export default {
|
export default {
|
||||||
name: 'DeviceConfig',
|
name: 'DeviceConfig',
|
||||||
components: {
|
components: {
|
||||||
@@ -202,7 +203,8 @@ export default {
|
|||||||
hailiang_old_package_receiving_machine,
|
hailiang_old_package_receiving_machine,
|
||||||
hailiang_cleaning_put_line,
|
hailiang_cleaning_put_line,
|
||||||
hailiang_engraving_in,
|
hailiang_engraving_in,
|
||||||
hailiang_frame_weighing
|
hailiang_frame_weighing,
|
||||||
|
hailiang_with_station
|
||||||
},
|
},
|
||||||
dicts: ['device_type'],
|
dicts: ['device_type'],
|
||||||
mixins: [crud],
|
mixins: [crud],
|
||||||
|
|||||||
@@ -1,489 +1,494 @@
|
|||||||
<template>
|
<template>
|
||||||
<!---海亮-老车间包装输送线-->
|
<!---海亮-老车间包装输送线-->
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<el-card class="box-card" shadow="never">
|
<el-card class="box-card" shadow="never">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span class="role-span">设备协议:</span>
|
<span class="role-span">设备协议:</span>
|
||||||
</div>
|
</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
|
||||||
|
@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-row>
|
||||||
<el-col :span="12">
|
<el-col :span="8">
|
||||||
OpcServer:
|
<el-form-item label="电气调度号" label-width="150px">
|
||||||
<el-select
|
<el-input v-model="form.OPCServer" />
|
||||||
v-model="opc_id"
|
</el-form-item>
|
||||||
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
|
|
||||||
@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-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="box-card" shadow="never">
|
<el-card class="box-card" shadow="never">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span class="role-span">输送系统:</span>
|
<span class="role-span">指令相关:</span>
|
||||||
</div>
|
</div>
|
||||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="电气调度号" label-width="150px">
|
<el-form-item label="开启扫码">
|
||||||
<el-input v-model="form.OPCServer" />
|
<el-switch v-model="form.open_scanner" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
<el-col :span="8">
|
||||||
</el-form>
|
<el-form-item label="忽视取货校验" label-width="150px">
|
||||||
</el-card>
|
<el-switch v-model="form.ignore_pickup_check" />
|
||||||
|
</el-form-item>
|
||||||
<el-card class="box-card" shadow="never">
|
</el-col>
|
||||||
<div slot="header" class="clearfix">
|
<el-col :span="8">
|
||||||
<span class="role-span">指令相关:</span>
|
<el-form-item label="忽视放货校验" label-width="150px">
|
||||||
</div>
|
<el-switch v-model="form.ignore_release_check" />
|
||||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
</el-form-item>
|
||||||
<el-row>
|
</el-col>
|
||||||
<el-col :span="8">
|
</el-row>
|
||||||
<el-form-item label="开启扫码">
|
|
||||||
<el-switch v-model="form.open_scanner" />
|
<el-row>
|
||||||
</el-form-item>
|
<el-col :span="8">
|
||||||
</el-col>
|
<el-form-item label="申请空框" >
|
||||||
<el-col :span="8">
|
<el-switch v-model="form.apply_task" />
|
||||||
<el-form-item label="忽视取货校验" label-width="150px">
|
</el-form-item>
|
||||||
<el-switch v-model="form.ignore_pickup_check" />
|
</el-col>
|
||||||
</el-form-item>
|
<el-col :span="8">
|
||||||
</el-col>
|
<el-form-item label="申请空框数量" label-width="150px">
|
||||||
<el-col :span="8">
|
<el-input v-model="form.apply_num" />
|
||||||
<el-form-item label="忽视放货校验" label-width="150px">
|
</el-form-item>
|
||||||
<el-switch v-model="form.ignore_release_check" />
|
</el-col>
|
||||||
</el-form-item>
|
<el-col :span="8">
|
||||||
</el-col>
|
<el-form-item label="手动生成任务" label-width="150px">
|
||||||
</el-row>
|
<el-switch v-model="form.manual_create_task" />
|
||||||
|
</el-form-item>
|
||||||
<el-row>
|
</el-col>
|
||||||
<el-col :span="8">
|
</el-row>
|
||||||
<el-form-item label="申请任务">
|
<el-row>
|
||||||
<el-switch v-model="form.apply_task" />
|
<el-col :span="8">
|
||||||
</el-form-item>
|
<el-form-item label="申请空盘" prop="device_code">
|
||||||
</el-col>
|
<el-select
|
||||||
<el-col :span="8">
|
v-model="form.apply_empty"
|
||||||
<el-form-item label="手动生成任务" label-width="150px">
|
filterable
|
||||||
<el-switch v-model="form.manual_create_task" />
|
multiple
|
||||||
</el-form-item>
|
placeholder="请选择"
|
||||||
</el-col>
|
>
|
||||||
</el-row>
|
<el-option
|
||||||
<el-row>
|
v-for="item in deviceList"
|
||||||
<el-col :span="8">
|
:key="item.device_code"
|
||||||
<el-form-item label="申请空盘" prop="device_code">
|
:label="item.device_name"
|
||||||
<el-select
|
:value="item.device_code"
|
||||||
v-model="form.apply_empty"
|
/>
|
||||||
filterable
|
</el-select>
|
||||||
multiple
|
</el-form-item>
|
||||||
placeholder="请选择"
|
</el-col>
|
||||||
>
|
</el-row>
|
||||||
<el-option
|
</el-form>
|
||||||
v-for="item in deviceList"
|
</el-card>
|
||||||
:key="item.device_code"
|
|
||||||
:label="item.device_name"
|
<el-card class="box-card" shadow="never">
|
||||||
:value="item.device_code"
|
<div slot="header" class="clearfix">
|
||||||
/>
|
<span class="role-span">AGV相关:</span>
|
||||||
</el-select>
|
</div>
|
||||||
</el-form-item>
|
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||||
</el-col>
|
<el-row>
|
||||||
</el-row>
|
<el-col :span="8">
|
||||||
</el-form>
|
<el-form-item label="取货">
|
||||||
</el-card>
|
<el-switch v-model="form.pickup" />
|
||||||
|
</el-form-item>
|
||||||
<el-card class="box-card" shadow="never">
|
</el-col>
|
||||||
<div slot="header" class="clearfix">
|
<el-col :span="8">
|
||||||
<span class="role-span">AGV相关:</span>
|
<el-form-item label="放货">
|
||||||
</div>
|
<el-switch v-model="form.is_release" />
|
||||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
</el-form-item>
|
||||||
<el-row>
|
</el-col>
|
||||||
<el-col :span="8">
|
</el-row>
|
||||||
<el-form-item label="取货">
|
</el-form>
|
||||||
<el-switch v-model="form.pickup" />
|
</el-card>
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
<el-card class="box-card" shadow="never">
|
||||||
<el-col :span="8">
|
<div slot="header" class="clearfix">
|
||||||
<el-form-item label="放货">
|
<span class="role-span">PLC读取字段:</span>
|
||||||
<el-switch v-model="form.is_release" />
|
</div>
|
||||||
</el-form-item>
|
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||||
</el-col>
|
<el-table
|
||||||
</el-row>
|
v-loading="false"
|
||||||
</el-form>
|
:data="data1"
|
||||||
</el-card>
|
:max-height="550"
|
||||||
|
size="small"
|
||||||
<el-card class="box-card" shadow="never">
|
style="width: 100%;margin-bottom: 15px"
|
||||||
<div slot="header" class="clearfix">
|
>
|
||||||
<span class="role-span">PLC读取字段:</span>
|
|
||||||
</div>
|
<el-table-column prop="name" label="用途" />
|
||||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
<el-table-column prop="code" label="别名要求" />
|
||||||
<el-table
|
<el-table-column prop="db" label="DB块">
|
||||||
v-loading="false"
|
<template slot-scope="scope">
|
||||||
:data="data1"
|
<el-input v-model="data1[scope.$index].db" size="mini" class="edit-input" @input="finishReadEdit(data1[scope.$index])" />
|
||||||
:max-height="550"
|
</template>
|
||||||
size="small"
|
</el-table-column>
|
||||||
style="width: 100%;margin-bottom: 15px"
|
<el-table-column prop="dbr_value">
|
||||||
>
|
<template slot="header">
|
||||||
|
<el-link type="primary" :underline="false" @click.native="test_read1()">测试读</el-link>
|
||||||
<el-table-column prop="name" label="用途" />
|
</template>
|
||||||
<el-table-column prop="code" label="别名要求" />
|
<template slot-scope="scope">
|
||||||
<el-table-column prop="db" label="DB块">
|
<el-input v-model="data1[scope.$index].dbr_value" size="mini" class="edit-input" />
|
||||||
<template slot-scope="scope">
|
</template>
|
||||||
<el-input v-model="data1[scope.$index].db" size="mini" class="edit-input" @input="finishReadEdit(data1[scope.$index])" />
|
</el-table-column>
|
||||||
</template>
|
</el-table>
|
||||||
</el-table-column>
|
</el-form>
|
||||||
<el-table-column prop="dbr_value">
|
</el-card>
|
||||||
<template slot="header">
|
|
||||||
<el-link type="primary" :underline="false" @click.native="test_read1()">测试读</el-link>
|
<el-card class="box-card" shadow="never">
|
||||||
</template>
|
<div slot="header" class="clearfix">
|
||||||
<template slot-scope="scope">
|
<span class="role-span">PLC写入字段:</span>
|
||||||
<el-input v-model="data1[scope.$index].dbr_value" size="mini" class="edit-input" />
|
</div>
|
||||||
</template>
|
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||||
</el-table-column>
|
<el-table
|
||||||
</el-table>
|
v-loading="false"
|
||||||
</el-form>
|
:data="data2"
|
||||||
</el-card>
|
:max-height="550"
|
||||||
|
size="small"
|
||||||
<el-card class="box-card" shadow="never">
|
style="width: 100%;margin-bottom: 15px"
|
||||||
<div slot="header" class="clearfix">
|
>
|
||||||
<span class="role-span">PLC写入字段:</span>
|
|
||||||
</div>
|
<el-table-column prop="name" label="用途" />
|
||||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
<el-table-column prop="code" label="别名要求" />
|
||||||
<el-table
|
<el-table-column prop="db" label="DB块">
|
||||||
v-loading="false"
|
<template slot-scope="scope">
|
||||||
:data="data2"
|
<el-input v-model="data2[scope.$index].db" size="mini" class="edit-input" @input="finishWriteEdit(data2[scope.$index])" />
|
||||||
:max-height="550"
|
</template>
|
||||||
size="small"
|
</el-table-column>
|
||||||
style="width: 100%;margin-bottom: 15px"
|
<el-table-column prop="dbr_value2">
|
||||||
>
|
<template slot="header">
|
||||||
|
<el-link type="primary" :underline="false" @click.native="test_read2()">测试读</el-link>
|
||||||
<el-table-column prop="name" label="用途" />
|
</template>
|
||||||
<el-table-column prop="code" label="别名要求" />
|
<template slot-scope="scope">
|
||||||
<el-table-column prop="db" label="DB块">
|
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input" />
|
||||||
<template slot-scope="scope">
|
</template>
|
||||||
<el-input v-model="data2[scope.$index].db" size="mini" class="edit-input" @input="finishWriteEdit(data2[scope.$index])" />
|
</el-table-column>
|
||||||
</template>
|
<el-table-column prop="dbw_value">
|
||||||
</el-table-column>
|
<template slot="header">
|
||||||
<el-table-column prop="dbr_value2">
|
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
|
||||||
<template slot="header">
|
</template>
|
||||||
<el-link type="primary" :underline="false" @click.native="test_read2()">测试读</el-link>
|
<template slot-scope="scope">
|
||||||
</template>
|
<el-input v-model="data2[scope.$index].dbw_value" size="mini" class="edit-input" />
|
||||||
<template slot-scope="scope">
|
</template>
|
||||||
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input" />
|
</el-table-column>
|
||||||
</template>
|
</el-table>
|
||||||
</el-table-column>
|
</el-form>
|
||||||
<el-table-column prop="dbw_value">
|
</el-card>
|
||||||
<template slot="header">
|
|
||||||
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
|
<el-card class="box-card" shadow="never">
|
||||||
</template>
|
<div slot="header" class="clearfix">
|
||||||
<template slot-scope="scope">
|
<span class="role-span" />
|
||||||
<el-input v-model="data2[scope.$index].dbw_value" size="mini" class="edit-input" />
|
<el-button
|
||||||
</template>
|
:loading="false"
|
||||||
</el-table-column>
|
icon="el-icon-check"
|
||||||
</el-table>
|
size="mini"
|
||||||
</el-form>
|
style="float: right; padding: 6px 9px"
|
||||||
</el-card>
|
type="primary"
|
||||||
|
@click="doSubmit"
|
||||||
<el-card class="box-card" shadow="never">
|
>保存
|
||||||
<div slot="header" class="clearfix">
|
</el-button>
|
||||||
<span class="role-span" />
|
</div>
|
||||||
<el-button
|
</el-card>
|
||||||
:loading="false"
|
|
||||||
icon="el-icon-check"
|
</div>
|
||||||
size="mini"
|
</template>
|
||||||
style="float: right; padding: 6px 9px"
|
|
||||||
type="primary"
|
<script>
|
||||||
@click="doSubmit"
|
import {
|
||||||
>保存
|
queryDriverConfig,
|
||||||
</el-button>
|
updateConfig,
|
||||||
</div>
|
testRead,
|
||||||
</el-card>
|
testwrite
|
||||||
|
} from '@/api/acs/device/driverConfig'
|
||||||
</div>
|
import { selectOpcList } from '@/api/acs/device/opc'
|
||||||
</template>
|
import { selectPlcList } from '@/api/acs/device/opcPlc'
|
||||||
|
import { selectListByOpcID } from '@/api/acs/device/opcPlc'
|
||||||
<script>
|
|
||||||
import {
|
import crud from '@/mixins/crud'
|
||||||
queryDriverConfig,
|
import deviceCrud from '@/api/acs/device/device'
|
||||||
updateConfig,
|
|
||||||
testRead,
|
export default {
|
||||||
testwrite
|
name: 'LnshPalletizingManipulatorSite',
|
||||||
} from '@/api/acs/device/driverConfig'
|
mixins: [crud],
|
||||||
import { selectOpcList } from '@/api/acs/device/opc'
|
props: {
|
||||||
import { selectPlcList } from '@/api/acs/device/opcPlc'
|
parentForm: {
|
||||||
import { selectListByOpcID } from '@/api/acs/device/opcPlc'
|
type: Object,
|
||||||
|
require: true
|
||||||
import crud from '@/mixins/crud'
|
}
|
||||||
import deviceCrud from '@/api/acs/device/device'
|
},
|
||||||
|
data() {
|
||||||
export default {
|
return {
|
||||||
name: 'LnshPalletizingManipulatorSite',
|
device_code: '',
|
||||||
mixins: [crud],
|
device_id: '',
|
||||||
props: {
|
plc_id: '',
|
||||||
parentForm: {
|
plc_code: '',
|
||||||
type: Object,
|
opc_id: '',
|
||||||
require: true
|
opc_code: '',
|
||||||
|
configLoading: false,
|
||||||
|
dataOpcservers: [],
|
||||||
|
dataOpcPlcs: [],
|
||||||
|
data1: [],
|
||||||
|
data2: [],
|
||||||
|
form: {
|
||||||
|
inspect_in_stocck: true,
|
||||||
|
ignore_pickup_check: true,
|
||||||
|
ignore_release_check: true,
|
||||||
|
apply_task: true,
|
||||||
|
apply_num: '',
|
||||||
|
apply_empty: [],
|
||||||
|
manual_create_task: true,
|
||||||
|
is_pickup: true,
|
||||||
|
is_release: true
|
||||||
|
},
|
||||||
|
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) {
|
||||||
|
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) + 2)
|
||||||
|
}
|
||||||
|
if (this.data1[val].code.indexOf('action') !== -1) {
|
||||||
|
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 4)
|
||||||
|
}
|
||||||
|
if (this.data1[val].code.indexOf('direction') !== -1) {
|
||||||
|
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 6)
|
||||||
|
}
|
||||||
|
if (this.data1[val].code.indexOf('is_flip') !== -1) {
|
||||||
|
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 8)
|
||||||
|
}
|
||||||
|
if (this.data1[val].code.indexOf('error') !== -1) {
|
||||||
|
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 10)
|
||||||
|
}
|
||||||
|
if (this.data1[val].code.indexOf('task') !== -1) {
|
||||||
|
this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 12)
|
||||||
|
}
|
||||||
|
if (this.data1[val].code.indexOf('barcode') !== -1) {
|
||||||
|
this.data1[val].db = beforeStr + '.' + 'STRING' + (parseInt(endNumber) + 16) + '.20'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
finishWriteEdit(data) {
|
||||||
return {
|
// 编辑的是code列,并且值包含mode
|
||||||
device_code: '',
|
if (data.code.indexOf('to_command') !== -1) {
|
||||||
device_id: '',
|
const dbValue = data.db
|
||||||
plc_id: '',
|
// .之前的字符串
|
||||||
plc_code: '',
|
const beforeStr = dbValue.match(/(\S*)\./)[1]
|
||||||
opc_id: '',
|
// .之后的字符串
|
||||||
opc_code: '',
|
const afterStr = dbValue.match(/\.(\S*)/)[1]
|
||||||
configLoading: false,
|
// 取最后数字
|
||||||
dataOpcservers: [],
|
const endNumber = afterStr.substring(1)
|
||||||
dataOpcPlcs: [],
|
// 最后为非数字
|
||||||
data1: [],
|
if (isNaN(parseInt(endNumber))) {
|
||||||
data2: [],
|
return
|
||||||
form: {
|
}
|
||||||
inspect_in_stocck: true,
|
for (const val in this.data2) {
|
||||||
ignore_pickup_check: true,
|
if (this.data2[val].code.indexOf('to_target') !== -1) {
|
||||||
ignore_release_check: true,
|
this.data2[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2)
|
||||||
apply_task: true,
|
}
|
||||||
apply_empty: [],
|
if (this.data2[val].code.indexOf('to_is_flip') !== -1) {
|
||||||
manual_create_task: true,
|
this.data2[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 4)
|
||||||
is_pickup: true,
|
}
|
||||||
is_release: true
|
if (this.data2[val].code.indexOf('to_task') !== -1) {
|
||||||
},
|
this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 6)
|
||||||
rules: {}
|
}
|
||||||
|
if (this.data2[val].code.indexOf('to_barcode') !== -1) {
|
||||||
|
this.data2[val].db = beforeStr + '.' + 'STRING' + (parseInt(endNumber) + 10) + '.20'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
changeOpc(val) {
|
||||||
this.$nextTick(() => {
|
this.dataOpcservers.forEach(item => {
|
||||||
// 从父表单获取设备编码
|
if (item.opc_id === val) {
|
||||||
this.device_id = this.$props.parentForm.device_id
|
this.opc_code = item.opc_code
|
||||||
this.device_code = this.$props.parentForm.device_code
|
}
|
||||||
queryDriverConfig(this.device_id, this.$props.parentForm.driver_code).then(data => {
|
})
|
||||||
// 给表单赋值,并且属性不能为空
|
|
||||||
if (data.form) {
|
selectListByOpcID(val).then(data => {
|
||||||
const arr = Object.keys(data.form)
|
this.dataOpcPlcs = data
|
||||||
// 不为空
|
this.plc_id = ''
|
||||||
if (arr.length > 0) {
|
this.plc_code = ''
|
||||||
this.form = data.form
|
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()
|
||||||
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: {
|
changePlc(val) {
|
||||||
finishReadEdit(data) {
|
this.dataOpcPlcs.forEach(item => {
|
||||||
// 编辑的是code列,并且值包含mode
|
if (item.plc_id === val) {
|
||||||
if (data.code.indexOf('mode') !== -1) {
|
this.plc_code = item.plc_code
|
||||||
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) + 2)
|
|
||||||
}
|
|
||||||
if (this.data1[val].code.indexOf('action') !== -1) {
|
|
||||||
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 4)
|
|
||||||
}
|
|
||||||
if (this.data1[val].code.indexOf('direction') !== -1) {
|
|
||||||
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 6)
|
|
||||||
}
|
|
||||||
if (this.data1[val].code.indexOf('is_flip') !== -1) {
|
|
||||||
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 8)
|
|
||||||
}
|
|
||||||
if (this.data1[val].code.indexOf('error') !== -1) {
|
|
||||||
this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 10)
|
|
||||||
}
|
|
||||||
if (this.data1[val].code.indexOf('task') !== -1) {
|
|
||||||
this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 12)
|
|
||||||
}
|
|
||||||
if (this.data1[val].code.indexOf('barcode') !== -1) {
|
|
||||||
this.data1[val].db = beforeStr + '.' + 'STRING' + (parseInt(endNumber) + 16) + '.20'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
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_is_flip') !== -1) {
|
|
||||||
this.data2[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 4)
|
|
||||||
}
|
|
||||||
if (this.data2[val].code.indexOf('to_task') !== -1) {
|
|
||||||
this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 6)
|
|
||||||
}
|
|
||||||
if (this.data2[val].code.indexOf('to_barcode') !== -1) {
|
|
||||||
this.data2[val].db = beforeStr + '.' + 'STRING' + (parseInt(endNumber) + 10) + '.20'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
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()
|
this.sliceItem()
|
||||||
})
|
return
|
||||||
},
|
}
|
||||||
changePlc(val) {
|
})
|
||||||
this.dataOpcPlcs.forEach(item => {
|
},
|
||||||
if (item.plc_id === val) {
|
test_read1() {
|
||||||
this.plc_code = item.plc_code
|
testRead(this.data1, this.opc_id).then(data => {
|
||||||
this.sliceItem()
|
this.data1 = data
|
||||||
return
|
this.notify('操作成功!', 'success')
|
||||||
}
|
}).catch(err => {
|
||||||
})
|
console.log(err.response.data.message)
|
||||||
},
|
})
|
||||||
test_read1() {
|
},
|
||||||
testRead(this.data1, this.opc_id).then(data => {
|
test_read2() {
|
||||||
this.data1 = data
|
testRead(this.data2, this.opc_id).then(data => {
|
||||||
this.notify('操作成功!', 'success')
|
this.data2 = data
|
||||||
}).catch(err => {
|
console.log(this.data2)
|
||||||
console.log(err.response.data.message)
|
this.notify('操作成功!', 'success')
|
||||||
})
|
}).catch(err => {
|
||||||
},
|
console.log(err.response.data.message)
|
||||||
test_read2() {
|
})
|
||||||
testRead(this.data2, this.opc_id).then(data => {
|
},
|
||||||
this.data2 = data
|
test_write1() {
|
||||||
console.log(this.data2)
|
testwrite(this.data2, this.opc_id).then(data => {
|
||||||
this.notify('操作成功!', 'success')
|
this.notify('操作成功!', 'success')
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
test_write1() {
|
doSubmit() {
|
||||||
testwrite(this.data2, this.opc_id).then(data => {
|
this.$refs['form'].validate((valid) => {
|
||||||
this.notify('操作成功!', 'success')
|
if (valid) {
|
||||||
}).catch(err => {
|
this.configLoading = true
|
||||||
console.log(err.response.data.message)
|
// 根据驱动类型判断是否为路由设备
|
||||||
})
|
const parentForm = this.parentForm
|
||||||
},
|
parentForm.is_route = true
|
||||||
doSubmit() {
|
parentForm.plc_id = this.plc_id
|
||||||
this.$refs['form'].validate((valid) => {
|
parentForm.opc_id = this.opc_id
|
||||||
if (valid) {
|
updateConfig(parentForm, this.form, this.data1, this.data2).then(res => {
|
||||||
this.configLoading = true
|
this.notify('保存成功', 'success')
|
||||||
// 根据驱动类型判断是否为路由设备
|
this.configLoading = false
|
||||||
const parentForm = this.parentForm
|
}).catch(err => {
|
||||||
parentForm.is_route = true
|
this.configLoading = false
|
||||||
parentForm.plc_id = this.plc_id
|
console.log(err.response.data.message)
|
||||||
parentForm.opc_id = this.opc_id
|
})
|
||||||
updateConfig(parentForm, this.form, this.data1, this.data2).then(res => {
|
}
|
||||||
this.notify('保存成功', 'success')
|
})
|
||||||
this.configLoading = false
|
},
|
||||||
}).catch(err => {
|
sliceItem() { // 拼接DB的Item值
|
||||||
this.configLoading = false
|
this.data1.forEach(item => {
|
||||||
console.log(err.response.data.message)
|
const str = item.code
|
||||||
})
|
// 是否包含.
|
||||||
}
|
if (str.search('.') !== -1) {
|
||||||
})
|
// 截取最后一位
|
||||||
},
|
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + str.slice(str.lastIndexOf('.') + 1)
|
||||||
sliceItem() { // 拼接DB的Item值
|
} else {
|
||||||
this.data1.forEach(item => {
|
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + item.code
|
||||||
const str = item.code
|
}
|
||||||
// 是否包含.
|
})
|
||||||
if (str.search('.') !== -1) {
|
this.data2.forEach(item => {
|
||||||
// 截取最后一位
|
const str = item.code
|
||||||
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + str.slice(str.lastIndexOf('.') + 1)
|
// 是否包含.
|
||||||
} else {
|
if (str.search('.') !== -1) {
|
||||||
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + item.code
|
// 截取最后一位
|
||||||
}
|
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + str.slice(str.lastIndexOf('.') + 1)
|
||||||
})
|
} else {
|
||||||
this.data2.forEach(item => {
|
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + item.code
|
||||||
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>
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@@ -145,7 +145,8 @@ export default {
|
|||||||
duration: 0
|
duration: 0
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
const id = '123'
|
// const id = '123'
|
||||||
|
const id = ''
|
||||||
// 获取token保存到vuex中的用户信息,此处仅适用于本项目,注意删除或修改
|
// 获取token保存到vuex中的用户信息,此处仅适用于本项目,注意删除或修改
|
||||||
// 实例化socket,这里我把用户名传给了后台,使后台能判断要把消息发给哪个用户,其实也可以后台直接获取用户IP来判断并推送
|
// 实例化socket,这里我把用户名传给了后台,使后台能判断要把消息发给哪个用户,其实也可以后台直接获取用户IP来判断并推送
|
||||||
const wsUri = process.env.VUE_APP_WS_API + id
|
const wsUri = process.env.VUE_APP_WS_API + id
|
||||||
|
|||||||
@@ -0,0 +1,600 @@
|
|||||||
|
<template>
|
||||||
|
<div class="monitor-wrap">
|
||||||
|
<el-row style="margin-top: 20px;margin-left: 20px;margin-bottom: 20px">
|
||||||
|
<el-col :span="6" />
|
||||||
|
<el-col :span="18">
|
||||||
|
<!-- 舞台:
|
||||||
|
<el-select v-model="stage_code" placeholder="请选择" @change="changeStage">
|
||||||
|
<el-option
|
||||||
|
v-for="item in stageSelectList"
|
||||||
|
:key="item.stage_code"
|
||||||
|
:label="item.stage_name"
|
||||||
|
:value="item.stage_code">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-button type="primary" @click="saveAll" :loading="saveLoading">保存</el-button>
|
||||||
|
<el-button type="success" @click="cleanArr2">清空</el-button>-->
|
||||||
|
<!-- <el-button type="info">操作</el-button>-->
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="1" style="margin-left: 10px">
|
||||||
|
<div>
|
||||||
|
<!-- <draggable :list="arr1" animation="300"
|
||||||
|
dragClass="dragClass"
|
||||||
|
ghostClass="ghostClass"
|
||||||
|
chosenClass="chosenClass"
|
||||||
|
@start="onStart"
|
||||||
|
@end="onEnd"
|
||||||
|
:move="onMove"
|
||||||
|
:group="{ name:'group', pull:'clone', put:false}"
|
||||||
|
>
|
||||||
|
<!–vue中引入图片https://blog.csdn.net/qq_35393869/article/details/80333564–>
|
||||||
|
<div v-for="(item,index) in arr1" :key="index"
|
||||||
|
style="position: relative; width: 34px;height: 34px;display: inline-block;margin: 0 0 0 0 ;vertical-align:bottom;outline: 1px solid #f0f0f0;">
|
||||||
|
<img :src="require('../../../../assets/acs/' +item.img1+'.png')" alt="" width="34px" height="34px;"
|
||||||
|
style="margin: 0 0 0 0;vertical-align:bottom;transform: rotate(0deg);"/>
|
||||||
|
</div>
|
||||||
|
</draggable>-->
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="22" style="margin-left: 30px">
|
||||||
|
<el-scrollbar style="width:1850px;height: 1050px;">
|
||||||
|
<!--使用draggable组件-->
|
||||||
|
<draggable
|
||||||
|
:list="arr2"
|
||||||
|
group="group"
|
||||||
|
animation="300"
|
||||||
|
filter=".forbid"
|
||||||
|
:style="'width:'+ grid_width +'px;'"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-for="(item) in arr2"
|
||||||
|
:key="item.index"
|
||||||
|
class="forbid"
|
||||||
|
style="position: relative; width: 34px;height: 34px;display: inline-block;margin: 0 0 0 0 ;vertical-align:bottom;"
|
||||||
|
@click="clickDevice(item)"
|
||||||
|
>
|
||||||
|
<el-popover
|
||||||
|
v-if="currentItem == item.index"
|
||||||
|
:ref="'pop_'+item.index"
|
||||||
|
placement="bottom"
|
||||||
|
effect="dark"
|
||||||
|
trigger="manual"
|
||||||
|
:value="currentItem == item.index"
|
||||||
|
:disabled="item.device_code == ''"
|
||||||
|
:popper-class="isErrorColor(item)"
|
||||||
|
>
|
||||||
|
<div v-if="item.device_code !== ''" style="height: 390px;overflow-y: auto">
|
||||||
|
<div style="padding: 3px;">
|
||||||
|
设备信息
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
:data="moveShow(item)"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<af-table-column
|
||||||
|
prop="name"
|
||||||
|
label="监控项"
|
||||||
|
/>
|
||||||
|
<af-table-column
|
||||||
|
prop="value"
|
||||||
|
label="当前值"
|
||||||
|
/>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</el-popover>
|
||||||
|
<div v-popover="'pop_'+item.index" class="content" @mouseover="changeCurrentTime(item)">
|
||||||
|
<img
|
||||||
|
:src="require('../../../../assets/acs/' +item.img2+'.png')"
|
||||||
|
alt=""
|
||||||
|
width="34px"
|
||||||
|
height="34px;"
|
||||||
|
:style="{ transform:' rotate('+item.angle+'deg)' }"
|
||||||
|
style="outline: 1px solid #f0f0f0;"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
v-if="hasGoods(item) && item.img2!='1' "
|
||||||
|
:src="require('../../../../assets/acs/' +'托盘'+'.png')"
|
||||||
|
style="position: absolute; top: 5px;right: 5px;width: 24px;height: 24px;"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
v-if="statusPic(item) && item.img2!='1'"
|
||||||
|
:src="require('../../../../assets/acs/' +'status0'+'.png')"
|
||||||
|
style="position: absolute; top: 0;left: 0;"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
v-if="!statusPic(item) && item.img2!='1' && item.device_code"
|
||||||
|
:src="require('../../../../assets/acs/' +'status1'+'.png')"
|
||||||
|
style="position: absolute; top: 0;left: 0;"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
v-if="isError(item)"
|
||||||
|
:src="require('../../../../assets/acs/' +'icon_alert'+'.png')"
|
||||||
|
style="position: absolute; top: 5px;right: 5px;width: 23px;height: 23px;"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</draggable>
|
||||||
|
</el-scrollbar>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<!--弹窗设置设备与图标绑定与角度-->
|
||||||
|
<el-dialog title="设备设置" :visible.sync="dialogFormVisible" width="35%">
|
||||||
|
<el-form :model="form" size="small">
|
||||||
|
<el-form-item label="设备编号" prop="device_code" label-width="80px">
|
||||||
|
<el-input v-model="form.device_code" :disabled="true" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备状态" label-width="80px">
|
||||||
|
<el-radio-group v-model="form.hasGoodStatus">
|
||||||
|
<el-radio-button :label="0">无货</el-radio-button>
|
||||||
|
<el-radio-button :label="1">有托盘</el-radio-button>
|
||||||
|
<el-radio-button :label="2">有托盘有货</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="dialogSave">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<!--弹窗设置设备与图标绑定与角度-->
|
||||||
|
<el-dialog title="设备设置" :visible.sync="dialogFormVisible3" width="35%">
|
||||||
|
<el-form :model="form" size="small">
|
||||||
|
<el-form-item label="设备编号" prop="device_code" label-width="80px">
|
||||||
|
<el-input v-model="form.device_code" :disabled="true" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备状态" label-width="80px">
|
||||||
|
<el-radio-group v-model="form.hasGoodStatus">
|
||||||
|
<el-radio-button :label="0">无货</el-radio-button>
|
||||||
|
<el-radio-button :label="1">空料斗</el-radio-button>
|
||||||
|
<el-radio-button :label="2">满料斗</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料编码" prop="material_type" label-width="80px">
|
||||||
|
<el-input v-model="form.material_type" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible3 = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="dialogSave">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<!--弹窗设置设备与图标绑定与角度-->
|
||||||
|
<el-dialog title="设备设置" :visible.sync="dialogFormVisible4" width="35%">
|
||||||
|
<el-form :model="form" size="small">
|
||||||
|
<el-form-item label="设备编号" prop="device_code" label-width="120px">
|
||||||
|
<el-input v-model="form.device_code" :disabled="true" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="缺料请求成功" prop="requireSucess" label-width="120px">
|
||||||
|
<el-radio-group v-model="form.requireSucess">
|
||||||
|
<el-radio-button :label="0">否</el-radio-button>
|
||||||
|
<el-radio-button :label="1">是</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="空箱请求成功" prop="fullrequireSucess" label-width="120px">
|
||||||
|
<el-radio-group v-model="form.fullrequireSucess">
|
||||||
|
<el-radio-button :label="0">否</el-radio-button>
|
||||||
|
<el-radio-button :label="1">是</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible4 = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="dialogSave">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!--弹窗设置设备与图标绑定与角度-->
|
||||||
|
<el-dialog title="设备设置" :visible.sync="dialogFormVisible1" width="35%">
|
||||||
|
<el-form :model="form" size="small">
|
||||||
|
<el-form-item label="设备编号" prop="device_code" label-width="80px">
|
||||||
|
<el-input v-model="form.device_code" :disabled="true" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="条码" label-width="80px">
|
||||||
|
<el-input v-model="form.barcode" :disabled="false" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible1 = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="saveBarcode">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<XJDeviceMonitor ref="child1" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// 导入draggable组件
|
||||||
|
import deviceCrud from '@/api/acs/device/device'
|
||||||
|
import draggable from 'vuedraggable'
|
||||||
|
import crud from '@/mixins/crud'
|
||||||
|
import actorCrud from '@/api/acs/stage/actor'
|
||||||
|
import XJDeviceMonitor from '@/views/acs/monitor/device/XJDeviceMonitor'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'MonitorDeviceNew',
|
||||||
|
// 注册draggable组件
|
||||||
|
components: {
|
||||||
|
draggable, XJDeviceMonitor
|
||||||
|
},
|
||||||
|
mixins: [crud],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
stage_code: '',
|
||||||
|
dialogFormVisible: false,
|
||||||
|
dialogFormVisible1: false,
|
||||||
|
dialogFormVisible2: false,
|
||||||
|
dialogFormVisible3: false,
|
||||||
|
dialogFormVisible4: false,
|
||||||
|
arr2: [],
|
||||||
|
currentItem: '',
|
||||||
|
stageSelectList: [],
|
||||||
|
deviceList: [],
|
||||||
|
form: {
|
||||||
|
index: 0,
|
||||||
|
device_code: '',
|
||||||
|
angle: 0,
|
||||||
|
hasGoodStatus: null,
|
||||||
|
barcode: '',
|
||||||
|
suspended: null,
|
||||||
|
material_type: '',
|
||||||
|
requireSucess: '',
|
||||||
|
fullrequireSucess: ''
|
||||||
|
},
|
||||||
|
grid_width: 1000
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.initArr2()
|
||||||
|
this.webSocket()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
clickDevice(item) {
|
||||||
|
// debugger
|
||||||
|
const index = item.index
|
||||||
|
const clickObj = this.arr2[index]
|
||||||
|
console.log(clickObj.data)
|
||||||
|
if (!clickObj.img2 || clickObj.img2 === '1' || !item.data) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (clickObj.data.is_click !== true) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (clickObj.data.device_type === 'scanner') {
|
||||||
|
this.dialogFormVisible1 = true
|
||||||
|
} else {
|
||||||
|
if (clickObj.data.driver_type === 'hailiang_engraving_cache') {
|
||||||
|
this.dialogFormVisible3 = true
|
||||||
|
} else if (clickObj.data.driver_type === 'hailiang_packer_station') {
|
||||||
|
this.dialogFormVisible4 = true
|
||||||
|
} else if (clickObj.data.driver_type === 'hailiang_xj_plc_test') {
|
||||||
|
this.$refs.child1.setForm(clickObj)
|
||||||
|
} else {
|
||||||
|
this.dialogFormVisible = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.form.angle = clickObj.angle
|
||||||
|
this.form.index = clickObj.index
|
||||||
|
this.form.device_code = clickObj.device_code
|
||||||
|
this.form.hasGoodStatus = clickObj.data.hasGoods
|
||||||
|
this.form.material_type = clickObj.data.material_type
|
||||||
|
this.form.requireSucess = clickObj.data.requireSucess
|
||||||
|
this.form.fullrequireSucess = clickObj.data.fullrequireSucess
|
||||||
|
},
|
||||||
|
hasGoods(item) {
|
||||||
|
if (item.data && item.data.hasGoods > 0) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
statusPic(item) {
|
||||||
|
if (item.data && item.data.isOnline === true) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
isError(item) {
|
||||||
|
if (item.data && item.data.isError === true) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
isErrorColor(item) {
|
||||||
|
if (item.data && item.data.isError === true) {
|
||||||
|
return 'error'
|
||||||
|
}
|
||||||
|
return 'normal'
|
||||||
|
},
|
||||||
|
changeCurrentTime(item) {
|
||||||
|
this.currentItem = item.index
|
||||||
|
},
|
||||||
|
moveShow(item) {
|
||||||
|
// debugger
|
||||||
|
if (item.device_code && item.data) {
|
||||||
|
const arr = [
|
||||||
|
{ name: '设备编号', value: item.device_code },
|
||||||
|
{ name: '设备名称', value: item.device_name }
|
||||||
|
]
|
||||||
|
const data = item.data
|
||||||
|
for (const val in data) {
|
||||||
|
if (val === 'isOnline' || val === 'isError' || val === 'hasGoods') {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (val === 'message' && data.isError === true) {
|
||||||
|
const obj = { name: '设备信息', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (val === 'message' && data.isError === 'false') {
|
||||||
|
const obj = { name: '异常信息', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (val === 'move') {
|
||||||
|
const obj = { name: '光电信号', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'mode') {
|
||||||
|
const obj = { name: '模式', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'error') {
|
||||||
|
const obj = { name: '报警', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'ip') {
|
||||||
|
const obj = { name: 'IP地址', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'number') {
|
||||||
|
const obj = { name: '托盘数量', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'qty') {
|
||||||
|
const obj = { name: '数量', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'weight') {
|
||||||
|
const obj = { name: '重量', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'instruction_message') {
|
||||||
|
const obj = { name: '指令信息', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'last_instruction_message') {
|
||||||
|
const obj = { name: '上次指令信息', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'container') {
|
||||||
|
const obj = { name: '载具号', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'last_container') {
|
||||||
|
const obj = { name: '上次载具号', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'instruction_code') {
|
||||||
|
const obj = { name: '指令号', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'last_instruction_code') {
|
||||||
|
const obj = { name: '上次指令号', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'action') {
|
||||||
|
const obj = { name: '动作信号', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'io_action') {
|
||||||
|
const obj = { name: '允许进出信号', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'material') {
|
||||||
|
const obj = { name: '物料', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'batch') {
|
||||||
|
const obj = { name: '批次', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'requestSucess') {
|
||||||
|
const obj = { name: '缺料请求成功', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'fullrequestSucess') {
|
||||||
|
const obj = { name: '空箱请求成功', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'applySucess') {
|
||||||
|
const obj = { name: '是否申请指令', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'message') {
|
||||||
|
const obj = { name: '说明', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'empty_is_lack') {
|
||||||
|
const obj = { name: '空箱位缺箱', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'empty_is_finish') {
|
||||||
|
const obj = { name: '空位完成', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'full_ready_req_agv') {
|
||||||
|
const obj = { name: '满箱位就绪,请求AGV', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'full_out') {
|
||||||
|
const obj = { name: '满箱已运出满箱位', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'finish') {
|
||||||
|
const obj = { name: '订单完成', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'order_compel_finish') {
|
||||||
|
const obj = { name: '订单强制完成', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'now_order_prod_num') {
|
||||||
|
const obj = { name: '当前生产总量', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'now_one_prod_num') {
|
||||||
|
const obj = { name: '当前箱生产量', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'task') {
|
||||||
|
const obj = { name: '任务号', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'full_number') {
|
||||||
|
const obj = { name: '出料口满框数量', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'storage_stock_num') {
|
||||||
|
const obj = { name: '储料仓库存数量', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'line_stock_num') {
|
||||||
|
const obj = { name: '线体库存数量', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'order_prod_allnum') {
|
||||||
|
const obj = { name: '订单生产总量', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'order') {
|
||||||
|
const obj = { name: '工单号', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'storage_stock_num') {
|
||||||
|
const obj = { name: '储料仓库存数量', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'line_stock_num') {
|
||||||
|
const obj = { name: '线体库存数量', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'material_type') {
|
||||||
|
const obj = { name: '产品编号', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'lack_req') {
|
||||||
|
const obj = { name: '缺料请求', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'empty_req') {
|
||||||
|
const obj = { name: '空箱请求', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'address') {
|
||||||
|
const obj = { name: 'agv位置', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'phaseName') {
|
||||||
|
const obj = { name: 'phase', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'full_req') {
|
||||||
|
const obj = { name: '满箱请求', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'open_time') {
|
||||||
|
const obj = { name: '开机时间', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'close_time') {
|
||||||
|
const obj = { name: '关机时间', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'feeding_qty') {
|
||||||
|
const obj = { name: '上料数量', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
} else if (val === 'error_num') {
|
||||||
|
const obj = { name: '故障次数', value: data[val] }
|
||||||
|
arr.push(obj)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return arr
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dialogSave() {
|
||||||
|
deviceCrud.changeDeviceStatus(this.form).then(res => {
|
||||||
|
this.notify('操作成功', 'success')
|
||||||
|
this.dialogFormVisible = false
|
||||||
|
this.dialogFormVisible3 = false
|
||||||
|
this.dialogFormVisible4 = false
|
||||||
|
this.initArr2()
|
||||||
|
}).catch(err => {
|
||||||
|
this.dialogFormVisible = false
|
||||||
|
this.dialogFormVisible3 = false
|
||||||
|
this.dialogFormVisible4 = false
|
||||||
|
console.log(err.response.data.message)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
statusSave() {
|
||||||
|
deviceCrud.changeFenceStatus(this.form).then(res => {
|
||||||
|
this.notify('操作成功', 'success')
|
||||||
|
this.dialogFormVisible2 = false
|
||||||
|
this.initArr2()
|
||||||
|
}).catch(err => {
|
||||||
|
this.dialogFormVisible2 = false
|
||||||
|
console.log(err.response.data.message)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
saveBarcode() {
|
||||||
|
deviceCrud.saveBarcode(this.form).then(res => {
|
||||||
|
this.notify('操作成功', 'success')
|
||||||
|
this.dialogFormVisible1 = false
|
||||||
|
this.initArr2()
|
||||||
|
}).catch(err => {
|
||||||
|
this.dialogFormVisible1 = false
|
||||||
|
console.log(err.response.data.message)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
initArr2() {
|
||||||
|
actorCrud.queryStageActor('SHDP').then(data => {
|
||||||
|
if (data.detail.length > 0) {
|
||||||
|
this.grid_width = data.form.grid_width
|
||||||
|
this.arr2 = []
|
||||||
|
for (let i = 0; i < data.form.grid_length; i++) {
|
||||||
|
const a = { 'id': i, 'name': '', device_code: '', img: '', index: i, img2: '1', angle: '0' }
|
||||||
|
this.arr2.push(a)
|
||||||
|
}
|
||||||
|
for (const i of data.detail) {
|
||||||
|
const index = i.index
|
||||||
|
this.arr2.splice(index, 1, i)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err.response.data.message)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
webSocket() {
|
||||||
|
const that = this
|
||||||
|
if (typeof (WebSocket) === 'undefined') {
|
||||||
|
this.$notify({
|
||||||
|
title: '提示',
|
||||||
|
message: '当前浏览器无法接收实时报警信息,请使用谷歌浏览器!',
|
||||||
|
type: 'warning',
|
||||||
|
duration: 0
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
const id = 'device_monitor'
|
||||||
|
// 获取token保存到vuex中的用户信息,此处仅适用于本项目,注意删除或修改
|
||||||
|
// 实例化socket,这里我把用户名传给了后台,使后台能判断要把消息发给哪个用户,其实也可以后台直接获取用户IP来判断并推送
|
||||||
|
// const wsUri = process.env.VUE_APP_WS_API + '/webSocket/' + id
|
||||||
|
const wsUri = window.g.prod.VUE_APP_BASE_API.replace('http', 'ws') + '/webSocket/' + id
|
||||||
|
this.socket = new WebSocket(wsUri)
|
||||||
|
// 监听socket打开
|
||||||
|
this.socket.onopen = function() {
|
||||||
|
console.log('浏览器WebSocket已打开')
|
||||||
|
// that.socket.send('测试客户端发送消息')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听socket消息接收
|
||||||
|
this.socket.onmessage = function(msg) {
|
||||||
|
const list = JSON.parse(msg.data).msg.detail
|
||||||
|
// console.log(list)
|
||||||
|
for (const item of list) {
|
||||||
|
const index = item.index
|
||||||
|
// that.arr2.splice(index, 1, item)
|
||||||
|
if (item.data) {
|
||||||
|
Object.assign(that.arr2[index].data, item.data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听socket错误
|
||||||
|
this.socket.onerror = function() {
|
||||||
|
that.$notify({
|
||||||
|
title: '错误',
|
||||||
|
message: '服务器错误,无法接收实时报警信息',
|
||||||
|
type: 'error',
|
||||||
|
duration: 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 监听socket关闭
|
||||||
|
this.socket.onclose = function() {
|
||||||
|
console.log('WebSocket已关闭')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.normal {
|
||||||
|
background: #4a659c !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error {
|
||||||
|
background: #95341c !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<style>
|
||||||
|
|
||||||
|
.monitor-wrap .el-popover {
|
||||||
|
margin-left: 35px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ import del from '@/assets/acs/del_new.png'
|
|||||||
import crud from '@/mixins/crud'
|
import crud from '@/mixins/crud'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'StageEditor',
|
name: 'StageEditorNew',
|
||||||
// 注册draggable组件
|
// 注册draggable组件
|
||||||
components: {
|
components: {
|
||||||
draggable
|
draggable
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ import deviceCrud from '@/api/acs/device/device'
|
|||||||
import { getDeviceByCodes } from '@/api/acs/device/deviceStageMonitor'
|
import { getDeviceByCodes } from '@/api/acs/device/deviceStageMonitor'
|
||||||
import '@logicflow/core/dist/style/index.css'
|
import '@logicflow/core/dist/style/index.css'
|
||||||
import '@logicflow/extension/lib/style/index.css'
|
import '@logicflow/extension/lib/style/index.css'
|
||||||
import {isEqual} from "lodash"
|
import { isEqual } from 'lodash'
|
||||||
import { LogicFlow } from '@logicflow/core'
|
import { LogicFlow } from '@logicflow/core'
|
||||||
import { registerCustomElement } from '@/views/system/logicflow/editor/components/node'
|
import { registerCustomElement } from '@/views/system/logicflow/editor/components/node'
|
||||||
|
|
||||||
@@ -726,58 +726,58 @@ export default {
|
|||||||
} else if (val === 'barcodeArr') {
|
} else if (val === 'barcodeArr') {
|
||||||
const obj = { name: '码垛条码', value: data[val] }
|
const obj = { name: '码垛条码', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='robotCode'){
|
} else if (val === 'robotCode') {
|
||||||
const obj = { name: '编码', value: data[val] }
|
const obj = { name: '编码', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='robotTypeCode'){
|
} else if (val === 'robotTypeCode') {
|
||||||
const obj = { name: '型号', value: data[val] }
|
const obj = { name: '型号', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='pointCode'){
|
} else if (val === 'pointCode') {
|
||||||
const obj = { name: '节点编码', value: data[val] }
|
const obj = { name: '节点编码', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='positionX'){
|
} else if (val === 'positionX') {
|
||||||
const obj = { name: '坐标x', value: data[val] }
|
const obj = { name: '坐标x', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='positionY'){
|
} else if (val === 'positionY') {
|
||||||
const obj = { name: '坐标y', value: data[val] }
|
const obj = { name: '坐标y', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='theta'){
|
} else if (val === 'theta') {
|
||||||
const obj = { name: '⻆度', value: data[val] }
|
const obj = { name: '⻆度', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='forkHeight'){
|
} else if (val === 'forkHeight') {
|
||||||
const obj = { name: '货叉⾼度', value: data[val] }
|
const obj = { name: '货叉⾼度', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='forkLength'){
|
} else if (val === 'forkLength') {
|
||||||
const obj = { name: '货叉⻓度', value: data[val] }
|
const obj = { name: '货叉⻓度', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='forkTheta'){
|
} else if (val === 'forkTheta') {
|
||||||
const obj = { name: '货叉相对机器⼈⻆度', value: data[val] }
|
const obj = { name: '货叉相对机器⼈⻆度', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='stationCode'){
|
} else if (val === 'stationCode') {
|
||||||
const obj = { name: '⼯作站编码', value: data[val] }
|
const obj = { name: '⼯作站编码', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='locationCode'){
|
} else if (val === 'locationCode') {
|
||||||
const obj = { name: '⼯作位编码', value: data[val] }
|
const obj = { name: '⼯作位编码', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='state'){
|
} else if (val === 'state') {
|
||||||
const obj = { name: '机器⼈状态', value: data[val] }
|
const obj = { name: '机器⼈状态', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='hardwareState'){
|
} else if (val === 'hardwareState') {
|
||||||
const obj = { name: '机器⼈硬件状态', value: data[val] }
|
const obj = { name: '机器⼈硬件状态', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='trays'){
|
} else if (val === 'trays') {
|
||||||
const obj = { name: '背篓描述', value: data[val] }
|
const obj = { name: '背篓描述', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='trayLevel'){
|
} else if (val === 'trayLevel') {
|
||||||
const obj = { name: '背篓序号', value: data[val] }
|
const obj = { name: '背篓序号', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='containerCode'){
|
} else if (val === 'containerCode') {
|
||||||
const obj = { name: '容器编码', value: data[val] }
|
const obj = { name: '容器编码', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='taskCodes'){
|
} else if (val === 'taskCodes') {
|
||||||
const obj = { name: '业务任务', value: data[val] }
|
const obj = { name: '业务任务', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}else if (val==='positionCode'){
|
} else if (val === 'positionCode') {
|
||||||
const obj = { name: '位置编码', value: data[val] }
|
const obj = { name: '位置编码', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
}
|
}
|
||||||
@@ -789,17 +789,17 @@ export default {
|
|||||||
let resion = {}
|
let resion = {}
|
||||||
resion = lf.getGraphData().nodes.map(item => ({ id: item.id, device_code: item.properties.device }))
|
resion = lf.getGraphData().nodes.map(item => ({ id: item.id, device_code: item.properties.device }))
|
||||||
getDeviceByCodes(resion).then(res => {
|
getDeviceByCodes(resion).then(res => {
|
||||||
let startTime=new Date().getTime();
|
const startTime = new Date().getTime()
|
||||||
let arr=[];
|
const arr = []
|
||||||
let obj={};
|
const obj = {}
|
||||||
if(window.lastArr){
|
if (window.lastArr) {
|
||||||
res.forEach(i=>{
|
res.forEach(i => {
|
||||||
obj[i.id]=i
|
obj[i.id] = i
|
||||||
})
|
})
|
||||||
|
|
||||||
window.lastArr.forEach(old=>{
|
window.lastArr.forEach(old => {
|
||||||
let _new=obj[old.id];
|
const _new = obj[old.id]
|
||||||
if(!isEqual(old,_new)){
|
if (!isEqual(old, _new)) {
|
||||||
arr.push(_new)
|
arr.push(_new)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -809,8 +809,7 @@ export default {
|
|||||||
// console.log('initStatus-res', res)
|
// console.log('initStatus-res', res)
|
||||||
// 实时设置状态信息
|
// 实时设置状态信息
|
||||||
for (var item of arr) { // 循环并且设置属性值
|
for (var item of arr) { // 循环并且设置属性值
|
||||||
|
const temp = {}
|
||||||
let temp={}
|
|
||||||
if (item.data !== undefined) {
|
if (item.data !== undefined) {
|
||||||
if (item.data.isOnline !== undefined) {
|
if (item.data.isOnline !== undefined) {
|
||||||
temp.isOnline = item.data.isOnline
|
temp.isOnline = item.data.isOnline
|
||||||
@@ -830,7 +829,7 @@ export default {
|
|||||||
// isError: item.data.isError
|
// isError: item.data.isError
|
||||||
// })
|
// })
|
||||||
}
|
}
|
||||||
lf.setProperties(item.id , temp)
|
lf.setProperties(item.id, temp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
window.lastArr = res
|
window.lastArr = res
|
||||||
@@ -840,9 +839,9 @@ export default {
|
|||||||
if (nodes.length === 1) { // 因为是定时器,没有选中则不用实时更新显示数据
|
if (nodes.length === 1) { // 因为是定时器,没有选中则不用实时更新显示数据
|
||||||
this.moveShow(nodes[0]) // 监控模式下不可能托选,因此就只有一个数据
|
this.moveShow(nodes[0]) // 监控模式下不可能托选,因此就只有一个数据
|
||||||
}
|
}
|
||||||
let endTime=new Date().getTime();
|
const endTime = new Date().getTime()
|
||||||
|
|
||||||
console.log("time:",endTime - startTime)
|
console.log('time:', endTime - startTime)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
dialogSave() {
|
dialogSave() {
|
||||||
|
|||||||
Reference in New Issue
Block a user