const tl_rtc_app_module_setting_content_normal = { props: { socket: { type: Object, default: null }, isMobile: { type: Boolean, default: false }, normalSetting: { type: Object, default: { homePage: 'channel', sidebarChannelOpen: true, sidebarContactOpen: true, sidebarCutPasteOpen: true, sidebarSettingOpen: true, } }, leftModule: { type: String, default: '' }, rightModule: { type: String, default: '' } }, computed: { propsSocket(){ return this.socket; }, propsIsMobile(){ return this.isMobile; }, propsNormalSetting(){ return this.normalSetting; }, propsLeftModule() { return this.leftModule; }, propsRightModule() { return this.rightModule; }, }, watch: { leftModule: function (val) { }, rightModule: function (val) { } }, data : function(){ return { settingFields: [ 'sidebarChannelOpen', 'sidebarContactOpen', 'sidebarCutPasteOpen', 'sidebarSettingOpen', 'homePage' ] } }, methods: { /** * 事件触发,向上传递 * @param {*} event */ leftModuleChange: function(event){ this.$emit('left-module-change', event) }, /** * 事件触发,向上传递 * @param {*} event */ rightModuleChange: function(event){ this.$emit('right-module-change', event) }, /** * 获取设置字段数据 * @returns */ getSettingFieldsData: function(){ let that = this let returnData = {} this.settingFields.forEach((item) => { returnData[item] = that.propsNormalSetting[item] }) // 侧边栏-设置强制开启 returnData.sidebarSettingOpen = true return returnData }, mouseEnter: function (event, title) { tl_rtc_app_comm.mouseEnterTips({ id: event.target.id, text: title, position: 'top' }); }, mouseLeave: function () { tl_rtc_app_comm.mouseLeaveTips(); }, /** * 更新设置 */ updateNormalSetting(){ this.$emit('update-user-config-normal', this.getSettingFieldsData()); }, /** * 修改字体大小 * @param {*} fontSize */ changeFontSize: function(fontSize){ this.propsNormalSetting.fontSize = fontSize; this.updateNormalSetting() }, }, mounted() { let that = this; window.form.render(); window.form.val('normalSettingContent', this.getSettingFieldsData()) window.form.on('switch', function(data){ if(that.settingFields.includes(data.elem.name)){ that.propsNormalSetting[data.elem.name] = data.elem.checked that.updateNormalSetting() } }); window.form.on('radio', function(data){ if(data.elem.name === 'homePage'){ that.propsNormalSetting.homePage = data.value that.updateNormalSetting() } }); }, updated() { window.form.val('normalSettingContent', this.getSettingFieldsData()) }, template: `
通用设置
首页设置
消息
通讯录
剪贴板
设置
底部/侧边导航栏设置
消息
通讯录
剪贴板
设置
` } window.tl_rtc_app_module_setting_content_normal = tl_rtc_app_module_setting_content_normal