rev:修改
This commit is contained in:
@@ -13,6 +13,7 @@ import org.nl.acs.device.device.service.DeviceService;
|
||||
import org.nl.acs.device.device.service.entity.Device;
|
||||
import org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.AbstractStandardDeviceDriver;
|
||||
import org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.standardOrdinarySite.StandardOrdinarySiteDeviceDriver;
|
||||
import org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.standardStorage.StandardStorageDeviceDriver;
|
||||
import org.nl.acs.log.LokiLog;
|
||||
import org.nl.acs.log.LokiLogType;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -140,11 +141,31 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver {
|
||||
// 二次分配处理
|
||||
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
// 判断是否需要二次分配
|
||||
if ("".equals(inst.getStart_device_code())) {
|
||||
if ("A".equals(inst.getStart_device_code())) {
|
||||
// 向WMS申请新点位
|
||||
JSONObject response = acsToWmsService.taskRedirection(task.getTask_code(), inst.getStart_device_code());
|
||||
if (response != null && response.getInteger("responseCode") == 0
|
||||
&& ObjectUtil.isNotEmpty(response.getString("locationNew"))) {
|
||||
// 更新任务/指令起点位置
|
||||
old_device_code = response.getString("locationNew");
|
||||
if (StrUtil.contains(old_device_code, "-")) {
|
||||
String[] point = old_device_code.split("-");
|
||||
device_code = point[0];
|
||||
} else if (StrUtil.contains(old_device_code, ".")) {
|
||||
String[] point = old_device_code.split("\\.");
|
||||
device_code = point[0];
|
||||
emptyNum = point[1];
|
||||
} else {
|
||||
device_code = old_device_code;
|
||||
}
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
task.setStart_device_code(device.getDevice_code());
|
||||
task.setStart_point_code(response.getString("locationNew"));
|
||||
taskserver.update(task);
|
||||
inst.setStart_device_code(device.getDevice_code());
|
||||
inst.setStart_point_code(response.getString("locationNew"));
|
||||
instructionService.update(inst);
|
||||
|
||||
// 返回NDC更换新位置
|
||||
data = ndcAgvService.sendAgvOneModeInstDis(phase, index, response.getString("locationNew"));
|
||||
}
|
||||
@@ -188,8 +209,8 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver {
|
||||
}
|
||||
// "========================================================================请求取货================================================================================="
|
||||
agv_status = 1;
|
||||
//到达普通站点
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
//到达普通站点或者货架
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver || device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
boolean canTake = StrUtil.startWith(task.getTask_code(), CommonFinalParam.HYPHEN_)
|
||||
|| acsToWmsService.feedbackTask(inst, WmsFeedbackStatusEnum.APPLY_TAKE.getValue());
|
||||
|
||||
@@ -244,7 +265,7 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver {
|
||||
//反馈车辆动作
|
||||
agv_status = 2;
|
||||
//到达普通站点取货完成
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver || device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
boolean canTake = StrUtil.startWith(task.getTask_code(), CommonFinalParam.HYPHEN_)
|
||||
|| acsToWmsService.feedbackTask(inst, WmsFeedbackStatusEnum.TAKE_FINISH.getValue());
|
||||
|
||||
@@ -259,11 +280,30 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver {
|
||||
// 二次分配处理
|
||||
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
// 判断是否需要二次分配
|
||||
if ("".equals(inst.getStart_device_code())) {
|
||||
if ("A".equals(inst.getNext_device_code())) {
|
||||
// 向WMS申请新点位
|
||||
JSONObject response = acsToWmsService.taskRedirection(task.getTask_code(), inst.getStart_device_code());
|
||||
JSONObject response = acsToWmsService.taskRedirection(task.getTask_code(), inst.getNext_device_code());
|
||||
if (response != null && response.getInteger("responseCode") == 0
|
||||
&& ObjectUtil.isNotEmpty(response.getString("locationNew"))) {
|
||||
// 更新任务/指令起点位置
|
||||
old_device_code = response.getString("locationNew");
|
||||
if (StrUtil.contains(old_device_code, "-")) {
|
||||
String[] point = old_device_code.split("-");
|
||||
device_code = point[0];
|
||||
} else if (StrUtil.contains(old_device_code, ".")) {
|
||||
String[] point = old_device_code.split("\\.");
|
||||
device_code = point[0];
|
||||
emptyNum = point[1];
|
||||
} else {
|
||||
device_code = old_device_code;
|
||||
}
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
task.setNext_device_code(device.getDevice_code());
|
||||
task.setNext_point_code(response.getString("locationNew"));
|
||||
taskserver.update(task);
|
||||
inst.setNext_device_code(device.getDevice_code());
|
||||
inst.setNext_point_code(response.getString("locationNew"));
|
||||
instructionService.update(inst);
|
||||
// 返回NDC更换新位置
|
||||
data = ndcAgvService.sendAgvOneModeInstDis(phase, index, response.getString("locationNew"));
|
||||
}
|
||||
@@ -302,8 +342,8 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver {
|
||||
}
|
||||
// "========================================================================请求放货================================================================================="
|
||||
agv_status = 3;
|
||||
//普通站点
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
//到达普通站点或者货架
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver || device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
boolean canTake = StrUtil.startWith(task.getTask_code(), CommonFinalParam.HYPHEN_)
|
||||
|| acsToWmsService.feedbackTask(inst, WmsFeedbackStatusEnum.APPLY_PUT.getValue());
|
||||
|
||||
@@ -353,7 +393,7 @@ public class AgvNdcOneDeviceDriver extends AbstractStandardDeviceDriver {
|
||||
// "========================================================================放货完成================================================================================="
|
||||
agv_status = 4;
|
||||
//agv普通站点放货完成
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver || device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
boolean canTake = StrUtil.startWith(task.getTask_code(), CommonFinalParam.HYPHEN_)
|
||||
|| acsToWmsService.feedbackTask(inst, WmsFeedbackStatusEnum.PUT_FINISH.getValue());
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.standardStorage;
|
||||
|
||||
import org.nl.acs.device.device.service.entity.Device;
|
||||
import org.nl.acs.device.device.service.enums.DeviceType;
|
||||
import org.nl.acs.device.deviceDriver.service.defination.DeviceDriverDefination;
|
||||
import org.nl.acs.device.deviceDriver.service.driver.DeviceDriver;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 货架
|
||||
*/
|
||||
@Service
|
||||
public class StandardStorageDefination implements DeviceDriverDefination {
|
||||
@Override
|
||||
public String getDriverCode() {
|
||||
return "standard_storage";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverName() {
|
||||
return "标准版-货架";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverDescription() {
|
||||
return "标准版-货架";
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceDriver getDriverInstance(Device device) {
|
||||
return (new StandardStorageDeviceDriver()).init(device, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends DeviceDriver> getDeviceDriverType() {
|
||||
return StandardStorageDeviceDriver.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.storage);
|
||||
return types;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.standardStorage;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device.deviceDriver.service.defination.ordinaryDefination.AbstractStandardDeviceDriver;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 标准版货架
|
||||
*/
|
||||
@Slf4j
|
||||
@Data
|
||||
public class StandardStorageDeviceDriver extends AbstractStandardDeviceDriver {
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject getDeviceStatusName() throws Exception {
|
||||
JSONObject jo = new JSONObject();
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDeviceStatus(JSONObject data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws Exception {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +101,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
private TaskService taskService;
|
||||
@Autowired
|
||||
private AcsToKitService acsToKitService;
|
||||
@Autowired
|
||||
private NDCAgvService ndcAgvService;
|
||||
|
||||
@Autowired
|
||||
private LuceneExecuteLogService luceneExecuteLogService;
|
||||
@@ -1052,6 +1054,9 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
if (ObjectUtil.isNotEmpty(entity.getAgv_system_type()) && entity.getAgv_system_type().equals(CommonFinalParam.TWO)) {
|
||||
// NDC agv指令不当场取消指令,需要等agv上报
|
||||
if ("1".equals(entity.getSend_status())) {
|
||||
// 告知NDC取消任务
|
||||
Instruction instruction = JSONObject.parseObject(JSONObject.toJSONString(entity), Instruction.class);
|
||||
ndcAgvService.deleteAgvInstToNDC(instruction);
|
||||
flag = true;
|
||||
} else {
|
||||
flag = true;
|
||||
|
||||
@@ -32,14 +32,14 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
dto.setStart_device_code(request.getLocationFrom());
|
||||
dto.setNext_point_code(request.getLocationTo());
|
||||
dto.setNext_device_code(request.getLocationTo());
|
||||
dto.setPriority(request.getPriority() == null ? null : String.valueOf(request.getPriority()));
|
||||
dto.setPriority(request.getPriority() == null ? "1" : String.valueOf(request.getPriority()));
|
||||
dto.setQuantity("1");
|
||||
dto.setRoute_plan_code("normal");
|
||||
dto.setCompound_task("0");
|
||||
dto.setCreate_type("WMS");
|
||||
dto.setFinish_type("WMS");
|
||||
// 调度系统类型:默认1
|
||||
dto.setAgv_system_type("1");
|
||||
dto.setAgv_system_type("2");
|
||||
// 当前任务模型没有完整承载 WMS 扩展字段的结构化列,先放入 remark 保留。
|
||||
JSONObject extInfo = new JSONObject();
|
||||
extInfo.put("houseCode", request.getHouseCode());
|
||||
|
||||
@@ -82,12 +82,14 @@ import agv_ndc_two from '@/views/acs/device/driver/agv/agv_ndc_two'
|
||||
import xg_agv from '@/views/acs/device/driver/agv/xg_agv'
|
||||
import xg_agv_car from '@/views/acs/device/driver/agv/xg_agv_car.vue'
|
||||
import standard_manipulator from '@/views/acs/device/driver/one_manipulator/standard_manipulator.vue'
|
||||
import standard_storage from '@/views/acs/device/driver/standard_storage'
|
||||
export default {
|
||||
name: 'DeviceConfig',
|
||||
components: {
|
||||
standard_autodoor,
|
||||
standard_ordinary_site,
|
||||
standard_inspect_site,
|
||||
standard_storage,
|
||||
agv_ndc_two,
|
||||
agv_ndc_one,
|
||||
xg_agv,
|
||||
|
||||
315
acs2/nladmin-ui/src/views/acs/device/driver/standard_storage.vue
Normal file
315
acs2/nladmin-ui/src/views/acs/device/driver/standard_storage.vue
Normal file
@@ -0,0 +1,315 @@
|
||||
<template>
|
||||
<!-- 标准版-货架-->
|
||||
<div>
|
||||
<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="是否请求wms" label-width="150px">
|
||||
<el-switch v-model="form.reqWms" />
|
||||
</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="12">
|
||||
<el-form-item label="排:" label-width="150px" prop="x">
|
||||
<el-input v-model.number="form.x" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="巷道:" label-width="150px" prop="tunnel">
|
||||
<el-input v-model.number="form.tunnel" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="最大列:" label-width="150px" prop="maxY">
|
||||
<el-input v-model.number="form.maxY" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="最小列:" label-width="150px" prop="minY">
|
||||
<el-input v-model.number="form.minY" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="最大层:" label-width="150px" prop="maxZ">
|
||||
<el-input v-model.number="form.maxZ" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="最小层:" label-width="150px" prop="minZ">
|
||||
<el-input v-model.number="form.minZ" />
|
||||
</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" />
|
||||
<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: 'StandardStorage',
|
||||
mixins: [crud],
|
||||
props: {
|
||||
parentForm: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const checkMaxY = (rule, value, callback) => {
|
||||
if (value < this.form.minY) {
|
||||
callback(new Error('最大列应大于最小列!'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
const checkMinY = (rule, value, callback) => {
|
||||
if (value > this.form.maxY) {
|
||||
callback(new Error('最小列应小于最大列!'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
const checkMaxZ = (rule, value, callback) => {
|
||||
if (value < this.form.minZ) {
|
||||
callback(new Error('最大层应大于最小层!'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
const checkMinZ = (rule, value, callback) => {
|
||||
if (value > this.form.maxZ) {
|
||||
callback(new Error('最小层应小于最大层!'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
return {
|
||||
device_code: '',
|
||||
device_id: '',
|
||||
plc_id: '',
|
||||
plc_code: '',
|
||||
opc_id: '',
|
||||
opc_code: '',
|
||||
configLoading: false,
|
||||
dataOpcservers: [],
|
||||
dataOpcPlcs: [],
|
||||
deviceList: [],
|
||||
data1: [],
|
||||
data2: [],
|
||||
form: {
|
||||
x: 0,
|
||||
tunnel: 0,
|
||||
maxY: 0,
|
||||
maxZ: 0,
|
||||
minY: 0,
|
||||
minZ: 0,
|
||||
reqWms: true
|
||||
},
|
||||
rules: {
|
||||
x: [
|
||||
{ required: true, message: '排不能为空', trigger: 'blur' }
|
||||
],
|
||||
tunnel: [
|
||||
{ required: true, type: 'number', min: 0, message: '请输入大于0的数字', trigger: 'blur' }
|
||||
],
|
||||
maxY: [
|
||||
{ required: true, type: 'number', min: 0, message: '请输入大于0的数字', trigger: 'blur' },
|
||||
{ validator: checkMaxY, trigger: 'blur' }
|
||||
],
|
||||
maxZ: [
|
||||
{ required: true, type: 'number', min: 0, message: '请输入大于0的数字', trigger: 'blur' },
|
||||
{ validator: checkMaxZ, trigger: 'blur' }
|
||||
],
|
||||
minY: [
|
||||
{ required: true, type: 'number', min: 0, message: '请输入大于0的数字', trigger: 'blur' },
|
||||
{ validator: checkMinY, trigger: 'blur' }
|
||||
],
|
||||
minZ: [
|
||||
{ required: true, type: 'number', min: 0, message: '请输入大于0的数字', trigger: 'blur' },
|
||||
{ validator: checkMinZ, trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
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) {
|
||||
data.form.x = parseInt(data.form.x)
|
||||
data.form.tunnel = parseInt(data.form.tunnel)
|
||||
data.form.minY = parseInt(data.form.minY)
|
||||
data.form.maxY = parseInt(data.form.maxY)
|
||||
data.form.minZ = parseInt(data.form.minZ)
|
||||
data.form.maxZ = parseInt(data.form.maxZ)
|
||||
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: {
|
||||
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_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>
|
||||
@@ -186,7 +186,8 @@
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="device_id" :label="$t('device.device_table_title.device_identification')" />
|
||||
<el-table-column sortable prop="device_code" :label="$t('device.device_table_title.device_encoding')" :min-width="flexWidth('device_code',crud.data,$t('device.device_table_title.device_encoding'))" />
|
||||
<el-table-column sortable :label="$t('device.device_table_title.device_name')" :prop="$langPre.computedProp('device_name')" :min-width="flexWidth($langPre.computedProp('device_name'),crud.data,$t('device.device_table_title.device_name'))" />
|
||||
<el-table-column sortable prop="device_name" :label="$t('device.device_table_title.device_name')" :min-width="flexWidth('device_name',crud.data,$t('device.device_table_title.device_name'))" />
|
||||
<!-- <el-table-column sortable :label="$t('device.device_table_title.device_name')" :prop="$langPre.computedProp('device_name')" :min-width="flexWidth($langPre.computedProp('device_name'),crud.data,$t('device.device_table_title.device_name'))" />-->
|
||||
<el-table-column prop="device_type_name" :label="$t('device.device_table_title.device_type')" :min-width="flexWidth('device_type_name',crud.data,$t('device.device_table_title.device_type'))">
|
||||
<template slot-scope="scope">
|
||||
<div>{{ scope.row.device_type_name }}</div>
|
||||
|
||||
@@ -633,7 +633,7 @@ export default {
|
||||
to_x2: null,
|
||||
to_y2: null,
|
||||
to_z2: null,
|
||||
agv_system_type: '',
|
||||
agv_system_type: '2',
|
||||
interactionJson: null
|
||||
},
|
||||
taskStatus: {
|
||||
|
||||
Reference in New Issue
Block a user