|
@@ -2,6 +2,7 @@ import { defineComponent } from "vue";
|
|
|
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'
|
|
|
|
|
|
|
|
|
type optionsType = 'ALL' | 'JOIN'
|
|
@@ -9,17 +10,23 @@ export default defineComponent({
|
|
|
name: 'message',
|
|
|
data() {
|
|
|
return {
|
|
|
- options: 'ALL' as optionsType
|
|
|
+ options: 'ALL' as optionsType,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ whetherChat() {
|
|
|
+ const config = state.user?.roomConfig ? JSON.parse(state.user?.roomConfig) : {}
|
|
|
+ return !!config.whetherChat
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
async SeatsCtrl() {
|
|
|
- await RuntimeUtils.sendMessage({seatBan: runtime.allowSeatsCtrl, ...RuntimeUtils.getSendMessageUser()}, 'SeatsCtrl')
|
|
|
- runtime.allowSeatsCtrl = !runtime.allowSeatsCtrl
|
|
|
+ await RuntimeUtils.sendMessage({seatBan: runtime.allowSeatsCtrl, ...RuntimeUtils.getSendMessageUser()}, 'SeatsCtrl')
|
|
|
+ runtime.allowSeatsCtrl = !runtime.allowSeatsCtrl
|
|
|
},
|
|
|
async ChatBan() {
|
|
|
- await RuntimeUtils.sendMessage({chatBan: runtime.allowChatCtrl, ...RuntimeUtils.getSendMessageUser()}, 'ChatBan')
|
|
|
- runtime.allowChatCtrl = !runtime.allowChatCtrl
|
|
|
+ await RuntimeUtils.sendMessage({chatBan: runtime.allowChatCtrl, ...RuntimeUtils.getSendMessageUser()}, 'ChatBan')
|
|
|
+ runtime.allowChatCtrl = !runtime.allowChatCtrl
|
|
|
},
|
|
|
},
|
|
|
render() {
|
|
@@ -27,7 +34,7 @@ export default defineComponent({
|
|
|
<div class={styles.message}>
|
|
|
<div class={styles.buttonGroup}>
|
|
|
{/* class={[!runtime.allowChatCtrl ? styles.active : null, styles.btn]} */}
|
|
|
- <ElButton type={!runtime.allowChatCtrl ? 'primary' : 'info'} onClick={this.ChatBan} >{runtime.allowChatCtrl ? '全体禁言' : '关闭全体禁言'}</ElButton>
|
|
|
+ {this.whetherChat ? <ElButton type={!runtime.allowChatCtrl ? 'primary' : 'info'} onClick={this.ChatBan} >{runtime.allowChatCtrl ? '全体禁言' : '关闭全体禁言'}</ElButton> : null}
|
|
|
{/* class={[!runtime.allowSeatsCtrl ? styles.active : null, styles.btn]} */}
|
|
|
<ElButton type={!runtime.allowSeatsCtrl ? 'primary' : 'info'} onClick={this.SeatsCtrl}>{runtime.allowSeatsCtrl ? '禁止连麦' : '关闭禁止连麦'}</ElButton>
|
|
|
</div>
|