diff --git a/src/api/management/goods.js b/src/api/management/goods.js index 40fbd4cd7..245f16864 100644 --- a/src/api/management/goods.js +++ b/src/api/management/goods.js @@ -124,7 +124,8 @@ export function getGoodsByPermissionId(id) { // 创建商品 export function postsPermissionGoods(data) { return request({ - url: `/api/goods`, + // url: `/api/goods`, + url: `/api/goods/create/list`, method: 'post', data: data }); @@ -138,3 +139,12 @@ export function postPermissionIdsGoods(data) { data: data }); } + +// 创建万能权限商品 +export function postCreatePackage(data) { + return request({ + url: `/api/goods/create/package`, + method: 'post', + data: data + }); +} diff --git a/src/api/management/order.js b/src/api/management/order.js index 322ea6a47..80339a328 100644 --- a/src/api/management/order.js +++ b/src/api/management/order.js @@ -107,7 +107,8 @@ export function cancalOrder(orderId) { // 快速创建权限 export function createPermission(data) { return request({ - url: `/api/order/quicklyGenerateOrder`, + // url: `/api/order/quicklyGenerateOrder`, + url: `/api/distribute/createQuickly`, method: 'post', data: data }); diff --git a/src/i18n/langs/en/map.js b/src/i18n/langs/en/map.js index 5af4e5438..4b5e47e25 100644 --- a/src/i18n/langs/en/map.js +++ b/src/i18n/langs/en/map.js @@ -558,4 +558,5 @@ export default { chargeStationList:'Managed station list', createModel: 'Create model:', startingPoint: 'Starting point:', + endingPoint: 'Ending point:' }; diff --git a/src/i18n/langs/zh/map.js b/src/i18n/langs/zh/map.js index 2596bb20a..7e6233445 100644 --- a/src/i18n/langs/zh/map.js +++ b/src/i18n/langs/zh/map.js @@ -551,5 +551,6 @@ export default { rightAssociatedSection: '右关联区段:', chargeStationList:'管理车站列表', createModel: '创建方式:', - startingPoint: '起点:' + startingPoint: '起点:', + endingPoint: '终点:' }; diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index d7c95a8b3..2bdca4314 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -150,10 +150,6 @@ class Jlmap { } } - setLayerVisible(layer) { - this.$painter.setLayerVisible(layer); - } - setLevelVisible(list) { this.$painter.setLevelVisible(list); } diff --git a/src/jmapNew/mouseController.js b/src/jmapNew/mouseController.js index 7cfa6e7ce..b87a16bad 100644 --- a/src/jmapNew/mouseController.js +++ b/src/jmapNew/mouseController.js @@ -241,7 +241,7 @@ class MouseController extends Eventful { deviceList.forEach( item =>{ if (item.instance && item.instance._type == deviceType.Section) { let deviceBoundingRect = {}; - if (item.type == '03') { + if (item.type == '04') { deviceBoundingRect = { x1: item.namePosition.x, y1: item.namePosition.y, diff --git a/src/jmapNew/painter.js b/src/jmapNew/painter.js index f2a5cdc82..fbd223cff 100644 --- a/src/jmapNew/painter.js +++ b/src/jmapNew/painter.js @@ -27,11 +27,6 @@ class Painter { * @param {*} config */ initLevels() { - // 图层分级策略 - this.layerBranch = {}; - this.layerBranch['01'] = (type) => { return type == deviceType.Link; }; // 逻辑图层级 - this.layerBranch['02'] = (type) => { return type != deviceType.Link; }; // 物理图层级 - this.layerBranch['03'] = (type) => { return true; }; // 混合图层级 // 添加父级图层 this.parentLevel = new Group({ name: '__parent__' }); @@ -43,9 +38,6 @@ class Painter { this.mapInstanceLevel[type] = level; this.parentLevel.add(level); }); - - // 设置默认显示图级 - this.setLayerVisible('02'); } /** @@ -193,21 +185,6 @@ class Painter { } } - /** - * 设置逻辑和物理图层 - * @param {*} layer - */ - setLayerVisible(layer) { - zrUtil.each(Object.values(deviceType), type => { - const level = this.mapInstanceLevel[type]; - if (this.layerBranch[layer](type)) { - level.show(); - } else { - level.hide(); - } - }, this); - } - /** * 设置图层可见 * @param {*} code diff --git a/src/jmapNew/shape/Section/index.js b/src/jmapNew/shape/Section/index.js index a3c93df42..300562c3a 100644 --- a/src/jmapNew/shape/Section/index.js +++ b/src/jmapNew/shape/Section/index.js @@ -9,8 +9,8 @@ import { EAxle } from './EAxle'; // 创建计轴 (私有) import { EBackArrow, EBackArrowTriangle } from './EBackArrow'; // 折返进路箭头 import ELimitName from './ELimitName'; // 成都三号线 限速名称 import JTriangle from '../../utils/JTriangle'; -import Rect from 'zrender/src/graphic/shape/Rect'; import router from '@/router'; +import EHighlight from '../element/EHighlight'; /** 区段*/ export default class Section extends Group { @@ -24,8 +24,8 @@ export default class Section extends Group { this.style = style; this.create(); this.createMouseEvent(); - this.createMouse(); // 框选鼠标移入移事件 this.setState(model); + this.checkIsDrawMap(); } create() { @@ -823,31 +823,6 @@ export default class Section extends Group { } } - createMouse() { - const rect = this.getBoundingRect(); - this.lineBorder = new Rect({ - zlevel: this.zlevel, - z: this.z - 1, - shape: rect, - style: { - lineDash: [3, 3], - stroke: '#fff', - fill: this.style.transparentColor - } - }); - - this.add(this.lineBorder); - this.lineBorder.hide(); - } - - mouseout() { - this.lineBorder && this.lineBorder.show(); - } - - mouseover() { - this.lineBorder && this.lineBorder.hide(); - } - /** 计算提示位置*/ getShapeTipPoint() { let rect = this.getBoundingRect(); @@ -874,4 +849,18 @@ export default class Section extends Group { return super.getBoundingRect(); } } + + drawSelected(selected) { + this.highlight && this.highlight.drawSelected(selected); + } + + checkIsDrawMap() { + const path = window.location.href; + if (path.includes('/map/draw')) { + this.highlight = new EHighlight(this.section); + this.add(this.highlight); + this.on('mouseout', () => { this.highlight.mouseout(); }); + this.on('mouseover', () => { this.highlight.mouseover(); }); + } + } } diff --git a/src/jmapNew/shape/Signal/index.js b/src/jmapNew/shape/Signal/index.js index 8abb1005c..5dcbb3f9f 100644 --- a/src/jmapNew/shape/Signal/index.js +++ b/src/jmapNew/shape/Signal/index.js @@ -12,6 +12,7 @@ import ESigName from './ESigName'; import EMouse from './EMouse'; import Group from 'zrender/src/container/Group'; import BoundingRect from 'zrender/src/core/BoundingRect'; +import EHighlight from '../element/EHighlight'; class Signal extends Group { constructor(model, style) { @@ -28,6 +29,7 @@ class Signal extends Group { this.createMouseEvent(); this.transformRotation(this); this.setState(model); + this.checkIsDrawMap(); } create() { @@ -510,6 +512,19 @@ class Signal extends Group { y: rect.y - offsetY }; } + drawSelected(selected) { + this.highlight && this.highlight.drawSelected(selected); + } + + checkIsDrawMap() { + const path = window.location.href; + if (path.includes('/map/draw')) { + this.highlight = new EHighlight(this); + this.add(this.highlight); + this.on('mouseout', () => { this.highlight.mouseout(); }); + this.on('mouseover', () => { this.highlight.mouseover(); }); + } + } } export default Signal; diff --git a/src/jmapNew/shape/Station/index.js b/src/jmapNew/shape/Station/index.js index 152d34e4d..e777c9cf9 100644 --- a/src/jmapNew/shape/Station/index.js +++ b/src/jmapNew/shape/Station/index.js @@ -2,73 +2,88 @@ * 车站 */ import Group from 'zrender/src/container/Group'; -import ETextName from '../element/ETextName'; // 名称文字 (共有) +import ETextName from '../element/ETextName'; +import EHighlight from '../element/EHighlight'; // 名称文字 (共有) export default class Station extends Group { - constructor(model, style) { - super(); - this._code = model.code; - this._type = model._type; - this.zlevel = model.zlevel; - this.z = 40; - this.model = model; - this.style = style; - this.create(); - this.setState(model); - } + constructor(model, style) { + super(); + this._code = model.code; + this._type = model._type; + this.zlevel = model.zlevel; + this.z = 40; + this.model = model; + this.style = style; + this.create(); + this.setState(model); + this.checkIsDrawMap(); + } - create() { - const model = this.model; - const style = this.style; + create() { + const model = this.model; + const style = this.style; - if (model.visible) { - // 公里标名称是否显示 - this.stationText = new ETextName({ - zlevel: this.zlevel, - z: this.z, - position: [0, 0], - x: model.position.x, - y: model.position.y, - fontWeight: model.fontWeight, - fontSize: model.nameFont || 18, - fontFamily: style.fontFamily, - text: model.name, - textAlign: 'middle', - textVerticalAlign: 'top', - textFill: model.nameFontColor - }); - this.add(this.stationText); - const path = window.location.href; - if (style.Station.kmPostShow || path.includes('/map/draw')) { - // 公里标是否显示 - let direction = 1; - if (this.style.Station.kilometerPosition == 'up') { - direction = -1; - } - this.mileageText = new ETextName({ - zlevel: this.zlevel, - z: this.z, - position: [0, 0], - x: model.position.x, - y: model.position.y + ((parseInt(model.nameFont) + 2) * direction), - fontWeight: model.fontWeight, - fontSize: model.kmPostFont || 18, - fontFamily: style.fontFamily, - text: model.kmPost, - textAlign: 'middle', - textVerticalAlign: 'top', - textFill: model.kmPostFontColor - }); - this.add(this.mileageText); - } - } - } + if (model.visible) { + // 公里标名称是否显示 + this.stationText = new ETextName({ + zlevel: this.zlevel, + z: this.z, + position: [0, 0], + x: model.position.x, + y: model.position.y, + fontWeight: model.fontWeight, + fontSize: model.nameFont || 18, + fontFamily: style.fontFamily, + text: model.name, + textAlign: 'middle', + textVerticalAlign: 'top', + textFill: model.nameFontColor + }); + this.add(this.stationText); + const path = window.location.href; + if (style.Station.kmPostShow || path.includes('/map/draw')) { + // 公里标是否显示 + let direction = 1; + if (this.style.Station.kilometerPosition == 'up') { + direction = -1; + } + this.mileageText = new ETextName({ + zlevel: this.zlevel, + z: this.z, + position: [0, 0], + x: model.position.x, + y: model.position.y + ((parseInt(model.nameFont) + 2) * direction), + fontWeight: model.fontWeight, + fontSize: model.kmPostFont || 18, + fontFamily: style.fontFamily, + text: model.kmPost, + textAlign: 'middle', + textVerticalAlign: 'top', + textFill: model.kmPostFontColor + }); + this.add(this.mileageText); + } + } + } - // eslint-disable-next-line no-unused-vars - setState(model) { - } + // eslint-disable-next-line no-unused-vars + setState(model) { + } - getShapeTipPoint() { - return null; - } + getShapeTipPoint() { + return null; + } + drawSelected(selected) { + this.highlight && this.highlight.drawSelected(selected); + } + + checkIsDrawMap() { + const path = window.location.href; + if (path.includes('/map/draw')) { + this.highlight = new EHighlight(this); + this.add(this.highlight); + this.on('mouseout', () => { this.highlight.mouseout(); }); + this.on('mouseover', () => { this.highlight.mouseover(); }); + } + } } diff --git a/src/jmapNew/shape/StationStand/index.js b/src/jmapNew/shape/StationStand/index.js index f9afaa17d..6ab8673d7 100644 --- a/src/jmapNew/shape/StationStand/index.js +++ b/src/jmapNew/shape/StationStand/index.js @@ -9,6 +9,7 @@ import ESafeStand from './ESafeStand'; import ESafeEmergent from './ESafeEmergent'; import EMouse from './EMouse'; import EJump from './EJump'; +import EHighlight from '../element/EHighlight'; class StationStand extends Group { constructor(model, style) { @@ -24,6 +25,7 @@ class StationStand extends Group { this.createMouseEvent(); this.setVisible(model.visible); this.setState(model); + this.checkIsDrawMap(); } create() { const model = this.model; @@ -413,5 +415,19 @@ class StationStand extends Group { } return null; } + + drawSelected(selected) { + this.highlight && this.highlight.drawSelected(selected); + } + + checkIsDrawMap() { + const path = window.location.href; + if (path.includes('/map/draw')) { + this.highlight = new EHighlight(this); + this.add(this.highlight); + this.on('mouseout', () => { this.highlight.mouseout(); }); + this.on('mouseover', () => { this.highlight.mouseover(); }); + } + } } export default StationStand; diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index c51012deb..98acf77d4 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -10,6 +10,7 @@ import ESwLocal from './ESwLocal.js'; import ESwLnversion from './ESwLnversion'; import ELockRect from './ELockRect'; import EMouse from './EMouse'; +import EHighlight from '../element/EHighlight'; export default class Switch extends Group { constructor(model, style) { @@ -25,6 +26,7 @@ export default class Switch extends Group { this.createLockRect(); // 创建单锁矩形框显示 this.createMouseEvent(); this.setState(model); + this.checkIsDrawMap(); } createMouseEvent() { @@ -422,4 +424,18 @@ export default class Switch extends Group { } return null; } + + drawSelected(selected) { + this.highlight && this.highlight.drawSelected(selected); + } + + checkIsDrawMap() { + const path = window.location.href; + if (path.includes('/map/draw')) { + this.highlight = new EHighlight(this); + this.add(this.highlight); + this.on('mouseout', () => { this.highlight.mouseout(); }); + this.on('mouseover', () => { this.highlight.mouseover(); }); + } + } } diff --git a/src/jmapNew/shape/element/EHighlight.js b/src/jmapNew/shape/element/EHighlight.js new file mode 100644 index 000000000..5c061636a --- /dev/null +++ b/src/jmapNew/shape/element/EHighlight.js @@ -0,0 +1,47 @@ +import Group from 'zrender/src/container/Group'; +import Rect from 'zrender/src/graphic/shape/Rect'; + +class EHighlight extends Group { + constructor(device) { + super(); + this.device = device; + this.selected = false; + this.create(); + } + create() { + if (this.device) { + const rect = this.device.getBoundingRect(); + this.lineBorder = new Rect({ + zlevel: this.device.zlevel, + z: this.device.z + 1, + shape: rect, + style: { + lineDash: [3, 3], + stroke: '#fff', + fill: 'rgba(204,255,255,0.5)' + } + }); + + this.add(this.lineBorder); + this.lineBorder.hide(); + } + } + + mouseover() { + this.lineBorder && this.lineBorder.show(); + } + + mouseout() { + !this.selected && this.lineBorder && this.lineBorder.hide(); + } + drawSelected(selected) { + if (selected && this.lineBorder) { + this.lineBorder && this.lineBorder.show(); + this.selected = true; + } else { + this.lineBorder && this.lineBorder.hide(); + this.selected = false; + } + } +} +export default EHighlight; diff --git a/src/store/modules/map.js b/src/store/modules/map.js index ce908fd16..9b1f33792 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -84,110 +84,110 @@ function saveMapDeviceDefaultRelations(state) { const map = state.map; const deviceMap = Vue.prototype.$jlmap.mapDevice; // 是否集中站 - if (map.stationControlList && map.stationControlList.length) { - map.stationControlList.forEach(elem => { - const station = deviceMap[elem.stationCode]; - if (station) { - station.centralized = true; - } - }); - } + // if (map.stationControlList && map.stationControlList.length) { + // map.stationControlList.forEach(elem => { + // const station = deviceMap[elem.stationCode]; + // if (station) { + // station.centralized = true; + // } + // }); + // } // 设置区段关联 if (map.sectionList && map.sectionList.length) { - map.sectionList.forEach(elem => { - if (elem.type !== '03') { - const station = deviceMap[elem.parentCode]; - if (station) { - elem.stationCode = station.stationCode; - } - } else { - elem.parentCode = ''; - } + // map.sectionList.forEach(elem => { + // if (elem.type !== '03') { + // const station = deviceMap[elem.parentCode]; + // if (station) { + // elem.stationCode = station.stationCode; + // } + // } else { + // elem.parentCode = ''; + // } - if (elem.type === '01') { - elem.nameShow == true; - } - }); + // if (elem.type === '01') { + // elem.nameShow == true; + // } + // }); } // 站台轨设置 - if (map.stationStandList && map.stationStandList.length && map.sectionList && map.sectionList.length) { - map.stationStandList.forEach((stand) => { - const stopPoint = deviceMap[stand.stopPointCode]; - if (stopPoint) { - map.sectionList.forEach(section => { - if (section.type === '01' && - stopPoint.linkCode === section.linkCode && - stopPoint.offset >= section.offsetLeft && - stopPoint.offset <= section.offsetRight) { - section.isStandTrack = true; - if (!section.standTrackName) { - section.standTrackName = section.name.replace(section.name.slice(0, 2), 'ZT'); - } - if (!section.standTrackNamePosition) { - section.standTrackNamePosition = { x: 0, y: 0 }; - } - } - }); - } - }); - } + // if (map.stationStandList && map.stationStandList.length && map.sectionList && map.sectionList.length) { + // map.stationStandList.forEach((stand) => { + // const stopPoint = deviceMap[stand.stopPointCode]; + // if (stopPoint) { + // map.sectionList.forEach(section => { + // if (section.type === '01' && + // stopPoint.linkCode === section.linkCode && + // stopPoint.offset >= section.offsetLeft && + // stopPoint.offset <= section.offsetRight) { + // section.isStandTrack = true; + // if (!section.standTrackName) { + // section.standTrackName = section.name.replace(section.name.slice(0, 2), 'ZT'); + // } + // if (!section.standTrackNamePosition) { + // section.standTrackNamePosition = { x: 0, y: 0 }; + // } + // } + // }); + // } + // }); + // } // 折返轨设置 - if (map.stopPointList && map.stopPointList.length && map.sectionList && map.sectionList.length) { - map.stopPointList.forEach(stopPoint => { - if (stopPoint.isTurningPoint) { - map.sectionList.forEach(section => { - if (section.type === '01' && - stopPoint.linkCode === section.linkCode && - stopPoint.offset >= section.offsetLeft && - stopPoint.offset <= section.offsetRight) { - section.isReentryTrack = true; - if (!section.reentryTrackName) { - section.reentryTrackName = section.name.replace(section.name.slice(0, 2), 'ZF'); - } - if (!section.reentryTrackNamePosition) { - section.reentryTrackNamePosition = { x: 0, y: 0 }; - } - } - }); - } - }); - } + // if (map.stopPointList && map.stopPointList.length && map.sectionList && map.sectionList.length) { + // map.stopPointList.forEach(stopPoint => { + // if (stopPoint.isTurningPoint) { + // map.sectionList.forEach(section => { + // if (section.type === '01' && + // stopPoint.linkCode === section.linkCode && + // stopPoint.offset >= section.offsetLeft && + // stopPoint.offset <= section.offsetRight) { + // section.isReentryTrack = true; + // if (!section.reentryTrackName) { + // section.reentryTrackName = section.name.replace(section.name.slice(0, 2), 'ZF'); + // } + // if (!section.reentryTrackNamePosition) { + // section.reentryTrackNamePosition = { x: 0, y: 0 }; + // } + // } + // }); + // } + // }); + // } // 设置道岔区段 if (map.switchList && map.switchList.length && map.sectionList && map.sectionList.length) { map.switchList.forEach(elem => { const sectiona = deviceMap[elem.sectionACode]; if (sectiona && sectiona.type !== '03') { - sectiona.nameShow = false; - sectiona.isSwitchSection = true; - sectiona.relSwitchCode = elem.code; + // sectiona.nameShow = false; + // sectiona.isSwitchSection = true; + // sectiona.relSwitchCode = elem.code; } const sectionb = deviceMap[elem.sectionBCode]; if (sectionb && sectionb.type !== '03') { - sectionb.nameShow = false; - sectionb.isSwitchSection = true; - sectionb.relSwitchCode = elem.code; + // sectionb.nameShow = false; + // sectionb.isSwitchSection = true; + // sectionb.relSwitchCode = elem.code; } const sectionc = deviceMap[elem.sectionCCode]; if (sectionc && sectionc.type !== '03') { - sectionc.nameShow = false; - sectionc.isSwitchSection = true; - sectionc.relSwitchCode = elem.code; - } - let sectionp = ''; - if (sectiona && sectiona.parentCode) { - sectionp = deviceMap[sectiona.parentCode]; - } else if (sectionb && sectionb.parentCode) { - sectionp = deviceMap[sectionb.parentCode]; - } else if (sectionc && sectionc.parentCode) { - sectionp = deviceMap[sectionc.parentCode]; - } - if (sectionp) { - sectionp.relSwitchCode = elem.code; + // sectionc.nameShow = false; + // sectionc.isSwitchSection = true; + // sectionc.relSwitchCode = elem.code; } + // let sectionp = ''; + // if (sectiona && sectiona.parentCode) { + // sectionp = deviceMap[sectiona.parentCode]; + // } else if (sectionb && sectionb.parentCode) { + // sectionp = deviceMap[sectionb.parentCode]; + // } else if (sectionc && sectionc.parentCode) { + // sectionp = deviceMap[sectionc.parentCode]; + // } + // if (sectionp) { + // sectionp.relSwitchCode = elem.code; + // } }); } diff --git a/src/views/newMap/jlmapNew/index.vue b/src/views/newMap/jlmapNew/index.vue index 58bed977f..eca3c470a 100644 --- a/src/views/newMap/jlmapNew/index.vue +++ b/src/views/newMap/jlmapNew/index.vue @@ -137,7 +137,7 @@ export default { // 默认个人地图绘制可以滚轮放大缩小 其他地图显示不允许此操作 const path = window.location.href; let mouseWheelFlag = false; - if (path.includes('design/userlist/map/draw')) { + if (path.includes('design/userlist/map/draw') || path.includes('design/usermap/map/draw')) { mouseWheelFlag = true; } @@ -183,10 +183,6 @@ export default { }, 100); }); }, - // 设置显示图级 - setLayerVisible(layer) { - this.$jlmap && this.$jlmap.setLayerVisible(layer); - }, // 设置显示图层 setLevelVisible(levels) { this.$jlmap && this.$jlmap.setLevelVisible(levels); diff --git a/src/views/newMap/newMapdraft/configMap.vue b/src/views/newMap/newMapdraft/configMap.vue index 739ed64ff..3348d9d03 100644 --- a/src/views/newMap/newMapdraft/configMap.vue +++ b/src/views/newMap/newMapdraft/configMap.vue @@ -2,31 +2,13 @@ - - - {{ $t('map.logicalView') }} - {{ $t('map.physicalView') }} - - - - - - {{ view.name }} - - - + {{ view.name }} - - - - {{ view.name }} - - @@ -51,22 +33,10 @@ export default { { code: 'Signal', name: this.$t('map.signal') }, { code: 'Switch', name: this.$t('map.switch') } ], - HybridViewTypeList: [], - - defaultLogicalSelect: [], - defaultPhysicalSelect: [], - defaultHybridSelect: [], - - logicalLevelsSelect: [], - physicalLevelsSelect: [], - hybridLevelsSelect: [] // 混合图层 + // defaultPhysicalSelect: [], // 默认选中 + physicalLevelsSelect: [] // 选中list }; }, - watch: { - '$store.state.map.mapDataLoadedCount': function (val) { - this.handleSelectView(this.viewSelect); - } - }, mounted() { this.initPage(); }, @@ -78,53 +48,17 @@ export default { this.dialogTableVisible = false; }, initPage() { - this.$Dictionary.logicalViewType().then(list => { - this.LogicalViewTypeList = list; - list.forEach(v => { - this.HybridViewTypeList.push(v); - this.hybridLevelsSelect.push(v.code); - this.defaultHybridSelect.push(v.code); - }); - this.LogicalViewTypeList.forEach(elem => { - this.logicalLevelsSelect.push(elem.code); - this.defaultLogicalSelect.push(elem.code); - }); - }); this.$Dictionary.physicalViewType().then(list => { this.PhysicalViewTypeList = list; - list.forEach(v => { - this.HybridViewTypeList.push(v); - this.hybridLevelsSelect.push(v.code); - this.defaultHybridSelect.push(v.code); - }); this.PhysicalViewTypeList.forEach(elem => { this.physicalLevelsSelect.push(elem.code); - this.defaultPhysicalSelect.push(elem.code); + // this.defaultPhysicalSelect.push(elem.code); }); }); }, - handleSelectView(value) { - if (value.length == 2) { - this.$emit('handleSelectView', '03'); - this.hybridLevelsSelect = this.copyList(this.defaultHybridSelect); - } else { - this.$emit('handleSelectView', value); - if (this.viewSelect[0] == this.ViewMode.LOGIC) { - this.logicalLevelsSelect = this.copyList(this.defaultLogicalSelect); - } else { - this.physicalLevelsSelect = this.copyList(this.defaultPhysicalSelect); - } - } - }, - handleSelectLogicalView(handle) { - this.$emit('handleSelectLogicalView', handle); - }, handleSelectPhysicalView(handle) { this.$emit('handleSelectPhysicalView', handle); }, - handleSelectHybridView(handle) { - this.$emit('handleSelectHybridView', handle); - }, copyList(list) { return JSON.parse(JSON.stringify(list)); } diff --git a/src/views/newMap/newMapdraft/index.vue b/src/views/newMap/newMapdraft/index.vue index aa9f3bdab..10e6faf08 100644 --- a/src/views/newMap/newMapdraft/index.vue +++ b/src/views/newMap/newMapdraft/index.vue @@ -164,26 +164,11 @@ export default { this.$store.dispatch('menuOperation/setMapDrawSelectCount'); } }, - handleSelectView(handle) { - if (this.$refs.jlmapVisual) { - this.$refs.jlmapVisual.setLayerVisible(handle); - } - }, - handleSelectLogicalView(handle) { - if (this.$refs.jlmapVisual) { - this.$refs.jlmapVisual.setLevelVisible(handle); - } - }, handleSelectPhysicalView(handle) { if (this.$refs.jlmapVisual) { this.$refs.jlmapVisual.setLevelVisible(handle); } }, - handleSelectHybridView(handle) { - if (this.$refs.jlmapVisual) { - this.$refs.jlmapVisual.setLevelVisible(handle); - } - }, clickEvent(em) { var device = this.getDeviceByEm(em); this.onSelect(device); @@ -235,9 +220,8 @@ export default { if (this.$refs.jlmapVisual && map && parseInt(this.$route.params.mapId)) { if (this.verifySectionPoint(map)) { this.mapSaveing = true; - this.$store.dispatch('map/saveMapDeviceDefaultRelations').then(() => { + this.$store.dispatch('map/saveMapDeviceDefaultRelations').then(() => { // 草稿地图关系处理 saveMap(Object.assign(map, { mapId: this.$route.params.mapId })).then(response => { - // saveNewMap(Object.assign(map, { mapId: this.$route.params.mapId })).then(response => { this.$message.success(this.$t('tip.saveSuccessfully')); this.mapSaveing = false; this.initAutoSaveTask(); diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index 1c75442e7..d40071860 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -63,6 +63,7 @@ :selected="selected" @updateMapModel="updateMapModel" @setCenter="setCenter" + @standStationCode="standStationTab" /> @@ -89,22 +90,22 @@ @setCenter="setCenter" /> - + + - +
- 起点: + {{ this.$t('map.startingPoint') }}
@@ -41,20 +41,10 @@
-
- 终点: -
- - - -
-
- - - -
-
- + + + + {{ $t('map.activate') }} - +
- 新建 + {{ this.$t('map.newConstruction') }}
@@ -330,7 +320,7 @@ export default { createModel: { type: '01', startPoint: { x: 0, y: 0 }, - endPoint: { x: 0, y: 0 }, + length: 0, leftSectionCode: '', rightSectionCode: '' }, @@ -341,11 +331,8 @@ export default { 'startPoint.y': [ { required: true, message: this.$t('rules.destinationCodePointY'), trigger: 'blur' } ], - 'endPoint.x': [ - { required: true, message: this.$t('rules.destinationCodePointX'), trigger: 'blur' } - ], - 'endPoint.y': [ - { required: true, message: this.$t('rules.destinationCodePointY'), trigger: 'blur' } + 'length': [ + { required: true, message: '请填写距离值', trigger: 'blur' } ] }, typeOptions: [{ @@ -518,9 +505,6 @@ export default { relSwitchCode: [ { required: true, message: this.$t('rules.sectionRelSwitchCode'), trigger: 'change' } ], - trainPosType: [ - { required: true, message: this.$t('rules.pleaseSelectTrainDir'), trigger: 'change' } - ], leftSectionCode: [ { validator: validateLeftSection, trigger: 'change' } ], @@ -825,7 +809,7 @@ export default { this.editModel.points.splice(index, 1); this.logicSectionNums.splice(index, 1); }, - // 一键生成区段 + // 创建区段 create() { const uid = getUID('Section'); const model = { @@ -871,7 +855,7 @@ export default { if (this.createModel.type == '01') { model.points = [ { x: this.createModel.startPoint.x, y: this.createModel.startPoint.y }, - { x: this.createModel.endPoint.x, y: this.createModel.endPoint.y } + { x: this.createModel.startPoint.x + this.createModel.length, y: this.createModel.startPoint.y } ]; } else if (this.createModel.type == '02') { const startModel = this.$store.getters['map/getDeviceByCode'](this.createModel.leftSectionCode); diff --git a/src/views/newMap/newMapdraft/mapoperate/signal.vue b/src/views/newMap/newMapdraft/mapoperate/signal.vue index f23b8cb0d..d72733a93 100644 --- a/src/views/newMap/newMapdraft/mapoperate/signal.vue +++ b/src/views/newMap/newMapdraft/mapoperate/signal.vue @@ -19,11 +19,17 @@ - --> +
+ +
+ + 111 + +
+
+ + {{ $t('map.create') }} + +
+
+ +
+ + 222 + +
+
+ + {{ $t('map.create') }} + +
+
+ +
+ + 333 + +
+
+ + {{ $t('map.create') }} + +
+
+ +
+ + 444 + +
+
+ + {{ $t('map.create') }} + +
+
@@ -193,9 +241,9 @@ export default { this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, deviceSelect(selected) { - this.$refs.dataform.resetFields(); - this.$refs.make.resetFields(); - if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) { + // this.$refs.make.resetFields(); + if (this.field.toUpperCase() != 'selectStationCode'.toUpperCase() && selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) { + this.$refs.dataform.resetFields(); this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); this.editModel.runPlanName = selected.runPlanName || ''; @@ -204,11 +252,19 @@ export default { return !data.centralized && data.code != this.editModel.code && !(data.controlled && data.concentrateStationCode != this.editModel.code); }); } - if (this.field.toUpperCase() === 'selectStationCode'.toUpperCase()) { - this.addModel.sectionCode = selected.code; - this.activeName = 'second'; - this.field = ''; - this.$emit('stationSectionCode', ''); + if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'selectStationCode'.toUpperCase()) { + if (selected.type == '01') { + this.addModel.sectionCode = selected.code; + this.activeName = 'second'; + this.field = ''; + this.$emit('stationSectionCode', ''); + } else if (selected.type == '02') { + this.addModel.sectionCode = selected.parentCode; + this.activeName = 'second'; + this.field = ''; + this.$emit('stationSectionCode', ''); + } + } }, // 选择管理车站 @@ -218,13 +274,13 @@ export default { const newModal = Object.assign({}, station); newModal.controlled = false; newModal.concentrateStationCode = ''; - this.setStationStand(station,''); + this.setStationStand(station, ''); data.forEach(each=>{ switch (each) { case station.code: { newModal.controlled = true; newModal.concentrateStationCode = this.editModel.code; - this.setStationStand(station,this.editModel.code); + this.setStationStand(station, this.editModel.code); break; } } @@ -244,7 +300,7 @@ export default { this.edit(); this.modifyChargeStation(); this.setStationStand(this.editModel, ''); - }else { + } else { this.setStationStand(this.editModel, this.editModel.code); } }, diff --git a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue index 0db497753..1c22b54ee 100644 --- a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue +++ b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue @@ -26,16 +26,11 @@ :value="item.code" /> - - - - - + {{ $t('map.activate') }} @@ -107,6 +102,7 @@ export default { visible: true, direction: '' }, + field: '', addModel: { stationCode: '', doorLocationType: '01', @@ -202,7 +198,7 @@ export default { ], doorLocationType: [ { required: true, message: this.$t('rules.doorLocationType'), trigger: 'change' } - ], + ] }; } }, @@ -228,25 +224,32 @@ export default { updateView() { this.edit(); }, - changeStation(data){ - let station=this.stationList.find(elem => {return elem.code==data}); - if(station){ - if(station.centralized){ - this.addModel.deviceStationCode=station.code; - } - else{ - this.addModel.deviceStationCode=station.concentrateStationCode; + changeStation(data) { + const station = this.stationList.find(elem => { return elem.code == data; }); + if (station) { + if (station.centralized) { + this.addModel.deviceStationCode = station.code; + } else { + this.addModel.deviceStationCode = station.concentrateStationCode; } } }, + hover(field) { + this.field = field === this.field ? '' : field; + this.$emit('standStationCode', this.field); + }, deviceSelect(selected) { - this.$refs.dataform.resetFields(); - this.$refs.make.resetFields(); - if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) { + // this.$refs.make.resetFields(); + if (this.field.toUpperCase() != 'standSelectStationCode'.toUpperCase() && selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) { + this.$refs.dataform.resetFields(); this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); - } else if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) { + } + if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase() && this.field.toUpperCase() === 'standSelectStationCode'.toUpperCase()) { this.addModel.stationCode = selected.code; + this.activeName = 'second'; + this.field = ''; + this.$emit('standStationCode', ''); } }, create() { diff --git a/src/views/newMap/newMapdraft/mapoperate/switch.vue b/src/views/newMap/newMapdraft/mapoperate/switch.vue index 40b200d21..904b47ff2 100644 --- a/src/views/newMap/newMapdraft/mapoperate/switch.vue +++ b/src/views/newMap/newMapdraft/mapoperate/switch.vue @@ -195,8 +195,8 @@ export default { this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, deviceSelect(selected) { - this.$refs.dataform.resetFields(); - if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) { + if (this.field.toUpperCase() != 'relevanceSectionList'.toUpperCase() && selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) { + this.$refs.dataform.resetFields(); this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); } else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'relevanceSectionList'.toUpperCase()) { @@ -527,6 +527,7 @@ export default { }); } }); + console.log(sectiona); sectiona.relSwitchCode = elem.code; sectionb.relSwitchCode = elem.code; diff --git a/src/views/orderauthor/permission/create/edit.vue b/src/views/orderauthor/permission/create/edit.vue new file mode 100644 index 000000000..a0d9f67ed --- /dev/null +++ b/src/views/orderauthor/permission/create/edit.vue @@ -0,0 +1,114 @@ + + + diff --git a/src/views/orderauthor/permission/create/index.vue b/src/views/orderauthor/permission/create/index.vue index d1330659a..c32aa15cc 100644 --- a/src/views/orderauthor/permission/create/index.vue +++ b/src/views/orderauthor/permission/create/index.vue @@ -56,7 +56,7 @@ export default { this.display = 1; }, // 万能权限,走订单路线 - permissionNextOrder(permission, good) { + permissionNextOrder(good) { this.goodsList = [{ isPackage: true, id: good.id, @@ -66,7 +66,6 @@ export default { price: good.price, list: good.list }]; - this.$refs.orderForm.setOrderName(permission, good); this.display = 1; }, orderNext(data) { diff --git a/src/views/orderauthor/permission/create/order.vue b/src/views/orderauthor/permission/create/order.vue index 88cead5a5..8621c34bb 100644 --- a/src/views/orderauthor/permission/create/order.vue +++ b/src/views/orderauthor/permission/create/order.vue @@ -1,12 +1,7 @@