|
@@ -40,13 +40,16 @@
|
|
|
return {
|
|
|
buttonJson: [], // 当前window中按钮
|
|
|
staticUrl:this.$store.state.staticUrl, // 静态资源路径
|
|
|
- window:this.$attrs.window
|
|
|
+ window:this.$attrs.window,
|
|
|
+ isPressDownButtons:[], // 初始化时默认按下的按钮
|
|
|
}
|
|
|
},
|
|
|
|
|
|
async beforeCreate() {
|
|
|
const arr = await getStaticFile('EnityButton.Data')
|
|
|
this.buttonJson = arr.filter(item => item.WindowID === this.window.ID)
|
|
|
+ const isPressDownButtons = this.buttonJson.filter(item => item.IsPressDown)
|
|
|
+ this.isPressDownButtons = isPressDownButtons
|
|
|
},
|
|
|
|
|
|
updated() {
|
|
@@ -55,6 +58,13 @@
|
|
|
keyArr.forEach((item,index) => {
|
|
|
this.$refs[item][0].style.backgroundImage = this.buttonJson[index].BackIcon ? 'url('+`${this.staticUrl}/Data/${this.buttonJson[index].BackIcon}`+')' : null
|
|
|
})
|
|
|
+ // 默认按下的按钮背景显示为ActionIcon
|
|
|
+ this.isPressDownButtons.forEach((item,index) => {
|
|
|
+ this.$refs[item.ID][0].style.backgroundImage = this.isPressDownButtons[index].ActionIcon ? 'url('+`${this.staticUrl}/Data/${this.isPressDownButtons[index].ActionIcon}`+')' : null
|
|
|
+ // 发布消息控制窗口显示
|
|
|
+ let windowIds = item.MouseDownActionList.map(item => item.SourceID)
|
|
|
+ PubSub.publish(OPEN_WINDOWS,windowIds)
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
@@ -70,7 +80,6 @@
|
|
|
const controlBtns = this.buttonJson.filter(item => item.ButtonType === 1 && item.GroupNumber === e.GroupNumber)
|
|
|
if(controlBtns.some(item => item === e)){
|
|
|
// 1.当前按下的按钮处于激活状态
|
|
|
- // this.$refs[e.ID][0].style.backgroundImage = 'url(' + require(`../../../static/Data/${e.ActionIcon}`) + ')'
|
|
|
this.$refs[e.ID][0].style.backgroundImage = 'url('+`${this.staticUrl}/Data/${e.ActionIcon}`+')'
|
|
|
|
|
|
// 2.同一组的其他按钮处于未激活状态
|