|
@@ -3,6 +3,7 @@ import { ElButton } from "element-plus";
|
|
|
import runtime, * as RuntimeUtils from '/src/components/live-broadcast/runtime'
|
|
|
import styles from './message.module.less';
|
|
|
import { state } from '/src/state'
|
|
|
+import request from '/src/helpers/request'
|
|
|
|
|
|
|
|
|
type optionsType = 'ALL' | 'JOIN'
|
|
@@ -21,21 +22,68 @@ export default defineComponent({
|
|
|
},
|
|
|
methods: {
|
|
|
async SeatsCtrl() {
|
|
|
- await RuntimeUtils.sendMessage({seatBan: runtime.allowSeatsCtrl, ...RuntimeUtils.getSendMessageUser()}, 'SeatsCtrl')
|
|
|
+ try {
|
|
|
+ const users = state.user
|
|
|
+ const roomConfig = users?.roomConfig ? JSON.parse(users?.roomConfig) : {}
|
|
|
+ await request.post('/api-web/imLiveBroadcastRoom/update', {
|
|
|
+ requestType: 'json',
|
|
|
+ data: {
|
|
|
+ id: users.id,
|
|
|
+ liveRemark: users.liveRemark,
|
|
|
+ liveStartTime: users.liveStartTime,
|
|
|
+ preTemplate: users.preTemplate,
|
|
|
+ roomConfig: {
|
|
|
+ whether_chat: runtime.allowChatCtrl ? 1 : 0,
|
|
|
+ whether_like: roomConfig.whether_like,
|
|
|
+ whether_mic: runtime.allowSeatsCtrl ? 1 : 0,
|
|
|
+ whether_video: roomConfig.whether_video
|
|
|
+ },
|
|
|
+ roomTitle: users.roomTitle,
|
|
|
+ speakerId: users.speakerId,
|
|
|
+ tenantId: users.tenantId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ await RuntimeUtils.sendMessage({ seatBan: runtime.allowSeatsCtrl, ...RuntimeUtils.getSendMessageUser() }, 'SeatsCtrl')
|
|
|
runtime.allowSeatsCtrl = !runtime.allowSeatsCtrl
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
},
|
|
|
async ChatBan() {
|
|
|
- await RuntimeUtils.sendMessage({chatBan: runtime.allowChatCtrl, ...RuntimeUtils.getSendMessageUser()}, 'ChatBan')
|
|
|
+ try {
|
|
|
+ const users = state.user
|
|
|
+ const roomConfig = users?.roomConfig ? JSON.parse(users?.roomConfig) : {}
|
|
|
+ await request.post('/api-web/imLiveBroadcastRoom/update', {
|
|
|
+ requestType: 'json',
|
|
|
+ data: {
|
|
|
+ id: users.id,
|
|
|
+ liveRemark: users.liveRemark,
|
|
|
+ liveStartTime: users.liveStartTime,
|
|
|
+ preTemplate: users.preTemplate,
|
|
|
+ roomConfig: {
|
|
|
+ whether_chat: runtime.allowChatCtrl ? 1 : 0,
|
|
|
+ whether_like: roomConfig.whether_like,
|
|
|
+ whether_video: roomConfig.whether_video,
|
|
|
+ whether_mic: roomConfig.whether_mic
|
|
|
+ },
|
|
|
+ roomTitle: users.roomTitle,
|
|
|
+ speakerId: users.speakerId,
|
|
|
+ tenantId: users.tenantId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ await RuntimeUtils.sendMessage({ chatBan: runtime.allowChatCtrl, ...RuntimeUtils.getSendMessageUser() }, 'ChatBan')
|
|
|
runtime.allowChatCtrl = !runtime.allowChatCtrl
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
render() {
|
|
|
return (
|
|
|
<div class={styles.message}>
|
|
|
<div class={styles.buttonGroup}>
|
|
|
- {/* class={[!runtime.allowChatCtrl ? styles.active : null, styles.btn]} */}
|
|
|
- {this.whetherChat ? <ElButton type={!runtime.allowChatCtrl ? 'primary' : 'info'} onClick={this.ChatBan} >{runtime.allowChatCtrl ? '全体禁言' : '关闭全体禁言'}</ElButton> : null}
|
|
|
- {/* class={[!runtime.allowSeatsCtrl ? styles.active : null, styles.btn]} */}
|
|
|
+ {/* {this.whetherChat ? <ElButton type={!runtime.allowChatCtrl ? 'primary' : 'info'} onClick={this.ChatBan} >{runtime.allowChatCtrl ? '全体禁言' : '关闭全体禁言'}</ElButton> : null} */}
|
|
|
+ <ElButton type={!runtime.allowChatCtrl ? 'primary' : 'info'} onClick={this.ChatBan} >{runtime.allowChatCtrl ? '全体禁言' : '关闭全体禁言'}</ElButton>
|
|
|
<ElButton type={!runtime.allowSeatsCtrl ? 'primary' : 'info'} onClick={this.SeatsCtrl}>{runtime.allowSeatsCtrl ? '禁止连麦' : '关闭禁止连麦'}</ElButton>
|
|
|
</div>
|
|
|
</div>
|