Merge branch 'dev' of https://git.qcloud.com/joylink/jl-nclient into dev
# Conflicts: # src/views/designPlatform/mapPreview.vue
This commit is contained in:
commit
b9111b8219
@ -26,9 +26,9 @@ export function getScriptById(id) {
|
||||
});
|
||||
}
|
||||
/** 通过ID查询未发布剧本的详细信息 */
|
||||
export function getDraftScriptById(id) {
|
||||
export function getDraftScriptByGroup(group) {
|
||||
return request({
|
||||
url: `/api/script/draft/${id}/detail`,
|
||||
url: `/api/simulation/${group}/script/loadedScript`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -425,3 +425,12 @@ export function handlerIbpEvent(group, data) {
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 预览脚本仿真*/
|
||||
export function scriptDraftRecordNotify(scriptId) {
|
||||
return request({
|
||||
url: `/api/simulation/scriptDraft/${scriptId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -205,5 +205,6 @@ export default {
|
||||
publishTheCourseHint: 'This operation will publish the course. Are you sure?',
|
||||
rejectedCourseReleaseApplicationSuccessful: 'Rejected course release application successful!',
|
||||
rejectedCourseReleaseApplicationFailed: 'Rejected course release application failed!',
|
||||
duplicatePlanFailedTips: 'The interval needs to be more than 30 seconds or the times is more than 1'
|
||||
duplicatePlanFailedTips: 'The interval needs to be more than 30 seconds or the times is more than 1',
|
||||
createSwitchPortion: 'The relevant turnout is not formed'
|
||||
};
|
||||
|
@ -205,5 +205,6 @@ export default {
|
||||
publishTheCourseHint: '此操作将发布课程,是否确定?',
|
||||
rejectedCourseReleaseApplicationSuccessful: '驳回课程发布申请成功!',
|
||||
rejectedCourseReleaseApplicationFailed: '驳回课程发布申请失败!',
|
||||
duplicatePlanFailedTips: '间隔时间需要大于30秒或次数大于1'
|
||||
duplicatePlanFailedTips: '间隔时间需要大于30秒或次数大于1',
|
||||
createSwitchPortion: '相关道岔未生成'
|
||||
};
|
||||
|
@ -40,6 +40,7 @@ class Jlmap {
|
||||
initMapInstance(opts) {
|
||||
const width = opts.dom.clientWidth;
|
||||
const height = opts.dom.clientHeight;
|
||||
this.zoomOnMouseWheel = opts.options.zoomOnMouseWheel;
|
||||
|
||||
this.$zr = zrender.init(opts.dom, deepAssign({ renderer, devicePixelRatio, width, height }, opts.config));
|
||||
|
||||
@ -125,6 +126,7 @@ class Jlmap {
|
||||
if (this.$options.disabled == true) {
|
||||
this.$mouseController.disable();
|
||||
} else {
|
||||
opts['zoomOnMouseWheel'] = this.zoomOnMouseWheel;
|
||||
this.$mouseController.enable(opts);
|
||||
}
|
||||
|
||||
|
@ -1,17 +0,0 @@
|
||||
<template>
|
||||
<section class="app-main">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<transition name="fade" mode="out-in">
|
||||
<router-view />
|
||||
</transition>
|
||||
</el-scrollbar>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'AppMain',
|
||||
computed: {
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,3 +1,3 @@
|
||||
export { default as Navbar } from './Navbar';
|
||||
export { default as Sidebar } from './Sidebar';
|
||||
export { default as AppMain } from './AppMain';
|
||||
// export { default as AppMain } from './AppMain';
|
||||
|
@ -119,7 +119,7 @@
|
||||
<script>
|
||||
import md5 from 'js-md5';
|
||||
import { getInfo } from '@/api/login';
|
||||
import { getDesignToken } from '@/utils/auth'; // 验权
|
||||
import { getDesignToken, getToken } from '@/utils/auth'; // 验权
|
||||
import { getUserinfoName, getUserinfoNickname, getUserinfoMobile, getUserinfoMobileCode, getUserinfoEmailCode, getUserinfoEmail, getUserinfoPassword } from '@/api/management/user';
|
||||
import { setInterval, clearInterval } from 'timers';
|
||||
|
||||
@ -187,7 +187,8 @@ export default {
|
||||
},
|
||||
doShow() {
|
||||
this.visible = true;
|
||||
getInfo(getDesignToken()).then(response => {
|
||||
const token = getToken() || getDesignToken();
|
||||
getInfo(token).then(response => {
|
||||
const user = response.data;
|
||||
this.userInfo = {
|
||||
name: user.name,
|
||||
|
@ -2,13 +2,12 @@
|
||||
<div class="app-wrapper" :class="classObj">
|
||||
<div class="main-container">
|
||||
<navbar />
|
||||
<!-- <app-main :style="{width: width+'px', height: height+'px'}" /> -->
|
||||
<section class="app-main" :style="{height: height+'px'}">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper app_scrollbar_box">
|
||||
<transition name="fade" mode="out-in">
|
||||
<router-view />
|
||||
</transition>
|
||||
</el-scrollbar>
|
||||
<!-- <el-scrollbar wrap-class="scrollbar-wrapper app_scrollbar_box"> -->
|
||||
<transition name="fade" mode="out-in">
|
||||
<router-view />
|
||||
</transition>
|
||||
<!-- </el-scrollbar> -->
|
||||
</section>
|
||||
<el-footer style="height:30px;text-align:right;line-height: 30px;">
|
||||
<span style="font-size:14px;">Copyright ©2018 北京玖琏科技有限公司 京ICP备18028522号</span>
|
||||
@ -24,7 +23,6 @@ export default {
|
||||
name: 'Layout',
|
||||
components: {
|
||||
Navbar
|
||||
// AppMain
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -77,6 +75,10 @@ export default {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.app-main{
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.drawer-bg {
|
||||
background: #000;
|
||||
opacity: 0.3;
|
||||
@ -94,4 +96,49 @@ export default {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
// 定义公共card样式
|
||||
.joylink-card{
|
||||
border: 1px solid #EBEEF5;
|
||||
background-color: #FFF;
|
||||
color: #303133;
|
||||
transition: .3s;
|
||||
box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
|
||||
}
|
||||
|
||||
// 谷歌、safari、qq浏览器、360浏览器滚动条样式
|
||||
// 定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸
|
||||
::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 110px;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
/*定义滚动条轨道 内阴影+圆角*/
|
||||
::-webkit-scrollbar-track {
|
||||
// box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
|
||||
border-radius: 10px;
|
||||
background-color: #FFFFFF;;
|
||||
}
|
||||
/*定义滑块 内阴影+圆角*/
|
||||
::-webkit-scrollbar-thumb {
|
||||
border-radius: 10px;
|
||||
// box-shadow: inset 0 0 6px rgba(0,0,0,.3);
|
||||
background-color: #eaeaea;
|
||||
}
|
||||
/*滑块效果*/
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
border-radius: 5px;
|
||||
// box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
|
||||
background: rgba(0,0,0,0.4);
|
||||
}
|
||||
/*IE滚动条颜色*/
|
||||
html {
|
||||
scrollbar-face-color:#bfbfbf;/*滚动条颜色*/
|
||||
scrollbar-highlight-color:#000;
|
||||
scrollbar-3dlight-color:#000;
|
||||
scrollbar-darkshadow-color:#000;
|
||||
scrollbar-Shadow-color:#adadad;/*滑块边色*/
|
||||
scrollbar-arrow-color:rgba(0,0,0,0.4);/*箭头颜色*/
|
||||
scrollbar-track-color:#eeeeee;/*背景颜色*/
|
||||
}
|
||||
</style>
|
||||
|
@ -3,8 +3,8 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
|
||||
} else {
|
||||
|
@ -1,17 +1,20 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card v-loading="loading" class="map-list-main" :header="$t('map.publishedMapList')">
|
||||
<div v-loading="loading" class="joylink-card map-list-main">
|
||||
<div class="clearfix">
|
||||
<span>{{ $t('map.publishedMapList') }}</span>
|
||||
</div>
|
||||
<div class="text_item" style="height: calc(100% - 47px);">
|
||||
<filter-city ref="filerCity" filter-empty :query-function="queryFunction" :local-param-name="localParamName" @filterSelectChange="refresh" />
|
||||
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-125) +'px' }">
|
||||
<el-tree ref="tree" :data="treeList" node-key="id" :props="defaultProps" highlight-current :span="22" :filter-node-method="filterNode" @node-click="clickEvent">
|
||||
<div style="height: calc(100% - 76px);">
|
||||
<el-tree ref="tree" class="tree_box" :data="treeList" node-key="id" :props="defaultProps" highlight-current :span="22" :filter-node-method="filterNode" @node-click="clickEvent">
|
||||
<span slot-scope="{ node:tnode, data }">
|
||||
<span class="el-icon-tickets" :style="{color: data.valid ? 'green':''}" />
|
||||
<span> {{ tnode.label }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -57,11 +60,6 @@ export default {
|
||||
cityCode: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
height() {
|
||||
return this.$store.state.app.height - 93;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
this.treeList = this.treeData.filter((res) => {
|
||||
@ -174,8 +172,28 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.map-list-main{
|
||||
text-align:left;
|
||||
.back-home {
|
||||
float: right;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: #3ea726;
|
||||
}
|
||||
}
|
||||
|
||||
.map-list-main{
|
||||
text-align:left;
|
||||
height: 100%;
|
||||
}
|
||||
.clearfix{
|
||||
padding: 0 20px;
|
||||
border-bottom: 1px solid #EBEEF5;
|
||||
box-sizing: border-box;
|
||||
height: 47px;
|
||||
line-height: 47px;
|
||||
}
|
||||
.tree_box{
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
|
@ -1,14 +1,12 @@
|
||||
<template>
|
||||
<div class="app-wrapper">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
||||
<demon-list ref="demonList" :width="widthLeft" />
|
||||
</div>
|
||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||
<transition>
|
||||
<router-view :product-list="productList" :width-left="widthLeft" />
|
||||
</transition>
|
||||
</el-scrollbar>
|
||||
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
||||
<demon-list ref="demonList" :width="widthLeft" />
|
||||
</div>
|
||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||
<transition>
|
||||
<router-view :product-list="productList" :width-left="widthLeft" />
|
||||
</transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -99,8 +97,6 @@ export default {
|
||||
}
|
||||
|
||||
.examList {
|
||||
// position: fixed;
|
||||
// top: 61px;
|
||||
float: left;
|
||||
height: 100%;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="map-view">
|
||||
<jlmap-visual ref="jlmapVisual" @onSelect="clickEvent" @onMenu="onContextmenu" />
|
||||
<jlmap-visual ref="jlmapVisual" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -1,39 +1,25 @@
|
||||
<template>
|
||||
<el-card v-loading="loading" class="map-list-main" :header="$t('map.myMapList')">
|
||||
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-185) +'px' }">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="treeList"
|
||||
node-key="id"
|
||||
:props="defaultProps"
|
||||
highlight-current
|
||||
:span="22"
|
||||
:filter-node-method="filterNode"
|
||||
@node-click="clickEvent"
|
||||
@node-contextmenu="showContextMenu"
|
||||
>
|
||||
<span slot-scope="{ node:tnode, data }">
|
||||
<span
|
||||
class="el-icon-tickets"
|
||||
:style="{color: data.valid ? 'green':''}"
|
||||
/>
|
||||
<span> {{ tnode.label }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
<div class="buttonList">
|
||||
<el-button size="small" type="primary" class="eachButton uploadDemo ">
|
||||
<input
|
||||
ref="files"
|
||||
type="file"
|
||||
class="file_box"
|
||||
accept=".json, application/json"
|
||||
@change="importf"
|
||||
>
|
||||
{{ $t('map.importMap') }}
|
||||
</el-button>
|
||||
<el-button size="small" type="primary" class="eachButton" @click="createMap">{{ $t('map.newConstruction') }}</el-button>
|
||||
<div v-loading="loading" class="joylink-card map-list-main">
|
||||
<div class="clearfix">
|
||||
<span>{{ $t('map.myMapList') }}</span>
|
||||
</div>
|
||||
<div class="text_item" style="height: calc(100% - 47px);">
|
||||
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
|
||||
<div style="height: calc(100% - 89px); overflow-y: auto;">
|
||||
<el-tree ref="tree" :data="treeList" node-key="id" :props="defaultProps" highlight-current :span="22" :filter-node-method="filterNode" @node-click="clickEvent" @node-contextmenu="showContextMenu">
|
||||
<span slot-scope="{ node:tnode, data }">
|
||||
<span class="el-icon-tickets" :style="{color: data.valid ? 'green':''}" />
|
||||
<span> {{ tnode.label }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
<div class="buttonList">
|
||||
<el-button size="small" type="primary" class="eachButton uploadDemo ">
|
||||
<input ref="files" type="file" class="file_box" accept=".json, application/json" @change="importf">
|
||||
{{ $t('map.importMap') }}
|
||||
</el-button>
|
||||
<el-button size="small" type="primary" class="eachButton" @click="createMap">{{ $t('map.newConstruction') }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<map-operate-menu
|
||||
ref="menu"
|
||||
@ -43,7 +29,7 @@
|
||||
@refresh="loadInitData"
|
||||
@jlmap3d="jlmap3d"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
@ -59,10 +45,6 @@ export default {
|
||||
MapOperateMenu
|
||||
},
|
||||
props: {
|
||||
height: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
width: {
|
||||
type: Number,
|
||||
required: true
|
||||
@ -223,6 +205,16 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.clearfix{
|
||||
padding: 0 20px;
|
||||
border-bottom: 1px solid #EBEEF5;
|
||||
box-sizing: border-box;
|
||||
height: 47px;
|
||||
line-height: 47px;
|
||||
}
|
||||
.tree_box{
|
||||
height: 100%;
|
||||
}
|
||||
.buttonList{
|
||||
padding: 8px 0px 8px 0px;
|
||||
border-top: 1px #ccc solid;
|
||||
@ -249,5 +241,6 @@ export default {
|
||||
}
|
||||
.map-list-main{
|
||||
text-align:left;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,20 +1,13 @@
|
||||
<template>
|
||||
<div class="app-wrapper">
|
||||
<div class="app-wrapper" style="height: 100%;">
|
||||
<map-create ref="mapCreate" :skin-code="skinCode" @refresh="refresh1" @editmap="handleNodeClick" />
|
||||
<!-- <el-scrollbar wrap-class="scrollbar-wrapper"> -->
|
||||
<div>
|
||||
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
||||
<demon-list ref="demonList" :height="height" :width="widthLeft" @createMap="createMap" />
|
||||
</div>
|
||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||
<transition>
|
||||
<!-- position:'relative', -->
|
||||
<!-- :style="{left:widthLeft+'px', width: (width - widthLeft)+'px'}" -->
|
||||
<router-view :product-list="productList" />
|
||||
</transition>
|
||||
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
||||
<demon-list ref="demonList" :width="widthLeft" @createMap="createMap" />
|
||||
</div>
|
||||
|
||||
<!-- </el-scrollbar> -->
|
||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||
<transition>
|
||||
<router-view :product-list="productList" />
|
||||
</transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -47,9 +40,6 @@ export default {
|
||||
...mapGetters([
|
||||
'lessonbar'
|
||||
]),
|
||||
height() {
|
||||
return this.$store.state.app.height - 50;
|
||||
},
|
||||
width() {
|
||||
return this.$store.state.app.width;
|
||||
}
|
||||
@ -140,8 +130,6 @@ export default {
|
||||
}
|
||||
|
||||
.examList {
|
||||
// position: fixed;
|
||||
// top: 61px;
|
||||
float: left;
|
||||
height: 100%;
|
||||
}
|
||||
|
@ -131,6 +131,12 @@ export default {
|
||||
document.getElementById(this.canvasId).oncontextmenu = function (e) {
|
||||
return false;
|
||||
};
|
||||
// 默认个人地图绘制可以滚轮放大缩小 其他地图显示不允许此操作
|
||||
const path = window.location.href;
|
||||
let flag = false;
|
||||
if (path.includes('design/userlist/map/draw')) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
Vue.prototype.$jlmap = new Jlmap({
|
||||
dom: document.getElementById(this.canvasId),
|
||||
@ -142,7 +148,8 @@ export default {
|
||||
options: {
|
||||
scaleRate: 1,
|
||||
offsetX: 0,
|
||||
offsetY: 0
|
||||
offsetY: 0,
|
||||
zoomOnMouseWheel: flag
|
||||
},
|
||||
methods: {
|
||||
dataLoaded: this.handleDataLoaded,
|
||||
|
@ -104,6 +104,7 @@
|
||||
<div class="point-section">
|
||||
<template v-for="(point, index) in formModel[item.prop]">
|
||||
<div :key="index" style="overflow: hidden;">
|
||||
<span style="display: table; margin-right: 3px; font-size: 14px; float: left; line-height: 28px;">{{ index == 0 ? '(起点)' : index == formModel[item.prop].length - 1 ? '(终点)' : `(中点${index})` }}</span>
|
||||
<el-form-item
|
||||
label=""
|
||||
:prop="'points[' + index + '].x'"
|
||||
@ -120,7 +121,7 @@
|
||||
label=""
|
||||
:prop="'points[' + index + '].y'"
|
||||
style="display: table; float: left; margin-right: 5px;"
|
||||
label-width="10px"
|
||||
label-width="4px"
|
||||
>
|
||||
<el-input-number v-model="point.y" :disabled="item.pointDisabled" />
|
||||
</el-form-item>
|
||||
@ -136,6 +137,7 @@
|
||||
:disabled="index == 0 || index == formModel[item.prop].length - 1"
|
||||
circle
|
||||
class="point-button"
|
||||
style="margin-left: 4px;"
|
||||
@click="item.delPoint(index)"
|
||||
/>
|
||||
</div>
|
||||
|
@ -107,6 +107,7 @@
|
||||
<div class="point-section" :style="{ width: `calc(100% - 10px - ${item.width})` }">
|
||||
<template v-for="(point, index) in formModel[item.prop]">
|
||||
<div :key="index" style="overflow: hidden;">
|
||||
<span style="display: table; margin-right: 3px; font-size: 14px; float: left; line-height: 28px;" :style="{'margin-right': index == 0 || index == formModel[item.prop].length - 1 ? '9px' : '5px'}">{{ index == 0 ? '起 点' : index == formModel[item.prop].length - 1 ? '终 点' : `中点${index}` }}</span>
|
||||
<el-form-item
|
||||
label=""
|
||||
:prop="'points[' + index + '].x'"
|
||||
@ -123,7 +124,7 @@
|
||||
label=""
|
||||
:prop="'points[' + index + '].y'"
|
||||
style="display: table; float: left; margin-right: 5px;"
|
||||
label-width="10px"
|
||||
label-width="4px"
|
||||
>
|
||||
<el-input-number v-model="point.y" :disabled="item.pointDisabled" />
|
||||
</el-form-item>
|
||||
@ -139,6 +140,7 @@
|
||||
:disabled="index == 0 || index == formModel[item.prop].length - 1"
|
||||
circle
|
||||
class="point-button"
|
||||
style="margin-left: 4px;"
|
||||
@click="item.delPoint(index)"
|
||||
/>
|
||||
</div>
|
||||
|
@ -161,7 +161,7 @@ export default {
|
||||
{ prop: 'code', label: this.$t('map.lineCoding'), type: 'select', optionLabel: 'code', optionValue: 'code', options: this.lineList, change: true, deviceChange: this.deviceChange },
|
||||
{ prop: 'type', label: this.$t('map.lineType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.LineTypeList },
|
||||
{ prop: 'width', label: this.$t('map.lineWidth'), type: 'number', min: 1, placeholder: 'px' },
|
||||
{ prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '120px', isHidden: !this.isPointsShow, addPoint: this.addPoint, delPoint: this.delPoint }
|
||||
{ prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '100px', isHidden: !this.isPointsShow, addPoint: this.addPoint, delPoint: this.delPoint }
|
||||
]
|
||||
},
|
||||
map: {
|
||||
|
@ -130,7 +130,7 @@
|
||||
<el-tab-pane class="view-control" label="批量删除" name="five" :style="{ height: cardHeight + 30 +'px' }">
|
||||
<div class="link_box_select">
|
||||
<span style="margin-right: 12px;">选择link:</span>
|
||||
<el-select v-model="linkCode" filterable size="mini">
|
||||
<el-select v-model="linkCode" filterable multiple size="mini">
|
||||
<el-option
|
||||
v-for="item in linkList"
|
||||
:key="item.code"
|
||||
@ -225,6 +225,7 @@ export default {
|
||||
},
|
||||
linkCode: '',
|
||||
tableData: [],
|
||||
oldPoint: [], // 区段未修改前 坐标
|
||||
addModel: {
|
||||
code: '',
|
||||
splitNumber: 2,
|
||||
@ -343,7 +344,7 @@ export default {
|
||||
{ prop: 'segmentationPosition.y', firstLevel: 'segmentationPosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
|
||||
] },
|
||||
{ prop: 'isCurve', label: this.$t('map.isCurve'), type: 'checkbox', isHidden: !this.isSectionType },
|
||||
{ prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '140px', isHidden: !this.isPointsShow, pointDisabled: this.pointDisabledName, addPoint: this.addPoint, delPoint: this.delPoint }
|
||||
{ prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '100px', isHidden: !this.isPointsShow, pointDisabled: this.pointDisabledName, addPoint: this.addPoint, delPoint: this.delPoint }
|
||||
]
|
||||
},
|
||||
map: {
|
||||
@ -565,6 +566,7 @@ export default {
|
||||
this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0];
|
||||
this.editModel.isSegmentation = selected.isSegmentation || false;
|
||||
this.editModel.points = JSON.parse(JSON.stringify(selected.points));
|
||||
this.oldPoint = JSON.parse(JSON.stringify(selected.points));
|
||||
|
||||
this.addModel.splitOffsetMax = Math.sqrt(new JTriangle(selected.points[0], selected.points[selected.points.length - 1]).abspowz);
|
||||
this.addModel.splitOffset = this.addModel.splitOffsetMax / 2;
|
||||
@ -836,7 +838,6 @@ export default {
|
||||
}
|
||||
}
|
||||
});
|
||||
console.log(models, remove);
|
||||
|
||||
const _that = this;
|
||||
this.$confirm(this.$t('tip.confirmBatchGeneration'), this.$t('tip.hint'), {
|
||||
@ -865,7 +866,7 @@ export default {
|
||||
this.$refs['dataform'].validate((valid) => {
|
||||
if (valid) {
|
||||
const edits = [];
|
||||
const model = Object.assign({_type: 'Section'}, this.editModel);
|
||||
const model = Object.assign({_type: 'Section'}, this.editModel); // 修改元素model
|
||||
model.leftStopPointOffset = Number(model.leftStopPointOffset);
|
||||
model.rightStopPointOffset = Number(model.rightStopPointOffset);
|
||||
this.sectionList.forEach(section => {
|
||||
@ -874,10 +875,24 @@ export default {
|
||||
section.trainPosType = model.trainPosType;
|
||||
edits.push(section);
|
||||
}
|
||||
if (section.linkCode == model.linkCode && model.code != section.code) {
|
||||
// debugger;
|
||||
const lastIndex = this.oldPoint.length - 1;
|
||||
if (this.oldPoint[0].x == section.points[section.points.length -1].x && this.oldPoint[0].y == section.points[section.points.length -1].y) {
|
||||
section.points[section.points.length -1].x = model.points[0].x;
|
||||
section.points[section.points.length -1].y = model.points[0].y;
|
||||
}
|
||||
if (this.oldPoint[lastIndex].x == section.points[0].x && this.oldPoint[lastIndex].y == section.points[0].y) {
|
||||
section.points[0].x = model.points[model.points.length -1].x;
|
||||
section.points[0].y = model.points[model.points.length -1].y;
|
||||
}
|
||||
edits.push(section);
|
||||
}
|
||||
});
|
||||
edits.push(model);
|
||||
this.fieldS = '';
|
||||
this.$emit('addOrUpdateMapModel', edits);
|
||||
this.oldPoint = JSON.parse(JSON.stringify(model.points));
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -1101,17 +1116,19 @@ export default {
|
||||
delRelevanceSection() {
|
||||
const selected = [];
|
||||
const switchList = [];
|
||||
this.sectionList.forEach(section => {
|
||||
if (section.linkCode == this.linkCode) {
|
||||
const selectedSection = this.$store.getters['map/getDeviceByCode'](section.code);
|
||||
selected.push(selectedSection);
|
||||
this.switchList.forEach(switchEle => {
|
||||
if (section.relSwitchCode == switchEle.code) {
|
||||
const selectedSwitch = this.$store.getters['map/getDeviceByCode'](switchEle.code);
|
||||
switchList.push(selectedSwitch);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.linkCode.forEach(linkCode => {
|
||||
this.sectionList.forEach(section => {
|
||||
if (section.linkCode == linkCode) {
|
||||
const selectedSection = this.$store.getters['map/getDeviceByCode'](section.code);
|
||||
selected.push(selectedSection);
|
||||
this.switchList.forEach(switchEle => {
|
||||
if (section.relSwitchCode == switchEle.code) {
|
||||
const selectedSwitch = this.$store.getters['map/getDeviceByCode'](switchEle.code);
|
||||
switchList.push(selectedSwitch);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
@ -1123,6 +1140,7 @@ export default {
|
||||
});
|
||||
await this.$emit('delMapModel', selected);
|
||||
this.deviceSelect();
|
||||
this.linkCode = '';
|
||||
}).catch(() => {
|
||||
this.$message.info(this.$t('tip.cancelledDelete'));
|
||||
});
|
||||
|
@ -171,15 +171,15 @@ export default {
|
||||
create() { // 一键生成道岔
|
||||
this.questionList = []; // 有问题区段列表
|
||||
const models = [];
|
||||
// const remove = [];
|
||||
const linkObj = {};
|
||||
this.linkList.forEach(link => {
|
||||
if (link && link.leftFdCode && link.leftSdCode) { // 左侧同时都有关联link
|
||||
linkObj[`${link.code}`] = { name: '', num: 0 };
|
||||
} else if (link && link.rightFdCode && link.rightSdCode) { // 右侧同时都有关联link
|
||||
linkObj[`${link.code}`] = { name: '', num: 0 };
|
||||
} else if (link && link.leftFdCode && !link.leftSdCode && link.rightFdCode && !link.rightSdCode) { // 左右正向link关联,侧向link不关联检测
|
||||
linkObj[`${link.code}`] = { name: '', num: 0 };
|
||||
}
|
||||
|
||||
});
|
||||
this.sectionList.forEach(section => {
|
||||
for (const link in linkObj) {
|
||||
@ -227,7 +227,7 @@ export default {
|
||||
}
|
||||
};
|
||||
const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode);
|
||||
!swch && models.push(model);
|
||||
!swch && models.push(model); // 已有的道岔不在创建
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -273,6 +273,16 @@ export default {
|
||||
}
|
||||
}
|
||||
});
|
||||
const createArr = [];
|
||||
models.forEach((item) => {
|
||||
const sectionA = this.$store.getters['map/getDeviceByCode'](item.sectionACode);
|
||||
const sectionB = this.$store.getters['map/getDeviceByCode'](item.sectionBCode);
|
||||
const sectionC = this.$store.getters['map/getDeviceByCode'](item.sectionCCode);
|
||||
if (linkObj[sectionA.linkCode].num != 1 && linkObj[sectionB.linkCode].num != 1 && linkObj[sectionC.linkCode].num != 1 ) {
|
||||
createArr.push(item);
|
||||
}
|
||||
});
|
||||
// console.log(models, createArr, '创建道岔list');
|
||||
this.$confirm(this.$t('tip.confirmBatchGeneration'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
@ -280,14 +290,11 @@ export default {
|
||||
}).then(() => {
|
||||
for (const link in linkObj) {
|
||||
if (linkObj[link].num == 1) {
|
||||
this.questionList.push(`${this.$t('map.section')}${linkObj[link].name}${this.$t('tip.linkNoneSplit')}`);
|
||||
this.questionList.push(`${this.$t('map.section')}${linkObj[link].name}${this.$t('tip.linkNoneSplit')}, ${this.$t('tip.createSwitchPortion')}`);
|
||||
}
|
||||
}
|
||||
if (!this.questionList.length) { // 没有问题list 再去创建
|
||||
// this.$emit('delMapModel', remove);
|
||||
this.$emit('addOrUpdateMapModel', models);
|
||||
this.createSwitchSection(models);
|
||||
}
|
||||
this.$emit('addOrUpdateMapModel', createArr);
|
||||
this.createSwitchSection(createArr);
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
|
Loading…
Reference in New Issue
Block a user