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

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

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

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

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

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

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

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

Loading…
Cancel
Save