lcw
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
<el-input-number v-model="listQuery[item.prop]" v-else-if="item.type == 'number'" :step="item.step || 1" style="width: 100%" :min="item.min || 0" :max="item.max || 1000" :disabled="item.disabled" />
|
||||
|
||||
<!--选择 select-->
|
||||
<MOSTY.Select v-else-if="item.type == 'select'" filterable :multiple="item.multiple" v-model="listQuery[item.prop]" :dictEnum="item.options" width="100%" clearable :placeholder="`请选择${item.label}`" :disabled="item.disabled" />
|
||||
<MOSTY.Select v-else-if="item.type == 'select'" :filterable="item.filterable" :multiple="item.multiple" v-model="listQuery[item.prop]" :dictEnum="item.options" width="100%" clearable :placeholder="`请选择${item.label}`" :disabled="item.disabled" />
|
||||
|
||||
<!-- 部门department -->
|
||||
<template v-else-if="item.type === 'department'">
|
||||
|
||||
@ -30,20 +30,40 @@ const countdown = ref(0) // 倒计时时间(秒)
|
||||
|
||||
// 音频播放器实例映射
|
||||
const audioPlayers = ref({
|
||||
'01': null, // 预警信息
|
||||
'02': null, // 信息上报
|
||||
'03': null, // 研判审批
|
||||
'04': null, // 研判指令
|
||||
'05': null, // 线索下发,
|
||||
'06': null, // 警情监测
|
||||
'07': null, // 线索处理
|
||||
'08': null, // 线索下发
|
||||
'09': null, // 线索处理
|
||||
'10': null, // 林安码
|
||||
'11': null, // 发布了新的线索
|
||||
'12': null, // 有新的研判指令
|
||||
'13': null, // 有新的研判约稿通知
|
||||
'14': null, // 有新的公文发布
|
||||
'15': null, // 有新的待审核工作(补发音效)
|
||||
})
|
||||
|
||||
// 音频文件路径映射
|
||||
const audioPaths = {
|
||||
'02': require('@/assets/images/cjyp.mp3'),
|
||||
'03': require('@/assets/images/ypbg.mp3'),
|
||||
'04': require('@/assets/images/ypzl.mp3'),
|
||||
'05': require('@/assets/images/xsyp.mp3'),
|
||||
'06': require('@/assets/images/jqjc.mp3')
|
||||
'01': require('@/assets/images/01.mp3'),//高级预计信息前置
|
||||
'02': require('@/assets/images/02.mp3'),//一般预警信息前置
|
||||
'03': require('@/assets/images/03.mp3'),//信息前置
|
||||
'04': require('@/assets/images/04.mp3'),//红色预警
|
||||
'05': require('@/assets/images/05.mp3'),//新的重点人
|
||||
'06': require('@/assets/images/06.mp3'),//一级临控预警
|
||||
'07': require('@/assets/images/07.mp3'),//有新的布控预警情
|
||||
'08': require('@/assets/images/08.mp3'),//有新的标签预警
|
||||
'09': require('@/assets/images/09.mp3'),//信息汇聚系统有新信息
|
||||
'10': require('@/assets/images/10.mp3'),//林安码
|
||||
'11': require('@/assets/images/11.mp3'),//发布了新的线索
|
||||
'12': require('@/assets/images/12.mp3'),//有新的研判指令
|
||||
'13': require('@/assets/images/13.mp3'),//有新的研判约稿通知
|
||||
'14': require('@/assets/images/14.mp3'),//有新的公文发布
|
||||
'15': require('@/assets/images/16.mp3'),//有新的警情监测预警,请注意查收
|
||||
}
|
||||
|
||||
// 初始化音频播放器
|
||||
@ -59,14 +79,85 @@ const initAudioPlayers = () => {
|
||||
}
|
||||
|
||||
// 根据类型播放音频
|
||||
const playAudioByType = (type) => {
|
||||
if (audioPlayers.value[type]) {
|
||||
try {
|
||||
audioPlayers.value[type].play()
|
||||
} catch (error) {
|
||||
console.error(`播放类型${type}的音频失败:`, error)
|
||||
}
|
||||
const playAudioByType = (val) => {
|
||||
|
||||
|
||||
switch (val.typeMasgeLx) {
|
||||
case '01'://预警
|
||||
// 01 布控预警、02 七类重点人、03 政保
|
||||
switch (val.yjlb) {
|
||||
case '01':
|
||||
switch (val.yjJb) {
|
||||
case '01':
|
||||
audioPlayers.value['01'].play()
|
||||
audioPlayers.value['06'].play()
|
||||
break;
|
||||
default:
|
||||
audioPlayers.value['02'].play()
|
||||
audioPlayers.value['07'].play()
|
||||
break;
|
||||
}
|
||||
break
|
||||
case '02':
|
||||
switch (val.yjJb) {
|
||||
case '01':
|
||||
audioPlayers.value['01'].play()
|
||||
audioPlayers.value['04'].play()
|
||||
break;
|
||||
default:
|
||||
audioPlayers.value['02'].play()
|
||||
audioPlayers.value['05'].play()
|
||||
break;
|
||||
}
|
||||
break
|
||||
case '03':
|
||||
break
|
||||
}
|
||||
break
|
||||
case '02'://信息汇聚
|
||||
audioPlayers.value['03'].play()
|
||||
audioPlayers.value['09'].play()
|
||||
break
|
||||
case '03'://约稿
|
||||
audioPlayers.value['03'].play()
|
||||
audioPlayers.value['13'].play()
|
||||
break
|
||||
case '04'://指令
|
||||
audioPlayers.value['03'].play()
|
||||
audioPlayers.value['12'].play()
|
||||
break
|
||||
case '05'://新线索
|
||||
audioPlayers.value['03'].play()
|
||||
audioPlayers.value['11'].play()
|
||||
break
|
||||
case '06'://监测
|
||||
audioPlayers.value['02'].play()
|
||||
audioPlayers.value['15'].play()
|
||||
break
|
||||
// case '07':
|
||||
// audioPlayers.value['07'].play()
|
||||
// break
|
||||
case '08'://林安码
|
||||
audioPlayers.value['03'].play()
|
||||
audioPlayers.value['10'].play()
|
||||
break
|
||||
// case '10':
|
||||
// audioPlayers.value['10'].play()
|
||||
// break
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// if (audioPlayers.value[type]) {
|
||||
// try {
|
||||
// audioPlayers.value[type].play()
|
||||
// } catch (error) {
|
||||
// console.error(`播放类型${type}的音频失败:`, error)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
// 手动关闭
|
||||
const handleClose = () => {
|
||||
@ -108,7 +199,7 @@ onMounted(() => {
|
||||
dataList.value = newsDate
|
||||
// dataList.value.unshift({...newsDate.data,typeMasgeLx:newsDate.type})
|
||||
// 根据消息类型播放音频
|
||||
playAudioByType(newsDate[0].typeMasgeLx)
|
||||
playAudioByType(newsDate[0])
|
||||
resetCountdown()
|
||||
}
|
||||
})
|
||||
@ -117,20 +208,19 @@ const idEntityCard = ref(getItem('idEntityCard'))
|
||||
const dataModel = () => {
|
||||
qcckGet({}, '/mosty-gsxt/dsjJbxx/message').then(res => {
|
||||
if (res) {
|
||||
const yjmasg = res.filter(item => item.type === '01')
|
||||
if (yjmasg.length > 0) {
|
||||
emitter.emit('openYp', yjmasg[0].obj); // 触发音频播放
|
||||
} else {
|
||||
const data = res.filter(item => item.sfzList.includes(idEntityCard.value))
|
||||
const infoMasge = data.map(item => {
|
||||
return {
|
||||
...item.obj,
|
||||
typeMasgeLx: item.type
|
||||
}
|
||||
})
|
||||
console.log(infoMasge,"xxxxxxxxxxxx");
|
||||
emitter.emit('webSocketMessage', infoMasge)
|
||||
}
|
||||
// const yjmasg = res.filter(item => item.type === '01')
|
||||
// if (yjmasg.length > 0) {
|
||||
// emitter.emit('openYp', yjmasg[0].obj); // 触发音频播放
|
||||
// }
|
||||
const data = res.filter(item => item.sfzList.includes(idEntityCard.value))
|
||||
const infoMasge = data.map(item => {
|
||||
return {
|
||||
...item.obj,
|
||||
typeMasgeLx: item.type
|
||||
}
|
||||
})
|
||||
console.log(infoMasge, "xxxxxxxxxxxx");
|
||||
emitter.emit('webSocketMessage', infoMasge)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@ -1,4 +1,12 @@
|
||||
<template>
|
||||
<div class="test-item" v-if="item.typeMasgeLx == '01'" @click="goDetail(item.id, item.typeMasgeLx, item)">
|
||||
<div class="item-header">
|
||||
<div class="item-title">{{ item.yjBt || '' }}</div>
|
||||
<div class="item-type">{{ item.yjlb == '01' ? '布控预警' : item.yjlb == '02' ? '七类重点人' : '政保' }}</div>
|
||||
</div>
|
||||
<div class="item-message">{{ item.yjNr }}</div>
|
||||
<div class="item-time">{{ item.yjSj || '' }}</div>
|
||||
</div>
|
||||
<div class="test-item" v-if="item.typeMasgeLx == '02'" @click="goDetail(item.id, item.typeMasgeLx)">
|
||||
<div class="item-header">
|
||||
<div class="item-title">{{ item.qbmc || '' }}</div>
|
||||
@ -9,11 +17,11 @@
|
||||
</div>
|
||||
<div class="test-item" v-if="item.typeMasgeLx == '03'" @click="goDetail(item.id, item.typeMasgeLx)">
|
||||
<div class="item-header">
|
||||
<div class="item-title">{{ item.bgmc || '' }}</div>
|
||||
<div class="item-title">{{ item.ypyt || '' }}</div>
|
||||
<div class="item-type">{{ informationMap[item.typeMasgeLx] }}</div>
|
||||
</div>
|
||||
<div class="item-message" v-html="item.bgnr"></div>
|
||||
<div class="item-time">{{ item.xtCjsj || '' }}</div>
|
||||
<div class="item-message">{{ item.ssbm }}</div>
|
||||
<div class="item-time">{{ item.ypsj || '' }}</div>
|
||||
</div>
|
||||
<div class="test-item" v-if="item.typeMasgeLx == '04'" @click="goDetail(item.id, item.typeMasgeLx)">
|
||||
<div class="item-header">
|
||||
@ -31,18 +39,27 @@
|
||||
<div class="item-message" v-html="item.zlnr"></div>
|
||||
<div class="item-time">{{ item.xtCjsj || '' }}</div>
|
||||
</div>
|
||||
<div class="test-item" v-if="item.typeMasgeLx == '06'" @click="goDetail(item.id, item.typeMasgeLx)">
|
||||
<div class="test-item" v-if="item.typeMasgeLx == '06'" @click="goDetail(item.id, item.typeMasgeLx)">
|
||||
<div class="item-header">
|
||||
<div class="item-title">{{ item.gxdwmc || '' }}</div>
|
||||
<div class="item-type">{{ informationMap[item.typeMasgeLx] }}</div>
|
||||
</div>
|
||||
<div class="item-message" >{{ item.bcjjnr }}</div>
|
||||
<div class="item-message">{{ item.bcjjnr }}</div>
|
||||
<div class="item-time">{{ item.bjsj || '' }}</div>
|
||||
</div>
|
||||
<div class="test-item" v-if="item.typeMasgeLx == '08'" @click="goDetail(item.id, item.typeMasgeLx)">
|
||||
<div class="item-header">
|
||||
<div class="item-title">{{ item.qbmc || '' }}</div>
|
||||
<div class="item-type">{{ informationMap[item.typeMasgeLx] }}</div>
|
||||
</div>
|
||||
<div class="item-message">{{ item.qbnr }}</div>
|
||||
<div class="item-time">{{ item.sxsbsj || '' }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
|
||||
import { useRouter } from 'vue-router'
|
||||
import emitter from "@/utils/eventBus.js"; // 导入
|
||||
const router = useRouter()
|
||||
const props = defineProps({
|
||||
item: {
|
||||
@ -51,32 +68,39 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
const informationMap = {
|
||||
'01': '报警信息',
|
||||
'01': '预警信息',
|
||||
'02': '信息上报',
|
||||
'03': '研判审批',
|
||||
'03': '研判约稿',
|
||||
'04': '研判指令',
|
||||
'05': '线索下发',
|
||||
'06': '警情监测',
|
||||
'08': '林安码信息',
|
||||
}
|
||||
const emit=defineEmits(['goDetail'])
|
||||
const goDetail = (id, lx) => {
|
||||
const emit = defineEmits(['goDetail'])
|
||||
const goDetail = (id, lx, val) => {
|
||||
let path = ''
|
||||
switch (lx) {
|
||||
case '01':
|
||||
emitter.emit('openYp', val);
|
||||
break;
|
||||
case '02':
|
||||
path = '/InfoCollection'
|
||||
break;
|
||||
case '03':
|
||||
path = '/strategicResearchs'
|
||||
path = '/dataReduction'
|
||||
break;
|
||||
default:
|
||||
case '04':
|
||||
path = '/judgmentCommand'
|
||||
break;
|
||||
case '05':
|
||||
path = '/InstructionInformation'
|
||||
case '05':
|
||||
path = '/InstructionInformation'
|
||||
break;
|
||||
case '06':
|
||||
path = '/policeReport'
|
||||
break;
|
||||
case '08':
|
||||
path = '/lamXs'
|
||||
break;
|
||||
case '06':
|
||||
path = '/policeReport'
|
||||
break;
|
||||
}
|
||||
router.push({
|
||||
path: path,
|
||||
|
||||
Reference in New Issue
Block a user