|
@@ -30,7 +30,9 @@
|
|
|
|
|
|
<script>
|
|
|
import {mapState} from 'vuex'
|
|
|
+ import PubSub from 'pubsub-js'
|
|
|
import {getStaticFile} from "../../utils/tools"
|
|
|
+ import {OPEN_WINDOWS} from "../../utils/constant"
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -76,79 +78,9 @@
|
|
|
})
|
|
|
|
|
|
// 3.切换界面
|
|
|
- // 上一次点击的按钮(同一组的情况)
|
|
|
- const preBtn = this.preBtns.filter(a => a.ButtonType === 1 && a.GroupNumber === e.GroupNumber)
|
|
|
- console.log(preBtn)
|
|
|
-
|
|
|
- if(preBtn.length){
|
|
|
- // 3.1 切换按钮
|
|
|
- this.buttonJson.forEach(item => {
|
|
|
- // 先隐藏
|
|
|
- if(preBtn[0].MouseDownActionList.length){
|
|
|
- for(const btn of preBtn[0].MouseDownActionList){
|
|
|
- if(btn.SourceID === item.WindowID){
|
|
|
- item.IsVisibility = false
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 后显示
|
|
|
- if(e.MouseDownActionList.length){
|
|
|
- for(const btn of e.MouseDownActionList){
|
|
|
- if(btn.SourceID === item.WindowID){
|
|
|
- item.IsVisibility = true
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- // 3.2 切换label
|
|
|
- this.$store.state.labelJson.forEach(item => {
|
|
|
- if(preBtn[0].MouseDownActionList.length){
|
|
|
- for(const btn of preBtn[0].MouseDownActionList){
|
|
|
- if(btn.SourceID === item.WindowID){
|
|
|
- item.IsVisibility = false
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(e.MouseDownActionList.length){
|
|
|
- for(const btn of e.MouseDownActionList){
|
|
|
- if(btn.SourceID === item.WindowID){
|
|
|
- item.IsVisibility = true
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- // 替换上一次点击的按钮
|
|
|
- const btnArr = this.preBtns.filter(b => b.ID !== preBtn[0].ID)
|
|
|
- this.preBtns = [...btnArr,e]
|
|
|
- }else {
|
|
|
- // 不同组的情况
|
|
|
- // 1.显示按钮
|
|
|
- this.buttonJson.forEach(item => {
|
|
|
- if(e.MouseDownActionList.length){
|
|
|
- for(const btn of e.MouseDownActionList){
|
|
|
- if(btn.SourceID === item.WindowID){
|
|
|
- item.IsVisibility = true
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- // 2.显示label
|
|
|
- this.$store.state.labelJson.forEach(item => {
|
|
|
- if(e.MouseDownActionList.length){
|
|
|
- for(const btn of e.MouseDownActionList){
|
|
|
- if(btn.SourceID === item.WindowID){
|
|
|
- item.IsVisibility = true
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- // 增加到上一次点击的按钮数组中
|
|
|
- const btnArr = this.preBtns
|
|
|
- this.preBtns = [...btnArr,e]
|
|
|
- }
|
|
|
+ let windowIds = e.MouseDownActionList.map(item => item.SourceID)
|
|
|
+ // 发布消息控制窗口显示
|
|
|
+ PubSub.publish(OPEN_WINDOWS,windowIds)
|
|
|
}
|
|
|
|
|
|
// 音频菜单控制
|