|
@@ -11,7 +11,8 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<template slot-scope="{row,index}" slot="menu">
|
|
<template slot-scope="{row,index}" slot="menu">
|
|
- <operations :id="row.id" :data="row" :index="index" @display-detail="onDisplayDetail" />
|
|
|
|
|
|
+ <operations :id="row.id" :data="row" :index="index" @display-detail="onDisplayDetail"
|
|
|
|
+ @delete-room="onDeleteRoom" />
|
|
</template>
|
|
</template>
|
|
</avue-crud>
|
|
</avue-crud>
|
|
<liveroom-info :item="item" @close-dialog="item = null" />
|
|
<liveroom-info :item="item" @close-dialog="item = null" />
|
|
@@ -63,6 +64,25 @@ export default Vue.extend({
|
|
},
|
|
},
|
|
onDisplayDetail({ id, index }: { id: number, index: number }) {
|
|
onDisplayDetail({ id, index }: { id: number, index: number }) {
|
|
this.item = this.dataList[index]
|
|
this.item = this.dataList[index]
|
|
|
|
+ },
|
|
|
|
+ onDeleteRoom({ id, index }: { id: number, index: number }) {
|
|
|
|
+ const room = this.dataList[index]
|
|
|
|
+ this.$confirm(`确定删除直播间 “${room.title}”?`, '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ console.log(id)
|
|
|
|
+ httpx.post("/rooms/deleteRoom", { id }
|
|
|
|
+ ).then(({ data }) => {
|
|
|
|
+ this.getDataList()
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '操作成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ duration: 1500,
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|