合并代码

This commit is contained in:
fan 2020-06-03 14:30:14 +08:00
commit f6997d3bd9
20 changed files with 331 additions and 74 deletions

View File

@ -260,4 +260,10 @@ deviceRender[deviceType.ElectricButterflyValve] = {
zlevel: 1,
z: 5
};
// 水池
deviceRender[deviceType.Cistern] = {
_type: deviceType.Cistern,
zlevel: 1,
z: 5
}
export default deviceRender;

View File

@ -39,7 +39,8 @@ const deviceType = {
StateTable: 'StateTable',
LightingGroup: 'LightingGroup',
BalancedElectric: 'BalancedElectric',
ElectricButterflyValve: 'ElectricButterflyValve'
ElectricButterflyValve: 'ElectricButterflyValve',
Cistern: 'Cistern'
};
export default deviceType;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,27 @@
import Group from 'zrender/src/container/Group';
import createPathSvg from '../components/pathsvg';
export default class airConditioner extends Group {
constructor(device) {
super();
this.model = device.model;
this.zlevel = device.model.zlevel;
this.z = device.model.z;
this._type = device.model._type;
this.code = device.model.code;
this.create();
}
create() {
this.grouper = new Group({
id: this.model.code,
position: [this.model.point.x, this.model.point.y]
});
this.path = createPathSvg(this.model);
this.grouper.add(this.path);
this.add(this.grouper);
}
setModel(dx, dy) {
this.model.point.x += dx;
this.model.point.y += dy;
}
}

View File

@ -68,6 +68,10 @@ const map = {
width: 39,
path: 'M38,24V44H1V24H18.237L18,21s-6.5.6-9-8C7.705,8.542,10.288,2,20,2S31.849,8.083,31,13c-1.586,9.183-9,8-9,8v3H38Zm-3,4.077L24,34a4.361,4.361,0,0,1-3,5c-3.052,1.215-7,0-7,0L9,41H35V28.077ZM25.872,17.466A6.259,6.259,0,0,0,29,12a18.6,18.6,0,0,0-1-4L25,5H16L12.511,7.279C10.464,8.908,11.044,14.092,11,10.9a10.963,10.963,0,0,0,2.23,5.284L14,7h2l3.181,6.95L23,7h2Zm-1.924.915L23.261,10.13,19.91,17H18l-2.341-5.907L15.1,17.8A8.481,8.481,0,0,0,20,19C17.855,19.073,20.85,19.478,23.948,18.38ZM4,27V39.556L12,36a6.888,6.888,0,0,1,3-7c4.261-2.736,8,1,8,1l6-3H4Z'
},
Cistern: {
width: 323,
path: 'M264,27v3l-13-5.353V31s-8.068-6-16-6c-8.067,0-16,6-16,6V26H207V84H167v28H135v6s-7.614-6-16-6c-8.11,0-17,6-17,6v-6H23.467L26,119,4,109l23-9-3.13,7H76V31h72V12h59v9h12V14s8.08,5,16,5c8.079,0,16-5,16-5v7.353L264,16v7h54v4H264ZM148,37H82v70h20V99s8.89,8,17,8c8.386,0,16-8,16-8v8h26V84H148V37Zm54-20H153V55h15.5s-5.715-3.318-4.5-15c0.657-6.32,9-9,9-9l22-10h7V17Zm0,9h-6l-13,5s8.644,5.651,8,13c-0.827,9.433-4.75,11-4.75,11H202V26Zm-25,8a9,9,0,1,1-9,9A9,9,0,0,1,177,34Z'
},
StaircaseOneWay: {
width: 51,
path: 'M51,71H0V0H12V15H23V-1h4V15H39V0H51V71ZM23,19H12v4H23V19Zm0,8H12v3H23V27Zm0,7H12v3H23V34Zm0,7H12v3H23V41Zm0,7H12v3H23V48Zm0,7H12v4H23V55ZM39,19H27v4H39V19Zm0,8H27v3H39V27Zm0,7H27v3H39V34Zm0,7H27v3H39V41Zm0,7H27v3H39V48Zm0,7H27v4H39V55ZM43,4V63H8V4H4V66H47V4H43Z'

View File

@ -40,6 +40,7 @@ import SmookExhaustFd from './bas/smookExhaustFd';
import StateTable from './stateTable';
import LightingGroup from './lighting';
import ElectricButterflyValve from './bas/electricButterflyValve';
import Cistern from './bas/cistern';
const iscsShape = {};
iscsShape[deviceType.ManualAlarmButton] = ManualAlarmButton;
@ -84,6 +85,7 @@ iscsShape[deviceType.StateTable] = StateTable;
iscsShape[deviceType.LightingGroup] = LightingGroup;
iscsShape[deviceType.BalancedElectric] = BalancedElectric;
iscsShape[deviceType.ElectricButterflyValve] = ElectricButterflyValve;
iscsShape[deviceType.Cistern] = Cistern;
function shapefactory(device, iscs) {
const type = device.model._type;

View File

@ -166,6 +166,9 @@ export function parser(data) {
zrUtil.each(data.electricButterflyValveList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.ElectricButterflyValve, elem);
});
zrUtil.each(data.cisternList || [], elem => {
iscsDevice[elem.code] = deviceFactory(deviceType.Cistern, elem);
})
}
return iscsDevice;
@ -311,6 +314,9 @@ export function updateIscsData(state, device) {
case deviceType.ElectricButterflyValve:
updateIscsListByDevice(state, 'electricButterflyValveList', device);
break;
case deviceType.Cistern:
updateIscsListByDevice(state, 'cisternList', device);
break;
}
// store.dispatch('iscs/setIscsData', state.iscs);
}

View File

@ -412,10 +412,13 @@ class SkinCode extends defaultStyle {
spareColor: '#5b5b5b' // 区段显示颜色
},
core: {
length: 6 // 道岔单边长度
length: 6, // 道岔单边长度
graphShow: true // 图形显示
},
jointImg: { // 道岔 A B C D四元素属性配置
trapezoidLength: 8 // 直角梯形元素默认长度
trapezoidLength: 8, // 直角梯形元素默认长度
fork: true, // 挤岔专用(如有挤岔操作 变为true
forKColor: 'red' // 挤岔颜色 配合挤岔专用
},
arcBlcok: { // 圆形封锁图形
show: false, // 显示

View File

@ -45,6 +45,10 @@ class ESwLocal extends Group {
this.locShelter.stopAnimation(flag);
}
setColor(color) {
this.locShelter.setStyle({ fill: color });
}
animateStyle(cb) {
this.eachChild((child) => {
cb(child);

View File

@ -283,19 +283,18 @@ export default class Switch extends Group {
this.lockArc.hide(); // 圆形单锁框
this.name.getNameText().stopAnimation(false);
this.sheltertriangle.hide(); // 直角梯形覆盖图形
this.rhomboid.stopAnimation(false);
this.rhomboid.stopAnimation(false); // 平行四边形
this.releaseBackground.hide();
this.setHasTextBorder(0);
this.locShelter.hide(); // 定位覆盖图形
this.relocShelter.hide(); // 反位覆盖图形
this.enabledName.hide(); // 使能隐藏
this.lossShow && this.lossShow.hide();
this.lossShow && this.lossShow.hide(); // 道岔失去矩形
this.lossShow && this.lossShow.stopAnimation(false);
}
/** 定位*/
setLocationAction() {
// this.recover();
if (this.style.Switch.core.splice) {
this.locShelter.hide();
} else {
@ -303,12 +302,17 @@ export default class Switch extends Group {
}
this.relocShelter.hide();
this.rhomboid.hide();
if (this.style.Switch.core.graphShow) { // 佛山线路显示
this.relocShelter.show();
this.rhomboid.show();
this.relocShelter.setColor('#00FF00');
this.rhomboid.setColor('#00FF00');
}
this.setTextColor(this.style.Switch.text.locateColor);
}
/** 反位*/
setInversionAction() {
// this.recover();
this.setTextColor(this.style.Switch.text.inversionColor);
if (this.style.Switch.core.splice) {
this.relocShelter.hide();
@ -318,11 +322,15 @@ export default class Switch extends Group {
this.locShelter.hide(); // 定位
this.rhomboid.show(); // 平行四边形
this.setSectionState(this.rhomboid.getSection(), 'fill', this.model);
if (this.style.Switch.core.graphShow) { // 佛山线路显示
this.locShelter.show();
this.locShelter.setColor('#FFFF00');
this.rhomboid.setColor('#FFFF00');
}
}
/** 失去*/
setLossAction() {
// this.recover();
this.locShelter.show();
this.relocShelter.show();
this.rhomboid.hide();
@ -376,6 +384,7 @@ export default class Switch extends Group {
.when(2000, { fill: this.style.backgroundColor })
.start();
});
this.setTextColor('red');
}
}
@ -402,7 +411,6 @@ export default class Switch extends Group {
/** 封锁 */
block() {
if (this.style.Switch.jointImg.block) {
// this.recover();
this.relocShelter.show();
this.relocShelter.animateStyle(item => {
item.animateStyle(true)
@ -517,18 +525,15 @@ export default class Switch extends Group {
} else if (model.reversePosition) {
this.setInversionAction(model); /** 反位*/
} else {
this.setLossAction();
this.setLossAction(); // 失去
}
/** 道岔单锁 */
model.singleLock && this.setMonolock();
/** 道岔封锁 */
model.blockade && this.block();
model.singleLock && this.setMonolock(); // 道岔单锁
model.blockade && this.block(); // 道岔封锁
model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态
/** 区段切除*/
// this.setForkAction(); // 道岔挤岔完成
// 道岔使能显示
model.isCiConfirm && this.setCiConfirm();
// this.setForkAction(); // 道岔挤岔
model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示
this.setSwitchFault(model.split);
model.cutOff && this.setSwitchCutOff();
if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色

View File

@ -1,5 +1,5 @@
<template>
<div v-if="isShowBtn" class="menu" style="height: 45px;" :style="{left: point.x+'px', top: point.y+'px' }">
<div v-if="isShowBtn" menuButtonclass="menu menuButton" style="height: 45px;" :style="{left: point.x+'px', bottom: point.y+'px' }">
<button
:id="Signal.arrangementRoute.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@ -257,8 +257,8 @@ export default {
data() {
return {
point: {
x: -1000,
y: -1000
x: 0,
y: 15
},
operation: '0',
buttonName: '',
@ -309,11 +309,6 @@ export default {
methods: {
resetPosition() {
this.$nextTick(() => {
const canvasOffset = this.$store.state.config.canvasOffset;
this.point = {
x: canvasOffset.x + 20,
y: canvasOffset.y + this.$store.state.config.height - 65
};
this.$store.dispatch('training/tipReload');
});
},

View File

@ -1,5 +1,5 @@
<template>
<div v-if="isShowBtn" class="menu" style="height: 45px;" :style="{left: point.x+'px', top: point.y+'px' }">
<div v-if="isShowBtn" class="menu menuButton" style="height:45px;" :style="{left: point.x+'px', bottom: point.y+'px' }">
<button
:id="Signal.cancelTrainRoute.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@ -254,8 +254,8 @@ export default {
data() {
return {
point: {
x: -1000,
y: -1000
x: 5,
y: 15
},
operation: '0',
buttonName: '',
@ -297,11 +297,6 @@ export default {
methods: {
resetPosition() {
this.$nextTick(() => {
const canvasOffset = this.$store.state.config.canvasOffset;
this.point = {
x: canvasOffset.x + 20,
y: canvasOffset.y + this.$store.state.config.height - 65
};
this.$store.dispatch('training/tipReload');
});
},

View File

@ -1,5 +1,5 @@
<template>
<div id="menuButton">
<div id="menuButton" class="menuButton">
<div class="haerbin-01__systerm button">
<el-row>
<el-col :span="11">

View File

@ -112,7 +112,18 @@ export default {
async loadInitData() {
this.loading = true;
try {
const res = await getPublishMapInfo(this.mapId);
let res;
try {
res = await getPublishMapInfo(this.mapId);
} catch (error) {
if (error.code == 30001) {
const url = localStore.get('orignalTrainingPlatformRoute' + this.$store.state.user.id);
localStore.remove();
if (url) {
this.$router.push(url);
}
}
}
const resp = await getSubSystemDetail(this.$route.params.subSystem);
this.tryUser = 0;
this.loading = false;
@ -153,16 +164,8 @@ export default {
}
}
} catch (error) {
if (error.code == 30001) {
const url = localStore.get('orignalTrainingPlatformRoute' + this.$store.state.user.id);
localStore.remove();
if (url) {
this.$router.push(url);
}
} else {
this.loading = false;
this.$message.error(this.$t('error.refreshFailed'));
}
// this.loading = false;
// this.$message.error(this.$t('error.refreshFailed'));
}
},
refresh() {

View File

@ -0,0 +1,133 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item v-if="isUpdate" label="编号" prop="code">
<el-input v-model="form.code" :disabled="true" />
</el-form-item>
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="form.width" :min="10" />
</el-form-item>
<el-form-item label="颜色" prop="fill">
<el-color-picker v-model="form.fill" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item>
<el-form-item label="Y轴坐标" prop="y">
<el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import {getUID} from '@/iscs/utils/Uid';
export default {
name:'AirConditioner',
data() {
return {
isUpdate:false,
showDeleteButton: false,
buttonText: '立即创建',
form:{
code:'',
width: 20,
fill: '#000',
x: 10,
y: 10
},
rules: {
code: [
{ required: true, message:'请生成设备图形的编码', trigger: 'blur' }
],
width:[
{ required: true, message:'请输入设备图形宽度', trigger: 'blur' }
],
x: [
{ required: true, message: '请输入设备图形的X轴坐标', trigger: 'blur' }
],
y: [
{ required: true, message: '请输入设备图形的Y轴坐标', trigger: 'blur' }
]
}
};
},
computed:{
...mapGetters('iscs', [
'iscs'
])
},
watch:{
'$store.state.iscs.rightClickCount': function (val) {
const model = this.$store.getters['iscs/updateDeviceData'];
if (model._type === 'Cistern' ) {
this.buttonText = '修改';
this.showDeleteButton = true;
this.isUpdate = true;
this.form.code = model.code;
this.form.width = model.width;
this.form.fill = model.fill;
this.form.x = model.point.x;
this.form.y = model.point.y;
}
}
},
mounted() {
},
methods:{
onSubmit(form) {
this.$refs[form].validate((valid) => {
if (valid) {
const model = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'Cistern',
code: this.isUpdate ? this.form.code : getUID('Cistern', this.iscs.cisternList || []),
width: this.form.width,
fill: this.form.fill
};
this.$emit('createDataModel', model);
this.initPage();
} else {
return false;
}
});
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.form = {
code:'',
width: 20,
x: 10,
y: 10
};
this.$refs.form.resetFields();
},
deleteDevice() {
const airConditionerModel = {
point: {
x: this.form.x,
y: this.form.y
},
_type: 'Cistern',
code: this.form.code,
width: this.form.width,
fill: '#000'
};
this.$emit('deleteDataModel', airConditionerModel );
this.initPage();
}
}
};
</script>

View File

@ -123,7 +123,14 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="水池" name="Cistern">
<cistern
ref="cistern"
style="width: 90%"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="照明组" name="LightingGroup">
<lighting-group
ref="lightingGroup"
@ -190,6 +197,7 @@ import SmookExhaustFd from './smookExhaustFd';
import LightingGroup from './lightingGroup';
import BalancedElectric from './balancedElectric';
import ElectricButterflyValve from './electricButterflyValve';
import Cistern from './cistern';
export default {
name: 'IscsOperate',
@ -212,7 +220,8 @@ export default {
IscsLine,
LightingGroup,
BalancedElectric,
ElectricButterflyValve
ElectricButterflyValve,
Cistern
},
mixins: [
],

View File

@ -1,6 +1,6 @@
<template>
<!-- v-quickMenuDrag -->
<div class="chatBox">
<div class="chatBox" :style="{'bottom':bottom+'px'}">
<div v-show="!minimize" class="chat-box">
<chat-member-list ref="chatMemberList" :group="group" :current-coversition="currentCoversition" @addCoversition="addCoversition" />
<div class="chat-box-main">
@ -77,6 +77,7 @@ export default {
data() {
return {
minimize:true,
bottom:15,
recordSending:false,
currentCoversition:{},
seconds:0,
@ -114,6 +115,13 @@ export default {
},
'$store.state.socket.scriptFinish':function(val, old) {
this.$message('剧本执行完成');
},
'$store.state.map.mapViewLoadedCount':function(val) {
const object = document.querySelector('.menuButton');
if (object) {
const objectBottom = parseInt(object.offsetHeight.style.bottom) || 0;
this.bottom = this.bottom + object.offsetHeight + objectBottom;
}
}
},
@ -279,7 +287,7 @@ export default {
position: absolute;
padding-left:5px;
left: 0;
bottom:28px;
bottom:15px;
z-index:22;
}
.chat-box{

View File

@ -1,10 +1,10 @@
<template>
<!-- v-quickMenuDrag -->
<div class="chatBox">
<div class="chatBox" :style="{'bottom':bottom+'px'}">
<div v-show="!minimize" class="chat-box">
<chat-member-list ref="chatMemberList" :group="group" :current-coversition="currentCoversition" />
<div class="chat-box-main">
<chat-coversition-list ref="chatCoversitionList" :group="group" :user-role="userRole" @showAddCoverition="showAddCoverition" @hideAddCoversition="hideAddCoversition" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />
<chat-coversition-list ref="chatCoversitionList" :group="group" :user-role="userRole" @hideAddCoversition="hideAddCoversition" @setCurrentCoversition="setCurrentCoversition" @setHeadTitle="setHeadTitle" />
<div class="chat-window">
<div class="chat-box-header">
<div class="chat-box-header-title">{{ headerTitle }}</div>
@ -30,6 +30,7 @@
</div>
<div class="chat-box-footer">
<div class="chat-box-footer-tool" />
<div v-if="isButtonShow" class="chat-box-footer-quit" @click="quitCoversition()">退出群聊</div>
<div v-if="currentCoversition.all||isButtonShow" class="chat-box-footer-send" @click="startRecording()">发送语音</div>
</div>
</div>
@ -54,7 +55,7 @@ import ChatCoversitionList from './chatCoversitionList';
import ChatCreateGroup from './chatCreateGroup';
import ChatTooltip from './chatTooltip';
import RecordRTC from 'recordrtc';
import {uploadAudioFileNew} from '@/api/chat';
import {uploadAudioFileNew, quitCoversition} from '@/api/chat';
export default {
name: 'ChatBox',
components:{
@ -78,6 +79,7 @@ export default {
data() {
return {
minimize:false,
bottom:15,
recordSending:false,
currentCoversition:{},
seconds:0,
@ -100,6 +102,15 @@ export default {
return this.userRole != 'ADMIN' && this.userRole != 'AUDIENCE' && this.isHasCoversition;
}
},
watch:{
'$store.state.map.mapViewLoadedCount':function(val) {
const object = document.querySelector('.menuButton');
if (object) {
const objectBottom = parseInt(object.offsetHeight.style.bottom) || 0;
this.bottom = this.bottom + object.offsetHeight + objectBottom;
}
}
},
mounted() {
this.initPage();
},
@ -138,8 +149,14 @@ export default {
hideAddCoversition() {
this.isHasCoversition = true;
},
showAddCoverition() {
quitCoversition() {
quitCoversition(this.group, this.currentCoversition.id).then(res=>{
this.currentCoversition = null;
this.$refs.chatCoversitionList.initPage(true);
this.isHasCoversition = false;
}).catch(error=>{
this.$messageBox('退出会话失败: ' + error.message);
});
},
addCoversition({data, headerTitle}) {
this.$refs.chatCoversitionList.addCoversition(data);
@ -360,7 +377,19 @@ export default {
.coversition-list{
}
.chat-box-footer-quit{
background: red;
width: 65px;
font-size: 12px;
padding: 5px 0px 4px 0px;
text-align: center;
border-radius: 3px;
color: #fff;
float: left;
margin-left: 10px;
margin-bottom: 10px;
cursor: pointer;
}
.showMembers{
float: right;
line-height: 40px;

View File

@ -15,7 +15,7 @@
</div>
</template>
<script>
import {getSimulationConversationListNew, quitCoversition} from '@/api/chat';
import {getSimulationConversationListNew} from '@/api/chat';
export default {
name:'ChatCoversitionList',
props: {
@ -95,14 +95,6 @@ export default {
this.coversitionList.push(coversition);
}
this.changeCoversition(coversition);
},
closeCoversition(coversitionId) {
quitCoversition(this.group, coversitionId).then(res=>{
this.initPage(true);
this.$emit('showAddCoverition');
}).catch(error=>{
this.$messageBox('退出会话失败: ' + error.message);
});
}
}
};

View File

@ -193,8 +193,8 @@ export default {
{ prop: 'sepTypeLeft', label: this.$t('map.sepTypeLeft'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSwitchSectionType },
{ prop: 'sepTypeRight', label: this.$t('map.sepTypeRight'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSwitchSectionType },
{ prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '100px', isHidden: !this.isPointsShow, addPoint: this.addPoint, delPoint: this.delPoint, lastDisabled: true },
{ prop: 'logicSectionStartOffset', label: this.$t('map.logicalSectionStartOffset'), type: 'number', min: 0, width: '150px', isHidden: !this.isStationCodeDisabled, disabled: true },
{ prop: 'logicSectionEndOffset', label: this.$t('map.logicalSectionEndOffset'), type: 'number', min: 0, width: '150px', isHidden: !this.isStationCodeDisabled, disabled: true },
{ prop: 'logicSectionStartOffset', label: this.$t('map.logicalSectionStartOffset'), type: 'number', min: 0, width: '150px', isHidden: !this.isStationCodeDisabled, disabled: true }, //
{ prop: 'logicSectionEndOffset', label: this.$t('map.logicalSectionEndOffset'), type: 'number', min: 0, width: '150px', isHidden: !this.isStationCodeDisabled, disabled: true }, //
{ prop: 'standTrack', label: this.$t('map.isStandTrack'), type: 'checkbox', isHidden: !this.isLogicSectionNameSort }, //
{ prop: 'standTrackName', label: this.$t('map.standTrackName'), type: 'input', isHidden: !this.isstandTrackNameShow },
@ -593,7 +593,7 @@ export default {
return models;
},
handleOtherSectionChange(model) { //
const models = [];
let 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);
this.sectionList.forEach(section => {
@ -669,6 +669,41 @@ export default {
models.push(item);
});
if (!model.parentCode) {
const arr = this.setLogicOffset(model);
models = [...models, ...arr];
} else {
const sectionModel = this.$store.getters['map/getDeviceByCode'](model.parentCode);
const arr = this.setLogicOffset(sectionModel);
models = [...models, ...arr];
}
return models;
},
setLogicOffset(section) { //
const models = [];
// logicSectionCodeList
let startPoint = section.points[0].x + 's' + section.points[0].y;
let startOffset = 0;
const sectionMap = {};
if (section.logicSectionCodeList && section.logicSectionCodeList.length) {
section.logicSectionCodeList.forEach(sectionCode => {
const logicSection = this.$store.getters['map/getDeviceByCode'](sectionCode);
sectionMap[logicSection.points[0].x + 's' + logicSection.points[0].y] = logicSection;
});
while (sectionMap[startPoint]) {
const model = deepAssign({}, sectionMap[startPoint]);
if (!model.lengthFact) {
const length = section.lengthFact / section.logicSectionCodeList.length;
model.lengthFact = length.toFixed(3);
}
model.logicSectionStartOffset = startOffset;
model.logicSectionEndOffset = (model.lengthFact * 1000 + startOffset * 1000) / 1000;
models.push(model);
startOffset = (startOffset * 1000 + model.lengthFact * 1000) / 1000;
startPoint = model.points[model.points.length - 1].x + 's' + model.points[model.points.length - 1].y;
}
}
return models;
},
getSectionByCode(code) {