1.修复语音文字提醒不显示问题

master
董哲奇 7 months ago
parent 3b994f75d6
commit a7b1cbafd8

@ -1,6 +1,6 @@
<template>
<div class="component">
<el-radio-group class="radio-group-label" v-model="data.zyType" @change="changePage" :style="{width: zyTypeWidth}">
<el-radio-group v-if="qtbs" class="radio-group-label" v-model="data.zyType" @change="changePage" :style="{width: zyTypeWidth}">
<el-radio class="custom-radio-green" label="0" style="color: white">派工</el-radio>
<el-radio class="custom-radio-red" v-if="!ljbs" label="1" style="color: white"></el-radio>
<el-radio class="custom-radio-green" v-if="ljbs" label="10" style="color: white"></el-radio>
@ -19,6 +19,7 @@ export default {
name:"ZyjhSelectComp",
data(){
return {
qtbs:true,
ljbs:false,
deviceId:null,
zyTypeWidth:'20%',
@ -46,6 +47,9 @@ export default {
this.data.zyType=this.$route.query.zyType||'0'
const path=this.$route.path.replace('/','')
this.nextPath=this.nextPathName[path].path
if (path==='sliao'){
this.qtbs=false
}
if (path==='ljian'){
this.zyTypeWidth='43%'
this.ljbs=true

@ -9,7 +9,7 @@ export default {
name: "TipsComp",
data(){
return {
showStatus:false,
showStatus:true,
width:0,
height:0,
stage:null,
@ -21,7 +21,10 @@ export default {
开始报工:'开始报工',
确认完毕:'确认完毕',
执行成功:'执行成功',
}
},
msgFlag:false,
timeoutId3001:null,
timeoutId3002:null,
}
},
mounted(){
@ -29,21 +32,25 @@ export default {
},
created(){
this.deviceId=this.$route.query.deviceId||''
console.log(this.deviceId)
},
sockets:{
tip(data){
if (data.code===3001&&data.msg.deviceId===this.$props.deviceId){
this.onMsg(`语音设备已暂停,请再次说出"${this.commandEnum.大船大船}"激活语音设备`,true)
setTimeout(()=>{
this.hide()
},10000)
}
if (data.code===3002&&data.msg.deviceId===this.$props.deviceId){
this.show()
!!this.timeoutId3001&&clearTimeout(this.timeoutId3001)
!!this.timeoutId3002&&clearTimeout(this.timeoutId3002)
// if (data.code===3001&&data.msg.deviceId===this.deviceId){
// this.msgFlag&&this.onMsg(`,"${this.commandEnum.}"`,true)
// this.msgFlag=false
// this.timeoutId3001=setTimeout(()=>{
// this.hide()
// },10000)
// }
if (data.code===3002&&data.msg.deviceId===this.deviceId){
let msg
switch (data.msg.actionType){
case this.commandEnum.大船大船:
this.msgFlag=true
msg='设备已激活,请说出"开始派工"/"开始报工"'
break;
case this.commandEnum.开始派工:
@ -53,17 +60,27 @@ export default {
msg=`${data.msg.actionType},请说出派工单号后"确认完毕"`
break;
case this.commandEnum.确认完毕:
msg='正中处理中,请稍后...'
msg=`正中处理中,请稍后...`
break;
default:
msg=data.msg.actionType
}
this.onMsg(msg)
this.timeoutId3002=setTimeout(()=>{
this.msgFlag&&this.onMsg(`语音设备已暂停,请再次说出"${this.commandEnum.大船大船}"激活语音设备`,true)
this.msgFlag=false
this.timeoutId3001=setTimeout(()=>{
this.hide()
},10000)
},59000)
this.msgFlag&&this.show()
this.msgFlag&&this.onMsg(msg)
}
},
complete(){
if (data.code===3000&&data.msg.deviceId===this.$props.deviceId){
this.onMsg("设备激活中,您需要派工/报工?")
this.msgFlag&&this.onMsg("设备激活中,您可以继续派工/报工?",true)
}
}
},
@ -79,6 +96,7 @@ export default {
const {stage,layer}=container(this.width,this.height,'tips')
this.stage=stage
this.layer=layer
this.showStatus=false
},
hide(){
this.showStatus = false;

@ -139,7 +139,7 @@ export default function (width,height){
text: persons.userName,
align: 'center',
verticalAlign:'middle',
fill:'#fff',
fill:'#000',
fontSize:16
})
group.add(text)

@ -130,7 +130,6 @@ export default {
this.pgdShow=true
},
clear(){
console.log('qgpg')
this.stage.remove()
}
}

@ -51,7 +51,7 @@ const workers=function (width,height,persons) {
group.add(_group)
}
return bgGroup
return {bgGroup,group}
}
let currentWork=null;
@ -152,7 +152,7 @@ const workers=function (width,height,persons) {
}
return {
container,getCurrentWorker
container,getCurrentWorker,person
}
}

@ -1,8 +1,8 @@
<template>
<div>
<div id="sliao" class="sliao" ref="sliao"></div>
<SliaoSearch ref="sliaoSearch" @search="search" />
<TipsComp ref="tipsRef" :msg="msg" />
<SliaoSearch ref="sliaoSearch" @search="search" :workers="workers"/>
<ZyjhSelectComp id="selectComp" ref="selRef" @initWorkers="initWorkers" @clear="clear"/>
</div>
</template>
@ -19,10 +19,11 @@ import baifang from "@/views/zyjhzx/sliao/comps/baifang";
import {dict, getSljhPgd, getYcldw, shangLiao} from "@/api/zyjh";
import {getBzryList} from "@/api/sjzx/bzzGL";
import TipsComp from "@/views/zyjhzx/components/TipsComp.vue";
import ZyjhSelectComp from "@/views/zyjhzx/components/SelectComp.vue";
export default {
name:'SLiao',
components: {TipsComp, SliaoSearch},
components: {ZyjhSelectComp, TipsComp, SliaoSearch},
data(){
return {
title:'上 料 作 业 报 工',
@ -35,6 +36,7 @@ export default {
drawBaiFang:null,
ycldwGroup:null,
canSl:false,
workerGroup:null,
getCurrentWorker:null,
currentDw:null,
currentDwIndex:-1,
@ -419,13 +421,26 @@ export default {
this.layer.add(group)
})
},
initWorkers(){
getBzryList({resourcesCode:'4KB002'}).then(res=>{
this.workers=res.data
const {container,getCurrentWorker}=workers(this.width,this.height,this.workers)
const group=container()
initWorkers(bzType){
if (this.workerGroup){
this.workerGroup.destroyChildren()
}else{
const {container,getCurrentWorker,person}=workers(this.width,this.height,this.workers)
this.person=person
const {bgGroup,group}=container()
this.workerGroup=group
this.getCurrentWorker=getCurrentWorker
this.layer.add(group)
this.layer.add(bgGroup)
}
this.workerGroup.x(0)
this.workerGroup.y(0)
getBzryList({zyq:this.$route.query.zyq,zt:bzType}).then(res=>{
this.workers=res.data
for (let i=0;i<res.data.length;i++){
const item=res.data[i]
const worker=this.person(i,item)
this.workerGroup.add(worker)
}
})
},
initKonvaStage(){
@ -448,18 +463,31 @@ export default {
this.sljhGroup=sljhGroup
this.stage.add(sljhLayer)
this.initWorkers()
this.initWorkers(this.$refs.selRef.getData().bzType)
this.initYcldw()
this.initBaiFang()
},
clear(){
this.stage.remove()
}
}
}
</script>
<style>
#selectComp {
width:50%;
height: auto;
position: absolute;
top:10px;
left:20px;
border: none;
margin: 0;
}
.vxe-button{
top: 0px;
width: 80px;

Loading…
Cancel
Save