This commit is contained in:
joylink_cuiweidong 2022-07-15 11:34:32 +08:00
commit 898cadb72d
9 changed files with 1452 additions and 1114 deletions

View File

@ -1,5 +1,6 @@
# just a flag
NODE_ENV = 'local-test'
NODE_ENV = 'test'
VUE_APP_PRO = 'local-test'
# base api
# VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud'

View File

@ -255,6 +255,10 @@ class SkinCode extends defaultStyle {
}
};
this[deviceType.SignalButton] = {
shape: 'roundWithDock'
}
// 供电线路
this[deviceType.Power] = {
noElectricStrokeColor:'#808080', // 无电颜色

View File

@ -465,9 +465,7 @@ class Signal extends Group {
}
this.add(this.sigPost);
this.add(this.sigName);
this.style.Signal.text.show && model.nameShow ? this.sigName.show() : this.sigName.hide();
this.style.Signal.text.show && model.nameShow && this.add(this.sigName);
this.add(this.sigRoute);
this.add(this.sigDelay);
this.add(this.remainTimeName);

View File

@ -3,6 +3,7 @@ import Rect from 'zrender/src/graphic/shape/Rect';
import Line from 'zrender/src/graphic/shape/Line';
import Text from 'zrender/src/graphic/Text';
import Arc from 'zrender/src/graphic/shape/Arc';
import Circle from 'zrender/src/graphic/shape/Circle';
import store from '@/store/index';
export default class SignalButton extends Group {
@ -34,41 +35,84 @@ export default class SignalButton extends Group {
return item.includes('ctc');
});
const ctcArcList = ['OCCLUSION', 'RECOVERY', 'CHANGE_DIRECTION', 'ACCIDENT', 'DEPART_ASSIST', 'PICK_ASSIST', 'ASSIST'];
if (queryCtc && ctcArcList.includes(model.type)) {
this.arcShape = new Arc({
const typeList = []
console.log(this.style.SignalButton.shape === 'roundWithDock')
if (queryCtc && ctcArcList.includes(model.type)){
this.arcShape = new Arc({
zlevel: this.zlevel,
z: this.z,
shape: {
cx: this.model.position.x + 7,
cy: this.model.position.y + 7,
r: 7
},
style: {
stroke: '#69666E',
lineWidth: 1,
fill: fillColor
}
});
this.add(this.arcShape);
} else if (this.style.SignalButton.shape === 'roundWithDock' && typeList.includes(model.type)) { //TODO 通过线路配置this.style和按钮类型type判断
const circle1 = new Circle({
zlevel: this.zlevel,
z: this.z + 2,
shape: {
cx: this.model.position.x + 7,
cy: this.model.position.y + 7,
r: 7
},
style: {
stroke: '#69666E',
lineWidth: 1,
fill: fillColor
}
})
const circle2 = new Circle({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
cx: this.model.position.x + 7,
cy: this.model.position.y + 9,
r: 8
},
style: {
fill: '#000'
}
})
const circle3 = new Circle({
zlevel: this.zlevel,
z: this.z,
shape: {
cx: computedPosition.x + 7,
cy: computedPosition.y + 7,
r: 7
cx: this.model.position.x + 7,
cy: this.model.position.y + 9,
r: 9
},
style: {
stroke: '#69666E',
lineWidth: 1,
fill: fillColor
fill: '#eee'
}
});
this.add(this.arcShape);
})
this.arcShape = circle1
this.add(circle1).add(circle2).add(circle3)
} else {
this.rectButton = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: computedPosition.x,
y: computedPosition.y,
width: 14,
height: 14
},
style: {
lineDash: null,
stroke: '#69666E',
lineWidth:1,
fill: fillColor
}
});
this.add(this.rectButton);
}
this.rectButton = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: model.position.x,
y: model.position.y,
width: 14,
height: 14
},
style: {
lineDash: null,
stroke: '#69666E',
lineWidth:1,
fill: fillColor
}
});
this.add(this.rectButton);
}
this.leftLine = new Line({
zlevel: this.zlevel,
z: this.z + 1,

View File

@ -225,10 +225,9 @@ export default class Switch extends Group {
this.add(this.shapeModelB);
this.add(this.shapeModelC);
this.add(this.shapeBlockCover);
this.add(this.name);
style.Switch.text.show && model.nameShow && this.add(this.name);
this.add(this.enabledName);
style.Switch.text.show && model.nameShow ? this.name.show() : this.name.hide();
}
createLockRect() {

File diff suppressed because it is too large Load Diff

View File

@ -40,16 +40,16 @@ export function handlerUrl(data) {
VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
UPLOAD_API = 'http://joylink.club/jlfile';
BASE_SITE = 'https://test.joylink.club/cbtc';
} else if (process.env.NODE_ENV === 'test' && process.env.VUE_APP_PRO === 'local-test') {
BASE_API = 'https://192.168.3.233/rtss-server';
VOICE_API = 'https://192.168.3.233/oss/joylink';
UPLOAD_API = 'https://192.168.3.233';
BASE_SITE = '/cbtc';
} else if (process.env.NODE_ENV === 'test') {
BASE_API = data && data.domainName ? 'https://' + data.domainName : 'https://test.joylink.club/jlcloud';
VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
UPLOAD_API = 'http://joylink.club/jlfile';
BASE_SITE = 'https://test.joylink.club/cbtc';
} else if (process.env.NODE_ENV === 'local-test') {
BASE_API = 'https://192.168.3.233/rtss-server';
VOICE_API = 'https://192.168.3.233/oss/joylink';
UPLOAD_API = 'https://192.168.3.233';
BASE_SITE = '/cbtc';
} else if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_PRO === 'local') {
BASE_API = 'http://160.20.60.15:9000';
VOICE_API = 'http://160.20.60.15/oss/joylink';

View File

@ -12,328 +12,437 @@
/>
</el-tab-pane>
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
<create-operate
ref="createForm"
:create-form="createForm"
:add-model="addModel"
:create-rules="rules"
@create="create"
/>
<create-operate ref="createForm" :create-form="createForm" :add-model="addModel" :create-rules="rules" @create="create" />
</el-tab-pane>
</el-tabs>
</template>
<script>
import { mapGetters } from 'vuex';
import { getUID } from '@/jmapNew/utils/Uid';
import OperateProperty from './components/operateProperty';
import CreateOperate from './components/createOperate';
import { deepAssign } from '@/utils/index';
import { mapGetters } from 'vuex'
import { getUID } from '@/jmapNew/utils/Uid'
import OperateProperty from './components/operateProperty'
import CreateOperate from './components/createOperate'
import { deepAssign } from '@/utils/index'
export default {
name: 'SignalButton',
components: {
OperateProperty,
CreateOperate
},
props: {
selected: {
type: Object,
default: function () {
return null;
}
}
},
data() {
return {
activeName: 'first',
lazy: true,
field: '',
editModel: {
code: '',
name: '',
type: '',
signalCode: '',
sectionCode: '',
switchCode: '',
labelEnum: '',
position: {
x: 0,
y: 0
},
nameOffset: {
x: 0,
y: -10
},
stationCode: ''
},
addModel: {
name: '',
type: '',
position: {
x: 0,
y: 0
},
nameOffset: {
x: 0,
y: -10
}
},
typeList: [
{ value: 'PICK', label: '接车按钮' },
{ value: 'PASS', label: '通过按钮' },
{ value: 'GUIDE', label: '引导按钮' },
{ value: 'FLEXIBLE', label: '变通按钮' },
{ value: 'RAMP_TERMINAL', label: '坡道终端按钮'},
{ value: 'TRAIN_TERMINAL', label: '列车终端按钮'},
{ value: 'SHUNT_TERMINAL', label: '调车终端按钮'},
{ value: 'ASSIST', label: '总辅助按钮' },
{ value: 'PICK_ASSIST', label: '接辅助按钮' },
{ value: 'DEPART_ASSIST', label: '发辅助按钮' },
{ value: 'ACCIDENT', label: '事故按钮' },
{ value: 'CHANGE_DIRECTION', label: '改方按钮' },
{ value: 'RECOVERY', label: '复原按钮' },
{ value: 'OCCLUSION', label: '闭塞按钮' }
],
centralizedStationList: [], //
directionList: [{label:'X',value:'X'},{label:'XF',value:'XF'},{label:'XD',value:'XD'},{label:'S',value:'S'},{label:'SF',value:'SF'},{label:'SD',value:'SD'}],
rules: {
code: [
{ required: true, message: this.$t('rules.selectText'), trigger: 'blur' }
],
// name: [
// { required: true, message: '', trigger: 'blur' }
// ],
type: [
{ required: true, message: '请选择按钮类型', trigger: 'change' }
],
signalCode: [
{ required: true, message: '请选择关联的信号机设备', trigger: 'change' }
],
sectionCode: [
{ required: true, message: '请选择关联的区段设备', trigger: 'change' }
],
switchCode: [
{ required: true, message: '请选择关联的道岔设备', trigger: 'change' }
],
'position.x': [
{ required: true, message: this.$t('rules.pleaseEnterXCoordinate'), trigger: 'blur' }
],
'position.y': [
{ required: true, message: this.$t('rules.pleaseEnterYCoordinate'), trigger: 'blur' }
],
labelEnum: [
{ required: true, message: '请选择方向', trigger: 'change' }
]
}
};
},
computed: {
...mapGetters('map', [
'signalButtonList',
'stationList',
'lineCode',
'signalList',
'sectionList',
'switchList'
]),
form() {
const form = {
labelWidth: '130px',
items: {
code: {
name: '',
item: []
},
draw: {
name: this.$t('map.drawData'),
item: [
{ prop: 'code', label: '按钮编码:', type: 'select', optionLabel: 'code', optionValue: 'code', options: this.signalButtonList, deviceChange: this.deviceChange },
{ prop: 'name', label: '按钮名称:', type: 'input' },
{ prop: 'nameOffset', label: '名称偏移:', type: 'coordinate', width: '120px', children: [
{ prop: 'nameOffset.x', firstLevel: 'nameOffset', secondLevel: 'x', label: 'x', type: 'number', labelWidth: '25px', disabled: false },
{ prop: 'nameOffset.y', firstLevel: 'nameOffset', secondLevel: 'y', label: 'y', type: 'number', labelWidth: '25px', disabled: false }
] },
{ prop: 'type', label: '按钮类型:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.typeList},
{ prop: 'signalCode', label: '关联信号机:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.signalList, hover: this.hover, buttonType: 'linkSignal', buttonShowType: this.isLinkSignalShow, isHidden: !this.isLinkSignal },
{ prop: 'sectionCode', label: '关联区段:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.sectionList, hover: this.hover, buttonType: 'linkSection', buttonShowType: this.isLinkSectionShow, isHidden: !this.isLinkSection },
{ prop: 'switchCode', label: '关联道岔:', type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.switchList, hover: this.hover, buttonType: 'linkSwitch', buttonShowType: this.isLinkSwitchShow, isHidden: !this.isLinkSwitch },
{ prop: 'labelEnum', label: '方向:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.directionList, isHidden: !this.isLinkDirection },
{ prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '120px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false }
] },
{ prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList }
]
},
map: {
name: this.$t('map.mapData'),
item: [
]
}
}
};
return form;
},
createForm() {
const form = {
labelWidth: '110px',
items:{
all:{
name:'',
item: [
{ prop: 'name', label: '按钮名称:', type: 'input' },
{ prop: 'type', label: '按钮类型:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.typeList},
{ prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '120px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false }
] }
]
}
}
};
return form;
},
isLinkSignalShow() {
return this.field === 'linkSignal';
},
isLinkSignal() {
const list = ['PICK', 'PASS', 'GUIDE'];
return list.includes(this.editModel.type);
},
isLinkSectionShow() {
return this.field === 'linkSection';
},
isLinkSwitchShow() {
return this.field === 'linkSwitch';
},
isLinkSection() {
const list = ['RAMP_TERMINAL', 'TRAIN_TERMINAL', 'SHUNT_TERMINAL'];
return list.includes(this.editModel.type);
},
isLinkSwitch() {
return this.editModel.type === 'FLEXIBLE';
},
isLinkDirection() {
return ['ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'ACCIDENT', 'CHANGE_DIRECTION', 'RECOVERY', 'OCCLUSION'].includes(this.editModel.type);
}
},
methods: {
handleInit() {
if (this.stationList && this.stationList.length) {
this.centralizedStationList = this.stationList.filter(station=> station.centralized);
}
},
hover(field) {
this.field = field == this.field ? '' : field;
if (this.field) {
this.$emit('deviceSelect', 'SignalButton');
} else {
this.$emit('deviceSelect', '');
}
},
deviceChange(code) {
this.$emit('setCenter', code);
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() === 'SignalButton'.toUpperCase()) {
this.handleInit();
this.$refs.form && this.$refs.form.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.editModel.signalCode = '';
this.editModel.switchCode = '';
this.editModel.sectionCode = '';
this.editModel.labelEnum = '';
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
} else if (this.field === 'linkSignal' && selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.activeName = 'first';
this.editModel.signalCode = selected.code;
} else if (this.field === 'linkSection' && selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
this.activeName = 'first';
this.editModel.sectionCode = selected.code;
} else if (this.field === 'linkSwitch' && selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
this.activeName = 'first';
this.editModel.switchCode = selected.code;
}
this.field = '';
this.$emit('deviceSelect', '');
},
clearDeviceSelect() {
this.$emit('deviceSelect', '');
},
create() {
const model = {
_type: 'SignalButton',
code: getUID('BTN', this.signalButtonList),
type: this.addModel.type,
name: this.addModel.name,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
},
nameOffset: {
x: this.addModel.nameOffset.x,
y: this.addModel.nameOffset.y
}
};
this.$refs.createForm.resetForm();
this.$emit('updateMapModel', model);
},
deleteObj() {
this.$refs.dataform.deleteObj();
},
//
edit() {
this.$refs.dataform.edit();
},
updateMapModel(data) {
if (this.isLinkSignal) {
data.sectionCode = ''; data.switchCode = ''; data.labelEnum = '';
} else if (this.isLinkSection) {
data.signalCode = ''; data.switchCode = ''; data.labelEnum = '';
} else if (this.isLinkSwitch) {
data.signalCode = ''; data.sectionCode = ''; data.labelEnum = '';
} else if (this.isLinkDirection) {
data.sectionCode = ''; data.signalCode = ''; data.switchCode = '';
}
this.$emit('updateMapModel', data);
}
name: 'SignalButton',
components: {
OperateProperty,
CreateOperate
},
props: {
selected: {
type: Object,
default: function() {
return null
}
}
};
},
data() {
return {
activeName: 'first',
lazy: true,
field: '',
editModel: {
code: '',
name: '',
type: '',
signalCode: '',
sectionCode: '',
switchCode: '',
labelEnum: '',
position: {
x: 0,
y: 0
},
nameOffset: {
x: 0,
y: -10
},
stationCode: ''
},
addModel: {
name: '',
type: '',
position: {
x: 0,
y: 0
},
nameOffset: {
x: 0,
y: -10
}
},
typeList: [
{ value: 'PICK', label: '接车按钮' },
{ value: 'PASS', label: '通过按钮' },
{ value: 'GUIDE', label: '引导按钮' },
{ value: 'FLEXIBLE', label: '变通按钮' },
{ value: 'RAMP_TERMINAL', label: '坡道终端按钮' },
{ value: 'TRAIN_TERMINAL', label: '列车终端按钮' },
{ value: 'SHUNT_TERMINAL', label: '调车终端按钮' },
{ value: 'ASSIST', label: '总辅助按钮' },
{ value: 'PICK_ASSIST', label: '接辅助按钮' },
{ value: 'DEPART_ASSIST', label: '发辅助按钮' },
{ value: 'ACCIDENT', label: '事故按钮' },
{ value: 'CHANGE_DIRECTION', label: '改方按钮' },
{ value: 'RECOVERY', label: '复原按钮' },
{ value: 'OCCLUSION', label: '闭塞按钮' }
],
centralizedStationList: [], //
directionList: [
{ label: 'X', value: 'X' },
{ label: 'XF', value: 'XF' },
{ label: 'XD', value: 'XD' },
{ label: 'S', value: 'S' },
{ label: 'SF', value: 'SF' },
{ label: 'SD', value: 'SD' }
],
rules: {
code: [{ required: true, message: this.$t('rules.selectText'), trigger: 'blur' }],
type: [{ required: true, message: '请选择按钮类型', trigger: 'change' }],
signalCode: [{ required: true, message: '请选择关联的信号机设备', trigger: 'change' }],
sectionCode: [{ required: true, message: '请选择关联的区段设备', trigger: 'change' }],
switchCode: [{ required: true, message: '请选择关联的道岔设备', trigger: 'change' }],
'position.x': [{ required: true, message: this.$t('rules.pleaseEnterXCoordinate'), trigger: 'blur' }],
'position.y': [{ required: true, message: this.$t('rules.pleaseEnterYCoordinate'), trigger: 'blur' }],
labelEnum: [{ required: true, message: '请选择方向', trigger: 'change' }]
}
}
},
computed: {
...mapGetters('map', ['signalButtonList', 'stationList', 'lineCode', 'signalList', 'sectionList', 'switchList']),
form() {
const form = {
labelWidth: '130px',
items: {
code: {
name: '',
item: []
},
draw: {
name: this.$t('map.drawData'),
item: [
{
prop: 'code',
label: '按钮编码:',
type: 'select',
optionLabel: 'code',
optionValue: 'code',
options: this.signalButtonList,
deviceChange: this.deviceChange
},
{ prop: 'name', label: '按钮名称:', type: 'input' },
{
prop: 'nameOffset',
label: '名称偏移:',
type: 'coordinate',
width: '120px',
children: [
{
prop: 'nameOffset.x',
firstLevel: 'nameOffset',
secondLevel: 'x',
label: 'x',
type: 'number',
labelWidth: '25px',
disabled: false
},
{
prop: 'nameOffset.y',
firstLevel: 'nameOffset',
secondLevel: 'y',
label: 'y',
type: 'number',
labelWidth: '25px',
disabled: false
}
]
},
{ prop: 'type', label: '按钮类型:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.typeList },
{
prop: 'signalCode',
label: '关联信号机:',
type: 'selectHover',
optionLabel: 'name&&code',
optionValue: 'code',
clearable: true,
options: this.signalList,
hover: this.hover,
buttonType: 'linkSignal',
buttonShowType: this.isLinkSignalShow,
isHidden: !this.isLinkSignal
},
{
prop: 'sectionCode',
label: '关联区段:',
type: 'selectHover',
optionLabel: 'name&&code',
optionValue: 'code',
clearable: true,
options: this.sectionList,
hover: this.hover,
buttonType: 'linkSection',
buttonShowType: this.isLinkSectionShow,
isHidden: !this.isLinkSection
},
{
prop: 'switchCode',
label: '关联道岔:',
type: 'selectHover',
optionLabel: 'name&&code',
optionValue: 'code',
clearable: true,
options: this.switchList,
hover: this.hover,
buttonType: 'linkSwitch',
buttonShowType: this.isLinkSwitchShow,
isHidden: !this.isLinkSwitch
},
{
prop: 'labelEnum',
label: '方向:',
type: 'select',
optionLabel: 'label',
optionValue: 'value',
options: this.directionList,
isHidden: !this.isLinkDirection
},
{
prop: 'position',
label: this.$t('map.textPoints'),
type: 'coordinate',
width: '120px',
children: [
{
prop: 'position.x',
firstLevel: 'position',
secondLevel: 'x',
label: 'x:',
type: 'number',
labelWidth: '25px',
disabled: false
},
{
prop: 'position.y',
firstLevel: 'position',
secondLevel: 'y',
label: 'y:',
type: 'number',
labelWidth: '25px',
disabled: false
}
]
},
{
prop: 'stationCode',
label: this.$t('map.equipmentStation') + ':',
type: 'select',
optionLabel: 'name&&code',
optionValue: 'code',
options: this.centralizedStationList
}
]
},
map: {
name: this.$t('map.mapData'),
item: []
}
}
}
return form
},
createForm() {
const form = {
labelWidth: '110px',
items: {
all: {
name: '',
item: [
{ prop: 'name', label: '按钮名称:', type: 'input' },
{ prop: 'type', label: '按钮类型:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.typeList },
{
prop: 'position',
label: this.$t('map.textPoints'),
type: 'coordinate',
width: '120px',
children: [
{
prop: 'position.x',
firstLevel: 'position',
secondLevel: 'x',
label: 'x:',
type: 'number',
labelWidth: '25px',
disabled: false
},
{
prop: 'position.y',
firstLevel: 'position',
secondLevel: 'y',
label: 'y:',
type: 'number',
labelWidth: '25px',
disabled: false
}
]
}
]
}
}
}
return form
},
isLinkSignalShow() {
return this.field === 'linkSignal'
},
isLinkSignal() {
const list = ['PICK', 'PASS', 'GUIDE']
return list.includes(this.editModel.type)
},
isLinkSectionShow() {
return this.field === 'linkSection'
},
isLinkSwitchShow() {
return this.field === 'linkSwitch'
},
isLinkSection() {
const list = ['RAMP_TERMINAL', 'TRAIN_TERMINAL', 'SHUNT_TERMINAL']
return list.includes(this.editModel.type)
},
isLinkSwitch() {
return this.editModel.type === 'FLEXIBLE'
},
isLinkDirection() {
return ['ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'ACCIDENT', 'CHANGE_DIRECTION', 'RECOVERY', 'OCCLUSION'].includes(
this.editModel.type
)
}
},
methods: {
handleInit() {
if (this.stationList && this.stationList.length) {
this.centralizedStationList = this.stationList.filter(station => station.centralized)
}
},
hover(field) {
this.field = field == this.field ? '' : field
if (this.field) {
this.$emit('deviceSelect', 'SignalButton')
} else {
this.$emit('deviceSelect', '')
}
},
deviceChange(code) {
this.$emit('setCenter', code)
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code))
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() === 'SignalButton'.toUpperCase()) {
this.handleInit()
this.$refs.form && this.$refs.form.resetFields()
this.$refs.dataform && this.$refs.dataform.resetFields()
this.editModel.signalCode = ''
this.editModel.switchCode = ''
this.editModel.sectionCode = ''
this.editModel.labelEnum = ''
this.activeName = 'first'
this.editModel = deepAssign(this.editModel, selected)
} else if (this.field === 'linkSignal' && selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.activeName = 'first'
this.editModel.signalCode = selected.code
} else if (this.field === 'linkSection' && selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
this.activeName = 'first'
this.editModel.sectionCode = selected.code
} else if (this.field === 'linkSwitch' && selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
this.activeName = 'first'
this.editModel.switchCode = selected.code
}
this.field = ''
this.$emit('deviceSelect', '')
},
clearDeviceSelect() {
this.$emit('deviceSelect', '')
},
create() {
const model = {
_type: 'SignalButton',
code: getUID('BTN', this.signalButtonList),
type: this.addModel.type,
name: this.addModel.name,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
},
nameOffset: {
x: this.addModel.nameOffset.x,
y: this.addModel.nameOffset.y
}
}
this.$refs.createForm.resetForm()
this.$emit('updateMapModel', model)
},
deleteObj() {
this.$refs.dataform.deleteObj()
},
//
edit() {
this.$refs.dataform.edit()
},
updateMapModel(data) {
if (this.isLinkSignal) {
data.sectionCode = ''
data.switchCode = ''
data.labelEnum = ''
} else if (this.isLinkSection) {
data.signalCode = ''
data.switchCode = ''
data.labelEnum = ''
} else if (this.isLinkSwitch) {
data.signalCode = ''
data.sectionCode = ''
data.labelEnum = ''
} else if (this.isLinkDirection) {
data.sectionCode = ''
data.signalCode = ''
data.switchCode = ''
}
this.$emit('updateMapModel', data)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.card {
height: 100%;
}
.coordinate {
overflow: hidden;
@import 'src/styles/mixin.scss';
.card {
height: 100%;
}
.coordinate {
overflow: hidden;
.title {
text-align: right;
font-size: 14px;
color: #606266;
line-height: 40px;
padding: 0 12px 0 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
line-height: 28px;
width: 120px;
font-weight: bold;
display: block;
float: left;
margin-right: 7px;
}
}
/deep/ {
.el-select .el-input {
width: 130px;
}
.title {
text-align: right;
font-size: 14px;
color: #606266;
line-height: 40px;
padding: 0 12px 0 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
line-height: 28px;
width: 120px;
font-weight: bold;
display: block;
float: left;
margin-right: 7px;
}
}
/deep/ {
.el-select .el-input {
width: 130px;
}
.input-with-select .el-input-group__prepend {
background-color: #fff;
}
}
.input-with-select .el-input-group__prepend {
background-color: #fff;
}
}
</style>

View File

@ -19,7 +19,6 @@ let outputDir = '';
outputDir = process.env.VUE_APP_PRO == 'local' || process.env.VUE_APP_PRO == 'ntyl' ? 'dist' : 'dist/cbtc';
})();
// All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = {
/**
@ -33,7 +32,7 @@ module.exports = {
outputDir: outputDir,
assetsDir: 'static', // 相对于outputDir的静态资源(js、css、img、fonts)目录
lintOnSave: false,
productionSourceMap: false,
productionSourceMap: false,
devServer: {
port: port,
host: '0.0.0.0',
@ -73,7 +72,7 @@ module.exports = {
// })
// );
if (process.env.NODE_ENV != 'development') {
config.mode = 'production';
config.mode = 'production';
Object.assign(config, {
output:{
@ -84,8 +83,8 @@ module.exports = {
});
} else {
// 为开发环境修改配置...
config.mode = 'development';
config.name = name;
config.mode = 'development';
config.name = name;
}
config.resolve = {