This commit is contained in:
psh
2023-08-17 17:34:13 +08:00
parent fa24f5af33
commit 1ffd43af4e
18 changed files with 535 additions and 130 deletions

View File

@@ -1,2 +1,2 @@
# beiterui
# nladmin

View File

@@ -25,9 +25,9 @@
<hutool.version>5.7.14</hutool.version>
<jjwt.version>0.11.1</jjwt.version>
<lucene.version>8.2.0</lucene.version>
<!-- <lucene.version>7.6.0</lucene.version>-->
<!-- <lucene.version>7.6.0</lucene.version>-->
<!-- oshi监控需要指定jna版本, 问题详见 https://github.com/oshi/oshi/issues/1040 -->
<!-- <jna.version>5.8.0</jna.version>-->
<jna.version>5.9.0</jna.version>
<configuration.version>1.9</configuration.version>
<commons-csv.version>1.8</commons-csv.version>
</properties>
@@ -45,15 +45,6 @@
<type>pom</type>
</dependency>
<!-- 日志链路追踪 https://tlog.yomahub.com/pages/f62a84/#%E5%90%8C%E6%AD%A5%E6%97%A5%E5%BF%97-->
<dependency>
<groupId>com.yomahub</groupId>
<artifactId>tlog-all-spring-boot-starter</artifactId>
<version>1.5.0</version>
</dependency>
<!-- Lucence核心包 -->
<dependency>
<groupId>org.apache.lucene</groupId>
@@ -101,33 +92,9 @@
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>5.3.6</version>
<version>5.0.1</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.6.0</version>
</dependency>
<!-- elasticsearch-->
<!-- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
<version>2.7.5</version>
<exclusions>
<exclusion>
<artifactId>lucene-core</artifactId>
<groupId>org.apache.lucene</groupId>
</exclusion>
</exclusions>
</dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.yomahub</groupId>-->
<!-- <artifactId>liteflow-spring-boot-starter</artifactId>-->
<!-- <version>2.10.3</version>-->
<!-- </dependency>-->
<!-- logback appender日志-->
<dependency>
<groupId>com.internetitem</groupId>
@@ -149,10 +116,7 @@
<version>${hutool.version}</version>
</dependency>
<!--Spring boot 核心 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
@@ -245,6 +209,7 @@
<version>1.5.21</version>
</dependency>
<!--Mysql依赖包-->
<dependency>
<groupId>mysql</groupId>
@@ -438,42 +403,6 @@
<artifactId>commons-io</artifactId>
<version>2.8.0</version>
</dependency>
<!-- Lucence核心包 -->
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-highlighter</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers-common</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>com.github.magese</groupId>
<artifactId>ik-analyzer</artifactId>
<version>${lucene.version}</version>
</dependency>
<!--支持中文分词 -->
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers-smartcn</artifactId>
<version>${lucene.version}</version>
</dependency>
<!-- Lucene查询解析包 -->
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queryparser</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.openscada.jinterop</groupId>
<artifactId>org.openscada.jinterop.core</artifactId>
@@ -495,12 +424,19 @@
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.50</version>
</dependency>
<!--导出CSV相关-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>${commons-csv.version}</version>
</dependency>
</dependencies>
<build>

View File

@@ -2,7 +2,6 @@ package org.nl.acs.instruction.service.dto;
import lombok.Data;
import javax.persistence.Transient;
import java.io.Serializable;
/**
@@ -36,7 +35,6 @@ public class InstructionDto implements Serializable {
/**
* 是否下发
*/
@Transient
private String is_send = "0";
/**
@@ -300,7 +298,6 @@ public class InstructionDto implements Serializable {
/**
* 物料批次
*/
@Transient
private String batch;
/**
@@ -339,13 +336,11 @@ public class InstructionDto implements Serializable {
/**
* 起点父级编码
*/
@Transient
private String start_parent_code;
/**
* 终点父级编码
*/
@Transient
private String next_parent_code;
/**

View File

@@ -3,6 +3,7 @@ package org.nl.system.controller.menu;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
@@ -76,6 +77,9 @@ public class SysMenuController {
@ApiOperation("查询菜单")
@SaCheckPermission("menu:list")
public ResponseEntity<Object> pageQuery(MenuQuery query, PageQuery page) throws Exception {
if (ObjectUtil.isEmpty(page.getSort())) {
page.setSort("menu_sort,asc");
}
List list = iSysMenuService.query(query, page);
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
}

View File

@@ -68,6 +68,7 @@
WHERE
role_id IN ( SELECT role_id FROM sys_users_roles where user_id = #{user})
)
ORDER BY menu_sort
</select>
<select id="getMenusByRole" resultType="java.util.Map">
SELECT

View File

@@ -344,7 +344,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
} else {
queryWrapper = new QueryWrapper<SysMenu>().isNull("pid");
}
return baseMapper.selectList(queryWrapper);
return baseMapper.selectList(queryWrapper.orderByAsc("menu_sort"));
}
@Override

View File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -17,6 +18,7 @@ import java.io.Serializable;
**/
@Data
@Builder
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("sys_notice")
public class SysNotice implements Serializable {

View File

@@ -6,8 +6,8 @@ spring:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:nl-sso-server}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:stand_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:stand_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:beiterui}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
username: ${DB_USER:root}
# password: ${DB_PWD:Root.123456}
password: ${DB_PWD:123456}
@@ -52,18 +52,36 @@ spring:
wall:
config:
multi-statement-allow: true
flyway:
# 是否启用flyway
enabled: true
# 编码格式默认UTF-8
encoding: UTF-8
# 迁移sql脚本文件存放路径默认db/migration
locations: classpath:db/migration
# 迁移sql脚本文件名称的前缀默认V
sql-migration-prefix: V
# 迁移sql脚本文件名称的分隔符默认2个下划线__
sql-migration-separator: __
# 迁移sql脚本文件名称的后缀
sql-migration-suffixes: .sql
# 迁移时是否进行校验默认true
validate-on-migrate: true
# 当迁移发现数据库非空且存在没有元数据的表时自动执行基准迁移新建schema_version表
baseline-on-migrate: true
redis:
#数据库索引
database: ${REDIS_DB:15}
host: ${REDIS_HOST:127.0.0.1}
port: ${REDIS_PORT:6379}
#连接超时时间
# password: ${REDIS_PWD:}
#连接超时时间
timeout: 5000
redisson:
config: |
threads: 4
nettyThreads: 4
singleServerConfig:
database: 1
connectionMinimumIdleSize: 8
connectionPoolSize: 8
address: redis://127.0.0.1:6379
@@ -163,10 +181,12 @@ sa-token:
token-session-check-login: false
alone-redis:
# Redis数据库索引默认为0
database: 1
database: 2
# Redis服务器地址
host: 127.0.0.1
# Redis服务器连接端口
port: 6379
# Redis服务器连接密码默认为空
password:
# 连接超时时间
timeout: 10s

View File

@@ -53,7 +53,6 @@ spring:
multi-statement-allow: true
redis:
#数据库索引
database: ${REDIS_DB:15}
host: ${REDIS_HOST:127.0.0.1}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:}
@@ -64,6 +63,7 @@ spring:
threads: 4
nettyThreads: 4
singleServerConfig:
database: 1
connectionMinimumIdleSize: 8
connectionPoolSize: 8
address: redis://127.0.0.1:6379

View File

@@ -53,7 +53,6 @@ spring:
multi-statement-allow: true
redis:
#数据库索引
database: ${REDIS_DB:15}
host: ${REDIS_HOST:127.0.0.1}
port: ${REDIS_PORT:6379}
#连接超时时间
@@ -63,6 +62,7 @@ spring:
threads: 4
nettyThreads: 4
singleServerConfig:
database: 1
connectionMinimumIdleSize: 8
connectionPoolSize: 8
address: redis://127.0.0.1:6379

View File

@@ -2,17 +2,13 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.10.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<resource.delimiter>@</resource.delimiter>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
<modules>
<module>nlsso-server</module>
</modules>
@@ -21,18 +17,9 @@
<artifactId>nladmin-system</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>核心模块</name>
<dependencyManagement>
<dependencies>
<!-- SpringBoot的依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.2.10.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<properties>
<sa-token.version>1.31.0</sa-token.version>
</properties>
</project>

View File

@@ -1,9 +1,9 @@
window.g = {
dev: {
VUE_APP_BASE_API: 'http://127.0.0.1:8010'
VUE_APP_BASE_API: 'http://127.0.0.1:8011'
},
prod: {
VUE_APP_BASE_API: 'http://127.0.0.1:8010'
VUE_APP_BASE_API: 'http://127.0.0.1:8011'
}
}

View File

@@ -83,7 +83,7 @@ export default {
}
},
created() {
// this.initWebSocket()
this.initWebSocket()
},
computed: {
...mapGetters([

View File

@@ -135,7 +135,7 @@ export default {
this.$store.dispatch('Login', user).then(() => {
this.loading = false
window.location.href = this.redirect
// if (this.redirect === 'http://localhost:8013/dashboard'){
// if (this.redirect === 'http://localhost:8014/dashboard'){
// window.location.href = this.redirect
// }
// this.$router.push({ path: this.redirect || '/' })

View File

@@ -209,7 +209,7 @@ export default {
name: 'Menu',
components: { Treeselect, IconSelect, crudOperation, rrOperation, udOperation },
cruds() {
return CRUD({ title: '菜单', idField: 'menu_id', url: 'api/sysMenu', crudMethod: { ...crudMenu }})
return CRUD({ title: '菜单', idField: 'menu_id', url: 'api/sysMenu', crudMethod: { ...crudMenu }, sort: 'menu_sort,asc'})
},
mixins: [presenter(), header(), form(defaultForm), crud()],
data() {

View File

@@ -241,7 +241,7 @@ export default {
name: 'Menu',
components: { Treeselect, IconSelect, crudOperation, rrOperation, udOperation, DateRangePicker },
cruds() {
return CRUD({ title: '菜单', idField: 'menu_id', url: 'api/sysMenu', crudMethod: { ...crudMenu }})
return CRUD({ title: '菜单', idField: 'menu_id', url: 'api/sysMenu', crudMethod: { ...crudMenu }, sort: 'menu_sort,asc'})
},
mixins: [presenter(), header(), form(defaultForm), crud()],
dicts: ['system_type'],

View File

@@ -1,14 +1,127 @@
<template>
<div>
<div style="overflow: hidden">
<el-row>
<div id="container" className="container" />
<div id="container" className="container" style="min-height: 100%" />
</el-row>
<!--点击设备显示信息-->
<el-dialog
id="dialogs"
title="设备信息"
class="newDialog"
:visible.sync="dialogDeviceMsgVisible"
width="22%"
:top="tops"
:show-close="false"
:modal="false"
>
<el-table
:data="arr"
style="width: 100%"
max-height="500px"
>
<el-table-column
prop="name"
label="监控项"
/>
<el-table-column
prop="value"
label="当前值"
/>
</el-table>
</el-dialog>
<!--弹窗设置设备与图标绑定与角度-->
<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>
</div>
</template>
<script>
import crudStage from '@/api/logicflow/stage'
import paramCrud from '@/views/system/param/param'
import paramCrud from '@/api/system/param'
import deviceCrud from '@/api/acs/device/device'
import { getDeviceByCodes } from '@/api/acs/device/deviceStageMonitor'
import '@logicflow/core/dist/style/index.css'
import '@logicflow/extension/lib/style/index.css'
@@ -20,10 +133,10 @@ export default {
name: 'MonitorDevice',
data() {
return {
stageParam: 'test', // 舞台参数
dialogDeviceMsgVisible: false,
stageParam: 'stage_code', // 舞台参数
dialogDeviceMsgVisible: false, // 显示设备信息的dialog
device_code: null,
tops: '20vh',
tops: '20vh', // 初始top
stage_code: '',
stageSelectList: [],
arr: [], // 显示数组
@@ -49,6 +162,11 @@ export default {
mounted() {
this.init()
},
beforeDestroy() {
// js提供的clearInterval方法用来清除定时器
console.log('定时器销毁')
clearInterval(this.timer)
},
methods: {
// 流程图初始化
init() {
@@ -68,6 +186,7 @@ export default {
backgroundImage: 'url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2QwZDBkMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZDBkMGQwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=")',
backgroundRepeat: 'repeat'
},
isSilentMode: true,
adjustEdge: false,
adjustEdgeMiddle: false,
adjustEdgeStartAndEnd: false,
@@ -91,11 +210,24 @@ export default {
nodeMenu: false
})
lf.on('node:click', (data, e) => { // 鼠标点击节点
console.log('data: ', data)
// 展开显示设备信息
console.log('1')
if (data.data.type !== 'pro-rect' && data.data.type !== 'pro-circle' && data.data.type !== 'triangle' && data.data.type !== 'rect-radius') {
if (data.data.properties.device) {
this.moveShow(data.data) // 传递节点数据用来获取id做比对
this.dialogDeviceMsgVisible = true
this.device_code = data.data.properties.device
this.tops = data.e.y + 'px'
document.getElementsByClassName('el-dialog')[0].style.marginLeft = data.e.x + 'px'
}
}
})
lf.on('node:contextmenu', (data, e, position) => { // 右键
console.log('2')
lf.on('node:contextmenu', (data, e, position) => { // 右键编辑
if (data.data.type !== 'pro-rect' && data.data.type !== 'pro-circle' && data.data.type !== 'triangle' && data.data.type !== 'rect-radius') {
if (data.data.properties.device) {
this.editDevice(data.data.id) // 编辑
}
}
})
// 开始渲染
lf.render(data)
@@ -103,14 +235,342 @@ export default {
},
initStageData() {
// 获取舞台编码
this.getValueByCode(this.stageParam).then(res => {
if (res.value !== undefined) {
crudStage.getNewStageDataByCode(res.value).then(res => {
paramCrud.getValueByCode(this.stageParam).then(res => {
// console.log(res)
if (res.value) {
crudStage.getNewStageDataByCode(res.value).then(res => { // 通过舞台编码获取舞台数据并且赋值到lf对象
data = JSON.parse(res.stage_data)
lf.render(data)
this.initStatus() // 初始化状态
})
} else {
this.$notify.error({
title: '错误',
message: '请设置参数!'
})
}
})
this.timer = setInterval(() => { // 定时刷新设备的状态信息
console.log('定时器启动')
this.initStatus()
}, 2000)
},
editDevice(id) {
let item = ''
for (const i in this.allDeviceMsg) { // 查找点击节点的id
if (id === this.allDeviceMsg[i].id) {
item = this.allDeviceMsg[i]
break // 匹对完退出
}
}
const clickObj = item
console.log('clickObj.data', clickObj.data)
if (!item.data) {
return
}
if (!clickObj.data.is_click) {
return
}
if (clickObj.data.device_type === 'scanner') { // 扫码器
this.dialogFormVisible1 = true
} else {
if (clickObj.data.driver_type === 'standard_ordinary_site') {
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
},
moveShow(nodeData) { // 点击之后显示出来的数据----只需要设备信息
let item = ''
for (const i in this.allDeviceMsg) { // 查找点击节点的id
if (nodeData.id === this.allDeviceMsg[i].id) {
item = this.allDeviceMsg[i]
break // 匹对完退出
}
}
this.arr = [] // 清空
if (item.device_code && item.data) {
// console.log('item', item)
this.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] }
this.arr.push(obj)
}
if (val === 'message' && data.isError === 'false') {
const obj = { name: '异常信息', value: data[val] }
this.arr.push(obj)
}
if (val === 'move') {
const obj = { name: '光电信号', value: data[val] }
this.arr.push(obj)
} else if (val === 'mode') {
const obj = { name: '工作模式', value: data[val] }
this.arr.push(obj)
} else if (val === 'error') {
const obj = { name: '故障代码', value: data[val] }
this.arr.push(obj)
} else if (val === 'ip') {
const obj = { name: 'IP地址', value: data[val] }
this.arr.push(obj)
} else if (val === 'number') {
const obj = { name: '托盘数量', value: data[val] }
this.arr.push(obj)
} else if (val === 'instruction_message') {
const obj = { name: '指令信息', value: data[val] }
this.arr.push(obj)
} else if (val === 'last_instruction_message') {
const obj = { name: '上次指令信息', value: data[val] }
this.arr.push(obj)
} else if (val === 'container') {
const obj = { name: '载具号', value: data[val] }
this.arr.push(obj)
} else if (val === 'last_container') {
const obj = { name: '上次载具号', value: data[val] }
this.arr.push(obj)
} else if (val === 'instruction_code') {
const obj = { name: '指令号', value: data[val] }
this.arr.push(obj)
} else if (val === 'last_instruction_code') {
const obj = { name: '上次指令号', value: data[val] }
this.arr.push(obj)
} else if (val === 'action') {
const obj = { name: '动作信号', value: data[val] }
this.arr.push(obj)
} else if (val === 'io_action') {
const obj = { name: '允许进出信号', value: data[val] }
this.arr.push(obj)
} else if (val === 'material') {
const obj = { name: '物料', value: data[val] }
this.arr.push(obj)
} else if (val === 'batch') {
const obj = { name: '批次', value: data[val] }
this.arr.push(obj)
} else if (val === 'requestSucess') {
const obj = { name: '是否请求任务', value: data[val] }
this.arr.push(obj)
} else if (val === 'applySucess') {
const obj = { name: '是否申请指令', value: data[val] }
this.arr.push(obj)
} else if (val === 'message') {
const obj = { name: '说明', value: data[val] }
this.arr.push(obj)
} else if (val === 'status') {
const obj = { name: '设备状态', value: data[val] }
this.arr.push(obj)
} else if (val === 'open_time') {
const obj = { name: '开机时间', value: data[val] }
this.arr.push(obj)
} else if (val === 'close_time') {
const obj = { name: '关机时间', value: data[val] }
this.arr.push(obj)
} else if (val === 'standby_time') {
const obj = { name: '待机时间', value: data[val] }
this.arr.push(obj)
} else if (val === 'production_time') {
const obj = { name: '生产时间', value: data[val] }
this.arr.push(obj)
} else if (val === 'error_time') {
const obj = { name: '故障时间', value: data[val] }
this.arr.push(obj)
} else if (val === 'weight') {
const obj = { name: '生产重量', value: data[val] }
this.arr.push(obj)
} else if (val === 'order_No') {
const obj = { name: '工单号', value: data[val] }
this.arr.push(obj)
} else if (val === 'mix_num') {
const obj = { name: '碾次', value: data[val] }
this.arr.push(obj)
} else if (val === 'barcode') {
const obj = { name: '条码', value: data[val] }
this.arr.push(obj)
} else if (val === 'qualified') {
const obj = { name: '合格数量', value: data[val] }
this.arr.push(obj)
} else if (val === 'unqualified') {
const obj = { name: '不合格数量', value: data[val] }
this.arr.push(obj)
} else if (val === 'put_station') {
const obj = { name: '当前码盘工位', value: data[val] }
this.arr.push(obj)
} else if (val === 'encoder_qty') {
const obj = { name: '码盘数量', value: data[val] }
this.arr.push(obj)
} else if (val === 'outKiln_move') {
const obj = { name: '出窑光电', value: data[val] }
this.arr.push(obj)
} else if (val === 'outKiln_barcode') {
const obj = { name: '出窑条码', value: data[val] }
this.arr.push(obj)
} else if (val === 'outKiln_device') {
const obj = { name: '出窑设备', value: data[val] }
this.arr.push(obj)
} else if (val === 'car_sum') {
const obj = { name: '窑车总数', value: data[val] }
this.arr.push(obj)
} else if (val === 'nullCar_qty') {
const obj = { name: '空窑车数', value: data[val] }
this.arr.push(obj)
} else if (val === 'burning_car_qty') {
const obj = { name: '在烧窑车数', value: data[val] }
this.arr.push(obj)
} else if (val === 'container_qty') {
const obj = { name: '托盘数', value: data[val] }
this.arr.push(obj)
} else if (val === 'tray_crib_qty') {
const obj = { name: '托盘垛数', value: data[val] }
this.arr.push(obj)
} else if (val === 'total_container') {
const obj = { name: '托盘总数量', value: data[val] }
this.arr.push(obj)
} else if (val === 'total_split') {
const obj = { name: '累计拆垛数量', value: data[val] }
this.arr.push(obj)
} else if (val === 'getStation') {
const obj = { name: '当前抓取工位', value: data[val] }
this.arr.push(obj)
} else if (val === 'putStation') {
const obj = { name: '当前码盘工位', value: data[val] }
this.arr.push(obj)
} else if (val === 'move_1') {
const obj = { name: '前工位光电信号', value: data[val] }
this.arr.push(obj)
} else if (val === 'move_2') {
const obj = { name: '后工位光电信号', value: data[val] }
this.arr.push(obj)
} else if (val === 'action_1') {
const obj = { name: '前工位动作信号', value: data[val] }
this.arr.push(obj)
} else if (val === 'action_2') {
const obj = { name: '后工位动作信号', value: data[val] }
this.arr.push(obj)
} else if (val === 'walk_y') {
const obj = { name: '行走列', value: data[val] }
this.arr.push(obj)
} else if (val === 'task1') {
const obj = { name: '前工位任务号', value: data[val] }
this.arr.push(obj)
} else if (val === 'task2') {
const obj = { name: '后工位任务号', value: data[val] }
this.arr.push(obj)
} else if (val === 'labeling_qty') {
const obj = { name: '贴标数量', value: data[val] }
this.arr.push(obj)
} else if (val === 'container_type') {
const obj = { name: '托盘类型', value: data[val] }
this.arr.push(obj)
} else if (val === 'specifications') {
const obj = { name: '规格', value: data[val] }
this.arr.push(obj)
} else if (val === 'onoff_status') {
const obj = { name: '开关机状态', value: data[val] }
this.arr.push(obj)
} else if (val === 'task_qty') {
const obj = { name: '当前任务数量', value: data[val] }
this.arr.push(obj)
} else if (val === 'finishTask_qty') {
const obj = { name: '完成任务数量', value: data[val] }
this.arr.push(obj)
} else if (val === 'AlongSide') {
const obj = { name: 'A长边', value: data[val] }
this.arr.push(obj)
} else if (val === 'BshortSide') {
const obj = { name: 'B短边', value: data[val] }
this.arr.push(obj)
} else if (val === 'Htrapezoidal') {
const obj = { name: 'H梯形高', value: data[val] }
this.arr.push(obj)
} else if (val === 'Wthickness') {
const obj = { name: 'W厚度', value: data[val] }
this.arr.push(obj)
} else if (val === 'qty') {
const obj = { name: '数量', value: data[val] }
this.arr.push(obj)
}
}
}
// console.log('arr:', this.arr)
},
initStatus() { // 初始化所有节点的设备信息通过节点id对应设备编号
let resion = {}
resion = lf.getGraphData().nodes.map(item => ({ id: item.id, device_code: item.properties.device }))
getDeviceByCodes(resion).then(res => {
console.log(res)
this.allDeviceMsg = res // 拿到所有节点的设备数据
// console.log('initStatus-res', res)
// 实时设置状态信息
for (var item of res) { // 循环并且设置属性值
if (item.data !== undefined) {
if (item.data.isOnline !== undefined) {
lf.setProperties(item.id, {
isOnline: item.data.isOnline
})
}
if (item.data.hasGoods !== undefined) {
lf.setProperties(item.id, {
hasGoods: item.data.hasGoods
})
}
if (item.data.isError !== undefined) {
lf.setProperties(item.id, {
isError: item.data.isError
})
}
}
}
// 设置动态实时显示设备信息
const { nodes } = lf.getSelectElements() // 获取选中的节点
// console.log(nodes)
if (nodes.length === 1) { // 因为是定时器,没有选中则不用实时更新显示数据
this.moveShow(nodes[0]) // 监控模式下不可能托选,因此就只有一个数据
}
})
},
dialogSave() {
deviceCrud.changeDeviceStatus(this.form).then(res => {
this.$notify({ title: '操作成功', message: '', type: 'success' })
this.dialogFormVisible = false
this.dialogFormVisible3 = false
this.dialogFormVisible4 = false
this.initStageData()
}).catch(err => {
this.dialogFormVisible = false
this.dialogFormVisible3 = false
this.dialogFormVisible4 = false
console.log(err.response.data.message)
})
},
saveBarcode() {
deviceCrud.saveBarcode(this.form).then(res => {
this.notify('操作成功', 'success')
this.dialogFormVisible1 = false
this.initStageData()
}).catch(err => {
this.dialogFormVisible1 = false
console.log(err.response.data.message)
})
}
}
}

View File

@@ -7,7 +7,7 @@ function resolve(dir) {
}
const name = defaultSettings.title // 网址标题
const port = 8013 // 端口配置
const port = 8014 // 端口配置
// All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = {