This commit is contained in:
USER-20220102CG\noblelift
2023-02-16 18:15:40 +08:00
parent 018a3e251a
commit f78fd03e4a
11 changed files with 178 additions and 75 deletions

View File

@@ -1,17 +1,19 @@
<template>
<!--agv工位-->
<!--agv工位-->
<div>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span">设备协议</span>
<span class="role-span">指令相关</span>
</div>
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
<el-col :span="12">
<el-form-item label="扫码器ip" label-width="150px" prop="x">
<el-input v-model.trim="form.ip_address" />
</el-form-item>
</el-col>
<el-form ref="form" :inline="true" :model="form" size="small" label-width="95px">
<el-row>
<el-col :span="8">
<el-form-item label="ip地址" prop="ip_address">
<el-input
v-model="form.ip_address"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="box-card" shadow="never">
@@ -28,20 +30,19 @@
</el-button>
</div>
</el-card>
</div>
</template>
<script>
import {
queryDriverConfig,
updateConfig
} from '@/api/acs/device/driverConfig'
import crud from '@/mixins/crud'
import deviceCrud from '@/api/acs/device/device'
export default {
name: 'StandardScanner',
name: 'StandardConveyorControl',
mixins: [crud],
props: {
parentForm: {
@@ -52,9 +53,7 @@ export default {
data() {
return {
form: {
scannerIP: ''
},
rules: {
ip_address: ''
}
}
},
@@ -72,19 +71,7 @@ export default {
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
}
}
})
deviceCrud.selectDeviceList().then(data => {
this.deviceList = data
this.sliceItem()
})
})
},
@@ -95,6 +82,7 @@ export default {
this.configLoading = true
// 根据驱动类型判断是否为路由设备
const parentForm = this.parentForm
parentForm.is_route = true
updateConfig(parentForm, this.form, this.data1, this.data2).then(res => {
this.notify('保存成功', 'success')
this.configLoading = false