ws心跳检查

This commit is contained in:
朱菊兰 2024-03-26 17:16:52 +08:00
parent f844834453
commit 1c0dba7dbb
8 changed files with 335 additions and 331 deletions

View File

@ -25,7 +25,7 @@ VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.78:48082' # VUE_APP_BASE_API = 'http://192.168.1.78:48082'
# VUE_APP_BASE_API = 'http://192.168.1.47:48082' # VUE_APP_BASE_API = 'http://192.168.1.47:48082'
# socket地址 # socket地址
VUE_APP_Socket_API = 'ws://192.168.0.33:48082' VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081' VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
# 积木报表指向地址 # 积木报表指向地址

View File

@ -2,42 +2,18 @@
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:page="queryParams.pageNo" :max-height="tableH">
:limit="queryParams.pageSize" <method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
:table-props="tableProps" @clickBtn="handleClick" />
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table> </base-table>
<pagination <pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
:page.sync="queryParams.pageNo" @pagination="getList" />
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 新增 --> <!-- 新增 -->
<base-dialog <base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
:dialogTitle="addOrEditTitle" @confirm="handleConfirm" :before-close="handleCancel">
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<energy-plc-add ref="energyPlc" @successSubmit="successSubmit" /> <energy-plc-add ref="energyPlc" @successSubmit="successSubmit" />
</base-dialog> </base-dialog>
</div> </div>
@ -50,7 +26,8 @@ import EnergyPlcAdd from './components/energyPlcAdd.vue'
const tableProps = [ const tableProps = [
{ {
prop: 'plcTableName', prop: 'plcTableName',
label: '关联表名' label: '关联表名',
showOverflowtooltip: true
}, },
{ {
prop: 'code', prop: 'code',
@ -60,7 +37,9 @@ const tableProps = [
}, },
{ {
prop: 'name', prop: 'name',
label: '标识名' label: '标识名',
minWidth: 150,
showOverflowtooltip: true
}, },
{ {
prop: 'enName', prop: 'enName',
@ -109,21 +88,21 @@ export default {
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:energy-plc:update') this.$auth.hasPermi('base:energy-plc:update')
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑' btnName: '编辑'
} }
: undefined, : undefined,
this.$auth.hasPermi('base:energy-plc:delete') this.$auth.hasPermi('base:energy-plc:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除' btnName: '删除'
} }
: undefined : undefined
].filter((v) => v), ].filter((v) => v),
tableH: this.tableHeight(260), tableH: this.tableHeight(260),
collectionList: [ collectionList: [
{value: 0,label: '否'}, { value: 0, label: '否' },
{value: 1,label: '是'} { value: 1, label: '是' }
], ],
// //
total: 0, total: 0,
@ -167,7 +146,7 @@ export default {
getList() { getList() {
getEnergyPlcPage(this.queryParams).then(response => { getEnergyPlcPage(this.queryParams).then(response => {
let arr = response.data.list || []; let arr = response.data.list || [];
arr&&arr.map(item => { arr && arr.map(item => {
this.collectionList.map(i => { this.collectionList.map(i => {
if (item.collection === i.value) { if (item.collection === i.value) {
item.collection = i.label item.collection = i.label
@ -188,7 +167,7 @@ export default {
this.centervisible = true this.centervisible = true
break break
default: default:
this.handleDelete(val.data) this.handleDelete(val.data)
} }
}, },
handleCancel() { handleCancel() {
@ -205,13 +184,13 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
this.$modal.confirm('是否确认删除关联表名为"' + row.name + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除关联表名为"' + row.name + '"的数据项?').then(function () {
return deleteEnergyPlc(row.id); return deleteEnergyPlc(row.id);
}).then(() => { }).then(() => {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => { });
} }
} }
}; };

View File

@ -2,47 +2,23 @@
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:page="queryParams.pageNo" :max-height="tableH">
:limit="queryParams.pageSize" <method-btn v-if="tableBtn.length" slot="handleBtn" :width="160" label="操作" :method-list="tableBtn"
:table-props="tableProps" @clickBtn="handleClick" />
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="160"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table> </base-table>
<pagination <pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
:page.sync="queryParams.pageNo" @pagination="getList" />
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 新增 --> <!-- 新增 -->
<base-dialog <base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
:dialogTitle="addOrEditTitle" @confirm="handleConfirm" :before-close="handleCancel" width='30%'>
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width='30%'
>
<energy-plc-connect-add ref="energyPlcConnect" :objList="objList" @successSubmit="successSubmit" /> <energy-plc-connect-add ref="energyPlcConnect" :objList="objList" @successSubmit="successSubmit" />
</base-dialog> </base-dialog>
<!-- 参数绑定/查看 --> <!-- 参数绑定/查看 -->
<energy-plc-param v-if="paramVisible" ref="plcParam" @closeDrawer="closeDrawer" :energyTypeList="energyTypeList"></energy-plc-param> <energy-plc-param v-if="paramVisible" ref="plcParam" @closeDrawer="closeDrawer"
:energyTypeList="energyTypeList"></energy-plc-param>
</div> </div>
</template> </template>
@ -63,17 +39,20 @@ const tableProps = [
label: '对象编码' label: '对象编码'
}, },
{ {
prop: 'plcTableName', prop: 'plcTableName',
label: '关联表名' label: '关联表名'
}, },
{ {
prop: 'plcTableCode', prop: 'plcTableCode',
label: '关联表编码', label: '关联表编码',
minWidth: 150,
showOverflowtooltip: true showOverflowtooltip: true
}, },
{ {
prop: 'cnName', prop: 'cnName',
label: '标识名' label: '标识名',
minWidth: 150,
showOverflowtooltip: true
}, },
{ {
prop: 'varNum', prop: 'varNum',
@ -113,9 +92,9 @@ export default {
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:energy-plc-connect:bind') this.$auth.hasPermi('base:energy-plc-connect:bind')
? { ? {
type: 'connect', type: 'connect',
btnName: '绑定' btnName: '绑定'
} }
: undefined, : undefined,
{ {
type: 'detail', type: 'detail',
@ -123,15 +102,15 @@ export default {
}, },
this.$auth.hasPermi('base:energy-plc-connect:update') this.$auth.hasPermi('base:energy-plc-connect:update')
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑' btnName: '编辑'
} }
: undefined, : undefined,
this.$auth.hasPermi('base:energy-plc-connect:delete') this.$auth.hasPermi('base:energy-plc-connect:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除' btnName: '删除'
} }
: undefined : undefined
].filter((v) => v), ].filter((v) => v),
tableH: this.tableHeight(260), tableH: this.tableHeight(260),
@ -230,13 +209,13 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
this.$modal.confirm('是否确认删除对象为"' + row.objName + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除对象为"' + row.objName + '"的数据项?').then(function () {
return deleteEnergyPlcConnect(row.id); return deleteEnergyPlcConnect(row.id);
}).then(() => { }).then(() => {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => { });
}, },
closeDrawer() { closeDrawer() {
this.getList() this.getList()

View File

@ -2,43 +2,18 @@
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:page="queryParams.pageNo" :max-height="tableH">
:limit="queryParams.pageSize" <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
:table-props="tableProps" @clickBtn="handleClick" />
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table> </base-table>
<pagination <pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
:page.sync="queryParams.pageNo" @pagination="getList" />
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 新增 --> <!-- 新增 -->
<base-dialog <base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
:dialogTitle="addOrEditTitle" @confirm="handleConfirm" :before-close="handleCancel" width='50%'>
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width='50%'
>
<group-class-add ref="classList" @successSubmit="successSubmit" /> <group-class-add ref="classList" @successSubmit="successSubmit" />
</base-dialog> </base-dialog>
</div> </div>
@ -85,7 +60,7 @@ const tableProps = [
} }
] ]
export default { export default {
name: "GroupClass", name: "GroupClasses",
components: { GroupClassAdd }, components: { GroupClassAdd },
data() { data() {
return { return {
@ -115,33 +90,33 @@ export default {
], ],
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:group-classes:cancel') this.$auth.hasPermi('base:group-classes:cancel')
? { ? {
type: 'cancel', type: 'cancel',
btnName: '作废', btnName: '作废',
showParam: { showParam: {
type: '&', type: '&',
data: [ data: [
{ {
type: 'unequal', type: 'unequal',
name: 'status', name: 'status',
value: '不可用' value: '不可用'
} }
] ]
}
} }
}
: undefined, : undefined,
this.$auth.hasPermi('base:group-classes:update') this.$auth.hasPermi('base:group-classes:update')
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑' btnName: '编辑'
} }
: undefined, : undefined,
this.$auth.hasPermi('base:group-classes:delete') this.$auth.hasPermi('base:group-classes:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除' btnName: '删除'
} }
: undefined : undefined
].filter((v) => v), ].filter((v) => v),
tableH: this.tableHeight(260), tableH: this.tableHeight(260),
@ -213,7 +188,7 @@ export default {
this.discard(val.data) this.discard(val.data)
break break
default: default:
this.handleDelete(val.data) this.handleDelete(val.data)
} }
}, },
handleCancel() { handleCancel() {
@ -235,33 +210,33 @@ export default {
obj.endTime = row.endTime obj.endTime = row.endTime
obj.enableTime = row.enableTime obj.enableTime = row.enableTime
obj.disableTime = Date.parse(new Date()) obj.disableTime = Date.parse(new Date())
this.$modal.confirm('是否确认作废班次名称为"' + row.name + '"的数据项?').then(function() { this.$modal.confirm('是否确认作废班次名称为"' + row.name + '"的数据项?').then(function () {
return updateGroupClasses({ ...obj }) return updateGroupClasses({ ...obj })
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("操作成功"); this.$modal.msgSuccess("操作成功");
}).catch(() => {}); }).catch(() => { });
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
console.log(row) console.log(row)
let _this = this let _this = this
if (row.status === '可用') {// if (row.status === '可用') {//
_this.$modal.confirm('删除的班次"' + row.name + '"可能会影响交接班计划,请点取消再次确认!').then(function() { _this.$modal.confirm('删除的班次"' + row.name + '"可能会影响交接班计划,请点取消再次确认!').then(function () {
return _this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function() { return _this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function () {
return deleteGroupClasses(row.id);
}).then(() => {
_this.getList();
_this.$modal.msgSuccess("删除成功");
}).catch(() => {});
})
} else {
_this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function() {
return deleteGroupClasses(row.id); return deleteGroupClasses(row.id);
}).then(() => { }).then(() => {
_this.getList(); _this.getList();
_this.$modal.msgSuccess("删除成功"); _this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => { });
})
} else {
_this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function () {
return deleteGroupClasses(row.id);
}).then(() => {
_this.getList();
_this.$modal.msgSuccess("删除成功");
}).catch(() => { });
} }
} }
} }

View File

@ -21,7 +21,7 @@
</el-col> </el-col>
<el-col :span='4'> <el-col :span='4'>
<div class="blodTip">产品名称</div> <div class="blodTip">产品名称</div>
<div class="lightTip">{{ orderMsg.productName }}</div> <div class="lightTip" :title='orderMsg.productName'>{{ orderMsg.productName }}</div>
</el-col> </el-col>
<el-col :span='4'> <el-col :span='4'>
<div class="blodTip">产品规格</div> <div class="blodTip">产品规格</div>
@ -282,6 +282,9 @@ export default {
font-weight: 400; font-weight: 400;
color: rgba(102, 102, 102, 0.75); color: rgba(102, 102, 102, 0.75);
margin-bottom: 12px; margin-bottom: 12px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
} }

View File

@ -1,38 +1,21 @@
<template> <template>
<div class="app-container orderMonitoring"> <div class="app-container orderMonitoring">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<el-tabs v-model="activeName" @tab-click="toggleTab"> <el-tabs v-model="activeName" @tab-click="toggleTab">
<el-tab-pane label="数据列表" name="dataList"></el-tab-pane> <el-tab-pane label="数据列表" name="dataList"></el-tab-pane>
<el-tab-pane label="环形图" name="barChart"></el-tab-pane> <el-tab-pane label="环形图" name="barChart"></el-tab-pane>
</el-tabs> </el-tabs>
<!-- --> <!-- -->
<div v-if="activeName === 'dataList'"> <div v-if="activeName === 'dataList'">
<base-table <base-table :page="1" :limit="1000000000000" :table-props="tableProps" :table-data="list" :max-height="tableH"
:page="1" row-key="id" :tree-props="{ children: 'orderMonitorVOS', hasChildren: 'hasChildren' }">
:limit="1000000000000" <method-btn v-if="tableBtn.length" slot="handleBtn" :width="100" label="操作" :method-list="tableBtn"
:table-props="tableProps" @clickBtn="handleClick" />
:table-data="list"
:max-height="tableH"
row-key="id"
:tree-props="{children: 'orderMonitorVOS', hasChildren: 'hasChildren'}"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table> </base-table>
</div> </div>
<!-- --> <!-- -->
<monitoring-ring-charts ref='monitoringRingCharts' v-else :chart-list='chartList'/> <monitoring-ring-charts ref='monitoringRingCharts' v-else :chart-list='chartList' />
<!-- <pagination <!-- <pagination
:page.sync="queryParams.pageNo" :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@ -168,65 +151,65 @@ export default {
}, },
tableProps, tableProps,
list: [], list: [],
tableH: this.tableHeight(305), tableH: this.tableHeight(260),
total: 0, total: 0,
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:order-completion-monitoring:orderDet') this.$auth.hasPermi('base:order-completion-monitoring:orderDet')
? { ? {
type: 'orderDetail', type: 'orderDetail',
btnName: '详情', btnName: '详情',
showTip: '订单/工单详情', showTip: '订单/工单详情',
showParam: { showParam: {
type: '&', type: '&',
data: [ data: [
{ {
type: 'more', type: 'more',
name: 'orderNum', name: 'orderNum',
value: 1 value: 1
} }
] ]
}
} }
}
: undefined, : undefined,
this.$auth.hasPermi('base:order-completion-monitoring:qualityDet') this.$auth.hasPermi('base:order-completion-monitoring:qualityDet')
? { ? {
type: 'qualityDetail', type: 'qualityDetail',
btnName: '质量', btnName: '质量',
showTip: '质量详情', showTip: '质量详情',
showParam: { showParam: {
type: '&', type: '&',
data: [ data: [
{ {
type: 'more', type: 'more',
name: 'orderNum', name: 'orderNum',
value: 1 value: 1
}, },
{ {
type: 'unequal', type: 'unequal',
name: 'woIdString', name: 'woIdString',
value: '' value: ''
} }
] ]
}
} }
}
: undefined : undefined
// this.$auth.hasPermi('base:order-completion-monitoring:sendOut') // this.$auth.hasPermi('base:order-completion-monitoring:sendOut')
// ? { // ? {
// type: 'sendOutDetail', // type: 'sendOutDetail',
// btnName: '', // btnName: '',
// showTip: '', // showTip: '',
// showParam: { // showParam: {
// type: '&', // type: '&',
// data: [ // data: [
// { // {
// type: 'more', // type: 'more',
// name: 'workOrderNum', // name: 'workOrderNum',
// value: 1 // value: 1
// } // }
// ] // ]
// } // }
// } // }
// : undefined // : undefined
].filter((v) => v), ].filter((v) => v),
chartList: [] chartList: []
} }
@ -234,7 +217,7 @@ export default {
components: { MonitoringRingCharts }, components: { MonitoringRingCharts },
mounted() { mounted() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(305) this.tableH = this.tableHeight(260)
}) })
let start = moment().subtract(30, 'days').format('yyyy-MM-DD') let start = moment().subtract(30, 'days').format('yyyy-MM-DD')
let end = moment().format('yyyy-MM-DD') let end = moment().format('yyyy-MM-DD')
@ -245,10 +228,10 @@ export default {
}, },
methods: { methods: {
getPage() { getPage() {
orderGroupMonitor({...this.queryParams}).then(res => { orderGroupMonitor({ ...this.queryParams }).then(res => {
let arr = res.data || [] let arr = res.data || []
if (arr.length > 0) { if (arr.length > 0) {
let color = ['#7164FF','#288AFF','#63BDFF','#8EF0AB','#FFCE6A'] let color = ['#7164FF', '#288AFF', '#63BDFF', '#8EF0AB', '#FFCE6A']
let arr2 = [] let arr2 = []
arr.map(item => { arr.map(item => {
item.orderType = '集团订单'// item.orderType = '集团订单'//
@ -261,11 +244,11 @@ export default {
obj.num = item.planQuantity || 0 obj.num = item.planQuantity || 0
let sunNum = 0 let sunNum = 0
if (item.orderMonitorVOS && item.orderMonitorVOS.length > 0) { if (item.orderMonitorVOS && item.orderMonitorVOS.length > 0) {
for(let i = 0; i < item.orderMonitorVOS.length; i++) { for (let i = 0; i < item.orderMonitorVOS.length; i++) {
item.orderMonitorVOS[i].orderType = '厂务订单'// item.orderMonitorVOS[i].orderType = '厂务订单'//
item.orderMonitorVOS[i].id = item.orderMonitorVOS[i].orderid item.orderMonitorVOS[i].id = item.orderMonitorVOS[i].orderid
item.orderMonitorVOS[i].orderNum = item.orderMonitorVOS[i].workOrderNum item.orderMonitorVOS[i].orderNum = item.orderMonitorVOS[i].workOrderNum
woIdString+=item.orderMonitorVOS[i].woIdString?item.orderMonitorVOS[i].woIdString:'' woIdString += item.orderMonitorVOS[i].woIdString ? item.orderMonitorVOS[i].woIdString : ''
//============== //==============
let subObj = {} let subObj = {}
subObj.value = item.orderMonitorVOS[i].actualquantity subObj.value = item.orderMonitorVOS[i].actualquantity
@ -273,9 +256,9 @@ export default {
if (i < 5) { if (i < 5) {
subObj.color = color[i] subObj.color = color[i]
} else { } else {
subObj.color = color[i%5] subObj.color = color[i % 5]
} }
sunNum+=(item.orderMonitorVOS[i].actualquantity || 0) sunNum += (item.orderMonitorVOS[i].actualquantity || 0)
arr3.push(subObj) arr3.push(subObj)
} }
} }
@ -295,7 +278,7 @@ export default {
this.$refs.monitoringRingCharts.initChart() this.$refs.monitoringRingCharts.initChart()
}) })
} }
}else{ } else {
// //
this.chartList = [] this.chartList = []
} }
@ -320,24 +303,24 @@ export default {
case 'orderDetail': case 'orderDetail':
if (val.data.orderType === '集团订单') { if (val.data.orderType === '集团订单') {
this.$router.push({// this.$router.push({//
path: '/order/base/order-manage/order-detail-data?orderIdString='+ val.data.orderIds.join(',') path: '/order/base/order-manage/order-detail-data?orderIdString=' + val.data.orderIds.join(',')
}) })
}else{ } else {
this.$router.push({// this.$router.push({//
path: '/core/core-work-order-detail?woIdString='+val.data.woIdString path: '/core/core-work-order-detail?woIdString=' + val.data.woIdString
}) })
} }
break break
case 'qualityDetail': case 'qualityDetail':
this.$router.push({ this.$router.push({
path: '/quality/base/quality-inspection-data/detection-information/statistical-data?woIdString='+val.data.woIdString path: '/quality/base/quality-inspection-data/detection-information/statistical-data?woIdString=' + val.data.woIdString
}) })
break break
default: default:
// this.$router.push({ // this.$router.push({
// path: '/delivery/delivery-log?orderId='+encodeURI(val.data.name) // path: '/delivery/delivery-log?orderId='+encodeURI(val.data.name)
// }) // })
} }
}, },
toggleTab() { toggleTab() {
if (this.activeName === 'barChart' && this.chartList.length > 0) { if (this.activeName === 'barChart' && this.chartList.length > 0) {
@ -346,7 +329,7 @@ export default {
}) })
} }
} }
} }
} }
</script> </script>
<style lang='scss'> <style lang='scss'>
@ -360,31 +343,39 @@ export default {
height: 2px; height: 2px;
background-color: #e4e7ed; background-color: #e4e7ed;
} }
.el-tabs__nav-wrap::after { .el-tabs__nav-wrap::after {
width: 0; width: 0;
} }
.el-tabs__item { .el-tabs__item {
padding: 0 10px; padding: 0 10px;
} }
.el-tabs__item:hover { .el-tabs__item:hover {
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
} }
.el-tabs__item.is-active { .el-tabs__item.is-active {
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
} }
.el-tabs__item { .el-tabs__item {
color: rgba(0, 0, 0, 0.45); color: rgba(0, 0, 0, 0.45);
} }
.searchBarBox { .searchBarBox {
margin-bottom: 0; margin-bottom: 0;
} }
.boxTitle { .boxTitle {
display: inline-block; display: inline-block;
font-size: 16px; font-size: 16px;
font-weight: 400; font-weight: 400;
color: #000000; color: #000000;
margin:0 10px 16px 0; margin: 0 10px 16px 0;
} }
.blueTitle { .blueTitle {
content: ''; content: '';
display: inline-block; display: inline-block;

View File

@ -42,7 +42,7 @@ export function WsConnect(url, agentData, successCallback, errCallback) {
this.lockReconnect = true; this.lockReconnect = true;
this.wsCreateHandler && clearTimeout(this.wsCreateHandler); this.wsCreateHandler && clearTimeout(this.wsCreateHandler);
// 关闭心跳检查 // 关闭心跳检查
// heartCheck.stop(); heartCheck.stop();
} }
}; };
const initWsEventHandle = () => { const initWsEventHandle = () => {
@ -50,13 +50,13 @@ export function WsConnect(url, agentData, successCallback, errCallback) {
// 连接成功 // 连接成功
this.wsObj.onopen = (event) => { this.wsObj.onopen = (event) => {
onWsOpen(event); onWsOpen(event);
// heartCheck.start(); heartCheck.start();
}; };
// 监听服务器端返回的信息 // 监听服务器端返回的信息
this.wsObj.onmessage = (event) => { this.wsObj.onmessage = (event) => {
onWsMessage(event); onWsMessage(event);
// heartCheck.start(); heartCheck.start();
}; };
this.wsObj.onclose = (event) => { this.wsObj.onclose = (event) => {
@ -123,7 +123,7 @@ export function WsConnect(url, agentData, successCallback, errCallback) {
if (this.lockReconnect) { if (this.lockReconnect) {
return; return;
} }
writeToScreen("3秒后重连"); writeToScreen("5秒后重连");
this.lockReconnect = true; this.lockReconnect = true;
// 没连接上会一直重连,设置延迟避免请求过多 // 没连接上会一直重连,设置延迟避免请求过多
this.wsCreateHandler && clearTimeout(this.wsCreateHandler); this.wsCreateHandler && clearTimeout(this.wsCreateHandler);
@ -132,10 +132,40 @@ export function WsConnect(url, agentData, successCallback, errCallback) {
this.createWebSoket(); this.createWebSoket();
this.lockReconnect = false; this.lockReconnect = false;
writeToScreen("重连完成"); writeToScreen("重连完成");
}, 3000); }, 5000);
}; };
// 心跳检查看看websocket是否还在正常连接中 // 心跳检查看看websocket是否还在正常连接中不需要服务端返回单向的
let _this = this
let heartCheck = {
timeout: 55000,
timeoutObj: null,
// 重启
reset() {
clearTimeout(this.timeoutObj);
this.start();
},
// 停止
stop() {
clearTimeout(this.timeoutObj);
},
// 开启定时器
start() {
this.timeoutObj && clearTimeout(this.timeoutObj);
this.timeoutObj = setTimeout(() => {
writeToScreen("心跳检查发送ping到后台");
try {
const datas = { ping: true };
_this.wsObj.send(JSON.stringify(datas));
} catch (err) {
writeToScreen("发送ping异常");
}
}, this.timeout);
},
};
// 心跳检查看看websocket是否还在正常连接中,和服务端通信,双向的)
// let heartCheck = { // let heartCheck = {
// timeout: 15000, // timeout: 15000,
// timeoutObj: null, // timeoutObj: null,
@ -160,7 +190,7 @@ export function WsConnect(url, agentData, successCallback, errCallback) {
// writeToScreen("心跳检查发送ping到后台"); // writeToScreen("心跳检查发送ping到后台");
// try { // try {
// const datas = { ping: true }; // const datas = { ping: true };
// this.wsObj.send(JSON.stringify(datas)); // _this.wsObj.send(JSON.stringify(datas));
// } catch (err) { // } catch (err) {
// writeToScreen("发送ping异常"); // writeToScreen("发送ping异常");
// } // }

View File

@ -6,28 +6,33 @@ import store from "@/store";
const timestr = new Date().getTime() const timestr = new Date().getTime()
const dcsConn = new WsConnect( const dcsConn = new WsConnect(
// websocket地址 // websocket地址
process.env.VUE_APP_Socket_Dcs_API + '/xc-screen/websocket/dcsmsg'+timestr, process.env.VUE_APP_Socket_Dcs_API + '/xc-screen/websocket/dcsmsg' + timestr,
// 传递给后台的数据 // 传递给后台的数据
'', '',
(data) => { (data) => {
// console.log('dcs成功的回调函数, 接收到的data数据: ', data) // console.log('dcs成功的回调函数, 接收到的data数据: ', data)
let msgData = JSON.parse(data) let msgData = {}
try {
msgData = JSON.parse(data)
} catch (error) {
console.log("websocket: [unable to msgData] : ", data);
}
if (msgData == null) return; if (msgData == null) return;
switch (msgData?.type) { switch (msgData?.type) {
case "FanFrequencyInfo": { case "FanFrequencyInfo": {
store.dispatch({type: "websocket/setFanFrequencyInfo", payload:msgData.data.FanFrequencyInfo}) store.dispatch({ type: "websocket/setFanFrequencyInfo", payload: msgData.data.FanFrequencyInfo })
break; break;
} }
case "KilnInfo": { case "KilnInfo": {
store.dispatch({type: "websocket/setKilnInfo", payload: msgData.data}) store.dispatch({ type: "websocket/setKilnInfo", payload: msgData.data })
break; break;
} }
case "GasInfo": { case "GasInfo": {
store.dispatch({type: "websocket/setGasInfo", payload: msgData.data}) store.dispatch({ type: "websocket/setGasInfo", payload: msgData.data })
break; break;
} }
case "SumGasInfo": { case "SumGasInfo": {
store.dispatch({type: "websocket/setSumGasInfo", payload: msgData.data}) store.dispatch({ type: "websocket/setSumGasInfo", payload: msgData.data })
break; break;
} }
default: default:
@ -39,16 +44,20 @@ const dcsConn = new WsConnect(
) )
// ISRA // ISRA
const mesIsra = new WsConnect( const mesIsra = new WsConnect(
process.env.VUE_APP_Socket_API + '/websocket/message?userId=KILN'+timestr, process.env.VUE_APP_Socket_API + '/websocket/message?userId=KILN' + timestr,
'', '',
(data) => { (data) => {
// console.log('mes ISRA成功的回调函数, 接收到的data数据: ', data) // console.log('mes ISRA成功的回调函数, 接收到的data数据: ', data)
let msgData = JSON.parse(data) let msgData = {}
// console.log(msgData) try {
msgData = JSON.parse(data)
} catch (error) {
console.log("websocket: [unable to msgData] : ", data);
}
if (msgData == null) return; if (msgData == null) return;
switch (msgData?.type) { switch (msgData?.type) {
case "israKiln": { case "israKiln": {
store.dispatch({type: "websocket/setIsraKiln", payload:msgData.detData.dayStatistic}) store.dispatch({ type: "websocket/setIsraKiln", payload: msgData.detData.dayStatistic })
break; break;
} }
default: default:
@ -61,15 +70,20 @@ const mesIsra = new WsConnect(
// 原料 MA // 原料 MA
const mesMA = new WsConnect( const mesMA = new WsConnect(
process.env.VUE_APP_Socket_API + '/websocket/message?userId=MA'+timestr, process.env.VUE_APP_Socket_API + '/websocket/message?userId=MA' + timestr,
'', '',
(data) => { (data) => {
// console.log('mes 原料成功的回调函数, 接收到的data数据: ', data) // console.log('mes 原料成功的回调函数, 接收到的data数据: ', data)
let msgData = JSON.parse(data) let msgData = {}
try {
msgData = JSON.parse(data)
} catch (error) {
console.log("websocket: [unable to msgData] : ", data);
}
if (msgData == null) return; if (msgData == null) return;
switch (msgData?.type) { switch (msgData?.type) {
case "material": { case "material": {
store.dispatch({type: "websocket/setMaterial", payload:msgData.data}) store.dispatch({ type: "websocket/setMaterial", payload: msgData.data })
break; break;
} }
default: default:
@ -82,25 +96,30 @@ const mesMA = new WsConnect(
// 能耗 EN // 能耗 EN
const mesEN = new WsConnect( const mesEN = new WsConnect(
// websocket地址 // websocket地址
process.env.VUE_APP_Socket_API + '/websocket/message?userId=ENERGY'+timestr, process.env.VUE_APP_Socket_API + '/websocket/message?userId=ENERGY' + timestr,
// 传递给后台的数据 // 传递给后台的数据
'', '',
// 成功拿到后台返回的数据的回调函数 // 成功拿到后台返回的数据的回调函数
(data) => { (data) => {
// console.log('mes 能耗成功的回调函数, 接收到的data数据: ', data) // console.log('mes 能耗成功的回调函数, 接收到的data数据: ', data)
let msgData = JSON.parse(data) let msgData = {}
try {
msgData = JSON.parse(data)
} catch (error) {
console.log("websocket: [unable to msgData] : ", data);
}
if (msgData == null) return; if (msgData == null) return;
switch (msgData?.type) { switch (msgData?.type) {
case "EnergyInfo": { case "EnergyInfo": {
store.dispatch({type: "websocket/setEnergyInfo", payload:msgData.data}) store.dispatch({ type: "websocket/setEnergyInfo", payload: msgData.data })
break; break;
} }
case "EnergyTrend": { case "EnergyTrend": {
store.dispatch({type: "websocket/setEnergyTrend", payload:msgData.data}) store.dispatch({ type: "websocket/setEnergyTrend", payload: msgData.data })
break; break;
} }
case "EnergyMonitoring": { case "EnergyMonitoring": {
store.dispatch({type: "websocket/setEnergyMonitoring", payload:msgData.data}) store.dispatch({ type: "websocket/setEnergyMonitoring", payload: msgData.data })
break; break;
} }
default: default:
@ -114,23 +133,30 @@ const mesEN = new WsConnect(
// 烟气 GAS // 烟气 GAS
const mesGAS = new WsConnect( const mesGAS = new WsConnect(
// websocket地址 // websocket地址
process.env.VUE_APP_Socket_API + '/websocket/message?userId=GAS'+timestr, process.env.VUE_APP_Socket_API + '/websocket/message?userId=GAS' + timestr,
// 传递给后台的数据 // 传递给后台的数据
'', '',
// 成功拿到后台返回的数据的回调函数 // 成功拿到后台返回的数据的回调函数
(data) => { (data) => {
// console.log('mes 烟气成功的回调函数, 接收到的data数据: ', data) // console.log('mes 烟气成功的回调函数, 接收到的data数据: ', data)
let msgData = JSON.parse(data) let msgData = {}
try {
msgData = JSON.parse(data)
} catch (error) {
console.log("websocket: [unable to msgData] : ", data);
}
if (msgData == null) return; if (msgData == null) return;
switch (msgData?.type) { switch (msgData?.type) {
case "exhaustGas": { case "exhaustGas": {
store.dispatch({type: "websocket/setExhaustGasInfo", payload:msgData.realtime}) store.dispatch({ type: "websocket/setExhaustGasInfo", payload: msgData.realtime })
store.dispatch({type: "websocket/setExhaustGasChart", payload:{ store.dispatch({
dayTrend: msgData.dayTrend, type: "websocket/setExhaustGasChart", payload: {
weekTrend: msgData.weekTrend, dayTrend: msgData.dayTrend,
monthTrend: msgData.monthTrend, weekTrend: msgData.weekTrend,
yearTrend: msgData.yearTrend, monthTrend: msgData.monthTrend,
}}) yearTrend: msgData.yearTrend,
}
})
break; break;
} }
default: default:
@ -145,23 +171,30 @@ const mesGAS = new WsConnect(
// 缺陷分类/统计 IS // 缺陷分类/统计 IS
const mesIS = new WsConnect( const mesIS = new WsConnect(
// websocket地址 // websocket地址
process.env.VUE_APP_Socket_API + '/websocket/message?userId=IS'+timestr, process.env.VUE_APP_Socket_API + '/websocket/message?userId=IS' + timestr,
// 传递给后台的数据 // 传递给后台的数据
'', '',
// 成功拿到后台返回的数据的回调函数 // 成功拿到后台返回的数据的回调函数
(data) => { (data) => {
// console.log('mes 缺陷成功的回调函数, 接收到的data数据: ', data) // console.log('mes 缺陷成功的回调函数, 接收到的data数据: ', data)
let msgData = JSON.parse(data) let msgData = {}
try {
msgData = JSON.parse(data)
} catch (error) {
console.log("websocket: [unable to msgData] : ", data);
}
if (msgData == null) return; if (msgData == null) return;
switch (msgData?.type) { switch (msgData?.type) {
case "isra": { case "isra": {
store.dispatch({type: "websocket/setDefectChart", payload:{ store.dispatch({
checkType: msgData.detData.checkType, type: "websocket/setDefectChart", payload: {
dayStatistic: msgData.detData.dayStatistic, checkType: msgData.detData.checkType,
weekStatistic: msgData.detData.weekStatistic, dayStatistic: msgData.detData.dayStatistic,
monthStatistic: msgData.detData.monthStatistic, weekStatistic: msgData.detData.weekStatistic,
yearStatistic: msgData.detData.yearStatistic, monthStatistic: msgData.detData.monthStatistic,
}}) yearStatistic: msgData.detData.yearStatistic,
}
})
break; break;
} }
default: default:
@ -176,29 +209,34 @@ const mesIS = new WsConnect(
// 深加工生产运行驾驶舱(除能源) SJG // 深加工生产运行驾驶舱(除能源) SJG
const mesSJG = new WsConnect( const mesSJG = new WsConnect(
// websocket地址 // websocket地址
process.env.VUE_APP_Socket_API + '/websocket/message?userId=SJG'+timestr, process.env.VUE_APP_Socket_API + '/websocket/message?userId=SJG' + timestr,
// 传递给后台的数据 // 传递给后台的数据
'', '',
// 成功拿到后台返回的数据的回调函数 // 成功拿到后台返回的数据的回调函数
(data) => { (data) => {
// console.log('mes 产线产量及良品率成功的回调函数, 接收到的data数据: ', data) // console.log('mes 产线产量及良品率成功的回调函数, 接收到的data数据: ', data)
let msgData = JSON.parse(data) let msgData = {}
try {
msgData = JSON.parse(data)
} catch (error) {
console.log("websocket: [unable to msgData] : ", data);
}
if (msgData == null) return; if (msgData == null) return;
switch (msgData?.type) { switch (msgData?.type) {
case "productline": { case "productline": {
store.dispatch({type: "websocket/setProductline", payload:msgData.detData}) store.dispatch({ type: "websocket/setProductline", payload: msgData.detData })
break; break;
} }
case "equipment": { case "equipment": {
store.dispatch({type: "websocket/setSJGEq", payload:msgData.detData}) store.dispatch({ type: "websocket/setSJGEq", payload: msgData.detData })
break; break;
} }
case "order": { case "order": {
store.dispatch({type: "websocket/setWorkOrder", payload:msgData.detData}) store.dispatch({ type: "websocket/setWorkOrder", payload: msgData.detData })
break; break;
} }
case "defectSum": { case "defectSum": {
store.dispatch({type: "websocket/setDefectSum", payload:msgData.detData}) store.dispatch({ type: "websocket/setDefectSum", payload: msgData.detData })
break; break;
} }
default: default:
@ -213,18 +251,23 @@ const mesSJG = new WsConnect(
// 订单完成情况 OV // 订单完成情况 OV
const mesOV = new WsConnect( const mesOV = new WsConnect(
// websocket地址 // websocket地址
process.env.VUE_APP_Socket_API + '/websocket/message?userId=OV'+timestr, process.env.VUE_APP_Socket_API + '/websocket/message?userId=OV' + timestr,
// 'ws://192.168.0.33:48082/websocket/message?userId=OV'+timestr, // 'ws://192.168.0.33:48082/websocket/message?userId=OV'+timestr,
// 传递给后台的数据 // 传递给后台的数据
'', '',
// 成功拿到后台返回的数据的回调函数 // 成功拿到后台返回的数据的回调函数
(data) => { (data) => {
// console.log('mes 产线产量及良品率成功的回调函数, 接收到的data数据: ', data) // console.log('mes 产线产量及良品率成功的回调函数, 接收到的data数据: ', data)
let msgData = JSON.parse(data) let msgData = {}
try {
msgData = JSON.parse(data)
} catch (error) {
console.log("websocket: [unable to msgData] : ", data);
}
if (msgData == null) return; if (msgData == null) return;
switch (msgData?.type) { switch (msgData?.type) {
case "order": { case "order": {
store.dispatch({type: "websocket/setOrder", payload:msgData.detData}) store.dispatch({ type: "websocket/setOrder", payload: msgData.detData })
break; break;
} }
default: default:
@ -239,35 +282,39 @@ const mesOV = new WsConnect(
// 本日生产良品率 CUTTING // 本日生产良品率 CUTTING
const mesCUTTING = new WsConnect( const mesCUTTING = new WsConnect(
// websocket地址 // websocket地址
process.env.VUE_APP_Socket_API + '/websocket/message?userId=CUTTING'+timestr, process.env.VUE_APP_Socket_API + '/websocket/message?userId=CUTTING' + timestr,
// 传递给后台的数据 // 传递给后台的数据
'', '',
// 成功拿到后台返回的数据的回调函数 // 成功拿到后台返回的数据的回调函数
(data) => { (data) => {
// console.log('mes 产线产量及良品率成功的回调函数, 接收到的data数据: ', data) // console.log('mes 产线产量及良品率成功的回调函数, 接收到的data数据: ', data)
let msgData = JSON.parse(data) let msgData = {}
try {
msgData = JSON.parse(data)
} catch (error) {
console.log("websocket: [unable to msgData] : ", data);
}
if (msgData == null) return; if (msgData == null) return;
console.log(msgData)
switch (msgData?.type) { switch (msgData?.type) {
case "cutting": { case "cutting": {
if (msgData?.name === 'table') { if (msgData?.name === 'table') {
store.dispatch({type: "websocket/setYieldRateTable", payload:msgData.data}) store.dispatch({ type: "websocket/setYieldRateTable", payload: msgData.data })
return return
} }
if (msgData?.dateType === 'day') { if (msgData?.dateType === 'day') {
store.dispatch({type: "websocket/setCutChartDay", payload:msgData.detData}) store.dispatch({ type: "websocket/setCutChartDay", payload: msgData.detData })
return return
} }
if (msgData?.dateType === 'weekly') { if (msgData?.dateType === 'weekly') {
store.dispatch({type: "websocket/setCutChartWeek", payload:msgData.detData}) store.dispatch({ type: "websocket/setCutChartWeek", payload: msgData.detData })
return return
} }
if (msgData?.dateType === 'month') { if (msgData?.dateType === 'month') {
store.dispatch({type: "websocket/setCutChartMonth", payload:msgData.detData}) store.dispatch({ type: "websocket/setCutChartMonth", payload: msgData.detData })
return return
} }
if (msgData?.dateType === 'year') { if (msgData?.dateType === 'year') {
store.dispatch({type: "websocket/setCutChartYear", payload:msgData.detData}) store.dispatch({ type: "websocket/setCutChartYear", payload: msgData.detData })
return return
} }
break; break;