Merge branch 'dev' of https://git.qcloud.com/joylink/jl-nclient into dev
This commit is contained in:
commit
d3ddfeadc8
@ -239,7 +239,7 @@ class MouseController extends Eventful {
|
||||
const deviceList = Object.values(this.$jmap.mapDevice);
|
||||
const includeDeviceList = [];
|
||||
deviceList.forEach( item =>{
|
||||
if (item.instance._type == deviceType.Section) {
|
||||
if (item.instance && item.instance._type == deviceType.Section) {
|
||||
let deviceBoundingRect = {};
|
||||
if (item.type == '03') {
|
||||
deviceBoundingRect = {
|
||||
@ -260,7 +260,7 @@ class MouseController extends Eventful {
|
||||
includeDeviceList.push(item);
|
||||
}
|
||||
}
|
||||
if (item.instance._type == deviceType.Switch) {
|
||||
if (item.instance && item.instance._type == deviceType.Switch) {
|
||||
const deviceBoundingRect = {
|
||||
x1: item.intersection.x,
|
||||
y1: item.intersection.y,
|
||||
|
@ -7,11 +7,18 @@ import { deepAssign } from '@/utils/index';
|
||||
* 查询向上受影响的Devices
|
||||
* @param {Object} map
|
||||
* @param {Object} device
|
||||
* @param {Array} effectedDeviceList
|
||||
* @param {Array} list
|
||||
*/
|
||||
function queryEffectedModels(map, device, effectedDeviceList) {
|
||||
function queryDeleteModels(map, device, dict) {
|
||||
function setDisPose(model, dict) {
|
||||
if (!dict[model.code] || !dict[model.code]._dispose) {
|
||||
dict[model.code] = {...model, _dispose: true };
|
||||
}
|
||||
}
|
||||
|
||||
if (device && map) {
|
||||
effectedDeviceList.push(device);
|
||||
setDisPose(device, dict);
|
||||
|
||||
switch (device._type) {
|
||||
// 查询ink关联项
|
||||
case deviceType.Link:
|
||||
@ -19,7 +26,7 @@ function queryEffectedModels(map, device, effectedDeviceList) {
|
||||
if (map.sectionList && map.sectionList.length) {
|
||||
map.sectionList.forEach(elem => {
|
||||
if (elem.linkCode === device.code) {
|
||||
queryEffectedModels(map, elem, effectedDeviceList);
|
||||
queryDeleteModels(map, elem, dict);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -28,27 +35,18 @@ function queryEffectedModels(map, device, effectedDeviceList) {
|
||||
if (map.signalList && map.signalList.length) {
|
||||
map.signalList.forEach(elem => {
|
||||
if (elem.linkCode === device.code) {
|
||||
effectedDeviceList.push(elem);
|
||||
setDisPose(elem, dict);
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
// 移除区段关联项
|
||||
case deviceType.Section:
|
||||
// 查询物理区段关联的逻辑区段
|
||||
if (map.sectionList && map.sectionList.length && device.type === '01') {
|
||||
// 删除所属逻辑区段
|
||||
if (map.sectionList && map.sectionList.length && device.type == '01') {
|
||||
map.sectionList.forEach(elem => {
|
||||
if (elem.type !== '01' && elem.parentCode === device.code) {
|
||||
effectedDeviceList.push(elem);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 查询区段关联车次窗
|
||||
if (map.trainWindowList && map.trainWindowList.length) {
|
||||
map.trainModelList.forEach(elem => {
|
||||
if (elem.sectionCode == device.code) {
|
||||
effectedDeviceList.push(elem);
|
||||
if (elem.type != '01' && elem.parentCode == device.code) {
|
||||
setDisPose(elem, dict);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -56,22 +54,27 @@ function queryEffectedModels(map, device, effectedDeviceList) {
|
||||
// 查询区段关联的道岔
|
||||
if (map.switchList && map.switchList.length) {
|
||||
map.switchList.forEach(elem => {
|
||||
if (elem.sectionACode === device.code ||
|
||||
elem.sectionBCode === device.code ||
|
||||
elem.sectionCCode === device.code) {
|
||||
effectedDeviceList.push(elem);
|
||||
if (elem.sectionACode == device.code || elem.sectionBCode == device.code || elem.sectionCCode == device.code) {
|
||||
queryDeleteModels(map, elem, dict);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 查询区段关联的车站
|
||||
if (map.stationList && map.stationList.length) {
|
||||
map.stationList.forEach(elem => {
|
||||
if (elem.sectionCode === device.code) {
|
||||
effectedDeviceList.push(elem);
|
||||
break;
|
||||
case deviceType.Switch:
|
||||
map.sectionList.forEach(elem => {
|
||||
if (elem.type == '03' && elem.relSwitchCode == device.code) {
|
||||
setDisPose(elem, dict);
|
||||
}
|
||||
if (elem.relSwitchCode == device.code && elem.type != '03') {
|
||||
if (!dict[elem.code] || !dict[elem.code]._dispose) {
|
||||
const copyModel = deepAssign({}, elem);
|
||||
copyModel.relSwitchCode = '';
|
||||
copyModel.isSwitchSection = false;
|
||||
dict[elem.code] = copyModel;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -315,6 +318,9 @@ const map = {
|
||||
map: (state) => {
|
||||
return state.map;
|
||||
},
|
||||
safetyDoorList: (state) => {
|
||||
return state.map.safetyDoorList || [];
|
||||
},
|
||||
lineCode: (state) => {
|
||||
if (state.map && state.map.skinVO) {
|
||||
return state.map.skinVO.code;
|
||||
@ -601,6 +607,14 @@ const map = {
|
||||
if (Vue.prototype.$jlmap) {
|
||||
Vue.prototype.$jlmap.clear();
|
||||
}
|
||||
},
|
||||
updateMapStandData: (state, { models, type }) => {
|
||||
models.forEach(item => {
|
||||
if (!state.mapDevice[item.code]) {
|
||||
state.mapDevice[item.code] = item;
|
||||
state.map[type].push(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@ -643,19 +657,20 @@ const map = {
|
||||
}
|
||||
|
||||
// 查找向上关联需要一起删除的设备
|
||||
const effectedModelList = [];
|
||||
const dict = {};
|
||||
models.forEach((model) => {
|
||||
if (model['_dispose']) {
|
||||
queryEffectedModels(state.map, model, effectedModelList);
|
||||
queryDeleteModels(state.map, model, dict);
|
||||
} else {
|
||||
effectedModelList.push(model);
|
||||
dict[model.code] = model;
|
||||
}
|
||||
});
|
||||
|
||||
handleOperation(state, effectedModelList);
|
||||
const list = Object.values(dict);
|
||||
handleOperation(state, list);
|
||||
|
||||
commit('mapRender', effectedModelList);
|
||||
resolve(effectedModelList);
|
||||
commit('mapRender', list);
|
||||
resolve(list);
|
||||
});
|
||||
},
|
||||
|
||||
@ -704,6 +719,10 @@ const map = {
|
||||
|
||||
operateTrainModel: ({ commit }, { model, type }) => {
|
||||
commit('operateTrainModel', { model, type });
|
||||
},
|
||||
|
||||
updateMapStandData: ({ commit }, { models, type }) => {
|
||||
commit('updateMapStandData', { models, type });
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -178,9 +178,10 @@ export default {
|
||||
|
||||
confirm() {
|
||||
const roleName = this.memberList.find(elem=>{ return elem.id == this.form.role; });
|
||||
this.$emit('selectQuest', this.row, this.form.role, this.mapLocation, roleName.role);
|
||||
this.doClose();
|
||||
this.roleDoClose();
|
||||
this.$emit('selectQuest', this.row, this.form.role, this.mapLocation, roleName.role);
|
||||
|
||||
},
|
||||
|
||||
roleDoClose() {
|
||||
|
@ -585,11 +585,11 @@ export default {
|
||||
if (this.isDrive) {
|
||||
this.panelShow = false;
|
||||
this.drivingShow = true;
|
||||
this.$refs.Jl3dDrive.show(this.mapId,this.group);
|
||||
this.$refs.Jl3dDrive.show(this.mapId, this.group);
|
||||
} else {
|
||||
this.panelShow = false;
|
||||
this.simulationShow = true;
|
||||
this.$refs.Jl3dSimulation.show(this.mapId,this.group);
|
||||
this.$refs.Jl3dSimulation.show(this.mapId, this.group);
|
||||
}
|
||||
},
|
||||
showScheduling() {
|
||||
|
@ -6,6 +6,7 @@
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'ParkOperate',
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
|
@ -1,12 +1,54 @@
|
||||
<template>
|
||||
<div style="height: 100%;">
|
||||
11111
|
||||
<div style="height: calc(100% - 46px);">
|
||||
<template v-if="!display">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<el-form ref="form" :model="editModel" label-width="120px" size="mini">
|
||||
<el-form-item label="屏蔽门code" prop="code">
|
||||
<el-select v-model="editModel.code" clearable :filterable="true" @change="deviceChange">
|
||||
<el-option
|
||||
v-for="item in safetyDoorList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="名字" prop="name">
|
||||
<el-input v-model="editModel.name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属站台" prop="stationStandCode">
|
||||
<el-select v-model="editModel.stationStandCode" disabled>
|
||||
<el-option
|
||||
v-for="item in stationStandList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
</template>
|
||||
<template v-if="display">
|
||||
<div style="text-align: center;padding-top: 20px;">暂无数据</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="button_box">
|
||||
<el-button-group class="map-draft-group">
|
||||
<el-button type="primary" size="small" @click="create">批量创建</el-button>
|
||||
<el-button type="danger" size="small" @click="editObject">修改</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { deepAssign } from '@/utils/index';
|
||||
import { getUID } from '@/jmap/utils/Uid';
|
||||
|
||||
export default {
|
||||
name: 'SafetyDoorOperate',
|
||||
components: {
|
||||
|
||||
},
|
||||
@ -26,25 +68,85 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
display: true
|
||||
display: true,
|
||||
editModel: {
|
||||
code: '',
|
||||
name: '',
|
||||
stationCode: '',
|
||||
stationStandCode: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'map'
|
||||
'map',
|
||||
'safetyDoorList',
|
||||
'stationStandList'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.map': function(val) {
|
||||
if (val) {
|
||||
this.init();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.display = true;
|
||||
console.log(this.map);
|
||||
if (this.$store.state.map.map.safetyDoorList && this.$store.state.map.map.safetyDoorList.length) {
|
||||
this.display = false;
|
||||
const mapObject = this.map;
|
||||
if (mapObject) {
|
||||
if (mapObject.safetyDoorList && mapObject.safetyDoorList.length) {
|
||||
this.display = false;
|
||||
} else {
|
||||
mapObject.safetyDoorList = [];
|
||||
}
|
||||
}
|
||||
},
|
||||
deviceChange(code) {
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$refs.form.resetFields();
|
||||
if (selected && selected._type.toUpperCase() === 'PSD'.toUpperCase()) { // ESP
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
}
|
||||
},
|
||||
editObject() {
|
||||
console.log(this.editModel, 111);
|
||||
},
|
||||
hasPSD(data) {
|
||||
let falg = false;
|
||||
this.map.safetyDoorList.forEach(item => {
|
||||
if (item.stationStandCode == data.code) {
|
||||
falg = true;
|
||||
}
|
||||
});
|
||||
return falg;
|
||||
},
|
||||
create() {
|
||||
const arr = [];
|
||||
this.map.stationStandList.forEach(item => {
|
||||
if (item.visible && item.hasDoor && !this.hasPSD(item)) {
|
||||
arr.push({
|
||||
_type: 'PSD',
|
||||
code: getUID('PSD'),
|
||||
name: getUID('PSD'),
|
||||
stationCode: item.stationCode,
|
||||
stationStandCode: item.code
|
||||
});
|
||||
}
|
||||
});
|
||||
if (arr.length) {
|
||||
this.display = false;
|
||||
this.$message('创建完成');
|
||||
this.$store.dispatch('map/updateMapStandData', {models: arr, type: 'safetyDoorList'});
|
||||
} else {
|
||||
this.$message('暂无车站');
|
||||
}
|
||||
console.log(this.$store.state.map.map);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -183,9 +183,9 @@ export default {
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
if (selected && selected._type.toUpperCase() === 'ImageControl'.toUpperCase()) {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
}
|
||||
|
@ -196,9 +196,9 @@ export default {
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
if (selected && selected._type.toUpperCase() == 'ButtonControl'.toUpperCase()) {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
}
|
||||
|
@ -178,9 +178,9 @@ export default {
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
if (selected && selected._type.toUpperCase() === 'Counter'.toUpperCase()) {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
} else if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
|
||||
|
@ -161,9 +161,9 @@ export default {
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
if (selected && selected._type.toUpperCase() === 'DelayUnlock'.toUpperCase()) {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
} else if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
|
||||
|
@ -168,9 +168,9 @@ export default {
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
if (selected && selected._type.toUpperCase() === 'LcControl'.toUpperCase()) {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
}
|
||||
|
@ -159,9 +159,9 @@ export default {
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
if (selected && selected._type.toUpperCase() === 'LimitControl'.toUpperCase()) {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
}
|
||||
|
@ -191,9 +191,9 @@ export default {
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
}
|
||||
|
@ -133,9 +133,9 @@
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" label="批量操作" name="five">
|
||||
<el-form ref="oprt" label-width="130px" size="mini">
|
||||
<el-form label-width="130px" size="mini">
|
||||
<el-form-item label="选择link:">
|
||||
<el-select v-model="linkCode" filterable multiple size="mini">
|
||||
<el-select v-model="linkCodeList" filterable multiple size="mini">
|
||||
<el-option
|
||||
v-for="item in linkList"
|
||||
:key="item.code"
|
||||
@ -258,7 +258,7 @@ export default {
|
||||
lengthFact: 0,
|
||||
isCurve: false
|
||||
},
|
||||
linkCode: '',
|
||||
linkCodeList: [],
|
||||
tableData: [],
|
||||
oldPoint: [], // 区段未修改前 坐标
|
||||
addModel: {
|
||||
@ -283,8 +283,7 @@ export default {
|
||||
{ required: true, message: this.$t('rules.pleaseSelectSectionName'), trigger: 'change' }
|
||||
],
|
||||
splitNumber: [
|
||||
{ required: true, message: this.$t('rules.pleaseEnterSplit'), trigger: 'blur' },
|
||||
{ type: 'number', message: this.$t('rules.pleaseEnterSplitNumber'), min: '20' }
|
||||
{ required: true, message: this.$t('rules.pleaseEnterSplit'), trigger: 'blur' }
|
||||
],
|
||||
trainPosType: [
|
||||
{ required: true, message: this.$t('rules.pleaseSelectTrainDir'), trigger: 'change' }
|
||||
@ -948,12 +947,7 @@ export default {
|
||||
// 删除对象
|
||||
deleteObj() {
|
||||
const models = [];
|
||||
const switchList = [];
|
||||
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
|
||||
this.switchList.forEach(switchEle => {
|
||||
selected.relSwitchCode == switchEle.code && switchList.push(this.$store.getters['map/getDeviceByCode'](switchEle.code));
|
||||
});
|
||||
this.delSectionSwitch(switchList, models);
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
const _that = this;
|
||||
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
|
||||
@ -961,13 +955,6 @@ export default {
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (selected.type == '01') {
|
||||
this.sectionList.forEach(section => {
|
||||
if (section.parentCode == selected.code) { // 删除所属逻辑区段
|
||||
models.push(deepAssign(section, { _dispose: true }));
|
||||
}
|
||||
});
|
||||
}
|
||||
models.push(deepAssign(selected, { _dispose: true }));
|
||||
_that.$emit('updateMapModel', models);
|
||||
_that.deviceSelect();
|
||||
@ -1175,15 +1162,10 @@ export default {
|
||||
// 按link批量删除区段
|
||||
delRelevanceSection() {
|
||||
const models = [];
|
||||
const switchList = [];
|
||||
this.linkCode.forEach(linkCode => {
|
||||
this.linkCodeList.forEach(code => {
|
||||
this.sectionList.forEach(section => {
|
||||
if (section.linkCode == linkCode) {
|
||||
const selectedSection = this.$store.getters['map/getDeviceByCode'](section.code);
|
||||
models.push(deepAssign(selectedSection, { _dispose: true }));
|
||||
this.switchList.forEach(switchEle => {
|
||||
section.relSwitchCode == switchEle.code && switchList.push(this.$store.getters['map/getDeviceByCode'](switchEle.code));
|
||||
});
|
||||
if (section.linkCode == code) {
|
||||
models.push({...section, _dispose: true });
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -1192,31 +1174,14 @@ export default {
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.delSectionSwitch(switchList, models);
|
||||
// this.delSectionSwitch(switchList, models);
|
||||
this.$emit('updateMapModel', models);
|
||||
this.deviceSelect();
|
||||
this.linkCode = '';
|
||||
this.linkCodeList = [];
|
||||
}).catch(() => {
|
||||
this.$message.info(this.$t('tip.cancelledDelete'));
|
||||
});
|
||||
},
|
||||
// 删除道岔/ 关联的道岔区段以及 道岔绑定关系
|
||||
delSectionSwitch(switchList, models) {
|
||||
switchList.forEach((switchs) => {
|
||||
this.sectionList.forEach(elem => {
|
||||
if (elem.type == '03' && elem.relSwitchCode == switchs.code) {
|
||||
models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](elem.code), { _dispose: true }));
|
||||
}
|
||||
if (elem.relSwitchCode == switchs.code && elem.type != '03') {
|
||||
const copyModel = deepAssign({}, elem);
|
||||
copyModel.relSwitchCode = '';
|
||||
copyModel.isSwitchSection = false;
|
||||
models.push(copyModel);
|
||||
}
|
||||
});
|
||||
models.push(deepAssign(switchs, { _dispose: true }));
|
||||
});
|
||||
},
|
||||
// 多选区段设置集中站
|
||||
handleScetionStationCode() {
|
||||
this.$refs['operationModel'].validate((valid) => {
|
||||
|
@ -328,9 +328,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() === 'Signal'.toUpperCase()) {
|
||||
this.$refs.dataform.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
this.editModel.potLampType = selected.potLampType || '01';
|
||||
|
@ -188,9 +188,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.dataform.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
this.editModel.runPlanName = selected.runPlanName || '';
|
||||
|
@ -174,9 +174,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() === 'StationControl'.toUpperCase()) {
|
||||
this.$refs.dataform.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
} else if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
|
||||
|
@ -231,9 +231,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() === 'StationStand'.toUpperCase()) {
|
||||
this.$refs.dataform.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
} else if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
|
||||
|
@ -156,8 +156,8 @@ export default {
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$refs.dataform.resetFields();
|
||||
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
|
||||
this.$refs.dataform.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
}
|
||||
@ -476,7 +476,6 @@ export default {
|
||||
});
|
||||
}
|
||||
return models;
|
||||
// this.$emit('updateMapModel', models);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -176,9 +176,9 @@ export default {
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
if (selected && selected._type.toUpperCase() === 'Text'.toUpperCase()) {
|
||||
this.$refs.form.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
[this.editModel.prepend, this.editModel.content] = selected.content.split('::');
|
||||
|
@ -145,8 +145,8 @@ export default {
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$refs.form.resetFields();
|
||||
if (selected && selected._type.toUpperCase() === 'TrainWindow'.toUpperCase()) {
|
||||
this.$refs.form.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
}
|
||||
|
@ -165,9 +165,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() === 'ZcControl'.toUpperCase()) {
|
||||
this.$refs.dataform.resetFields();
|
||||
this.$refs.make.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
}
|
||||
|
@ -47,15 +47,13 @@ export default {
|
||||
rules() {
|
||||
const crules = {
|
||||
name: [
|
||||
// { required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'blur' },
|
||||
// { required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'change' }
|
||||
{ validator: this.validateScriptName, trigger: 'blur' },
|
||||
{ validator: this.validateScriptName, trigger: 'change' }
|
||||
],
|
||||
description: [
|
||||
{ validator: this.validateDescription, trigger: 'blur' },
|
||||
{ validator: this.validateDescription, trigger: 'change' }
|
||||
]
|
||||
// description:[
|
||||
// { required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'blur' },
|
||||
// { required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'change' }
|
||||
// ]
|
||||
};
|
||||
return crules;
|
||||
}
|
||||
@ -69,6 +67,14 @@ export default {
|
||||
return callback();
|
||||
}
|
||||
},
|
||||
validateDescription(rule, value, callback) {
|
||||
if (value.trim().length === 0) {
|
||||
this.formModel.description = this.formModel.name.replace(/\s/g, '');
|
||||
return callback(new Error(this.$t('scriptRecord.inputScriptDescription')));
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
},
|
||||
doShow(questid) {
|
||||
if (questid) {
|
||||
getQuestById(questid).then(resp=>{
|
||||
|
@ -137,6 +137,12 @@ export default {
|
||||
if (this.$route.query.id) {
|
||||
getCommandDetail(this.$route.query.id).then(res => {
|
||||
this.formModel = res.data;
|
||||
if (!this.formModel.paramList) {
|
||||
this.formModel.paramList = [];
|
||||
}
|
||||
if (!this.formModel.conditionList) {
|
||||
this.formModel.conditionList = [];
|
||||
}
|
||||
this.operateList = Object.values(Commands[this.formModel.operateObject]);
|
||||
});
|
||||
}
|
||||
|
@ -150,7 +150,6 @@ export default {
|
||||
},
|
||||
convertField(fieldValue, operateObject, converFormat) {
|
||||
if (Commands) {
|
||||
// debugger;
|
||||
const enumList = Object.values(Commands[operateObject]);
|
||||
if (enumList && converFormat && converFormat.length >= 2) {
|
||||
const value = converFormat[0];
|
||||
|
@ -24,6 +24,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
doShow(data) {
|
||||
this.dialogVisible = true;
|
||||
this.conditionList = data;
|
||||
},
|
||||
handleClose() {
|
||||
|
@ -140,16 +140,15 @@ export default {
|
||||
justify-content: space-between;
|
||||
|
||||
&__head {
|
||||
height: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #f0f0f0;
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding: 10px;
|
||||
|
||||
&--title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
padding:10px 0px 10px 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -216,6 +215,8 @@ export default {
|
||||
outline: none;
|
||||
resize: none;
|
||||
font-size: 16px;
|
||||
padding-left: 10px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
&--send {
|
||||
|
@ -119,9 +119,11 @@ export default {
|
||||
&--title {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
margin-left:10px;
|
||||
}
|
||||
|
||||
&--add {
|
||||
margin-right:2px;
|
||||
/deep/ .el-button.is-circle {
|
||||
padding: 5px;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ export default {
|
||||
return { label: 'nickName' };
|
||||
},
|
||||
treeHeight() {
|
||||
return this.height - 40;
|
||||
return this.height - 64;
|
||||
},
|
||||
filterMembers() {
|
||||
return this.members.filter(e =>{ return e.nickName.includes(this.filterText); });
|
||||
@ -97,7 +97,6 @@ export default {
|
||||
border: 1px solid #ccc;
|
||||
|
||||
&__head {
|
||||
height: 30px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
@ -105,13 +104,14 @@ export default {
|
||||
border-bottom: 1px solid #ccc;
|
||||
|
||||
&--title {
|
||||
padding:10px 0px;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
&--notes {
|
||||
font-size: 16px;
|
||||
height: 100%;
|
||||
padding:10px 0px;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
}
|
||||
@ -124,6 +124,7 @@ export default {
|
||||
height: auto;
|
||||
min-height: calc(100%-200px);
|
||||
max-height: calc(100%-200px);
|
||||
border-bottom: 1px #ccc solid;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
|
@ -129,9 +129,11 @@ export default {
|
||||
&--title {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
margin-left:10px;
|
||||
}
|
||||
|
||||
&--add {
|
||||
margin-right:2px;
|
||||
/deep/ .el-button.is-circle {
|
||||
padding: 5px;
|
||||
}
|
||||
|
@ -365,7 +365,7 @@ export default {
|
||||
this.loading = true;
|
||||
await putJointTrainingExit(this.group);
|
||||
this.loading = false;
|
||||
this.$router.push({ path: `/trainingPlatform/detail/${this.$route.query.subSystem}`, query: {mapId: this.room.mapId}});
|
||||
history.go(-1);
|
||||
} catch (error) {
|
||||
this.$emit('message', {type:'error', message: this.$t('error.operationFailure')});
|
||||
}
|
||||
@ -381,7 +381,6 @@ export default {
|
||||
background: #fff;
|
||||
|
||||
&__head {
|
||||
height: 60px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
@ -393,6 +392,7 @@ export default {
|
||||
&--title {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
padding: 10px 0px;
|
||||
|
||||
.label {
|
||||
font-size: 16px;
|
||||
|
Loading…
Reference in New Issue
Block a user