Initial commit: 景耀JY1.0项目

This commit is contained in:
Developer
2026-05-21 09:46:02 +08:00
parent 4969870de8
commit fd70670235
90 changed files with 10278 additions and 1508 deletions

View File

@@ -516,7 +516,7 @@ export default {
// 工作状态 0 黄色 1 绿色
getwork_state() {
var param = []
var Data = this.CreateData('11', 'MES_机加工MES_设备数据采集_工作状态_查询', param)
var Data = this.CreateData('11', 'MES_机加工MES_设备数据采集_工作状态_查询_新', param)
this.ExecDatabase(Data).then(response => {
// 通过jQuery添加类选择器和移除类选择器
for (let i = 0; i < response.data.length; i++) {
@@ -555,7 +555,7 @@ export default {
// 0 电流计故障 红 1 设备关机 灰 2 设备开机 黄 3 设备工作 绿 10断网或电脑关机 透明
getOP_state() {
var param = []
var Data = this.CreateData('11', 'MES_机加工MES_设备数据采集_工位状态_查询', param)
var Data = this.CreateData('11', 'MES_机加工MES_设备数据采集_工位状态_查询_新', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].状态代码 === '2') {
@@ -674,7 +674,7 @@ export default {
}
var param = []
param[0] = ['工位号', $event.path[2].id]
var Data = this.CreateData('11', 'MES_机加工MES_设备数据采集_工位状态_查询_按工位号', param)
var Data = this.CreateData('11', 'MES_机加工MES_设备数据采集_工位状态_查询_按工位号_新', param)
this.ExecDatabase(Data).then(res => {
if (res.data[0].状态代码 === '0') {
this.tooltip2 = '设备状态:设备报警'

View File

@@ -0,0 +1,245 @@
<template>
<div class="app-container">
<el-card class="real-time-card" shadow="hover">
<div class="search-container">
<el-date-picker
v-model="dateRange"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
size="small"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 300px"
/>
<el-select v-model="equipmentName" placeholder="请选择设备" size="small" style="width: 200px" clearable>
<el-option
v-for="item in equipmentList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-input v-model="variableName" placeholder="变量名称" size="small" clearable style="width: 200px"/>
<el-button type="primary" icon="el-icon-search" size="small" @click="pageSize = 20; pageCurrent = 1; searchTable()">查询</el-button>
</div>
<div v-loading="loading" class="table-container">
<el-table :data="tableData" border size="small" stripe highlight-current-row style="width: 100%">
<el-table-column label="设备名称" prop="设备名称" align="center" min-width="150px">
<template slot-scope="scope">
<span class="equipment-name">{{ scope.row.设备名称 }}</span>
</template>
</el-table-column>
<el-table-column label="参数名称" prop="参数名称" align="center" min-width="150px">
<template slot-scope="scope">
<span class="parameter-name">{{ scope.row.参数名称 }}</span>
</template>
</el-table-column>
<el-table-column label="数值" prop="数值" align="center" min-width="150px">
<template slot-scope="scope">
<span class="value">{{ scope.row.数值 }}</span>
</template>
</el-table-column>
<el-table-column label="单位" prop="单位" align="center" min-width="100px">
<template slot-scope="scope">
<span class="unit">{{ scope.row.单位 }}</span>
</template>
</el-table-column>
<el-table-column label="更新时间" prop="更新时间" align="center" min-width="180px">
<template slot-scope="scope">
<span class="update-time">{{ scope.row.更新时间 }}</span>
</template>
</el-table-column>
</el-table>
<!-- <div v-if="tableData.length === 0" class="empty-state">
<el-empty description="暂无数据" />
</div> -->
</div>
<div class="pagination-container">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
name: 'HistoryInformation',
data() {
return {
dateRange: [new Date().toISOString().slice(0, 10), new Date().toISOString().slice(0, 10)],
equipmentName: '',
variableName: '',
equipmentList: [],
total: 0, // 分页总数
tableData: [], // 设备历史数据信息表
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
loading: false // 加载状态
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.searchTable()
this.getEquipmentList()
},
methods: {
getEquipmentList() {
this.loading = true
this.ExecDatabase(this.CreateData('11', '设备管理_历史数据_设备_查询', [])).then(response => {
console.log(response)
if (response.data && response.data.length !== 0) {
this.equipmentList = response.data.map(item => {
return {
value: item.Zone,
label: item.Zone
}
})
} else {
this.equipmentList = []
}
this.loading = false
})
},
searchTable() {
this.loading = true
var param = []
param[0] = ['开始时间', this.dateRange.length > 0 ? this.dateRange[0] + ' 00:00:00' : '']
param[1] = ['结束时间', this.dateRange.length > 0 ? this.dateRange[1] + ' 23:59:59' : '']
param[2] = ['设备名称', this.equipmentName]
param[3] = ['参数名称', this.variableName]
param[4] = ['PageCurrent', this.pageCurrent]
param[5] = ['PageSize', this.pageSize]
param[6] = ['PageCount', '1111', 'int', '1']
param[7] = ['ItemCount', '1111', 'int', '1']
var Data = this.CreateData('11', '设备管理_历史数据_查询', param)
this.ExecDatabase(Data).then(response => {
console.log('历史数据查询', response.data)
// 转换数据格式以匹配表格需要的结构
if (response.data.result && response.data.result.length !== 0) {
this.tableData = response.data.result.map(item => {
return {
'设备名称': item.设备代码,
'参数名称': item.变量名称,
'数值': item.,
'单位': item.单位,
'更新时间': item.创建时间
}
})
} else {
this.tableData = []
}
this.total = parseInt(response.data.output[0].ItemCount) || 0
console.log('设备信息查询', this.tableData)
}).finally(() => {
this.loading = false
})
},
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped>
.app-container {
padding: 20px;
background-color: #f5f7fa;
min-height: 100vh;
}
.real-time-card {
border-radius: 8px;
overflow: hidden;
margin-bottom: 20px;
}
.search-container {
display: flex;
align-items: center;
margin-bottom: 20px;
gap: 16px;
flex-wrap: wrap;
}
.table-container {
margin-bottom: 20px;
border-radius: 4px;
overflow: hidden;
}
.pagination-container {
display: flex;
justify-content: flex-end;
margin-top: 16px;
}
.equipment-name {
font-weight: 500;
color: #303133;
}
.parameter-name {
color: #606266;
}
.value {
font-weight: 600;
color: #409eff;
}
.unit {
color: #909399;
font-size: 12px;
}
.update-time {
color: #606266;
font-size: 12px;
}
.empty-state {
padding: 40px 0;
text-align: center;
}
/* 响应式设计 */
@media screen and (max-width: 768px) {
.app-container {
padding: 10px;
}
.search-container {
flex-direction: column;
align-items: stretch;
}
.search-container > * {
width: 100% !important;
margin-bottom: 10px;
}
}
</style>

View File

@@ -0,0 +1,231 @@
<template>
<div class="app-container">
<el-card class="real-time-card" shadow="hover">
<div class="search-container">
<el-select v-model="equipmentName" placeholder="请选择设备" size="small" style="width: 200px" clearable>
<el-option
v-for="item in equipmentList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-input v-model="variableName" placeholder="变量名称" size="small" clearable style="width: 200px"/>
<el-button type="primary" icon="el-icon-search" size="small" @click=" searchTable() ">查询</el-button>
</div>
<div v-loading="loading" class="table-container">
<el-table :data="tableData" border size="small" stripe highlight-current-row style="width: 100%">
<el-table-column label="设备名称" prop="设备名称" align="center" min-width="150px">
<template slot-scope="scope">
<span class="equipment-name">{{ scope.row.设备名称 }}</span>
</template>
</el-table-column>
<el-table-column label="参数名称" prop="参数名称" align="center" min-width="150px">
<template slot-scope="scope">
<span class="parameter-name">{{ scope.row.参数名称 }}</span>
</template>
</el-table-column>
<el-table-column label="数值" prop="数值" align="center" min-width="150px">
<template slot-scope="scope">
<span class="value">{{ scope.row.数值 }}</span>
</template>
</el-table-column>
<el-table-column label="单位" prop="单位" align="center" min-width="100px">
<template slot-scope="scope">
<span class="unit">{{ scope.row.单位 }}</span>
</template>
</el-table-column>
<el-table-column label="更新时间" prop="更新时间" align="center" min-width="180px">
<template slot-scope="scope">
<span class="update-time">{{ scope.row.更新时间 }}</span>
</template>
</el-table-column>
</el-table>
<!-- <div v-if="tableData.length === 0" class="empty-state">
<el-empty description="暂无数据" />
</div> -->
</div>
<div class="pagination-container">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[10, 20, 30, 40, 100]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
background
@size-change="handleSizeChanges"
@current-change="handleCurrentChanges"
/>
</div>
</el-card>
</div>
</template>
<style scoped>
.app-container {
padding: 20px;
background-color: #f5f7fa;
min-height: 100vh;
}
.real-time-card {
border-radius: 8px;
overflow: hidden;
margin-bottom: 20px;
}
.search-container {
display: flex;
align-items: center;
margin-bottom: 20px;
gap: 16px;
flex-wrap: wrap;
}
.table-container {
margin-bottom: 20px;
border-radius: 4px;
overflow: hidden;
}
.pagination-container {
display: flex;
justify-content: flex-end;
margin-top: 16px;
}
.equipment-name {
font-weight: 500;
color: #303133;
}
.parameter-name {
color: #606266;
}
.value {
font-weight: 600;
color: #409eff;
}
.unit {
color: #909399;
font-size: 12px;
}
.update-time {
color: #606266;
font-size: 12px;
}
.empty-state {
padding: 40px 0;
text-align: center;
}
/* 响应式设计 */
@media screen and (max-width: 768px) {
.app-container {
padding: 10px;
}
.search-container {
flex-direction: column;
align-items: stretch;
}
.search-container > * {
width: 100% !important;
margin-bottom: 10px;
}
}
</style>
<script>
import { mapGetters } from 'vuex'
export default {
name: 'RealTimeInformation',
data() {
return {
equipmentName: '',
variableName: '',
equipmentList: [],
total: 0, // 分页总数
tableData: [], // 设备实时信息表
pageCurrent: 1, // 分页当前页
pageSize: 20, // 分页每页显示条数
loading: false // 加载状态
}
},
computed: {
...mapGetters([
'id',
'token'
])
},
created() {
this.getEquipmentList()
this.searchTable()
},
methods: {
getEquipmentList() {
this.loading = true
this.ExecDatabase(this.CreateData('11', '设备管理_历史数据_设备_查询', [])).then(response => {
console.log(response)
if (response.data && response.data.length !== 0) {
this.equipmentList = response.data.map(item => {
return {
value: item.Zone,
label: item.Zone
}
})
} else {
this.equipmentList = []
}
this.loading = false
})
},
searchTable() {
this.loading = true
var param = []
param[0] = ['设备名称', this.equipmentName]
param[1] = ['参数名称', this.variableName]
param[2] = ['PageCurrent', this.pageCurrent]
param[3] = ['PageSize', this.pageSize]
param[4] = ['PageCount', '1111', 'int', '1']
param[5] = ['ItemCount', '1111', 'int', '1']
var Data = this.CreateData('11', '设备管理_设备数据_查询', param)
this.ExecDatabase(Data).then(response => {
console.log('设备信息查询', response.data)
// 转换数据格式以匹配表格需要的结构
if (response.data.result && response.data.result.length !== 0) {
this.tableData = response.data.result.map(item => {
return {
'设备名称': item.Zone,
'参数名称': item.TagName,
'数值': item.TagValue,
'单位': item.TagUnit,
'更新时间': item.UpdateTime
}
})
} else {
this.tableData = []
}
this.total = parseInt(response.data.output[0].ItemCount) || 0
console.log('设备信息查询', this.tableData)
}).finally(() => {
this.loading = false
})
},
handleSizeChanges(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
handleCurrentChanges(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>

File diff suppressed because it is too large Load Diff