This commit is contained in:
fan 2020-05-18 17:59:52 +08:00
commit 9580d4b966
27 changed files with 96 additions and 190 deletions

View File

@ -262,9 +262,6 @@ class Jlmap {
const sectionC = this.mapDevice[item.sectionCCode];
if (sectionA && sectionB && sectionC) {
item['cutOff'] = sectionA.cutOff;
item['sectionAstatus'] = sectionA.status;
item['sectionBstatus'] = sectionB.status;
item['sectionCstatus'] = sectionC.status;
}
}
@ -281,9 +278,6 @@ class Jlmap {
const sectionC = this.mapDevice[swch.sectionCCode];
if (sectionA && sectionB && sectionC) {
swch['cutOff'] = sectionA.cutOff;
swch['sectionAstatus'] = sectionA.status;
swch['sectionBstatus'] = sectionB.status;
swch['sectionCstatus'] = sectionC.status;
}
this.$painter.update(swch);

View File

@ -434,7 +434,7 @@ export default class Switch extends Group {
}
sectionCutOff(section) {
const lineWidth = this.style.Section.line.width + (this.model.sectionAstatus != '01' ? this.style.Section.line.beyondWidth : 0);
const lineWidth = this.style.Section.line.width;
if (section) {
section.animateStyle(true, [
{ time: 0, styles: { lineWidth: lineWidth } },

View File

@ -5,6 +5,7 @@ import TurnbackBar from '@/components/TurnbackBar';
import ConstConfig from '@/scripts/ConstConfig';
import Dictionary from '@/scripts/DictionaryData';
import Theme from '@/jmapNew/theme/factory';
import store from './../store/index_Common';
// 全局组件
Vue.component('DataForm', DataForm);

View File

@ -149,9 +149,9 @@ export function deepAssign(obj, item) {
const target = item.constructor === Array ? [] : {}; // 判断复制的目标是数组还是对象
for (const keys in item) {
if (item.hasOwnProperty(keys) && keys != 'instance') { // instance 对面不拷贝
if (item[keys] && typeof item[keys] === 'object') { // 如果值是对象,就递归一下
target[keys] = item[keys].constructor === Array ? [] : {};
target[keys] = deepClone(item[keys]);
if (item[keys] && typeof item[keys] == 'object') { // 如果值是对象,就递归一下
const targetObj = item[keys].constructor == Array ? [] : {};
target[keys] = deepAssign(targetObj, item[keys]);
} else {
target[keys] = item[keys];
}

View File

@ -312,7 +312,6 @@ export default {
this.$refs.make.validate((valid) => {
if (valid) {
const uid = getUID(this.addModel.type, this.selectLists); // uid
const models = [];
const model = {
_type: this.addModel.type,
code: uid,
@ -326,8 +325,7 @@ export default {
cycleCode: this.addModel.cycleCode, // code
stationCode: this.addModel.stationCode //
};
models.push(model);
this.$emit('updateMapModel', models);
this.$emit('updateMapModel', model);
this.$refs.make.resetForm();
}
});
@ -337,7 +335,7 @@ export default {
this.$refs['dataform'].validate((valid) => {
if (valid) {
const data = Object.assign({_type: this.editModel.type}, this.editModel);
this.$emit('updateMapModel', [data]);
this.$emit('updateMapModel', data);
}
});
},

View File

@ -226,16 +226,15 @@ export default {
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'Resource'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('map.confirm'),
cancelButtonText: this.$t('map.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('updateMapModel', {...selected, _dispose: true});
_that.deviceSelect();
this.$emit('updateMapModel', {...selected, _dispose: true});
this.$refs.form && this.$refs.form.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
this.$message.info(this.$t('tip.cancelledDelete'));
});
}
}

View File

@ -150,8 +150,8 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.form && this.$refs.form.resetFields();
this.$refs.createForm && this.$refs.createForm.resetFields();
this.$refs.form && this.$refs.form.resetFields();
this.$refs.createForm && this.$refs.createForm.resetFields();
if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
@ -204,16 +204,15 @@ export default {
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('updateMapModel', {...selected, _dispose: true});
_that.deviceSelect();
this.$emit('updateMapModel', {...selected, _dispose: true});
this.$refs.form && this.$refs.form.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
this.$message.info(this.$t('tip.cancelledDelete'));
});
}
}

View File

@ -151,11 +151,6 @@ export default {
models.push(Model);
});
});
// this.seclectDeviceList.forEach(model => {
// const Model = deepAssign({}, this.$store.getters['map/getDeviceByCode'](model.code));
// Model.stationCode = this.stationCode;
// models.push(Model);
// });
this.$emit('updateMapModel', models);
this.$message.success('设置设备集中站成功');
this.stationCode = '';

View File

@ -501,7 +501,6 @@ export default {
this.$refs.make.validate((valid) => {
if (valid) {
const uid = getUID(this.getIdPrefix(this.addModel.type), this.selectLists); // uid
const models = [];
const model = {
_type: this.addModel.type,
type: this.addModel.type,
@ -516,8 +515,7 @@ export default {
stationCode: this.addModel.stationCode, //
switchCode: this.addModel.switchCode
};
models.push(model);
this.$emit('updateMapModel', models);
this.$emit('updateMapModel', model);
this.$refs.make.resetForm();
}
});
@ -527,7 +525,7 @@ export default {
this.$refs['dataform'].validate((valid) => {
if (valid) {
const data = Object.assign({_type: this.editModel.type}, this.editModel);
this.$emit('updateMapModel', [data]);
this.$emit('updateMapModel', data);
}
});
},

View File

@ -179,8 +179,8 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'Counter'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
@ -228,16 +228,15 @@ export default {
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'Counter'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('map.confirm'),
cancelButtonText: this.$t('map.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('updateMapModel', {...selected, _dispose: true});
_that.deviceSelect();
this.$emit('updateMapModel', {...selected, _dispose: true});
this.$refs.form && this.$refs.form.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
this.$message.info(this.$t('tip.cancelledDelete'));
});
}
}

View File

@ -162,8 +162,8 @@ export default {
},
deviceSelect(selected) {
this.$nextTick(() => {
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'DelayUnlock'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
@ -210,16 +210,15 @@ export default {
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'DelayUnlock'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('map.confirm'),
cancelButtonText: this.$t('map.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('updateMapModel', {...selected, _dispose: true});
_that.deviceSelect();
this.$emit('updateMapModel', {...selected, _dispose: true});
this.$refs.form && this.$refs.form.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
this.$message.info(this.$t('tip.cancelledDelete'));
});
}
}

View File

@ -135,7 +135,7 @@ export default {
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() === 'Esp'.toUpperCase()) {
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
}
@ -197,7 +197,7 @@ export default {
}).then(() => {
this.$store.dispatch('map/delMapStandData', {models: [selected], type: 'espList'});
this.deviceSelect();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
}).catch(() => {
this.$message.info(this.$t('tip.cancelledDelete'));
});

View File

@ -325,8 +325,7 @@ export default {
this.$emit('showMap');
},
handleSelectControlPage(device) {
const controlLampTypeList = ['AtsControl', 'CenterCommunication', 'ChainControl', 'IntersiteControl', 'LeuControl', 'LocalControl', 'Maintain', 'SwitchFault',
'PowerSupply', 'NoOneReturn', 'MaintenanceLamps', 'ZcCommunication', 'FaultStatusGroup', 'ModeStatusGroup', 'LampFilament', 'ReturnModeGroup', 'ControlSwitch', 'Axle'];
const controlLampTypeList = ['AtsControl', 'CenterCommunication', 'ChainControl', 'IntersiteControl', 'LeuControl', 'LocalControl', 'Maintain', 'SwitchFault', 'PowerSupply', 'NoOneReturn', 'MaintenanceLamps', 'ZcCommunication', 'FaultStatusGroup', 'ModeStatusGroup', 'LampFilament', 'ReturnModeGroup', 'ControlSwitch', 'Axle'];
const type = device._type;
if (this.stationType) {
this.enabledTab = 'Station';

View File

@ -169,8 +169,8 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'LcControl'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
@ -206,16 +206,15 @@ export default {
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'LcControl'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('updateMapModel', {...selected, _dispose: true});
_that.deviceSelect();
this.$emit('updateMapModel', {...selected, _dispose: true});
this.$refs.form && this.$refs.form.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
this.$message.info(this.$t('tip.cancelledDelete'));
});
}
}

View File

@ -213,9 +213,9 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) {
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
}
@ -234,18 +234,6 @@ export default {
delPointAddModel(index) {
this.addModel.points.splice(index, 1);
},
clear() {
this.addModel = {
type: '',
width: 1,
showConditions: '01',
lineColor: 'rgba(255, 255, 255, 1)',
points: [
{ x: 0, y: 0 },
{ x: 100, y: 100 }
]
};
},
create() {
this.$refs['make'].validate((valid) => {
if (valid) {
@ -261,7 +249,7 @@ export default {
points: JSON.parse(pointArr)
};
this.$emit('updateMapModel', model);
this.clear();
this.$refs.make && this.$refs.make.resetFields();
} else {
this.$message.console.error(this.$t('tip.cannotCoincide'));
@ -282,16 +270,15 @@ export default {
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('updateMapModel', {...selected, _dispose: true});
_that.deviceSelect();
this.$emit('updateMapModel', {...selected, _dispose: true});
this.$refs.form && this.$refs.form.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
this.$message.info(this.$t('tip.cancelledDelete'));
});
}
}

View File

@ -216,8 +216,8 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'OutFrame'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
@ -257,16 +257,15 @@ export default {
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'OutFrame'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('updateMapModel', {...selected, _dispose: true});
_that.deviceSelect();
this.$emit('updateMapModel', {...selected, _dispose: true});
this.$refs.form && this.$refs.form.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
this.$message.info(this.$t('tip.cancelledDelete'));
});
}
}

View File

@ -223,7 +223,7 @@ export default {
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() === 'Psd'.toUpperCase()) {
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
}
@ -271,17 +271,15 @@ export default {
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'Psd'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('updateMapModel', {...selected, _dispose: true});
_that.deviceSelect();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$emit('updateMapModel', {...selected, _dispose: true});
this.$refs.dataform && this.$refs.dataform.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
this.$message.info(this.$t('tip.cancelledDelete'));
});
}
},

View File

@ -502,14 +502,9 @@ export default {
this.clear();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.editModel.points = JSON.parse(JSON.stringify(selected.points));
this.editModel.lengthFact = selected.lengthFact || 0; //
this.oldPoint = JSON.parse(JSON.stringify(selected.points));
this.oldPoint = selected.points;
this.oldLeftSectionCode = selected.leftSectionCode;
this.oldRightSectionCode = selected.rightSectionCode;
this.editModel.leftAxlePosition = selected.leftAxlePosition || 0; //
this.editModel.rightAxlePosition = selected.rightAxlePosition || 0; //
this.editModel.belongStation = selected.belongStation || '';
if (this.field.toUpperCase() === 'splitSection'.toUpperCase()) {
this.$refs.splitOrMerge.addModel.splitOffsetMax = Math.sqrt(new JTriangle(selected.points[0], selected.points[selected.points.length - 1]).abspowz);
this.$refs.splitOrMerge.addModel.splitOffset = this.$refs.splitOrMerge.addModel.splitOffsetMax / 2;
@ -583,8 +578,7 @@ export default {
}
});
},
handleOtherSectionChange(model) {
//
handleOtherSectionChange(model) { //
const models = [];
const pointModel = [];
const slope1 = (this.oldPoint[this.oldPoint.length - 1].y - this.oldPoint[0].y) / (this.oldPoint[this.oldPoint.length - 1].x - this.oldPoint[0].x);
@ -592,7 +586,6 @@ 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.stationCode = model.stationCode; //
if (this.checkPointsCoincide(this.oldPoint[0], copySection.points[0])) {
copySection.points[0] = model.points[0];
@ -600,7 +593,7 @@ export default {
copySection.points[copySection.points.length - 1] = model.points[model.points.length - 1];
}
models.push(copySection);
} else if (model.code !== section.code && (section.type === '01' || section.type === '03' || section.type === '02')) {
} else if (model.code !== section.code && section.type != '04') {
const copySection = deepAssign({}, section);
let updataFlag = false;
if (model.leftSectionCode !== this.oldLeftSectionCode) {
@ -622,13 +615,10 @@ export default {
}
}
if (model.parentCode == copySection.code) { //
let lengthFact = 0;
copySection.logicSectionCodeList.forEach(code => {
if (model.code != code) {
const localSectionModel = this.$store.getters['map/getDeviceByCode'](code);
lengthFact += Number(localSectionModel.lengthFact);
}
});
let lengthFact = copySection.logicSectionCodeList.filter(code => model.code != code).reduce((pre, code) => {
const length = this.$store.getters['map/getDeviceByCode'](code).lengthFact;
return pre + Number(length);
}, 0);
lengthFact += model.lengthFact;
copySection.lengthFact = lengthFact.toFixed(3); //
if (copySection.lengthFact > 5) {
@ -696,7 +686,6 @@ export default {
models = [...models, ...deleteObjAssociatedSection];
this.$emit('updateMapModel', models);
this.clear();
this.deviceSelect();
}).catch(error => {
console.log(error);
this.$message.info(this.$t('tip.cancelledDelete'));
@ -736,15 +725,7 @@ export default {
}
},
clear() {
this.$refs.dataform && this.$refs.dataform.resetFields();
// 沿
this.editModel.logicSectionCodeList = [];
this.editModel.rightSectionCode = '';
this.editModel.leftSectionCode = '';
this.editModel.rightAxleOffset = {x:0, y:0};
this.editModel.leftAxleOffset = {x:0, y:0};
this.editModel.leftAxlePosition = 0;
this.editModel.rightAxlePosition = 0;
this.$refs.dataform && this.$refs.dataform.resetFields(); //
}
}
};

View File

@ -33,12 +33,7 @@
<el-form ref="signalType" label-width="130px" :model="typeModel" size="mini" style="margin-top: 40px">
<el-form-item label="信号机类型:" prop="type">
<el-select v-model="typeModel.type" placeholder="请选择">
<el-option
v-for="item in signalTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
<el-option v-for="item in signalTypeList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
</el-form>
@ -50,22 +45,12 @@
<el-form ref="signalCiStation" label-width="130px" :model="ciModel" size="mini" style="margin-top: 40px;">
<el-form-item label="信号机范围:">
<el-select v-model="ciModel.stationList" multiple placeholder="请选择">
<el-option
v-for="item in centralizedStationList"
:key="item.code"
:label="item.name+'下信号机'"
:value="item.code"
/>
<el-option v-for="item in centralizedStationList" :key="item.code" :label="item.name+'下信号机'" :value="item.code" />
</el-select>
</el-form-item>
<el-form-item label="归属连锁站:">
<el-select v-model="ciModel.ciStation" placeholder="请选择">
<el-option
v-for="item in ciStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
<el-option v-for="item in ciStationList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
</el-form>
@ -133,7 +118,6 @@ export default {
SignalLampPostTypeList: [],
SignalLampPositionTypeList: [],
SignalPositionTypeList: [],
// SignalUseTypeList: [],
failTypes: [
{ code: '00', name: this.$t('map.normal') },
{ code: '01', name: this.$t('map.signalFilamentAlarm') }
@ -277,7 +261,6 @@ export default {
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList },
{ prop: 'interlockStationCode', label: '所属联锁站', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.ciStationList},
{ prop: 'uniqueName', label: this.$t('map.signalUniqueName'), type: 'input' },
// { prop: 'useType', label: this.$t('map.signalUseType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalUseTypeList },
{ prop: 'sectionCode', label: this.$t('map.belongsSection'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.signalSectionList },
{ prop: 'sectionOffset', label: this.$t('map.signalOffset'), type: 'number', min: 0, placeholder: this.$t('tip.meter') }
@ -340,10 +323,6 @@ export default {
this.$Dictionary.signalPositionType().then(list => {
this.SignalPositionTypeList = list;
});
// this.$Dictionary.signalUseType().then(list => {
// this.SignalUseTypeList = list;
// });
},
methods: {
deviceChange(code) {
@ -355,14 +334,6 @@ export default {
this.$refs.dataform && this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.editModel.rotate = selected.rotate || 0; //
this.editModel.type = selected.type || '';
this.editModel.interlockStationCode = selected.interlockStationCode || '';
if (!selected.positionPoint) {
this.editModel.positionPoint.x = 0;
this.editModel.positionPoint.y = 0;
}
this.editModel.right = Boolean(selected.right);
} else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'selectSingalCode'.toUpperCase()) {
if (selected.type == '01' || selected.type === '03') {
this.$refs.createSignal.setSectionCode(selected.code);
@ -394,17 +365,15 @@ export default {
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type === 'Signal') {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('updateMapModel', {...selected, _dispose: true});
_that.deviceSelect();
this.$emit('updateMapModel', {...selected, _dispose: true});
this.$refs.dataform && this.$refs.dataform.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
this.$message.info(this.$t('tip.cancelledDelete'));
});
}
},

View File

@ -140,8 +140,8 @@ export default {
},
methods: {
deviceSelect(selected) {
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type === 'SplitStation') {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
@ -190,7 +190,7 @@ export default {
type: 'warning'
}).then(() => {
this.$emit('updateMapModel', {...selected, _dispose: true});
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
}).catch(() => {
this.$message.info(this.$t('tip.cancelledDelete'));
});

View File

@ -292,12 +292,10 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
// this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.editModel.runPlanName = selected.runPlanName || '';
//
const beCentralizedStation = {};
this.stationList.forEach(data=>{
@ -478,16 +476,15 @@ export default {
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('updateMapModel', {...selected, _dispose: true});
_that.deviceSelect();
this.$emit('updateMapModel', {...selected, _dispose: true});
this.$refs.dataform && this.$refs.dataform.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
this.$message.info(this.$t('tip.cancelledDelete'));
});
}
},

View File

@ -235,8 +235,7 @@ export default {
};
//
this.$nextTick(() => {
this.$refs.dataform &&
this.$refs.dataform.clearValidate();
this.$refs.dataform && this.$refs.dataform.clearValidate();
});
return rules;
@ -367,7 +366,7 @@ export default {
},
deviceSelect(selected) {
if (this.field.toUpperCase() != 'standSelectStationCode'.toUpperCase() && selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
}
@ -493,7 +492,6 @@ export default {
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
@ -511,11 +509,10 @@ export default {
models.push(deepAssign(item, { _dispose: true }));
}
});
_that.$emit('updateMapModel', models);
_that.deviceSelect();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$emit('updateMapModel', models);
this.$refs.dataform && this.$refs.dataform.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
this.$message.info(this.$t('tip.cancelledDelete'));
});
}
},

View File

@ -98,6 +98,9 @@ export default {
},
deleteObj() {
this.$refs.switchModel.deleteObj();
},
edit() {
this.$refs.switchModel.edit();
}
}
};

View File

@ -103,8 +103,7 @@ export default {
};
//
this.$nextTick(() => {
this.$refs.dataform &&
this.$refs.dataform.clearValidate();
this.$refs.dataform && this.$refs.dataform.clearValidate();
});
return rules;
@ -129,7 +128,7 @@ export default {
this.setModel(this.$store.getters['map/getDeviceByCode'](code));
},
setModel(data) {
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.editModel = deepAssign(this.editModel, data);
},
//
@ -148,17 +147,16 @@ export default {
const models = [];
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
models.push(deepAssign(selected, { _dispose: true }));
_that.$emit('updateMapModel', models);
_that.deviceSelect();
this.$emit('updateMapModel', models);
this.$refs.dataform && this.$refs.dataform.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelGeneration'));
this.$message.info(this.$t('tip.cancelGeneration'));
});
}
}

View File

@ -192,8 +192,8 @@ export default {
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
deviceSelect(selected) {
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.$refs.form && this.$refs.form.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'Text'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
@ -232,16 +232,15 @@ export default {
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'Text'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('updateMapModel', {...selected, _dispose: true});
_that.deviceSelect();
this.$emit('updateMapModel', {...selected, _dispose: true});
this.$refs.form && this.$refs.form.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
this.$message.info(this.$t('tip.cancelledDelete'));
});
}
}

View File

@ -348,7 +348,6 @@ export default {
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'TrainWindow'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
@ -363,10 +362,10 @@ export default {
}
});
models.push(deepAssign(selected, { _dispose: true }));
_that.$emit('updateMapModel', models);
_that.deviceSelect();
this.$emit('updateMapModel', models);
this.$refs.form && this.$refs.form.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
this.$message.info(this.$t('tip.cancelledDelete'));
});
}
},

View File

@ -182,8 +182,8 @@ export default {
this.getConcertrateStation();
},
deviceSelect(selected) {
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'ZcControl'.toUpperCase()) {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
@ -251,7 +251,6 @@ export default {
deleteObj() {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'ZcControl'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
@ -267,10 +266,10 @@ export default {
}
});
});
_that.$emit('updateMapModel', {...selected, _dispose: true});
_that.deviceSelect();
this.$emit('updateMapModel', {...selected, _dispose: true});
this.$refs.dataform && this.$refs.dataform.resetFields();
}).catch(() => {
_that.$message.info(this.$t('tip.cancelledDelete'));
this.$message.info(this.$t('tip.cancelledDelete'));
});
}
},