改造广播设备管理

This commit is contained in:
aixianling
2023-04-18 09:34:11 +08:00
parent d49d93b19d
commit da9b3b2add
3 changed files with 29 additions and 73 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div class="AppEquipmentManage">
<keep-alive :include="['List']">
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
<component :is="currentPage" v-bind="$props"/>
</keep-alive>
</div>
</template>
@@ -17,38 +17,13 @@ export default {
instance: Function,
dict: Object,
},
data() {
return {
component: 'List',
params: {},
include: [],
}
computed: {
currentPage: v => v.$route.hash == "#taskList" ? taskList : List
},
components: {
List,
taskList,
},
methods: {
onChange(data) {
if (data.type === 'taskList') {
this.component = 'taskList'
this.params = data.params
}
if (data.type == 'list') {
this.component = 'List'
this.params = data.params
this.$nextTick(() => {
if (data.isRefresh) {
this.$refs.component.getList()
}
})
}
},
},
}
}
</script>

View File

@@ -49,9 +49,7 @@ export default {
props: {
dict: Object,
instance: Function,
params: Object,
},
data() {
return {
isAdd: false,
@@ -113,17 +111,13 @@ export default {
locate: false
}
},
computed: {
...mapState(['user']),
},
created() {
this.dict.load('dlbDevStatus', 'yesOrNo').then(() => {
this.getList()
})
this.getList()
this.dict.load('dlbDevStatus', 'yesOrNo')
},
methods: {
bind(item) {
this.areaId = ''
@@ -186,13 +180,7 @@ export default {
},
toTaskList(id) {
this.$emit('change', {
type: 'taskList',
params: {
id: id || '',
// areaId: this.areaId,
},
})
this.$router.push({hash: "#taskList", query: {id}})
},
update() {
this.btnLoading = true

View File

@@ -1,7 +1,7 @@
<template>
<section class="taskList">
<ai-list>
<ai-title slot="title" title="任务列表" isShowBack isShowBottomBorder @onBackClick="cancel(true)"/>
<ai-title slot="title" title="任务列表" isShowBack isShowBottomBorder @onBackClick="cancel"/>
<template #content>
<ai-search-bar bottomBorder>
<template slot="right">
@@ -25,13 +25,13 @@
</template>
<script>
import {mapMutations} from "vuex";
export default {
name: 'taskList',
components: {},
props: {
dict: Object,
instance: Function,
params: Object,
},
data() {
return {
@@ -54,16 +54,16 @@ export default {
label: '媒资类型',
width: '200',
align: 'center',
render: (h, { row })=>{
return h('span',null,this.dict.getLabel('dlbResourceType',row.type))
render: (h, {row}) => {
return h('span', null, this.dict.getLabel('dlbResourceType', row.type))
}
},
{
prop: 'messageLevel',
label: '级别',
align: 'center',
render: (h, { row })=>{
return h('span',null,this.dict.getLabel('dlbMessageUrgency',row.messageLevel))
render: (h, {row}) => {
return h('span', null, this.dict.getLabel('dlbMessageUrgency', row.messageLevel))
}
},
{
@@ -72,7 +72,7 @@ export default {
width: '220',
align: 'center',
render: (h, {row}) => {
return h('span', null, (row.taskType == 1? '定时播放':'立即播放'))
return h('span', null, (row.taskType == 1 ? '定时播放' : '立即播放'))
},
},
{
@@ -85,8 +85,8 @@ export default {
prop: 'broadcastStatus',
label: '状态',
align: 'center',
render: (h, { row })=>{
return h('span',null, (row.broadcastStatus == 0? '已下发': row.broadcastStatus == 3? '播发成功': row.broadcastStatus == 6? '已取消': ''))
render: (h, {row}) => {
return h('span', null, (row.broadcastStatus == 0 ? '已下发' : row.broadcastStatus == 3 ? '播发成功' : row.broadcastStatus == 6 ? '已取消' : ''))
}
},
{
@@ -103,27 +103,23 @@ export default {
}
},
created() {
this.$dict.load('dlbDyclingType','dlbMessageUrgency','dlbBroadcastStatus','dlbResourceType').then(()=>{
this.getList()
})
this.setPageTitle("设备任务列表")
this.dict.load('dlbDyclingType', 'dlbMessageUrgency', 'dlbBroadcastStatus', 'dlbResourceType')
this.getList()
},
methods: {
...mapMutations(['setPageTitle']),
getList() {
this.instance.post(`/app/appzyvideobroadcast/list?deviceId`,null,{
params: {
...this.page,
...this.search,
deviceId: this.params.deviceId
}
}).then(res=>{
if(res?.data) {
const {id: deviceId} = this.$route.query
this.instance.post(`/app/appzyvideobroadcast/list`, null, {
params: {...this.page, ...this.search, deviceId}
}).then(res => {
if (res?.data) {
this.tableData = res.data.records
this.page.total = res.data.total
}
})
},
reset(id) {
this.$confirm('确定要撤回该任务吗?').then(() => {
this.instance.post(`/app/appzyvideobroadcast/getBroadcastRecall?broadcastId=${id}`).then((res) => {
@@ -134,11 +130,8 @@ export default {
})
})
},
cancel(isRefresh) {
this.$emit('change', {
type: 'list',
isRefresh: !!isRefresh,
})
cancel() {
this.$router.push({})
},
},
}
@@ -148,4 +141,4 @@ export default {
.taskList {
height: 100%;
}
</style>
</style>