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

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -9,7 +9,7 @@
/>
</el-select>
<el-row>
<div id="container" className="container" style="min-height: 100%" />
<div id="container" className="container" style="min-height: 100%"/>
</el-row>
<!--点击设备显示信息-->
<el-dialog
@@ -41,10 +41,10 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="120px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.bar_code')" label-width="120px">
<el-input v-model="form.hand_barcode" :disabled="false" />
<el-input v-model="form.hand_barcode" :disabled="false"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.request_flag')" prop="requireSucess" label-width="120px">
<el-radio-group v-model="form.requireSucess">
@@ -62,7 +62,7 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible3" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="80px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.device_status')" label-width="80px">
<el-radio-group v-model="form.hasGoodStatus">
@@ -72,7 +72,7 @@
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('monitor.click.material_code')" prop="material_type" label-width="80px">
<el-input v-model="form.material_type" />
<el-input v-model="form.material_type"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -85,7 +85,7 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible4" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="120px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.disabled_manipulator')" prop="is_disable" label-width="120px">
<el-radio-group v-model="form.is_disable">
@@ -109,7 +109,7 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible5" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="120px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.request_flag')" prop="requireSucess" label-width="120px">
<el-radio-group v-model="form.requireSucess">
@@ -127,10 +127,10 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible7" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="120px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.bar_code')" label-width="120px">
<el-input v-model="form.hand_barcode" :disabled="false" />
<el-input v-model="form.hand_barcode" :disabled="false"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.request_flag')" prop="requireSucess" label-width="120px">
<el-radio-group v-model="form.requireSucess">
@@ -148,7 +148,7 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible6" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="120px">
<el-input v-model="form.device_code" :disabled="true" />
<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">
@@ -173,11 +173,11 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible1" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="80px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.bar_code')" prop="device_code" label-width="80px">
<el-input v-model="form.barcode" :disabled="false" />
<el-input v-model="form.barcode" :disabled="false"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -190,7 +190,7 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible8" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="120px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.job_command')" prop="toCommand" label-width="120px">
<el-radio-group v-model="form.toCommand">
@@ -200,13 +200,13 @@
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('monitor.click.keep_out_of_storage')" prop="prohibitInWarehouse" label-width="120px">
<el-switch v-model="form.prohibitInWarehouse" />
<el-switch v-model="form.prohibitInWarehouse"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.no_release')" prop="prohibitOutWarehouse" label-width="120px">
<el-switch v-model="form.prohibitOutWarehouse" />
<el-switch v-model="form.prohibitOutWarehouse"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.stop_task')" prop="stopReceiveTask" label-width="120px">
<el-switch v-model="form.stopReceiveTask" />
<el-switch v-model="form.stopReceiveTask"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.requireSucess')" prop="applySucess" label-width="120px">
<el-radio-group v-model="form.requireSucess">
@@ -223,13 +223,13 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible10" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="120px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.bar_code')" label-width="120px">
<el-input v-model="form.hand_barcode" :disabled="false" />
<el-input v-model="form.hand_barcode" :disabled="false"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.material_code')" label-width="120px">
<el-input v-model="form.hand_material_barcode" :disabled="false" />
<el-input v-model="form.hand_material_barcode" :disabled="false"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.request_flag')" prop="requireSucess" label-width="120px">
<el-radio-group v-model="form.requireSucess">
@@ -250,13 +250,13 @@
import crudStage from '@/api/logicflow/stage'
import bgMonitor from '@/assets/images/bg_monitor.jpg'
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/extension/lib/style/index.css'
import { LogicFlow } from '@logicflow/core'
import { registerCustomElement } from '@/views/system/logicflow/editor/components/node'
import {LogicFlow} from '@logicflow/core'
import {registerCustomElement} from '@/views/system/logicflow/editor/components/node'
import i18n from '@/i18n'
import { selectStageList } from '@/api/acs/stage/stage'
import {selectStageList} from '@/api/acs/stage/stage'
let data = {}
let lf = ''
@@ -302,13 +302,13 @@ export default {
},
allDeviceMsg: [],
msgTop: '200px',
msgLeft: '200px'
msgLeft: '200px',
language: 'zh'
}
},
created() {
selectStageList().then(data => {
this.Stages = data
})
this.getStages()
this.language = localStorage.getItem('lang')
},
mounted() {
this.init()
@@ -351,10 +351,10 @@ export default {
})
lf.setTheme(
{
baseEdge: { strokeWidth: 1 },
baseNode: { strokeWidth: 1 },
nodeText: { overflowMode: 'autoWrap', lineHeight: 1.5 },
edgeText: { overflowMode: 'autoWrap', lineHeight: 1.5 }
baseEdge: {strokeWidth: 1},
baseNode: {strokeWidth: 1},
nodeText: {overflowMode: 'autoWrap', lineHeight: 1.5},
edgeText: {overflowMode: 'autoWrap', lineHeight: 1.5}
}
)
// 注册自定义元素
@@ -387,6 +387,34 @@ export default {
lf.render(data)
this.initStageData()
},
getStages() {
selectStageList().then(data => {
for (let i = 0; i < data.length; i++) {
if (this.language === 'en') {
const tempObject = {
'stage_name': data[i].en_stage_name,
'stage_code': data[i].stage_code
}
this.Stages.push(tempObject)
}
if (this.language === 'zh') {
const tempObject = {
'stage_name': data[i].zh_stage_name,
'stage_code': data[i].stage_code
}
this.Stages.push(tempObject)
}
if (this.language === 'in') {
const tempObject = {
'stage_name': data[i].in_stage_name,
'stage_code': data[i].stage_code
}
this.Stages.push(tempObject)
}
}
console.log(this.Stages)
})
},
changeStage(var1) {
// 获取舞台数据
this.stage_code = var1
@@ -476,9 +504,21 @@ export default {
this.arr = [] // 清空
if (item.device_code && item.data) {
console.log('item', item)
let tempDeviceName = ''
if (this.language === 'zh') {
tempDeviceName = item.data.zh_device_name
}
if (this.language === 'en') {
tempDeviceName = item.data.en_device_name
}
if (this.language === 'in') {
tempDeviceName = item.data.in_device_name
}
this.arr = [
{ name: i18n.t('monitor.click.equipment_number'), value: item.device_code },
{ name: i18n.t('monitor.click.device_name'), value: item.device_name }
{name: i18n.t('monitor.click.equipment_number'), value: item.device_code},
// { name: tempDeviceName, value: item.device_name }
{name: i18n.t('monitor.click.device_name'), value: tempDeviceName}
// { name: i18n.t('monitor.click.device_name'), value: item.device_name }
]
const data = item.data
for (const val in data) {
@@ -486,215 +526,215 @@ export default {
continue
}
if (val === 'message' && data.isError === true) {
const obj = { name: i18n.t('monitor.click.device_information'), value: data[val] }
const obj = {name: i18n.t('monitor.click.device_information'), value: data[val]}
this.arr.push(obj)
}
if (val === 'message' && data.isError === 'false') {
const obj = { name: i18n.t('monitor.click.exception_message'), value: data[val] }
const obj = {name: i18n.t('monitor.click.exception_message'), value: data[val]}
this.arr.push(obj)
}
if (val === 'move') {
const obj = { name: i18n.t('monitor.click.photoelectric_signal'), value: data[val] }
const obj = {name: i18n.t('monitor.click.photoelectric_signal'), value: data[val]}
this.arr.push(obj)
} else if (val === 'mode') {
const obj = { name: i18n.t('monitor.click.mode'), value: data[val] }
const obj = {name: i18n.t('monitor.click.mode'), value: data[val]}
this.arr.push(obj)
} else if (val === 'error') {
const obj = { name: i18n.t('monitor.click.alarm'), value: data[val] }
const obj = {name: i18n.t('monitor.click.alarm'), value: data[val]}
this.arr.push(obj)
} else if (val === 'ip') {
const obj = { name: 'IP', value: data[val] }
const obj = {name: 'IP', value: data[val]}
this.arr.push(obj)
} else if (val === 'number') {
const obj = { name: i18n.t('monitor.click.pallet_quantity'), value: data[val] }
const obj = {name: i18n.t('monitor.click.pallet_quantity'), value: data[val]}
this.arr.push(obj)
} else if (val === 'inst_message') {
const obj = { name: i18n.t('monitor.click.instruction_information'), value: data[val] }
const obj = {name: i18n.t('monitor.click.instruction_information'), value: data[val]}
this.arr.push(obj)
} else if (val === 'message') {
const obj = { name: i18n.t('monitor.click.note_information'), value: data[val] }
const obj = {name: i18n.t('monitor.click.note_information'), value: data[val]}
this.arr.push(obj)
} else if (val === 'inst_message') {
const obj = { name: i18n.t('monitor.click.current_instruction_message'), value: data[val] }
const obj = {name: i18n.t('monitor.click.current_instruction_message'), value: data[val]}
this.arr.push(obj)
} else if (val === 'last_inst_message') {
const obj = { name: i18n.t('monitor.click.last_instruction_message'), value: data[val] }
const obj = {name: i18n.t('monitor.click.last_instruction_message'), value: data[val]}
this.arr.push(obj)
} else if (val === 'container_type') {
const obj = { name: '托盘类型', value: data[val] }
const obj = {name: '托盘类型', value: data[val]}
this.arr.push(obj)
} else if (val === 'barcode') {
const obj = { name: i18n.t('monitor.click.barcode'), value: data[val] }
const obj = {name: i18n.t('monitor.click.barcode'), value: data[val]}
this.arr.push(obj)
} else if (val === 'barcode_length') {
const obj = { name: i18n.t('monitor.click.barcode_length'), value: data[val] }
const obj = {name: i18n.t('monitor.click.barcode_length'), value: data[val]}
this.arr.push(obj)
} else if (val === 'last_container') {
const obj = { name: i18n.t('monitor.click.last_container'), value: data[val] }
const obj = {name: i18n.t('monitor.click.last_container'), value: data[val]}
this.arr.push(obj)
} else if (val === 'instruction_code') {
const obj = { name: i18n.t('monitor.click.current_instruction_message'), value: data[val] }
const obj = {name: i18n.t('monitor.click.current_instruction_message'), value: data[val]}
this.arr.push(obj)
} else if (val === 'task_code') {
const obj = { name: i18n.t('monitor.click.task_number'), value: data[val] }
const obj = {name: i18n.t('monitor.click.task_number'), value: data[val]}
this.arr.push(obj)
} else if (val === 'last_instruction_code') {
const obj = { name: i18n.t('monitor.click.last_instruction_message'), value: data[val] }
const obj = {name: i18n.t('monitor.click.last_instruction_message'), value: data[val]}
this.arr.push(obj)
} else if (val === 'action') {
const obj = { name: i18n.t('monitor.click.action_signal'), value: data[val] }
const obj = {name: i18n.t('monitor.click.action_signal'), value: data[val]}
this.arr.push(obj)
} else if (val === 'io_action') {
const obj = { name: i18n.t('monitor.click.clearance_signal'), value: data[val] }
const obj = {name: i18n.t('monitor.click.clearance_signal'), value: data[val]}
this.arr.push(obj)
} else if (val === 'material') {
const obj = { name: i18n.t('monitor.click.materiel'), value: data[val] }
const obj = {name: i18n.t('monitor.click.materiel'), value: data[val]}
this.arr.push(obj)
} else if (val === 'batch') {
const obj = { name: i18n.t('monitor.click.lot'), value: data[val] }
const obj = {name: i18n.t('monitor.click.lot'), value: data[val]}
this.arr.push(obj)
} else if (val === 'requestSucess') {
const obj = { name: i18n.t('monitor.click.request_task'), value: data[val] }
const obj = {name: i18n.t('monitor.click.request_task'), value: data[val]}
this.arr.push(obj)
} else if (val === 'applySucess') {
const obj = { name: i18n.t('monitor.click.request_order'), value: data[val] }
const obj = {name: i18n.t('monitor.click.request_order'), value: data[val]}
this.arr.push(obj)
} else if (val === 'requireApplyLabelingSuccess') {
const obj = { name: i18n.t('monitor.click.apply_labeling'), value: data[val] }
const obj = {name: i18n.t('monitor.click.apply_labeling'), value: data[val]}
this.arr.push(obj)
} else if (val === 'requireApplyLaStrangulationSuccess') {
const obj = { name: i18n.t('monitor.click.apply_for_bundling'), value: data[val] }
const obj = {name: i18n.t('monitor.click.apply_for_bundling'), value: data[val]}
this.arr.push(obj)
} else if (val === 'status') {
const obj = { name: i18n.t('monitor.click.device_status'), value: data[val] }
const obj = {name: i18n.t('monitor.click.device_status'), value: data[val]}
this.arr.push(obj)
} else if (val === 'weight') {
const obj = { name: i18n.t('monitor.click.weight'), value: data[val] }
const obj = {name: i18n.t('monitor.click.weight'), value: data[val]}
this.arr.push(obj)
} else if (val === 'move_1') {
const obj = { name: i18n.t('monitor.click.front_station_photoelectric_signal'), value: data[val] }
const obj = {name: i18n.t('monitor.click.front_station_photoelectric_signal'), value: data[val]}
this.arr.push(obj)
} else if (val === 'open') {
const obj = { name: i18n.t('monitor.click.open'), value: data[val] }
const obj = {name: i18n.t('monitor.click.open'), value: data[val]}
this.arr.push(obj)
} else if (val === 'close') {
const obj = { name: i18n.t('monitor.click.close'), value: data[val] }
const obj = {name: i18n.t('monitor.click.close'), value: data[val]}
this.arr.push(obj)
} else if (val === 'phase') {
const obj = { name: i18n.t('monitor.click.AGV_phase'), value: data[val] }
const obj = {name: i18n.t('monitor.click.AGV_phase'), value: data[val]}
this.arr.push(obj)
} else if (val === 'phase_name') {
const obj = { name: i18n.t('monitor.click.description_of_the_AGV_phase'), value: data[val] }
const obj = {name: i18n.t('monitor.click.description_of_the_AGV_phase'), value: data[val]}
this.arr.push(obj)
} else if (val === 'option') {
const obj = { name: i18n.t('monitor.click.AGV_action'), value: data[val] }
const obj = {name: i18n.t('monitor.click.AGV_action'), value: data[val]}
this.arr.push(obj)
} else if (val === 'agv_power') {
const obj = { name: i18n.t('monitor.click.AGV_power'), value: data[val] }
const obj = {name: i18n.t('monitor.click.AGV_power'), value: data[val]}
this.arr.push(obj)
} else if (val === 'move_2') {
const obj = { name: i18n.t('monitor.click.station_photoelectric_signal'), value: data[val] }
const obj = {name: i18n.t('monitor.click.station_photoelectric_signal'), value: data[val]}
this.arr.push(obj)
} else if (val === 'action_1') {
const obj = { name: i18n.t('monitor.click.front_station_action_signal'), value: data[val] }
const obj = {name: i18n.t('monitor.click.front_station_action_signal'), value: data[val]}
this.arr.push(obj)
} else if (val === 'action_2') {
const obj = { name: i18n.t('monitor.click.back_station_action_signal'), value: data[val] }
const obj = {name: i18n.t('monitor.click.back_station_action_signal'), value: data[val]}
this.arr.push(obj)
} else if (val === 'walk_y') {
const obj = { name: i18n.t('monitor.click.walk_y'), value: data[val] }
const obj = {name: i18n.t('monitor.click.walk_y'), value: data[val]}
this.arr.push(obj)
} else if (val === 'task1') {
const obj = { name: i18n.t('monitor.click.previous_station_task'), value: data[val] }
const obj = {name: i18n.t('monitor.click.previous_station_task'), value: data[val]}
this.arr.push(obj)
} else if (val === 'task2') {
const obj = { name: i18n.t('monitor.click.back_station_task'), value: data[val] }
const obj = {name: i18n.t('monitor.click.back_station_task'), value: data[val]}
this.arr.push(obj)
} else if (val === 'task') {
const obj = { name: i18n.t('monitor.click.task_number'), value: data[val] }
const obj = {name: i18n.t('monitor.click.task_number'), value: data[val]}
this.arr.push(obj)
} else if (val === 'is_disable') {
const obj = { name: i18n.t('monitor.click.disable'), value: data[val] }
const obj = {name: i18n.t('monitor.click.disable'), value: data[val]}
this.arr.push(obj)
} else if (val === 'temperature') {
const obj = { name: i18n.t('monitor.click.current_temperature'), value: data[val] }
const obj = {name: i18n.t('monitor.click.current_temperature'), value: data[val]}
this.arr.push(obj)
} else if (val === 'finish') {
const obj = { name: i18n.t('monitor.click.oven_finish'), value: data[val] }
const obj = {name: i18n.t('monitor.click.oven_finish'), value: data[val]}
this.arr.push(obj)
} else if (val === 'countdown_house') {
const obj = { name: i18n.t('monitor.click.house'), value: data[val] }
const obj = {name: i18n.t('monitor.click.house'), value: data[val]}
this.arr.push(obj)
} else if (val === 'countdown_min') {
const obj = { name: i18n.t('monitor.click.minutes'), value: data[val] }
const obj = {name: i18n.t('monitor.click.minutes'), value: data[val]}
this.arr.push(obj)
} else if (val === 'countdown_sec') {
const obj = { name: i18n.t('monitor.click.seconds'), value: data[val] }
const obj = {name: i18n.t('monitor.click.seconds'), value: data[val]}
this.arr.push(obj)
} else if (val === 'door') {
const obj = { name: i18n.t('monitor.click.gate_state'), value: data[val] }
const obj = {name: i18n.t('monitor.click.gate_state'), value: data[val]}
this.arr.push(obj)
} else if (val === 'notCreateTaskMessage') {
const obj = { name: i18n.t('monitor.click.task_creation_failure'), value: data[val] }
const obj = {name: i18n.t('monitor.click.task_creation_failure'), value: data[val]}
this.arr.push(obj)
} else if (val === 'notCreateInstMessage') {
const obj = { name: i18n.t('monitor.click.failed_to_create_instruction'), value: data[val] }
const obj = {name: i18n.t('monitor.click.failed_to_create_instruction'), value: data[val]}
this.arr.push(obj)
} else if (val === 'feedMessage') {
const obj = { name: i18n.t('monitor.click.no_electrical_signal_feedback_cause'), value: data[val] }
const obj = {name: i18n.t('monitor.click.no_electrical_signal_feedback_cause'), value: data[val]}
this.arr.push(obj)
} else if (val === 'requireSucess') {
const obj = { name: i18n.t('monitor.click.request_success_flag'), value: data[val] }
const obj = {name: i18n.t('monitor.click.request_success_flag'), value: data[val]}
this.arr.push(obj)
} else if (val === 'applySucess') {
const obj = { name: 'applySucess', value: data[val] }
const obj = {name: 'applySucess', value: data[val]}
this.arr.push(obj)
} else if (val === 'out_finish') {
const obj = { name: i18n.t('monitor.click.delivery_completed'), value: data[val] }
const obj = {name: i18n.t('monitor.click.delivery_completed'), value: data[val]}
this.arr.push(obj)
} else if (val === 'inventory_qty') {
const obj = { name: i18n.t('monitor.click.inventory_quantity'), value: data[val] }
const obj = {name: i18n.t('monitor.click.inventory_quantity'), value: data[val]}
this.arr.push(obj)
} else if (val === 'hand_barcode') {
const obj = { name: 'hand_barcode', value: data[val] }
const obj = {name: 'hand_barcode', value: data[val]}
this.arr.push(obj)
} else if (val === 'x') {
const obj = { name: 'X', value: data[val] }
const obj = {name: 'X', value: data[val]}
this.arr.push(obj)
} else if (val === 'y') {
const obj = { name: 'Y', value: data[val] }
const obj = {name: 'Y', value: data[val]}
this.arr.push(obj)
} else if (val === 'angle') {
const obj = { name: i18n.t('monitor.click.angle'), value: data[val] }
const obj = {name: i18n.t('monitor.click.angle'), value: data[val]}
this.arr.push(obj)
} else if (val === 'electricity') {
const obj = { name: i18n.t('monitor.click.electric_quantity'), value: data[val] }
const obj = {name: i18n.t('monitor.click.electric_quantity'), value: data[val]}
this.arr.push(obj)
} else if (val === 'status_name') {
const obj = { name: i18n.t('monitor.click.status'), value: data[val] }
const obj = {name: i18n.t('monitor.click.status'), value: data[val]}
this.arr.push(obj)
} else if (val === 'fault') {
const obj = { name: i18n.t('monitor.click.abnormal'), value: data[val] }
const obj = {name: i18n.t('monitor.click.abnormal'), value: data[val]}
this.arr.push(obj)
} else if (val === 'map_id') {
const obj = { name: i18n.t('monitor.click.floor'), value: data[val] }
const obj = {name: i18n.t('monitor.click.floor'), value: data[val]}
this.arr.push(obj)
} else if (val === 'power') {
const obj = { name: i18n.t('monitor.click.electric_quantity'), value: data[val] }
const obj = {name: i18n.t('monitor.click.electric_quantity'), value: data[val]}
this.arr.push(obj)
} else if (val === 'pallet') {
const obj = { name: i18n.t('monitor.click.tray'), value: data[val] }
const obj = {name: i18n.t('monitor.click.tray'), value: data[val]}
this.arr.push(obj)
} else if (val === 'load') {
const obj = { name: i18n.t('monitor.click.loading_or_not'), value: data[val] }
const obj = {name: i18n.t('monitor.click.loading_or_not'), value: data[val]}
this.arr.push(obj)
} else if (val === 'alarm') {
const obj = { name: i18n.t('monitor.click.alarm'), value: data[val] }
const obj = {name: i18n.t('monitor.click.alarm'), value: data[val]}
this.arr.push(obj)
} else if (val === 'task_id') {
const obj = { name: i18n.t('monitor.click.task_number'), value: data[val] }
const obj = {name: i18n.t('monitor.click.task_number'), value: data[val]}
this.arr.push(obj)
}
}
@@ -703,7 +743,7 @@ export default {
},
initStatus() { // 初始化所有节点的设备信息通过节点id对应设备编号
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 => {
console.log(res)
this.allDeviceMsg = res // 拿到所有节点的设备数据
@@ -729,7 +769,7 @@ export default {
}
}
// 设置动态实时显示设备信息
const { nodes } = lf.getSelectElements() // 获取选中的节点
const {nodes} = lf.getSelectElements() // 获取选中的节点
// console.log(nodes)
if (nodes.length === 1) { // 因为是定时器,没有选中则不用实时更新显示数据
this.moveShow(nodes[0]) // 监控模式下不可能托选,因此就只有一个数据
@@ -738,7 +778,7 @@ export default {
},
dialogSave() {
deviceCrud.changeDeviceStatus(this.form).then(res => {
this.$notify({ title: '操作成功', message: '', type: 'success' })
this.$notify({title: '操作成功', message: '', type: 'success'})
this.dialogFormVisible = false
this.dialogFormVisible3 = false
this.dialogFormVisible4 = false
@@ -809,7 +849,7 @@ body {
background-color: transparent;
background-color: rgba(2, 11, 47, 0.9);
border: 1px solid #4dbeff;
box-shadow: inset 4px 4px 8px 0px rgba(77,190,255,.9),inset -4px -4px 8px 0px rgba(77,190,255,.9);
box-shadow: inset 4px 4px 8px 0px rgba(77, 190, 255, .9), inset -4px -4px 8px 0px rgba(77, 190, 255, .9);
/* background-image: url('../../../../assets/images/kanban.svg'); */
background-repeat: no-repeat;
background-size: 100% 100%;
@@ -871,7 +911,7 @@ body {
color: #00b3ee;
}
.newDialog /deep/ .el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell {
.newDialog /deep/ .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
background-color: #00557c;
}