From 21dce32b30dc3fbb4adf2517a8eaa260e3749fa3 Mon Sep 17 00:00:00 2001 From: "wu.jian2" Date: Fri, 1 Sep 2023 16:16:52 +0800 Subject: [PATCH 1/7] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E8=B7=91?= =?UTF-8?q?=E9=A9=AC=E7=81=AF=E7=BB=84=E4=BB=B6=EF=BC=8C=E6=9B=B4=E6=8D=A2?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=9B=BE=E6=A0=87=E8=B5=84=E6=BA=90=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=AD=E9=9F=B3=E6=9A=82=E5=81=9C=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=90=8E=EF=BC=8C=E8=AF=AD=E9=9F=B3=E6=9C=AA=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E7=9A=84=E6=83=85=E5=86=B5=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E9=85=8D=E7=BD=AE=E5=AE=9A=E6=97=B6=E5=99=A8?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E7=A6=BB=E5=BC=80=E5=BD=93=E5=89=8D=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E8=AF=AD=E9=9F=B3=E4=BB=8D=E5=9C=A8=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data-room-ui/package-lock.json | 89 ++++--- data-room-ui/package.json | 1 + .../BasicComponents/Marquee/index.vue | 252 ++++++++++++++---- .../BasicComponents/Marquee/setting.vue | 83 +++++- .../BigScreenDesign/OverallSetting/index.vue | 2 +- .../BigScreenDesign/PageDesignTop.vue | 1 - .../Layout/BigScreenHomeLayout/index.vue | 11 +- data-room-ui/packages/SvgIcon/index.vue | 5 +- .../images/alignIcon/svg/broadcast-1.svg | 1 + .../images/alignIcon/svg/broadcast-10.svg | 1 + .../images/alignIcon/svg/broadcast-11.svg | 1 + .../images/alignIcon/svg/broadcast-2.svg | 1 + .../images/alignIcon/svg/broadcast-3.svg | 1 + .../images/alignIcon/svg/broadcast-4.svg | 1 + .../images/alignIcon/svg/broadcast-5.svg | 1 + .../images/alignIcon/svg/broadcast-6.svg | 1 + .../images/alignIcon/svg/broadcast-7.svg | 1 + .../images/alignIcon/svg/broadcast-8.svg | 1 + .../images/alignIcon/svg/broadcast-9.svg | 1 + .../packages/js/mixins/commonMixins.js | 8 +- data-room-ui/packages/js/store/mutations.js | 12 +- 21 files changed, 360 insertions(+), 115 deletions(-) create mode 100644 data-room-ui/packages/assets/images/alignIcon/svg/broadcast-1.svg create mode 100644 data-room-ui/packages/assets/images/alignIcon/svg/broadcast-10.svg create mode 100644 data-room-ui/packages/assets/images/alignIcon/svg/broadcast-11.svg create mode 100644 data-room-ui/packages/assets/images/alignIcon/svg/broadcast-2.svg create mode 100644 data-room-ui/packages/assets/images/alignIcon/svg/broadcast-3.svg create mode 100644 data-room-ui/packages/assets/images/alignIcon/svg/broadcast-4.svg create mode 100644 data-room-ui/packages/assets/images/alignIcon/svg/broadcast-5.svg create mode 100644 data-room-ui/packages/assets/images/alignIcon/svg/broadcast-6.svg create mode 100644 data-room-ui/packages/assets/images/alignIcon/svg/broadcast-7.svg create mode 100644 data-room-ui/packages/assets/images/alignIcon/svg/broadcast-8.svg create mode 100644 data-room-ui/packages/assets/images/alignIcon/svg/broadcast-9.svg diff --git a/data-room-ui/package-lock.json b/data-room-ui/package-lock.json index c742673e..a4a5f4d1 100644 --- a/data-room-ui/package-lock.json +++ b/data-room-ui/package-lock.json @@ -1,6 +1,6 @@ { "name": "@gcpaas/data-room-ui", - "version": "1.0.1-2023082902-Alpha", + "version": "1.0.1-2023083002-Alpha", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3397,6 +3397,27 @@ "whatwg-fetch": "^3.6.2" }, "dependencies": { + "@vue/vue-loader-v15": { + "version": "npm:vue-loader@15.10.2", + "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.2.tgz", + "integrity": "sha512-ndeSe/8KQc/nlA7TJ+OBhv2qalmj1s+uBs7yHDRFaAXscFTApBzY9F1jES3bautmgWjDlDct0fw8rPuySDLwxw==", + "dev": true, + "requires": { + "@vue/component-compiler-utils": "^3.1.0", + "hash-sum": "^1.0.2", + "loader-utils": "^1.1.0", + "vue-hot-reload-api": "^2.3.0", + "vue-style-loader": "^4.1.0" + }, + "dependencies": { + "hash-sum": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz", + "integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==", + "dev": true + } + } + }, "acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", @@ -3468,6 +3489,26 @@ "tapable": "^2.0.0" } }, + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -3685,47 +3726,6 @@ "lodash": "^4.17.4" } }, - "@vue/vue-loader-v15": { - "version": "npm:vue-loader@15.10.2", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.2.tgz", - "integrity": "sha512-ndeSe/8KQc/nlA7TJ+OBhv2qalmj1s+uBs7yHDRFaAXscFTApBzY9F1jES3bautmgWjDlDct0fw8rPuySDLwxw==", - "dev": true, - "requires": { - "@vue/component-compiler-utils": "^3.1.0", - "hash-sum": "^1.0.2", - "loader-utils": "^1.1.0", - "vue-hot-reload-api": "^2.3.0", - "vue-style-loader": "^4.1.0" - }, - "dependencies": { - "hash-sum": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz", - "integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==", - "dev": true - }, - "json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, - "loader-utils": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", - "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" - } - } - } - }, "@vue/vue2-jest": { "version": "27.0.0", "resolved": "https://registry.npmjs.org/@vue/vue2-jest/-/vue2-jest-27.0.0.tgz", @@ -19988,6 +19988,11 @@ } } }, + "vue-player-audio": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/vue-player-audio/-/vue-player-audio-1.0.2.tgz", + "integrity": "sha512-1HH5+C7t5pKBoH5mrSQxLIxm/TLjD+GAuaJHzfGE2NehalMUFB5dLHM3k6l9xlJQQLWpgdFsMQP4sNqHy6Fl4g==" + }, "vue-router": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.0.6.tgz", diff --git a/data-room-ui/package.json b/data-room-ui/package.json index a5dc9a74..9db5c9f4 100644 --- a/data-room-ui/package.json +++ b/data-room-ui/package.json @@ -77,6 +77,7 @@ "vue-draggable-resizable-gorkys": "^2.4.8", "vue-json-editor": "^1.4.3", "vue-json-viewer": "^2.2.22", + "vue-player-audio": "^1.0.2", "vue-router": "3.0.6", "vue-sketch-ruler": "^1.0.3", "vue-video-player": "^5.0.1", diff --git a/data-room-ui/packages/BasicComponents/Marquee/index.vue b/data-room-ui/packages/BasicComponents/Marquee/index.vue index 92ea186f..52fd18ea 100644 --- a/data-room-ui/packages/BasicComponents/Marquee/index.vue +++ b/data-room-ui/packages/BasicComponents/Marquee/index.vue @@ -1,24 +1,34 @@ @@ -87,9 +108,12 @@ import Speech from 'speak-tts' import { EventBus } from 'data-room-ui/js/utils/eventBus' import commonMixins from 'data-room-ui/js/mixins/commonMixins' import paramsMixins from 'data-room-ui/js/mixins/paramsMixins' +import linkageMixins from 'data-room-ui/js/mixins/linkageMixins' import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting' import cloneDeep from 'lodash/cloneDeep' +import IconSvg from 'data-room-ui/SvgIcon' export default { + name: 'Marquee', props: { // 卡片的属性 config: { @@ -97,8 +121,13 @@ export default { default: () => ({}) } }, + components: { + IconSvg + }, data () { return { + showVoiceSwitch: false, + voiceSwitchValue: true, customClass: {}, attributeName: { right: 'x', @@ -125,16 +154,52 @@ export default { innerData: null, // 音频播放 audio: null, + // 音频地址 + isPlayAudio: null, // 语音播报 speech: null, - // 语音播报定时器 - speechTimer: null + isInit: false, + numberBroadcasts: 0 } }, computed: { - + // speechText + speechText () { + return this.config.customize.title || '' + }, + isPreview () { + return (this.$route.path === window?.BS_CONFIG?.routers?.previewUrl) || (this.$route.path === '/big-screen/preview') + }, + audioSrc () { + return this.config?.option?.data?.[this.config?.dataSource?.metricField] || '' + } }, - mixins: [paramsMixins, commonMixins], + watch: { + speechText (val) { + if (!this.isPreview && this.config.customize.voiceBroadcast && !this.isInit) { + this.speechBroadcast(val) + } else { + if (this.speech) { + this.speech = null + } + } + }, + deep: true, + audioSrc (val) { + if (this.config.customize.voiceBroadcast) { + if (this.audio) { + this.audio.src = val + this.audio.play() + } + } else { + if (this.aduio) { + this.aduio.pause() + this.aduio = null + } + } + } + }, + mixins: [paramsMixins, commonMixins, linkageMixins], mounted () { this.chartInit() // 如果点击了生成图片,则先关闭动画 @@ -145,15 +210,43 @@ export default { EventBus.$on('startMarquee', () => { this.isAnimate = true }) + // 如果删除了组件 + EventBus.$on('deleteComponent', (codes) => { + if (codes.includes(this.config.code)) { + if (this.audio) { + this.audio.pause() + this.audio = null + } + if (this.speech) { + this.speech = null + } + } + }) + this.speech = null + this.isInit = true + // 如果是预览模式的话,则弹出对话框,当前大屏存在语音播报,是否开启语音播报 + if (this.isPreview && this.config.customize.voiceBroadcast) { + this.$confirm('当前大屏存在语音播报,是否开启语音播报?若开启请点击确认或者回车', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + customClass: 'bs-el-message-box' + }).then(() => { + if (this.audioSrc) { + this.audio.play() + } else { + this.speech = null + this.speechBroadcast(this.config.customize.title) + this.isInit = false + } + }).catch(() => { }) + } document.addEventListener('visibilitychange', this.handleVisibilityChange) }, beforeDestroy () { EventBus.$off('stopMarquee') EventBus.$off('startMarquee') - // 销毁语音播报定时器 - if (this.speechTimer) { - clearInterval(this.speechTimer) - } + EventBus.$off('deleteComponent') }, methods: { dataFormatting (config, data) { @@ -166,7 +259,7 @@ export default { // 此处函数处理data eval(config.dataHandler) } catch (e) { - console.error(e) + console.info(e) } } config.option.data = data @@ -177,55 +270,53 @@ export default { // 数据返回失败则赋前端的模拟数据 config.option.data = [] } + // 清除上一个visibilitychange监听,重新开始监听 + if (this.voiceSwitchValue) { + this.voiceBroadcast(config) + } return config }, // 语音播报 voiceBroadcast (config) { - if (this.innerData) { + const innerData = this.innerData || config + if (innerData) { if (config.customize.voiceBroadcast) { - if (this.innerData.dataSource.businessKey && this.innerData.option.data[this.innerData.dataSource.metricField]) { - // 如果audio存在,先销毁这个实例,或者替换它的URL - if (this.audio) { - this.audio.pause() - this.audio = null + if (innerData?.dataSource?.businessKey && innerData?.option?.data[this.innerData.dataSource.metricField]) { + // 如果aduio存在,先销毁这个实例,或者替换它的URL + if (this.aduio) { + this.aduio.pause() + this.aduio = null } - this.audio = new Audio() - this.audio.src = this.innerData.option.data[this.innerData.dataSource.metricField] + // 获取音频元素 + this.audio = this.$refs[`audioPlayer${config.code}`] + this.audio.src = innerData.option.data[this.innerData.dataSource.metricField] this.audio.play() } else if (config.customize.title) { - this.speechBroadcast(config.customize.title) - // 根据配置的时间,定时播报,第一次播报后,再定时播报 - this.speechBroadcast(config.customize.title) - if (config.customize.dur) { - this.speechTimer = setInterval(() => { - this.speechBroadcast(config.customize.title) - }, config.customize.dur * 1000) + // 页面初始化不执行 + if (!this.isInit) { + this.speechBroadcast(config.customize.title) } } } else { - if (this.audio) { - this.audio.pause() - this.audio = null - } - } - } else { - if (config.customize.voiceBroadcast) { - this.speech = new Speech() - if (config.customize.dur) { - this.speechBroadcast(config.customize.title) - this.speechTimer = setInterval(() => { - this.speechBroadcast(config.customize.title) - }, config.customize.dur * 1000) + if (this.aduio) { + this.aduio.pause() + this.aduio = null } } } }, // 语音播报 speechBroadcast (text) { + this.numberBroadcasts = 0 + this.speech = new Speech() + this.speech.setLanguage('zh-CN') + this.speech.pitch = 1 + this.speech.init() if (this.speech.hasBrowserSupport()) { - this.speech.setLanguage('zh-CN') - this.speech.init() - this.speech.speak({ text: text }) + if (this.numberBroadcasts < 1) { + this.speech.speak({ text: text }) + this.numberBroadcasts += 1 + } } else { this.$message({ message: '您的浏览器不支持语音播报', @@ -235,7 +326,10 @@ export default { }, changeStyle (config) { config = { ...this.config, ...config } - this.voiceBroadcast(config) + if (config.customize.voiceBroadcast && this.isInit && !this.audioSrc) { + this.isInit = false + this.speechBroadcast(config.customize.title) + } // 样式改变时更新主题配置 config.theme = settingToTheme(cloneDeep(config), this.customTheme) this.changeChartConfig(config) @@ -250,7 +344,7 @@ export default { this.audio.pause() } if (this.speech) { - this.speech.pause() + this.speech = null } } else { if (this.audio) { @@ -260,6 +354,38 @@ export default { this.speech.resume() } } + }, + voiceSwitch () { + this.voiceSwitchValue = !this.voiceSwitchValue + if (this.voiceSwitchValue) { + if (this.audio) { + try { + this.audio.play() + } catch (e) { + console.info(e) + } + } + if (this.speech) { + this.speech.resume() + } + } else { + if (this.audio) { + try { + this.audio.pause() + } catch (e) { + console.info(e) + } + } + if (this.speech) { + this.speech.pause() + } + } + }, + mouseenter () { + this.showVoiceSwitch = true + }, + mouseleave () { + this.showVoiceSwitch = false } } } @@ -269,8 +395,10 @@ export default { .marquee-box { width: 100%; height: 100%; + user-select: none; white-space: nowrap; overflow: hidden; + position: relative; .scroll-area { width: 100%; @@ -287,10 +415,18 @@ export default { } } } + .icon { position: relative; top: 0; // 清除浮动 } } +.voice-switch{ + position: absolute; + cursor: pointer; + bottom: 5px; + color: #fff; +} + diff --git a/data-room-ui/packages/BasicComponents/Marquee/setting.vue b/data-room-ui/packages/BasicComponents/Marquee/setting.vue index a6362d55..f16d62b1 100644 --- a/data-room-ui/packages/BasicComponents/Marquee/setting.vue +++ b/data-room-ui/packages/BasicComponents/Marquee/setting.vue @@ -66,6 +66,8 @@ v-model="config.customize.direction" class="bs-el-select" popper-class="bs-el-select" + filterable + clearable > - + + + + + {{ icbroadcaston.label }} + + import SettingTitle from 'data-room-ui/SettingTitle/index.vue' import ColorPicker from 'data-room-ui/ColorPicker/index.vue' -import IconPicker from 'data-room-ui/IconPicker/index.vue' import PosWhSetting from 'data-room-ui/BigScreenDesign/RightSetting/PosWhSetting.vue' +import IconSvg from 'data-room-ui/SvgIcon' export default { name: 'TextSetting', components: { PosWhSetting, ColorPicker, SettingTitle, - IconPicker + IconSvg }, data () { return { @@ -352,6 +381,52 @@ export default { value: 'right' } ], + broadcastList: [ + { + label: '广播1', + value: 'broadcast-1' + }, + { + label: '广播2', + value: 'broadcast-2' + }, + { + label: '广播3', + value: 'broadcast-3' + }, + { + label: '广播4', + value: 'broadcast-4' + }, + { + label: '广播5', + value: 'broadcast-5' + }, + { + label: '广播6', + value: 'broadcast-6' + }, + { + label: '广播7', + value: 'broadcast-7' + }, + { + label: '广播8', + value: 'broadcast-8' + }, + { + label: '广播9', + value: 'broadcast-9' + }, + { + label: '广播10', + value: 'broadcast-10' + }, + { + label: '广播11', + value: 'broadcast-11' + } + ], rules: { title: [ { required: true, message: '请输入标题', trigger: 'blur' } @@ -383,7 +458,7 @@ export default { @import '../../assets/style/bsTheme.scss'; .bs-setting-wrap { - padding:12px 16px; + padding: 12px 16px; } .lc-field-body { diff --git a/data-room-ui/packages/BigScreenDesign/OverallSetting/index.vue b/data-room-ui/packages/BigScreenDesign/OverallSetting/index.vue index 629367e5..24d8535a 100644 --- a/data-room-ui/packages/BigScreenDesign/OverallSetting/index.vue +++ b/data-room-ui/packages/BigScreenDesign/OverallSetting/index.vue @@ -473,7 +473,7 @@ export default { this.$emit('close') }, timerEmptyState () { - return this.pageInfo.chartList.every(chart => chart.dataSource?.businessKey === '') + return this.pageInfo.chartList.every(chart => chart.dataSource?.businessKey === '' && chart.type !== 'marquee') } } } diff --git a/data-room-ui/packages/BigScreenDesign/PageDesignTop.vue b/data-room-ui/packages/BigScreenDesign/PageDesignTop.vue index a384925b..6a68a8ba 100644 --- a/data-room-ui/packages/BigScreenDesign/PageDesignTop.vue +++ b/data-room-ui/packages/BigScreenDesign/PageDesignTop.vue @@ -238,7 +238,6 @@ export default { }), changeZoom (val) { this.$emit('changeZoom', val) - // console.log(val) }, setAlign (command) { const pageInfo = cloneDeep(this.pageInfo) diff --git a/data-room-ui/packages/Layout/BigScreenHomeLayout/index.vue b/data-room-ui/packages/Layout/BigScreenHomeLayout/index.vue index bebe420a..1acf78af 100644 --- a/data-room-ui/packages/Layout/BigScreenHomeLayout/index.vue +++ b/data-room-ui/packages/Layout/BigScreenHomeLayout/index.vue @@ -16,12 +16,13 @@ /> Fork me on Gitee @@ -45,6 +46,8 @@ export default { data () { return { // 和此处路由保持一致,将会激活tab,请按需更改 + giteeHref: '', + giteeSvg: '' } }, computed: { @@ -115,6 +118,10 @@ export default { } }, created () {}, + mounted () { + this.giteeHref = 'https://gitee.com/gcpaas/DataRoom' + this.giteeSvg = 'https://gitee.com/gcpaas/DataRoom/widgets/widget_1.svg?color=007bff' + }, methods: { changeTab (tab) { if (this.$route.query.edit) { diff --git a/data-room-ui/packages/SvgIcon/index.vue b/data-room-ui/packages/SvgIcon/index.vue index cf0664e7..e30d5a07 100644 --- a/data-room-ui/packages/SvgIcon/index.vue +++ b/data-room-ui/packages/SvgIcon/index.vue @@ -1,9 +1,12 @@ diff --git a/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-1.svg b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-1.svg new file mode 100644 index 00000000..62c2e852 --- /dev/null +++ b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-10.svg b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-10.svg new file mode 100644 index 00000000..83ba3fc3 --- /dev/null +++ b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-10.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-11.svg b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-11.svg new file mode 100644 index 00000000..f40f81ea --- /dev/null +++ b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-11.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-2.svg b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-2.svg new file mode 100644 index 00000000..088faa58 --- /dev/null +++ b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-3.svg b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-3.svg new file mode 100644 index 00000000..d8012771 --- /dev/null +++ b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-3.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-4.svg b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-4.svg new file mode 100644 index 00000000..0578b192 --- /dev/null +++ b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-4.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-5.svg b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-5.svg new file mode 100644 index 00000000..b6179166 --- /dev/null +++ b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-5.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-6.svg b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-6.svg new file mode 100644 index 00000000..6f92485c --- /dev/null +++ b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-6.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-7.svg b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-7.svg new file mode 100644 index 00000000..01d732ea --- /dev/null +++ b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-7.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-8.svg b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-8.svg new file mode 100644 index 00000000..0a312acf --- /dev/null +++ b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-8.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-9.svg b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-9.svg new file mode 100644 index 00000000..d69542b9 --- /dev/null +++ b/data-room-ui/packages/assets/images/alignIcon/svg/broadcast-9.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data-room-ui/packages/js/mixins/commonMixins.js b/data-room-ui/packages/js/mixins/commonMixins.js index 8a87e7ec..1bb745ca 100644 --- a/data-room-ui/packages/js/mixins/commonMixins.js +++ b/data-room-ui/packages/js/mixins/commonMixins.js @@ -117,12 +117,12 @@ export default { * @description: 更新chart * @param {Object} config */ - changeData(config, filterList) { + changeData (config, filterList) { const list = config?.paramsList?.map((item) => { if (item.value === '${level}') { - return {...item,value:config.customize.level} + return { ...item, value: config.customize.level } } else if (item.value === '${name}') { - return {...item,value:config.customize.scope} + return { ...item, value: config.customize.scope } } else { return item } @@ -130,7 +130,7 @@ export default { const params = { chart: { ...config, - paramsList:list?[...list]:[], + paramsList: list ? [...list] : [], option: undefined }, current: 1, diff --git a/data-room-ui/packages/js/store/mutations.js b/data-room-ui/packages/js/store/mutations.js index 60f7aeea..4c807f1e 100644 --- a/data-room-ui/packages/js/store/mutations.js +++ b/data-room-ui/packages/js/store/mutations.js @@ -66,7 +66,7 @@ export default { state.pageLoading = booleanValue }, // 改变当前组件配置 - changeChartConfig(state, itemConfig) { + changeChartConfig (state, itemConfig) { const index = state.pageInfo.chartList.findIndex( item => item.code === itemConfig.code ) @@ -92,7 +92,7 @@ export default { { type: 'v', site: x || 0 } ] }, - changeActiveItemConfig(state, config) { + changeActiveItemConfig (state, config) { state.activeItemConfig = cloneDeep(config) }, // 新增一个组件 @@ -105,8 +105,16 @@ export default { // 删除组件/批量删除组件 delItem (state, codes) { if (Array.isArray(codes)) { + const delCharts = state.pageInfo.chartList.filter(chart => codes.includes(chart.code)) + // 如果删除的组件中有跑马灯,需要删除将跑马灯组件的音频实例销毁 + delCharts.some(item => { item.type === 'marquee' && EventBus.$emit('deleteComponent', item.code) }) state.pageInfo.chartList = state.pageInfo.chartList.filter(chart => !codes.includes(chart.code)) } else { + // 如果删除的组件是跑马灯,需要删除将跑马灯组件的音频实例销毁 + const delChart = state.pageInfo.chartList.find(chart => codes === chart.code) + if (delChart && delChart.type === 'marquee') { + EventBus.$emit('deleteComponent', codes) + } state.pageInfo.chartList = state.pageInfo.chartList.filter(chart => codes !== chart.code) } // 存储删除后的状态 From 8d3b61af0211558a0066501004fd770c4dbbf89b Mon Sep 17 00:00:00 2001 From: "liu.tao3" Date: Fri, 1 Sep 2023 16:37:35 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix:=E6=B7=BB=E5=8A=A0=E9=80=80=E5=87=BA?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BB=A5=E5=8F=8A=E8=87=AA=E9=80=82=E5=BA=94?= =?UTF-8?q?=E7=94=BB=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BigScreenDesign/CloseDialog/index.vue | 55 ------------------- .../BigScreenDesign/PageDesignTop.vue | 43 +++++++++------ 2 files changed, 27 insertions(+), 71 deletions(-) delete mode 100644 data-room-ui/packages/BigScreenDesign/CloseDialog/index.vue diff --git a/data-room-ui/packages/BigScreenDesign/CloseDialog/index.vue b/data-room-ui/packages/BigScreenDesign/CloseDialog/index.vue deleted file mode 100644 index 2a0ce24f..00000000 --- a/data-room-ui/packages/BigScreenDesign/CloseDialog/index.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - - diff --git a/data-room-ui/packages/BigScreenDesign/PageDesignTop.vue b/data-room-ui/packages/BigScreenDesign/PageDesignTop.vue index a384925b..0e0319dd 100644 --- a/data-room-ui/packages/BigScreenDesign/PageDesignTop.vue +++ b/data-room-ui/packages/BigScreenDesign/PageDesignTop.vue @@ -10,16 +10,21 @@ {{ pageInfo.name }}
- 缩放比例 + 缩放 + + 自适应 + -
@@ -127,7 +127,6 @@ import cloneDeep from 'lodash/cloneDeep' import uniqBy from 'lodash/uniqBy' import { stringifyObjectFunctions } from 'data-room-ui/js/utils/evalFunctions' import AssignDialog from 'data-room-ui/BigScreenDesign/AssignDialog/index.vue' -import CloseDialog from 'data-room-ui/BigScreenDesign/CloseDialog/index.vue' import HistoryList from 'data-room-ui/BigScreenDesign/HistoryList/index.vue' import CusBtn from './BtnLoading' import icons from 'data-room-ui/assets/images/alignIcon/export' @@ -146,7 +145,6 @@ export default { AssignDialog, CusBtn, HistoryList, - CloseDialog }, props: { code: { @@ -238,7 +236,6 @@ export default { }), changeZoom (val) { this.$emit('changeZoom', val) - // console.log(val) }, setAlign (command) { const pageInfo = cloneDeep(this.pageInfo) @@ -341,11 +338,21 @@ export default { } }, goBackManage () { - this.$refs.CloseDialog.init() - }, - async backSave () { - await this.save() - this.backManagement() + this.$confirm('确定返回主页面吗?未保存的配置将会丢失。', '提示', { + distinguishCancelAndClose: true, + confirmButtonText: '保存后离开页面', + cancelButtonText: '离开页面', + cancelButtonClass: 'cancel-btn', + type: 'warning', + customClass: 'bs-el-message-box' + }).then( async() => { + await this.save() + await this.backManagement() + }).catch((action) => { + if (action === 'cancel') { + this.backManagement() + } + }) }, backManagement () { this.$router.push({ path: this.pageInfo.type === 'component' ? (window.BS_CONFIG?.routers?.componentUrl || '/big-screen-components') : (window.BS_CONFIG?.routers?.pageManagementUrl || '/home') }) @@ -649,5 +656,9 @@ export default { background: var(--bs-el-background-1); color: var(--bs-el-text); border: 0 !important; + width: 100px; } +// .bs-el-input-number{ + +// } From cd17434058e1ad5a1a985d3a0b1b137f31d3d849 Mon Sep 17 00:00:00 2001 From: "wu.jian2" Date: Fri, 1 Sep 2023 16:38:02 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B7=91=E9=A9=AC?= =?UTF-8?q?=E7=81=AF=E7=BB=84=E4=BB=B6=E5=9C=A8=E9=A6=96=E6=AC=A1=E6=89=93?= =?UTF-8?q?=E5=BC=80=E9=85=8D=E7=BD=AE=E9=9D=A2=E6=9D=BF=EF=BC=8C=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E9=9F=B3=E9=A2=91=E5=92=8C=E6=96=87=E5=AD=97=E6=92=AD?= =?UTF-8?q?=E6=8A=A5=E5=90=8C=E6=97=B6=E5=87=BA=E7=8E=B0=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5=E5=92=8C=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=90=8E=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=87=BA=E7=8E=B0=E9=87=8D=E5=A4=8D=E4=B8=A4?= =?UTF-8?q?=E6=AC=A1=E6=96=87=E5=AD=97=E6=92=AD=E6=8A=A5=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BasicComponents/Marquee/index.vue | 31 ++++++++++++++----- data-room-ui/packages/Render/RenderCard.vue | 1 - 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/data-room-ui/packages/BasicComponents/Marquee/index.vue b/data-room-ui/packages/BasicComponents/Marquee/index.vue index 52fd18ea..c56879a9 100644 --- a/data-room-ui/packages/BasicComponents/Marquee/index.vue +++ b/data-room-ui/packages/BasicComponents/Marquee/index.vue @@ -112,6 +112,7 @@ import linkageMixins from 'data-room-ui/js/mixins/linkageMixins' import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting' import cloneDeep from 'lodash/cloneDeep' import IconSvg from 'data-room-ui/SvgIcon' +import { get } from 'sortablejs' export default { name: 'Marquee', props: { @@ -127,6 +128,7 @@ export default { data () { return { showVoiceSwitch: false, + visibilityState: false, voiceSwitchValue: true, customClass: {}, attributeName: { @@ -159,6 +161,7 @@ export default { // 语音播报 speech: null, isInit: false, + firstSpeech: true, numberBroadcasts: 0 } }, @@ -167,16 +170,19 @@ export default { speechText () { return this.config.customize.title || '' }, - isPreview () { - return (this.$route.path === window?.BS_CONFIG?.routers?.previewUrl) || (this.$route.path === '/big-screen/preview') - }, - audioSrc () { - return this.config?.option?.data?.[this.config?.dataSource?.metricField] || '' + audioSrc: { + get () { + return this.config?.option?.data?.[this.config?.dataSource?.metricField] || '' + }, + set (val) { + this.config.option.data[this.config.dataSource.metricField] = val + } } }, watch: { speechText (val) { - if (!this.isPreview && this.config.customize.voiceBroadcast && !this.isInit) { + if (!this.isPreview && this.config.customize.voiceBroadcast && !this.isInit && !this.firstSpeech) { + console.log(4) this.speechBroadcast(val) } else { if (this.speech) { @@ -236,6 +242,7 @@ export default { this.audio.play() } else { this.speech = null + console.log(1) this.speechBroadcast(this.config.customize.title) this.isInit = false } @@ -271,7 +278,8 @@ export default { config.option.data = [] } // 清除上一个visibilitychange监听,重新开始监听 - if (this.voiceSwitchValue) { + if (this.voiceSwitchValue && !this.visibilityState && this.isInit) { + console.log(6) this.voiceBroadcast(config) } return config @@ -294,6 +302,7 @@ export default { } else if (config.customize.title) { // 页面初始化不执行 if (!this.isInit) { + console.log(2) this.speechBroadcast(config.customize.title) } } @@ -326,9 +335,13 @@ export default { }, changeStyle (config) { config = { ...this.config, ...config } - if (config.customize.voiceBroadcast && this.isInit && !this.audioSrc) { + if (config.customize.voiceBroadcast && this.isInit && !config?.option?.data?.[this.config?.dataSource?.metricField]) { this.isInit = false + console.log(3) this.speechBroadcast(config.customize.title) + this.$nextTick(() => { + this.firstSpeech = false + }) } // 样式改变时更新主题配置 config.theme = settingToTheme(cloneDeep(config), this.customTheme) @@ -340,6 +353,7 @@ export default { // 监听页面是否可见 handleVisibilityChange () { if (document.visibilityState === 'hidden') { + this.visibilityState = true if (this.audio) { this.audio.pause() } @@ -347,6 +361,7 @@ export default { this.speech = null } } else { + this.visibilityState = false if (this.audio) { this.audio.play() } diff --git a/data-room-ui/packages/Render/RenderCard.vue b/data-room-ui/packages/Render/RenderCard.vue index c10e9c31..dadd12b4 100644 --- a/data-room-ui/packages/Render/RenderCard.vue +++ b/data-room-ui/packages/Render/RenderCard.vue @@ -57,7 +57,6 @@ export default { }, computed: {}, mounted () { - console.log(this.$refs) // 调用初始化方法 dataInit(this) }, From 7735e7c689ce700ff4f7486152be3b28db09cc6f Mon Sep 17 00:00:00 2001 From: "wu.jian2" Date: Fri, 1 Sep 2023 17:37:57 +0800 Subject: [PATCH 4/7] =?UTF-8?q?style:=20=E4=BC=98=E5=8C=96=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E6=95=B0=E6=8D=AE=E9=9B=86=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E5=87=BA=E7=8E=B0=E5=8F=8C=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E6=9D=A1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../packages/DataSetManagement/src/index.vue | 100 +++++++++++++++++- .../DataSetSetting/dataSetSetting.vue | 22 ++-- 2 files changed, 112 insertions(+), 10 deletions(-) diff --git a/data-room-ui/packages/DataSetManagement/src/index.vue b/data-room-ui/packages/DataSetManagement/src/index.vue index bd9eafae..887a155e 100644 --- a/data-room-ui/packages/DataSetManagement/src/index.vue +++ b/data-room-ui/packages/DataSetManagement/src/index.vue @@ -118,10 +118,104 @@
+ + + + + + + + + + + + + + + + + + From 195d5c2c021a11893dd78c90dde7e6583ba84010 Mon Sep 17 00:00:00 2001 From: "wu.jian2" Date: Sat, 2 Sep 2023 18:08:37 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=A0=87=E9=A2=98=E5=92=8Clogo=EF=BC=8C=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E9=85=8D=E7=BD=AE=E4=BC=A0=E5=85=A5=E7=A9=BA?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=E6=97=B6=EF=BC=8C=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=E7=9A=84=E6=83=85=E5=86=B5=EF=BC=8C?= =?UTF-8?q?=E5=8F=AA=E6=9C=89=E4=BC=A0=E5=85=A5null=E6=88=96undefined?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=86=8D=E4=BD=BF=E7=94=A8=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data-room-ui/packages/Layout/BigScreenHomeLayout/index.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data-room-ui/packages/Layout/BigScreenHomeLayout/index.vue b/data-room-ui/packages/Layout/BigScreenHomeLayout/index.vue index 1acf78af..38f54ab2 100644 --- a/data-room-ui/packages/Layout/BigScreenHomeLayout/index.vue +++ b/data-room-ui/packages/Layout/BigScreenHomeLayout/index.vue @@ -6,7 +6,7 @@ class="logo" :src="logo" > - {{ title || 'GCPAAS大屏设计器' }} + {{ title }}
@@ -53,10 +53,10 @@ export default { computed: { title () { if (this.$route.query.edit) return '大屏设计器' - return window?.BS_CONFIG?.starter?.title + return window?.BS_CONFIG?.starter?.title ?? 'GCPAAS大屏设计器' }, logo () { - return window?.BS_CONFIG?.starter?.logo || require('./images/logo.png') + return window?.BS_CONFIG?.starter?.logo ?? require('./images/logo.png') }, tabList () { if (this.$route.query.edit) { From 126d4ab11d808aeb780f2726016be65d274bbdf3 Mon Sep 17 00:00:00 2001 From: "wu.jian2" Date: Mon, 4 Sep 2023 10:50:53 +0800 Subject: [PATCH 6/7] =?UTF-8?q?fix:=20=E5=B0=9D=E8=AF=95=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BB=84=E4=BB=B6=E8=AE=BE=E8=AE=A1=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=82=B9=E5=87=BB=E8=BF=94=E5=9B=9E=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=90=8E=E5=B7=A6=E4=BE=A7=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=BF=80=E6=B4=BB=E5=92=8C=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8D=E5=AF=B9=E5=BA=94=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BigScreenComponentMag/SideMenu.vue | 21 ++++++++++++------- .../BigScreenDesign/PageDesignTop.vue | 10 ++++----- data-room-ui/packages/BizComponent/index.vue | 2 +- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/data-room-ui/packages/BigScreenComponentMag/SideMenu.vue b/data-room-ui/packages/BigScreenComponentMag/SideMenu.vue index 99ec3c37..005ee935 100644 --- a/data-room-ui/packages/BigScreenComponentMag/SideMenu.vue +++ b/data-room-ui/packages/BigScreenComponentMag/SideMenu.vue @@ -35,15 +35,22 @@ export default { activeType: 'component' } }, - created () { - const { globalData } = this.$router.app.$options - if (globalData?.componentsManagementType) { - this.activeType = globalData.componentsManagementType - this.$emit('getPageInfo', globalData.componentsManagementType) - // 清除this.$router.app.$options.globalData.componentsManagementType - delete globalData.componentsManagementType + watch: { + $route: { + handler (val) { + console.log(val) + const { globalData } = this.$router.app.$options + if (globalData?.componentsManagementType) { + this.activeType = globalData.componentsManagementType + this.$emit('getPageInfo', globalData.componentsManagementType) + // 清除this.$router.app.$options.globalData.componentsManagementType + delete globalData.componentsManagementType + } + }, + immediate: true } }, + created () { }, methods: { // 点击左侧组件 componentHandle (com) { diff --git a/data-room-ui/packages/BigScreenDesign/PageDesignTop.vue b/data-room-ui/packages/BigScreenDesign/PageDesignTop.vue index 0e0319dd..724250e7 100644 --- a/data-room-ui/packages/BigScreenDesign/PageDesignTop.vue +++ b/data-room-ui/packages/BigScreenDesign/PageDesignTop.vue @@ -19,7 +19,7 @@ label="描述文字" @change="changeZoom" /> - @@ -144,7 +144,7 @@ export default { ChooseTemplateDialog, AssignDialog, CusBtn, - HistoryList, + HistoryList }, props: { code: { @@ -338,14 +338,14 @@ export default { } }, goBackManage () { - this.$confirm('确定返回主页面吗?未保存的配置将会丢失。', '提示', { + this.$confirm('确定返回主页面吗?未保存的配置将会丢失。', '提示', { distinguishCancelAndClose: true, confirmButtonText: '保存后离开页面', cancelButtonText: '离开页面', cancelButtonClass: 'cancel-btn', type: 'warning', customClass: 'bs-el-message-box' - }).then( async() => { + }).then(async () => { await this.save() await this.backManagement() }).catch((action) => { @@ -355,9 +355,9 @@ export default { }) }, backManagement () { - this.$router.push({ path: this.pageInfo.type === 'component' ? (window.BS_CONFIG?.routers?.componentUrl || '/big-screen-components') : (window.BS_CONFIG?.routers?.pageManagementUrl || '/home') }) const data = { componentsManagementType: 'component' } this.$router.app.$options.globalData = data // 将数据存储在全局变量中 + this.$router.push({ path: this.pageInfo.type === 'component' ? (window.BS_CONFIG?.routers?.componentUrl || '/big-screen-components') : (window.BS_CONFIG?.routers?.pageManagementUrl || '/home') }) }, undo (isUndo) { this.undoTimeLine(isUndo) diff --git a/data-room-ui/packages/BizComponent/index.vue b/data-room-ui/packages/BizComponent/index.vue index 3da4900f..61cdbe22 100644 --- a/data-room-ui/packages/BizComponent/index.vue +++ b/data-room-ui/packages/BizComponent/index.vue @@ -337,9 +337,9 @@ export default { }) }, pageJump () { - this.$router.push({ path: window.BS_CONFIG?.routers?.componentUrl || '/big-screen-components' }) const data = { componentsManagementType: 'bizComponent' } this.$router.app.$options.globalData = data // 将数据存储在全局变量中 + this.$router.push({ path: window.BS_CONFIG?.routers?.componentUrl || '/big-screen-components' }) } } } From 00f6b7deee1d0017f13c9994149687581e9b3ce3 Mon Sep 17 00:00:00 2001 From: "wu.jian2" Date: Mon, 4 Sep 2023 10:52:51 +0800 Subject: [PATCH 7/7] =?UTF-8?q?refactor:=20=E5=8E=BB=E6=8E=89=E6=89=93?= =?UTF-8?q?=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data-room-ui/packages/BasicComponents/Marquee/index.vue | 5 ----- data-room-ui/packages/BigScreenComponentMag/SideMenu.vue | 1 - 2 files changed, 6 deletions(-) diff --git a/data-room-ui/packages/BasicComponents/Marquee/index.vue b/data-room-ui/packages/BasicComponents/Marquee/index.vue index c56879a9..c0c39d6a 100644 --- a/data-room-ui/packages/BasicComponents/Marquee/index.vue +++ b/data-room-ui/packages/BasicComponents/Marquee/index.vue @@ -182,7 +182,6 @@ export default { watch: { speechText (val) { if (!this.isPreview && this.config.customize.voiceBroadcast && !this.isInit && !this.firstSpeech) { - console.log(4) this.speechBroadcast(val) } else { if (this.speech) { @@ -242,7 +241,6 @@ export default { this.audio.play() } else { this.speech = null - console.log(1) this.speechBroadcast(this.config.customize.title) this.isInit = false } @@ -279,7 +277,6 @@ export default { } // 清除上一个visibilitychange监听,重新开始监听 if (this.voiceSwitchValue && !this.visibilityState && this.isInit) { - console.log(6) this.voiceBroadcast(config) } return config @@ -302,7 +299,6 @@ export default { } else if (config.customize.title) { // 页面初始化不执行 if (!this.isInit) { - console.log(2) this.speechBroadcast(config.customize.title) } } @@ -337,7 +333,6 @@ export default { config = { ...this.config, ...config } if (config.customize.voiceBroadcast && this.isInit && !config?.option?.data?.[this.config?.dataSource?.metricField]) { this.isInit = false - console.log(3) this.speechBroadcast(config.customize.title) this.$nextTick(() => { this.firstSpeech = false diff --git a/data-room-ui/packages/BigScreenComponentMag/SideMenu.vue b/data-room-ui/packages/BigScreenComponentMag/SideMenu.vue index 005ee935..f88db177 100644 --- a/data-room-ui/packages/BigScreenComponentMag/SideMenu.vue +++ b/data-room-ui/packages/BigScreenComponentMag/SideMenu.vue @@ -38,7 +38,6 @@ export default { watch: { $route: { handler (val) { - console.log(val) const { globalData } = this.$router.app.$options if (globalData?.componentsManagementType) { this.activeType = globalData.componentsManagementType