|
@@ -197,32 +197,32 @@
|
|
|
},
|
|
|
|
|
|
set(arr) {
|
|
|
- const bigscreenId = this.$store.state.curOpeBigscreenId
|
|
|
- const bigScreenObj = this.$store.state.bigScreenObj
|
|
|
- const bigScale = this.$store.state.bigScale
|
|
|
- const positionNum = this.$store.state.positionNum
|
|
|
+ setTimeout(() => {
|
|
|
+ const bigscreenId = this.$store.state.curOpeBigscreenId
|
|
|
+ const bigScreenObj = this.$store.state.bigScreenObj
|
|
|
+ const bigScale = this.$store.state.bigScale
|
|
|
+ const positionNum = this.$store.state.positionNum
|
|
|
|
|
|
- // debugger
|
|
|
+ const arr2 = []
|
|
|
+ arr.forEach(item => {
|
|
|
+ arr2.push(JSON.parse(JSON.stringify(item)))
|
|
|
+ })
|
|
|
|
|
|
- const arr2 = []
|
|
|
- arr.forEach(item => {
|
|
|
- arr2.push(JSON.parse(JSON.stringify(item)))
|
|
|
+ const newObj = arr2.filter(item => !item.Id)
|
|
|
+ const otherSignals = arr2.filter(item => item.Id)
|
|
|
+ newObj[0].Id = guId()
|
|
|
+ newObj[0].bigscreenId = bigscreenId
|
|
|
+ newObj[0].splitScreenStatus = bigScreenObj[bigscreenId].splitStatus + 1
|
|
|
+ newObj[0].width = bigScreenObj[bigscreenId].width * bigScale / newObj[0].splitScreenStatus
|
|
|
+ newObj[0].height = bigScreenObj[bigscreenId].height * bigScale / newObj[0].splitScreenStatus
|
|
|
+ newObj[0].widthScale = newObj[0].width / (bigScreenObj[bigscreenId].width * bigScale)
|
|
|
+ newObj[0].heightScale = newObj[0].height / (bigScreenObj[bigscreenId].height * bigScale)
|
|
|
+ const positionInfo = elePosition(newObj[0].width,newObj[0].height,positionNum,this.screenPosition[bigscreenId].top,this.screenPosition[bigscreenId].left,bigScreenObj[bigscreenId].splitStatus+1)
|
|
|
+ newObj[0].top = positionInfo.top - this.screenPosition[bigscreenId].top
|
|
|
+ newObj[0].left = positionInfo.left - this.screenPosition[bigscreenId].left
|
|
|
+ bigScreenObj[bigscreenId].signalArr = [...newObj,...otherSignals]
|
|
|
+ this.refreshBigScreen(bigScreenObj,bigscreenId)
|
|
|
})
|
|
|
-
|
|
|
- const newObj = arr2.filter(item => !item.Id)
|
|
|
- const otherSignals = arr2.filter(item => item.Id)
|
|
|
- newObj[0].Id = guId()
|
|
|
- newObj[0].bigscreenId = bigscreenId
|
|
|
- newObj[0].splitScreenStatus = bigScreenObj[bigscreenId].splitStatus + 1
|
|
|
- newObj[0].width = bigScreenObj[bigscreenId].width * bigScale / newObj[0].splitScreenStatus
|
|
|
- newObj[0].height = bigScreenObj[bigscreenId].height * bigScale / newObj[0].splitScreenStatus
|
|
|
- newObj[0].widthScale = newObj[0].width / (bigScreenObj[bigscreenId].width * bigScale)
|
|
|
- newObj[0].heightScale = newObj[0].height / (bigScreenObj[bigscreenId].height * bigScale)
|
|
|
- const positionInfo = elePosition(newObj[0].width,newObj[0].height,positionNum,this.screenPosition[bigscreenId].top,this.screenPosition[bigscreenId].left,bigScreenObj[bigscreenId].splitStatus+1)
|
|
|
- newObj[0].top = positionInfo.top - this.screenPosition[bigscreenId].top
|
|
|
- newObj[0].left = positionInfo.left - this.screenPosition[bigscreenId].left
|
|
|
- bigScreenObj[bigscreenId].signalArr = [...newObj,...otherSignals]
|
|
|
- this.refreshBigScreen(bigScreenObj,bigscreenId)
|
|
|
}
|
|
|
},
|
|
|
|