20230520 0826北汽福田现场

This commit is contained in:
2023-05-20 08:27:11 +08:00
parent ed309299ff
commit 7b33ffb462
66 changed files with 3523 additions and 2636 deletions

View File

@@ -18,18 +18,71 @@
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=100;pageCurrent=1;searchTable()">查询</el-button>
<span style="margin-left: 10px">是否启用</span>
<el-select v-model="valueUsedValue" placeholder="是否启用" clearable size="small" style="width:100px">
<el-option
v-for="item in valueUsed"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="margin-left: 10px">是否监控</span>
<el-select v-model="valueMonitorValue" placeholder="是否监控" clearable size="small" style="width:100px">
<el-option
v-for="item in valueMonitor"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=50;pageCurrent=1;searchTable()">查询</el-button>
</div>
<el-table
v-loading="loading"
:data="tableData"
:key="isUpdate"
highlight-current-row
border
size="mini"
height="740"
height="670"
center
style="width: 100%">
style="width: 100%"
@cell-dblclick="showEdit">
<el-table-column type="index" width="60" label="序号" align="center"/>
<el-table-column label="是否启用" align="center">
<template slot-scope="scope">
<el-switch
v-model="scope.row.是否启用_Value"
size="mini"
active-color="#13ce66"
inactive-color="#ff4949"
@change="switchChange($event, 1, scope.row)"/>
</template>
</el-table-column>
<el-table-column label="是否监控" align="center">
<template slot-scope="scope">
<el-switch
v-model="scope.row.是否监控_Value"
size="mini"
active-color="#13ce66"
inactive-color="#ff0000"
@change="switchChange($event, 2, scope.row)"/>
</template>
</el-table-column>
<el-table-column label="变量类型代码" align="center">
<template slot-scope="scope">
{{ scope.row.变量类型代码 }}
</template>
</el-table-column>
<el-table-column label="测量位置" align="center" min-width="200px">
<template slot-scope="scope">
{{ scope.row.测量位置 }}
</template>
</el-table-column>
<el-table-column label="测量项目" align="center" min-width="200px">
<template slot-scope="scope">
{{ scope.row.测量项目 }}
</template>
</el-table-column>
<el-table-column label="TagID" align="center">
<template slot-scope="scope">
{{ scope.row.TagID }}
@@ -50,7 +103,7 @@
{{ scope.row.数据来源 }}
</template>
</el-table-column>
<el-table-column label="IP" align="center">
<el-table-column label="IP" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.IP }}
</template>
@@ -95,27 +148,12 @@
{{ scope.row.列位置 }}
</template>
</el-table-column>
<el-table-column label="测量位置" align="center">
<template slot-scope="scope">
{{ scope.row.测量位置 }}
</template>
</el-table-column>
<el-table-column label="测量项目" align="center">
<template slot-scope="scope">
{{ scope.row.测量项目 }}
</template>
</el-table-column>
<el-table-column label="测量单位" align="center">
<template slot-scope="scope">
{{ scope.row.测量单位 }}
</template>
</el-table-column>
<el-table-column label="变量类型代码" align="center">
<template slot-scope="scope">
{{ scope.row.变量类型代码 }}
</template>
</el-table-column>
<el-table-column label="变量类型名称" width="300px" align="center">
<el-table-column label="变量类型名称" min-width="300px" align="center">
<template slot-scope="scope">
{{ scope.row.变量类型名称 }}
</template>
@@ -135,12 +173,7 @@
{{ scope.row.TagAdrDemo }}
</template>
</el-table-column>
<el-table-column label="是否启用" align="center">
<template slot-scope="scope">
{{ scope.row.是否启用 }}
</template>
</el-table-column>
<el-table-column label="监控组" align="center">
<el-table-column label="监控组" align="center" min-width="120px">
<template slot-scope="scope">
{{ scope.row.监控组 }}
</template>
@@ -160,11 +193,6 @@
{{ scope.row.变量特点 }}
</template>
</el-table-column>
<el-table-column label="是否监控" align="center">
<template slot-scope="scope">
{{ scope.row.是否监控 }}
</template>
</el-table-column>
<el-table-column label="变量排序" align="center">
<template slot-scope="scope">
{{ scope.row.变量排序 }}
@@ -225,6 +253,23 @@
{{ scope.row.OpcServer_MIS }}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
plain
icon="el-icon-edit"
@click="editShiftTable(scope.row)">编辑</el-button>
<el-button
size="mini"
type="text"
plain
icon="el-icon-delete"
style="color: #ff0000"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
@@ -237,6 +282,28 @@
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
<el-dialog :visible.sync="dialogFormVisible3" :title="title" center style="min-height: 200px" width="400px">
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="110px">
<el-form-item label="原始值" prop="oldValue" style="display: inline-block">
<el-input
v-model="form.oldValue"
readonly
size="small"
placeholder="原始值"/>
</el-form-item>
<el-form-item label="修改值" prop="newValue" style="display: inline-block">
<el-input
v-model="form.newValue"
clearable
size="small"
placeholder="修改值"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff('form')">取消</el-button>
<el-button type="primary" size="small" @click="submitAdd('form')">确定</el-button>
</div>
</el-dialog>
</el-card>
</div>
</template>
@@ -246,7 +313,22 @@ import request from '@/utils/request'
export default {
data() {
return {
form: {
tagID: '',
oldValue: '',
newValue: '',
filed: ''
},
rules: {
tagID: [{ required: true, message: '请输入tagID', trigger: 'blur' }],
oldValue: [{ required: true, message: '请输入oldValue', trigger: 'blur' }],
newValue: [{ required: true, message: '请输入newValue', trigger: 'blur' }],
filed: [{ required: true, message: '请输入filed', trigger: 'blur' }]
},
title: '',
dialogFormVisible3: false,
loading: false,
isUpdate: false,
tableData: [],
dataType: [], // 工位数组
dataTypeValue: '', // 工位信息
@@ -262,16 +344,36 @@ export default {
value: 7
}
],
valueUsed: [
{
label: '启用',
value: 1
}, {
label: '禁用',
value: 0
}
],
valueMonitor: [
{
label: '监控',
value: 1
}, {
label: '不监控',
value: 0
}
],
valueTypeValue: '',
valueUsedValue: 1,
valueMonitorValue: '',
total: 0, // 总条数
pageList: 100, // 每页显示条数
pageSize: 100, // 每页显示条数
pageSize: 50, // 每页显示条数
pageCurrent: 1 // 后台获取页
}
},
created() {
this.getNumber()
this.searchTable()
// this.searchTable()
},
methods: {
// 初始化获取产品型号
@@ -298,29 +400,114 @@ export default {
searchTable() {
this.loading = true
this.tableData = []
let stationNumberValue_check, valueType_check
let stationNumberValue_check, valueType_check, valueUsed_check, monitor_check
// this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
this.dataTypeValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.dataTypeValue = '')
this.valueTypeValue ? valueType_check = 1 : (valueType_check = 0, this.valueTypeValue = '')
this.dataTypeValue ? stationNumberValue_check = 1 : stationNumberValue_check = 0
this.valueTypeValue ? valueType_check = 1 : valueType_check = 0
this.valueUsedValue !== 0 && this.valueUsedValue !== 1 ? valueUsed_check = 0 : valueUsed_check = 1
this.valueMonitorValue !== 0 && this.valueMonitorValue !== 1 ? monitor_check = 0 : monitor_check = 1
var param = []
param[0] = ['变量类型_ischeck', valueType_check]
param[1] = ['变量类型', this.valueTypeValue]
param[2] = ['工位号_ischeck', stationNumberValue_check]
param[3] = ['工位号', this.dataTypeValue]
param[4] = ['PageCurrent', this.pageCurrent]
param[5] = ['PageSize', this.pageSize]
param[6] = ['PageCount', '1111', 'int', '1']
param[7] = ['ItemCount', '1111', 'int', '1']
param[4] = ['启用_ischeck', valueUsed_check]
param[5] = ['启用', this.valueUsedValue]
param[6] = ['监控_ischeck', monitor_check]
param[7] = ['监控', this.valueMonitorValue]
param[8] = ['PageCurrent', this.pageCurrent]
param[9] = ['PageSize', this.pageSize]
param[10] = ['PageCount', '1111', 'int', '1']
param[11] = ['ItemCount', '1111', 'int', '1']
var Data = this.CreateData('11', 'MES_基本变量_查询数据', param)
this.ExecDatabase(Data).then(response => {
console.log(response, 66)
if (response.data.result.length !== 0) {
this.tableData = response.data.result
}
for (const valueUsedCheckElement of this.tableData) {
valueUsedCheckElement['是否启用_Value'] = !!parseInt(valueUsedCheckElement['是否启用'])
valueUsedCheckElement['是否监控_Value'] = !!parseInt(valueUsedCheckElement['是否监控'])
}
this.total = parseInt(response.data.output[0].ItemCount)
this.loading = false
})
},
searchTableAfterEdit(tagID) {
var param = []
param[0] = ['TagId', tagID]
var Data = this.CreateData('11', 'MES_基本变量_查询数据_TagId', param)
this.ExecDatabase(Data).then(response => {
if (response.data.length !== 0) {
for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i]['TagID'] === tagID) {
response.data[0]['是否启用_Value'] = !!parseInt(response.data[0]['是否启用'])
response.data[0]['是否监控_Value'] = !!parseInt(response.data[0]['是否监控'])
console.log(response.data[0])
this.$set(this.tableData, i, response.data[0])
// this.tableData[i] = response.data[0]
return
}
}
}
this.isUpdate = !this.isUpdate
})
},
editShiftTable(row) {},
handleDelete(row) {},
switchChange(status, type, row) {
var param = []
param[0] = ['Value_type', parseInt(type)]
param[1] = ['Value_edit', status ? 1 : 0]
param[2] = ['TagID', row.TagID]
var Data = this.CreateData('12', 'MES_基本变量_启用与监控编辑', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message({
message: '修改成功',
type: 'success'
})
this.searchTableAfterEdit(row.TagID)
} else {
this.$message.error('修改失败!')
}
})
},
showEdit(row, column, cell, event) {
console.log(row, column, cell, event)
this.title = `${column.label}】 修改信息`
this.form.filed = column.label
this.form.oldValue = row[column.label]
this.form.tagID = row.TagID
this.form.newValue = ''
this.dialogFormVisible3 = true
},
submitAdd() {
var param = []
param[0] = ['newValue', this.form.newValue]
param[1] = ['filed', this.form.filed]
param[2] = ['TagID', this.form.tagID]
var Data = this.CreateData('12', 'MES_基本变量_字段信息_编辑', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message({
message: '修改成功',
type: 'success'
})
this.searchTableAfterEdit(this.form.tagID)
this.dialogFormVisible3 = false
} else {
this.$message.error('修改失败!')
}
})
},
callOff() {
this.title = ''
this.form.filed = ''
this.form.oldValue = ''
this.form.tagID = ''
this.form.newValue = ''
this.dialogFormVisible3 = false
},
// 分页
handleSizeChange(val) {
this.pageCurrent = 1