From 11eedc59adff301563c49a60a4fcc6aa1ade2ebc Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Fri, 10 Apr 2020 16:41:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8C=BA=E6=AE=B5=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E5=AE=9E=E9=99=85=E9=95=BF=E5=BA=A6=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMap/newMapdraft/mapoperate/index.vue | 73 ++++++++++--------- .../newMapdraft/mapoperate/section/index.vue | 2 +- .../mapoperate/section/logicBlock.vue | 7 +- 3 files changed, 44 insertions(+), 38 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index 7deee5b54..3afb3b3ab 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -424,44 +424,47 @@ export default { } /deep/ { - .mapEdit .el-tabs__nav-wrap.is-scrollable { - padding: 0 20px; - } - .mapEdit .el-tabs__header .el-tabs__item.is-active { - border-bottom-color: #f5f7fa; - background: #f5f7fa; - } - .mapEdit .el-tabs__active-bar{ - background: transparent; - } - .mapEdit .el-tabs__content { - height: calc(100% - 56px); - } + .mapEdit .el-tabs__nav-wrap.is-scrollable { + padding: 0 20px; + } + .mapEdit .el-tabs__header .el-tabs__item.is-active { + border-bottom-color: #f5f7fa; + background: #f5f7fa; + } + .mapEdit .el-tabs__active-bar{ + background: transparent; + } + .mapEdit .el-tabs__content { + height: calc(100% - 56px); + } - .card .el-tabs__nav .el-tabs__item.is-active { - border-bottom: 2px solid #E4E7ED; - background: #409eff; - color: #fff; - } + .card .el-tabs__nav .el-tabs__item.is-active { + border-bottom: 2px solid #E4E7ED; + background: #409eff; + color: #fff; + } + .card .el-tabs__nav .el-tabs__item{ + padding: 0 20px!important; + } - .mapEdit .el-tabs__nav-prev { - width: 20px; - height: 41px; - display: flex; - justify-content: center; - align-items: center; - box-shadow: 1px 1px 4px #ccc; - } + .mapEdit .el-tabs__nav-prev { + width: 20px; + height: 41px; + display: flex; + justify-content: center; + align-items: center; + box-shadow: 1px 1px 4px #ccc; + } - .mapEdit .el-tabs__nav-next { - width: 20px; - height: 41px; - display: flex; - justify-content: center; - align-items: center; - box-shadow: 1px 1px 4px #ccc; - } - } + .mapEdit .el-tabs__nav-next { + width: 20px; + height: 41px; + display: flex; + justify-content: center; + align-items: center; + box-shadow: 1px 1px 4px #ccc; + } + } // 页面页签样式 /deep/ { diff --git a/src/views/newMap/newMapdraft/mapoperate/section/index.vue b/src/views/newMap/newMapdraft/mapoperate/section/index.vue index 70cac2aa9..a2c7480b1 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/index.vue @@ -488,7 +488,7 @@ export default { if (section.parentCode === model.code) { const copySection = deepAssign({}, section); copySection.logicSectionShow = model.logicSectionShow; - copySection.lengthFact = (Number(model.lengthFact) / model.logicSectionCodeList.length).toFixed(3); + // copySection.lengthFact = (Number(model.lengthFact) / model.logicSectionCodeList.length).toFixed(3); // 容易处理成无限大 copySection.stationCode = model.stationCode; // 给元素 子逻辑区段设置 设备集中站 models.push(copySection); } else if (model.code !== section.code && (section.type === '01' || section.type === '03')) { diff --git a/src/views/newMap/newMapdraft/mapoperate/section/logicBlock.vue b/src/views/newMap/newMapdraft/mapoperate/section/logicBlock.vue index d45036117..7e364ed70 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/logicBlock.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/logicBlock.vue @@ -81,7 +81,10 @@ export default { this.tableData.forEach((ele, index) => { totalNum += Number(ele.num); }); - const lineLength = lengthFact / totalNum; // 均分逻辑区段偏移量 + let lineLength = 0; // NaN 由于 0/0 造成的 + if (totalNum) { + lineLength = lengthFact / totalNum; // 均分逻辑区段偏移量 + } this.tableData.forEach((ele, index) => { models = [...models, ...this.createLogicalSections(Number(ele.num), sectionPoints[index], sectionPoints[index + 1], this.editModel, counts, lineLength, totalNum)]; allNotZeros = Number(ele.num) && allNotZeros; @@ -173,7 +176,7 @@ export default { trainPosType: model.trainPosType, points: points, curve: false, - lengthFact: 0, + lengthFact: lineLength ? lineLength.toFixed(3) : lineLength, trainWindowCode: '', kmRangeRight: model.kmRangeRight, kmRangeLeft: model.kmRangeLeft,