diff --git a/src/jmapNew/shape/Train/index.js b/src/jmapNew/shape/Train/index.js index 0f518405e..4b6da6300 100644 --- a/src/jmapNew/shape/Train/index.js +++ b/src/jmapNew/shape/Train/index.js @@ -18,8 +18,6 @@ export default class Train extends Group { this.z = 40; this.size = 0; this.section = null; - this.nextPointIndex = 1; - this.currentAdd = 0; this.isShowShape = true; this.fontSize = style.Train.common.useSelfText ? style.Train.common.nameFontSize || style.Train.common.trainTextFontSize : model.nameFontSize || style.Train.common.nameFontSize || style.Train.common.trainTextFontSize; this.newScale = this.fontSize / style.Train.common.trainTextFontSize; @@ -183,19 +181,21 @@ export default class Train extends Group { // } // debugger; // 目标距离 + console.log('2222222222///////////////////////', this.currentAdd); let targetDistance = Math.sqrt( Math.pow(points[this.nextPointIndex - 1].x - points[this.nextPointIndex].x, 2) + Math.pow(points[this.nextPointIndex - 1].y - points[this.nextPointIndex].y, 2), ); const right = train.right == 1 ? 0 : 1; let currentDistance = this.lineLength * Math.abs(right - train.offsetp) - this.currentAdd; + console.log('33333333333/////////////////', currentDistance); // 利用运动距离与目标距离, 判断运动的点是否超过下一个目标点, 超过了就重置下一个点 if (currentDistance >= targetDistance) { this.nextPointIndex++; this.currentAdd += targetDistance; if (this.nextPointIndex <= points.length - 1) { currentDistance = this.lineLength * Math.abs(right - train.offsetp) - this.currentAdd; - console.log('///////////////////////////////////', this.currentAdd); + console.log('44444444444///////////////', this.currentAdd); console.log('///////////////////////////////////', currentDistance); targetDistance = Math.sqrt( Math.pow(points[this.nextPointIndex - 1].x - points[this.nextPointIndex].x, 2) + @@ -527,6 +527,8 @@ export default class Train extends Group { item.show(); }); this.isShowShape = true; + this.nextPointIndex = 1; + this.currentAdd = 0; this.setState(this.model, this); } else { this.eachChild(item => { diff --git a/src/views/ibpsystem/index.vue b/src/views/ibpsystem/index.vue index 061f54c73..c310b0bf3 100644 --- a/src/views/ibpsystem/index.vue +++ b/src/views/ibpsystem/index.vue @@ -1,6 +1,6 @@ @@ -58,6 +58,9 @@ export default { ]), ibpId() { return ['ibp', (Math.random().toFixed(5)) * 100000].join('_'); + }, + width() { + return this.canvasWidth - 200; } }, watch: { @@ -198,18 +201,14 @@ export default { this.$ibp.setClockStart(started); }, reSize() { - this.$nextTick(() => { - this.width = this.$store.state.config.width; - this.height = this.$store.state.config.height; - this.$ibp && this.$ibp.resize({ width: this.width, height: this.height }); - }); + this.width = this.$store.state.config.width; + this.height = this.$store.state.config.height; + this.$ibp && this.$ibp.resize({ width: this.width, height: this.height }); }, setWindowSize() { - this.$nextTick(() => { - const width = this.size ? this.size.width : this.$store.state.app.width; - const height = this.size ? this.size.height : this.$store.state.app.height; - this.$store.dispatch('config/resize', { width: width, height: height }); - }); + const width = this.size ? this.size.width : this.$store.state.app.width; + const height = this.size ? this.size.height : this.$store.state.app.height; + this.$store.dispatch('config/resize', { width: width, height: height }); }, back() { this.group = this.$route.query.group; diff --git a/src/views/system/ibpDraw/ibpOperate/index.vue b/src/views/system/ibpDraw/ibpOperate/index.vue index a4a2e835c..8db098306 100644 --- a/src/views/system/ibpDraw/ibpOperate/index.vue +++ b/src/views/system/ibpDraw/ibpOperate/index.vue @@ -1,141 +1,159 @@ @@ -254,5 +272,58 @@ export default { .map-control { float: right; width: 100%; + height: 100%; + } + .clearfix{ + height: 50px; + padding: 0 22px; + } + .ibpEdit{ + height: calc(100% - 50px); + } + + /deep/ { + .ibpEdit .el-tabs__nav-wrap.is-scrollable { + padding: 0 20px; + } + .ibpEdit .el-tabs__header{ + margin: 0; + } + .ibpEdit .el-tabs__header .el-tabs__item.is-active { + border-bottom-color: #f5f7fa; + background: #f5f7fa; + } + .ibpEdit .el-tabs__active-bar{ + background: transparent; + } + .ibpEdit .el-tabs__content { + height: calc(100% - 56px); + padding-top: 15px; + // overflow-y: scroll; + } + + .card .el-tabs__nav .el-tabs__item.is-active { + border-bottom: 2px solid #E4E7ED; + background: #409eff; + color: #fff; + } + + .ibpEdit .el-tabs__nav-prev { + width: 20px; + height: 41px; + display: flex; + justify-content: center; + align-items: center; + box-shadow: 1px 1px 4px #ccc; + } + + .ibpEdit .el-tabs__nav-next { + width: 20px; + height: 41px; + display: flex; + justify-content: center; + align-items: center; + box-shadow: 1px 1px 4px #ccc; + } } diff --git a/src/views/system/ibpDraw/index.vue b/src/views/system/ibpDraw/index.vue index d74d62bdd..02a31261d 100644 --- a/src/views/system/ibpDraw/index.vue +++ b/src/views/system/ibpDraw/index.vue @@ -13,6 +13,7 @@