desc: 修改代码

This commit is contained in:
zyy 2019-11-18 14:29:43 +08:00
parent 9a82914c11
commit 8d05730dc4
19 changed files with 493 additions and 219 deletions

View File

@ -25,6 +25,7 @@
"qrcode.vue": "^1.6.2", "qrcode.vue": "^1.6.2",
"script-loader": "^0.7.2", "script-loader": "^0.7.2",
"sessionstorage": "^0.1.0", "sessionstorage": "^0.1.0",
"sockjs-client": "^1.4.0",
"stompjs": "^2.3.3", "stompjs": "^2.3.3",
"storejs": "^1.0.25", "storejs": "^1.0.25",
"three": "^0.107.0", "three": "^0.107.0",

View File

@ -20,6 +20,7 @@
<script src="https://cdn.bootcss.com/element-ui/2.7.2/index.js"></script> <script src="https://cdn.bootcss.com/element-ui/2.7.2/index.js"></script>
<script src="https://cdn.bootcss.com/element-ui/2.7.2/locale/en.min.js"></script> <script src="https://cdn.bootcss.com/element-ui/2.7.2/locale/en.min.js"></script>
<script src="https://cdn.bootcss.com/element-ui/2.7.2/locale/zh-CN.min.js"></script> <script src="https://cdn.bootcss.com/element-ui/2.7.2/locale/zh-CN.min.js"></script>
<!-- <script src="https://cdn.bootcss.com/sockjs-client/1.4.0/sockjs.min.js"></script> -->
</head> </head>
<body> <body>
<noscript> <noscript>

View File

@ -71,10 +71,36 @@ export function getCommandList(parmas) {
}); });
} }
// 根据线路code分页查询指令 // 删除指令对象
export function delCommand(id) { export function delCommand(id) {
return request({ return request({
url: `/api/cmd/${id}`, url: `/api/cmd/${id}`,
method: 'delete' method: 'delete'
}); });
} }
// 创建指令
export function createCommand(data) {
return request({
url: `/api/cmd`,
method: 'post',
data: data
});
}
// 修改指令
export function editCommand(data) {
return request({
url: `/api/cmd`,
method: 'put',
data: data
});
}
// 获取指令详情
export function getCommandDetail(id) {
return request({
url: `/api/cmd/${id}`,
method: 'get'
});
}

View File

@ -10,7 +10,7 @@ export default {
normalCreate: 'The normal to create', normalCreate: 'The normal to create',
saveMapAs: 'Save the map as', saveMapAs: 'Save the map as',
create: 'establish', create: 'establish',
dataVerification: 'data verification', dataVerification: 'verify',
edit3d: '3D editor', edit3d: '3D editor',
logicalView: 'logical view', logicalView: 'logical view',
physicalView: 'Physical view', physicalView: 'Physical view',
@ -21,7 +21,7 @@ export default {
deny: 'no', deny: 'no',
drawMap: 'draw', drawMap: 'draw',
advanced: 'advanced', advanced: 'advanced',
viewLayer: 'The view layer', viewLayer: 'display',
layerDisplay: 'The layer display', layerDisplay: 'The layer display',
viewShows: 'View shows', viewShows: 'View shows',
contentShows: 'content show', contentShows: 'content show',
@ -87,7 +87,7 @@ export default {
text: 'text', text: 'text',
button: 'button', button: 'button',
mapName: 'Name of the map:', mapName: 'Name:',
skinName: 'Skin style:', skinName: 'Skin style:',
selectCity: 'city:', selectCity: 'city:',
offsetXColon: 'X Offset:', offsetXColon: 'X Offset:',
@ -126,7 +126,7 @@ export default {
abnormalOperation: 'abnormal operation', abnormalOperation: 'abnormal operation',
datQuestion: 'Data in question', datQuestion: 'Data in question',
dataList: 'Data list', dataList: 'Data list',
saveFailed: 'Save failed', saveFailed: 'Save',
mapEditor: 'map editor', mapEditor: 'map editor',
mapPublished: 'Map published as', mapPublished: 'Map published as',
@ -211,18 +211,18 @@ export default {
hypomere: 'Bottom section', hypomere: 'Bottom section',
returnByGraph: 'Return by graph', returnByGraph: 'Return by graph',
linkType: 'The Link type', linkType: 'Link type',
linkCode: 'The Link code:', linkCode: 'Link code:',
linkName: 'The Link name:', linkName: 'Link name:',
linkDisplayLength: 'Link display length:', linkDisplayLength: 'Link display length:',
linkActualLength: 'Actual Link length:', linkActualLength: 'Actual Link length:',
linkColor: 'The Link colors:', linkColor: 'color:',
linkLeftFdCode: 'Left forward Link:', linkLeftFdCode: 'Left forward Link:',
linkLeftSdCode: 'Left lateral Link:', linkLeftSdCode: 'Left lateral Link:',
linkRightFdCode: 'Right forward Link:', linkRightFdCode: 'Right forward Link:',
linkRightSdCode: 'Right lateral Link:', linkRightSdCode: 'Right lateral Link:',
linkLp: 'Link Start point coordinates:', linkLp: 'Start point coordinates:',
linkRp: 'Link End point coordinates:', linkRp: 'End point coordinates:',
linePoint: 'point:', linePoint: 'point:',
@ -237,9 +237,9 @@ export default {
aux: 'The first', aux: 'The first',
sectionLine: 'Section of the line', sectionLine: 'Section of the line',
sectionPolyline: 'Section polyline', sectionPolyline: 'Section polyline',
switchSection: 'The switch section', switchSection: 'turnout section',
trainDirection: 'Direction of train:', trainDirection: 'Direction of train:',
deleteSwitchSection: 'One key to delete the switch section', deleteSwitchSection: 'One key to delete turnout section',
createSwitchSection: 'One key creates the turnout section', createSwitchSection: 'One key creates the turnout section',
sectionLogicalNumber: 'Number of logical extents', sectionLogicalNumber: 'Number of logical extents',
sectionLsectioncode: 'Left section name:', sectionLsectioncode: 'Left section name:',
@ -249,8 +249,8 @@ export default {
sectionType: 'Section type:', sectionType: 'Section type:',
sectionNameColon: 'The name of the section:', sectionNameColon: 'The name of the section:',
sectionNameOffset: 'Extentname offset:', sectionNameOffset: 'Extentname offset:',
leftKilometerMark: 'Left kilometer mark (meter):', leftKilometerMark: 'Left kilometer mark:',
rightKilometerMark: 'Right kilometer mark (meter):', rightKilometerMark: 'Right kilometer mark:',
sectionColon: 'interval:', sectionColon: 'interval:',
displayExtentName: 'Whether to display the extent name:', displayExtentName: 'Whether to display the extent name:',
displayAxleCounter: 'Whether to display axis gauge:', displayAxleCounter: 'Whether to display axis gauge:',
@ -406,13 +406,13 @@ export default {
stationstandHeight: 'highly h:', stationstandHeight: 'highly h:',
switchCode: 'Switch coding:', switchCode: 'Switch coding:',
switchName: 'The name of the switch:', switchName: 'name of turnout:',
switchNameC: 'The name of the switch', switchNameC: 'name of turnout',
switchShowName: 'Whether the switch name is displayed:', switchShowName: 'Whether turnout name is displayed:',
switchPositionX: 'Switch name x offset:', switchPositionX: 'Switch name x offset:',
switchPositionY: 'Switch name y offset:', switchPositionY: 'Switch name y offset:',
switchPosition: 'Switch name offset:', switchPosition: 'Switch name offset:',
turnTime: 'The switch changes time:', turnTime: 'turnout changes time:',
timeoutShow: 'Whether to display switch countdown time:', timeoutShow: 'Whether to display switch countdown time:',
sectionACode: 'Associated with A Section Code:', sectionACode: 'Associated with A Section Code:',
sectionBCode: 'Associated with B Section Code:', sectionBCode: 'Associated with B Section Code:',
@ -546,5 +546,9 @@ export default {
horizontal: 'Horizontal', horizontal: 'Horizontal',
vertical: 'Vertical', vertical: 'Vertical',
piece: 'piece', piece: 'piece',
setStationCode: 'Batch set up centralized station' setStationCode: 'Batch set up centralized station',
physicalSection: 'Incoming physical section',
entryTurnout: 'Entry turnout',
accessGate: 'Access gate',
selectPhysicalSection: 'Please select the incoming physical sectio'
}; };

View File

@ -61,5 +61,6 @@ export default {
instructionType: 'type of instruction', instructionType: 'type of instruction',
paramDetail: 'Check Parameters', paramDetail: 'Check Parameters',
createDirective: '新增指令', createDirective: '新增指令',
editDirective: '修改指令' editDirective: '修改指令',
parameterName: '参数名称'
}; };

View File

@ -232,8 +232,8 @@ export default {
sectionType: '区段类型:', sectionType: '区段类型:',
sectionNameColon: '区段名称:', sectionNameColon: '区段名称:',
sectionNameOffset: '区段名称偏移量:', sectionNameOffset: '区段名称偏移量:',
leftKilometerMark: '左侧公里标(米):', leftKilometerMark: '左侧公里标:',
rightKilometerMark: '右侧公里标(米):', rightKilometerMark: '右侧公里标:',
sectionColon: '区间:', sectionColon: '区间:',
displayExtentName: '是否显示区段名称:', displayExtentName: '是否显示区段名称:',
displayAxleCounter: '是否显示计轴:', displayAxleCounter: '是否显示计轴:',
@ -541,6 +541,10 @@ export default {
horizontal: '水平', horizontal: '水平',
vertical: '垂直', vertical: '垂直',
piece: 'piece', piece: 'piece',
setStationCode: '批量设置集中站' setStationCode: '批量设置集中站',
physicalSection: '进路物理区段数据',
entryTurnout: '进路道岔数据',
accessGate: '进路屏蔽门数据',
selectPhysicalSection: '请选择进路物理区段数据'
}; };

View File

@ -61,5 +61,6 @@ export default {
instructionType: '指令类型', instructionType: '指令类型',
paramDetail: '查看参数', paramDetail: '查看参数',
createDirective: '新增指令', createDirective: '新增指令',
editDirective: '修改指令' editDirective: '修改指令',
parameterName: '参数名称'
}; };

View File

@ -32,6 +32,7 @@ const SystemGenerate = () => import('@/views/system/systemGenerate/index');
const IbpDraw = () => import('@/views/system/ibpDraw/index'); const IbpDraw = () => import('@/views/system/ibpDraw/index');
const News = () => import('@/views/system/news/index'); const News = () => import('@/views/system/news/index');
const CommandDictionary = () => import('@/views/system/commandDictionary/index'); const CommandDictionary = () => import('@/views/system/commandDictionary/index');
const CommandDictionaryDetail = () => import('@/views/system/commandDictionary/edit');
const Mapedit = () => import('@/views/mapdraft/index'); const Mapedit = () => import('@/views/mapdraft/index');
@ -820,6 +821,11 @@ export const asyncRouter = [
meta: { meta: {
i18n: 'router.commandDictionary' i18n: 'router.commandDictionary'
} }
},
{
path: 'commands/Detail',
hidden: true,
component: CommandDictionaryDetail
} }
] ]
}, },

View File

@ -117,6 +117,16 @@ export default {
], ],
customeredProductType: [ customeredProductType: [
{ enlabel: 'Plan Draw', label: '运行图编制', value: 'Plan'} { enlabel: 'Plan Draw', label: '运行图编制', value: 'Plan'}
],
controlMode: [
{ label: '中控', value: '01' },
{ label: '站控', value: '02' }
],
simulationRole: [
{ label: '行调操作', value: '01' },
{ label: '现地操作', value: '02' }
] ]
} }
}; };

View File

@ -3,11 +3,11 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud'; BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 杜闪 // BASE_API = 'http://192.168.3.41:9000'; // 杜闪
BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://192.168.3.82:9000'; // 杜康
} else { } else {
BASE_API = process.env.VUE_APP_BASE_API; BASE_API = process.env.VUE_APP_BASE_API;
} }

View File

@ -3,9 +3,11 @@ import { checkLoginLine } from '@/api/login';
import { getBaseUrl } from '@/utils/baseUrl'; import { getBaseUrl } from '@/utils/baseUrl';
import { MessageBox } from 'element-ui'; import { MessageBox } from 'element-ui';
import store from '../store'; import store from '../store';
import SockJS from 'sockjs-client';
import Stomp from 'stompjs';
var SockJS = require('sockjs-client'); // var SockJS = require('sockjs-client');
var Stomp = require('stompjs'); // var Stomp = require('stompjs');
const isDev = process.env.NODE_ENV === 'development'; const isDev = process.env.NODE_ENV === 'development';
const websocketUrl = `${getBaseUrl()}/joylink-websocket?token=`; const websocketUrl = `${getBaseUrl()}/joylink-websocket?token=`;

View File

@ -13,7 +13,7 @@
<el-button type="text" class="mapEdit_box" @click="showMap">{{ $t('map.viewLayer') }}</el-button> <el-button type="text" class="mapEdit_box" @click="showMap">{{ $t('map.viewLayer') }}</el-button>
</div> </div>
<el-tabs v-model="enabledTab" type="card" class="map_card" @tab-click="changePane"> <el-tabs v-model="enabledTab" type="card" class="map_card" @tab-click="changePane">
<el-tab-pane label="进路" class="tab_pane_box" name="route"> <el-tab-pane :label="$t('map.routeID')" class="tab_pane_box" name="route">
<route-operate <route-operate
ref="routeOperate" ref="routeOperate"
:map-info="mapInfo" :map-info="mapInfo"
@ -21,7 +21,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="路径单元" class="tab_pane_box" name="path"> <el-tab-pane :label="$t('map.pathUnit')" class="tab_pane_box" name="path">
<path-operate <path-operate
ref="pathOperate" ref="pathOperate"
:map-info="mapInfo" :map-info="mapInfo"
@ -29,7 +29,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="交路" class="tab_pane_box" name="routing"> <el-tab-pane :label="$t('map.routing')" class="tab_pane_box" name="routing">
<routing-operate <routing-operate
ref="routingOperate" ref="routingOperate"
:map-info="mapInfo" :map-info="mapInfo"
@ -37,7 +37,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="自动信号" class="tab_pane_box" name="automatic"> <el-tab-pane :label="$t('map.automaticSignal')" class="tab_pane_box" name="automatic">
<automatic-operate <automatic-operate
ref="automaticOperate" ref="automaticOperate"
:map-info="mapInfo" :map-info="mapInfo"
@ -45,7 +45,7 @@
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="联动道岔" class="tab_pane_box" name="swtich"> <el-tab-pane :label="$t('map.setSwitch')" class="tab_pane_box" name="swtich">
<switch-operate <switch-operate
ref="SwitchOperate" ref="SwitchOperate"
:map-info="mapInfo" :map-info="mapInfo"

View File

@ -117,8 +117,8 @@
@click="hover('routeTriggerSectionList')" @click="hover('routeTriggerSectionList')"
>{{ $t('map.activate') }}</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item label="进路物理区段数据:" prop="routeSectionList"> <el-form-item :label="$t('map.physicalSection') +':'" prop="routeSectionList">
<el-select v-model="addModel.routeSectionList" multiple :filterable="true" placeholder="请选择"> <el-select v-model="addModel.routeSectionList" multiple :filterable="true">
<el-option <el-option
v-for="item in sectionList" v-for="item in sectionList"
:key="item.code" :key="item.code"
@ -129,10 +129,10 @@
<el-button <el-button
:type=" field === 'routeSectionList' ? 'danger' : 'primary'" :type=" field === 'routeSectionList' ? 'danger' : 'primary'"
@click="hover('routeSectionList')" @click="hover('routeSectionList')"
>激活</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item label="进路道岔数据:" prop="routeSwitchList"> <el-form-item :label="$t('map.entryTurnout')+':'" prop="routeSwitchList">
<el-select v-model="routeCode" clearable :filterable="true" placeholder="请选择道岔数据"> <el-select v-model="routeCode" clearable :filterable="true">
<el-option <el-option
v-for="item in switchList" v-for="item in switchList"
:key="item.code" :key="item.code"
@ -143,12 +143,12 @@
<el-button <el-button
:type=" field === 'routeSwitchList' ? 'danger' : 'primary'" :type=" field === 'routeSwitchList' ? 'danger' : 'primary'"
@click="hover('routeSwitchList')" @click="hover('routeSwitchList')"
>激活</el-button> >{{ $t('map.activate') }}</el-button>
<el-button <el-button
type="primary" type="primary"
@click="pushSwitch(addModel.routeSwitchList, { switchCode: routeCode, switchLocateType: routeType, switchType: overlapType == '01' ? '定位' : '反位' } )" @click="pushSwitch(addModel.routeSwitchList, { switchCode: routeCode, switchLocateType: routeType, switchType: overlapType == '01' ? '定位' : '反位' } )"
>添加</el-button> >{{ $t('map.add') }}</el-button>
<el-select v-model="routeType" :filterable="true" placeholder="请选择道岔类型"> <el-select v-model="routeType" :filterable="true">
<el-option <el-option
v-for="item in SwitchLocateTypeList" v-for="item in SwitchLocateTypeList"
:key="item.code" :key="item.code"
@ -157,7 +157,7 @@
/> />
</el-select> </el-select>
<el-table :data="addModel.routeSwitchList" border style="width: 97%"> <el-table :data="addModel.routeSwitchList" border style="width: 97%">
<el-table-column prop="switchCode" label="道岔"> <el-table-column prop="switchCode" :label="$t('map.switch')">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ swictchName(scope.row.switchCode) }}</span> <span>{{ swictchName(scope.row.switchCode) }}</span>
</template> </template>
@ -176,8 +176,8 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-form-item> </el-form-item>
<el-form-item label="进路屏蔽门数据:" prop="routeStandList"> <el-form-item :label="$t('map.accessGate') + ':'" prop="routeStandList">
<el-select v-model="addModel.routeStandList" multiple :filterable="true" placeholder="请选择"> <el-select v-model="addModel.routeStandList" multiple :filterable="true">
<el-option <el-option
v-for="item in stationStandList" v-for="item in stationStandList"
:key="item.code" :key="item.code"
@ -188,7 +188,7 @@
<el-button <el-button
:type=" field === 'routeStandList' ? 'danger' : 'primary'" :type=" field === 'routeStandList' ? 'danger' : 'primary'"
@click="hover('routeStandList')" @click="hover('routeStandList')"
>激活</el-button> >{{ $t('map.activate') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.routeFlankProtectionList')" prop="routeFlankProtectionList"> <el-form-item :label="$t('map.routeFlankProtectionList')" prop="routeFlankProtectionList">
<el-select v-model="flankCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')"> <el-select v-model="flankCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
@ -223,7 +223,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="switchType" :label="$t('map.switchType')" /> <el-table-column prop="switchType" :label="$t('map.switchType')" />
<el-table-column fixed="right" label="操作" width="50"> <el-table-column fixed="right" :label="$t('map.operation')" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
@ -311,7 +311,6 @@
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid'; import { getUID } from '@/jmap/utils/Uid';
import { createRouteRoute, updateRouteRoute } from '@/api/jmap/mapdraft'; import { createRouteRoute, updateRouteRoute } from '@/api/jmap/mapdraft';
// import { ViewMode } from '@/scripts/ConstDic';
export default { export default {
name: 'RouteOperation', name: 'RouteOperation',
@ -436,7 +435,7 @@ export default {
{ required: true, message: this.$t('rules.autoAccessType'), trigger: 'change' } { required: true, message: this.$t('rules.autoAccessType'), trigger: 'change' }
], ],
routeSectionList: [ routeSectionList: [
{ required: true, message: '请选择进路物理区段数据', trigger: 'change' } { required: true, message: this.$t('map.selectPhysicalSection'), trigger: 'change' }
] ]
}; };
return baseRules; return baseRules;
@ -540,7 +539,7 @@ export default {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
updateRouteRoute(this.buildModel()).then(response => { updateRouteRoute(this.buildModel()).then(response => {
this.$message.success('更新成功'); this.$message.success(this.$t('map.updateSuccessfully'));
this.loading = false; this.loading = false;
this.clear(); this.clear();
}).catch(() => { }).catch(() => {

View File

@ -396,13 +396,13 @@ export default {
name: this.$t('map.mapData'), name: this.$t('map.mapData'),
item: [ item: [
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.stationList }, { prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.stationList },
{ prop: 'offsetLeft', label: this.$t('map.sectionOffsetLeft'), type: 'number', min: 0, placeholder: '米', isHidden: !this.isSectionType }, { prop: 'offsetLeft', label: this.$t('map.sectionOffsetLeft'), type: 'number', min: 0, placeholder: this.$t('map.meter'), isHidden: !this.isSectionType },
{ prop: 'offsetRight', label: this.$t('map.sectionOffsetRight'), type: 'number', min: 0, placeholder: '米', isHidden: !this.isSectionType }, { prop: 'offsetRight', label: this.$t('map.sectionOffsetRight'), type: 'number', min: 0, placeholder: this.$t('map.meter'), isHidden: !this.isSectionType },
{ prop: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset }, { prop: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset },
{ prop: 'rightStopPointOffset', label: this.$t('map.rightStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset }, { prop: 'rightStopPointOffset', label: this.$t('map.rightStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset },
{ prop: 'region', label: this.$t('map.sectionColon'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.regionList, isHidden: !this.sectionColonShow }, { prop: 'region', label: this.$t('map.sectionColon'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.regionList, isHidden: !this.sectionColonShow },
{ prop: 'kmRangeLeft', label: this.$t('map.leftKilometerMark'), type: 'number', min: 0 }, { prop: 'kmRangeLeft', label: this.$t('map.leftKilometerMark'), type: 'number', min: 0, placeholder: this.$t('map.meter') },
{ prop: 'kmRangeRight', label: this.$t('map.rightKilometerMark'), type: 'number', min: 0 }, { prop: 'kmRangeRight', label: this.$t('map.rightKilometerMark'), type: 'number', min: 0, placeholder: this.$t('map.meter') },
{ prop: 'trainPosType', label: this.$t('map.trainDirection'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.TrainPositionTypeList, isHidden: !this.isSectionType } { prop: 'trainPosType', label: this.$t('map.trainDirection'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.TrainPositionTypeList, isHidden: !this.isSectionType }
] ]
} }

View File

@ -1,46 +1,79 @@
<template> <template>
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false"> <div class="dictionary_box">
<div class="joylink-card">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" /> <data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer"> <div style="overflow: hidden;">
<div class="param-title">指令参数:</div>
<el-table :data="formModel.paramList" border class="param-table">
<el-table-column prop="name" label="参数名" />
<el-table-column :label="this.$t('global.operate')" width="180">
<template slot-scope="scope">
<el-button type="text" size="small" @click="editParam(scope.$index, scope.row)">修改</el-button>
<el-button type="text" size="small" @click="delParam(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="button-box">
<el-button type="primary" size="small" round @click="addParam">添加</el-button>
</div>
</div>
</div>
<div class="dialog-footer">
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button> <el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button> <el-button @click="back">返回</el-button>
</span> </div>
</el-dialog>
<command-edit ref="create" type="ADD" @addData="addData" />
<command-edit ref="edit" type="EDIT" @editData="editData" />
</div>
</template> </template>
<script> <script>
import { create, getData, update } from '@/api/management/dictionary'; import { createCommand, editCommand, getCommandDetail } from '@/api/management/dictionary';
import CommandEdit from './editParam';
import { getLineCodeList } from '@/api/management/mapline';
export default { export default {
name: 'DictionaryEdit', name: 'DictionaryEdit',
components: {
CommandEdit
},
props: { props: {
type: {
type: String,
required: true
}
}, },
data() { data() {
return { return {
dialogVisible: false, taskStatusList: [],
deviceTypeList: [
{ label: '区段', value: 'section' },
{ label: '道岔', value: 'switch' },
{ label: '信号机', value: 'signal' },
{ label: '站台', value: 'station' },
{ label: '控制模式', value: 'stationConter' },
{ label: '临时全线限速', value: 'limitConter' }
],
type: 'add',
editIndex: 0,
formModel: { formModel: {
code: '', id: '',
name: '', simulationRole: '',
status: '1', controlMode: '',
remarks: '' lineCode: '',
operateObject: '',
operate: '',
paramList: []
} }
}; };
}, },
computed: { computed: {
form() { form() {
const isAdd = this.type === 'ADD';
const form = { const form = {
labelWidth: '120px', labelWidth: '120px',
items: [ items: [
{ prop: 'controlMode', label: this.$t('system.controlMode'), type: 'text', required: true, disabled: !isAdd }, { prop: 'simulationRole', label: this.$t('system.simulationRole'), type: 'select', options: this.$ConstSelect.simulationRole },
{ prop: 'deviceType', label: this.$t('system.deviceType'), type: 'select', required: true, options: this.$ConstSelect.Status }, { prop: 'controlMode', label: this.$t('system.controlMode'), type: 'select', options: this.$ConstSelect.controlMode },
{ prop: 'lineCode', label: this.$t('system.lineCode'), type: 'select', required: true, options: this.$ConstSelect.Status }, { prop: 'lineCode', label: this.$t('system.lineCode'), type: 'select', options: this.taskStatusList },
{ prop: 'role', label: this.$t('system.simulationRole'), type: 'select', required: true, options: this.$ConstSelect.Status }, { prop: 'operateObject', label: this.$t('system.deviceType'), type: 'select', options: this.deviceTypeList, change: true, onChange: this.deviceChange },
{ prop: 'type', label: this.$t('system.instructionType'), type: 'select', required: true, options: this.$ConstSelect.Status } { prop: 'operate', label: this.$t('system.instructionType'), type: 'text' }
] ]
}; };
return form; return form;
@ -50,82 +83,137 @@ export default {
controlMode: [ controlMode: [
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' } { required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
], ],
deviceType: [ operateObject: [
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' } { required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
], ],
lineCode: [ lineCode: [
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' } { required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
], ],
role: [ simulationRole: [
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' } { required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
], ],
type: [ operate: [
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' } { required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
] ]
}; };
}
}, },
title() { mounted () {
if (this.type === 'ADD') { this.loadInitData();
return this.$t('system.createDirective'); this.init();
} else {
return this.$t('system.editDirective');
}
}
}, },
methods: { methods: {
show(id) { async loadInitData() {
this.dialogVisible = true; try {
if (id) { this.taskStatusList = [];
getData(id).then(response => { const list = await getLineCodeList();
this.formModel = response.data; list.data.forEach(elem => {
this.$refs.dataform.resetForm(); elem.value = elem.code;
elem.label = elem.name;
});
this.taskStatusList = list.data;
} catch (error) {
console.log(error);
}
},
init() {
this.type = this.$route.query.type;
if (this.$route.query.id) {
getCommandDetail(this.$route.query.id).then(res => {
this.formModel = res.data;
}); });
} }
}, },
deviceChange(code) {
console.log(code);
},
doSave() { doSave() {
const self = this;
this.$refs.dataform.validateForm(() => { this.$refs.dataform.validateForm(() => {
if (self.type === 'ADD') { if (this.type == 'add') {
self.create(); this.create();
} else { } else {
self.update(); this.update();
} }
}); });
}, },
create() { create() {
const self = this; createCommand(this.formModel).then(response => {
create(this.formModel).then(response => { this.$message.success(this.$t('system.createSuccess'));
self.$message.success(this.$t('system.createSuccess')); this.handleBack();
self.handleClose();
self.$emit('reloadTable');
}).catch(error => { }).catch(error => {
self.$message.error(`${this.$t('error.createDictionaryFailed')}:${error.message}`); console.log(error);
this.$message.error('创建指令失败');
}); });
}, },
update() { update() {
const self = this; editCommand(this.formModel).then(response => {
update(this.formModel).then(response => { this.$message.success(this.$t('system.updateSuccess'));
self.$message.success(this.$t('system.updateSuccess')); this.handleBack();
self.handleClose();
self.$emit('reloadTable');
}).catch(error => { }).catch(error => {
self.$message.error(`${this.$t('error.updateDictionaryFailed')}:${error.message}`); console.log(error);
this.$message.error('更新指令失败');
}); });
}, },
handleClose(done) { handleBack() {
this.formModel = { this.$router.push({ path: `/system/commands`, query: { } });
code: '', },
name: '', back() {
status: '1', this.$router.go(-1);
remarks: '' },
};
this.$refs.dataform.resetForm(); editData(data) {
if (done) { this.formModel.paramList.splice(this.editIndex, 1, data);
done(); },
} else { addData(data) {
this.dialogVisible = false; this.formModel.paramList.push(data);
} },
addParam() {
this.$refs.create.doShow();
},
editParam(index, row) {
this.$refs.edit.doShow(row);
this.editIndex = index;
},
delParam(index) {
this.formModel.paramList.splice(index, 1);
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped>
.dictionary_box{
margin: 40px auto 20px;
width: 800px;
.joylink-card{
padding: 24px;
.param-title{
width: 120px;
text-align: right;
float: left;
font-size: 14px;
color: #606266;
line-height: 40px;
padding: 0 12px 0 0;
box-sizing: border-box;
font-weight: 700;
}
.param-table{
width: calc(100% - 190px);
min-height: 200px;
float: left;
}
.button-box{
float: left;
margin-left: 10px;
}
}
.dialog-footer{
margin: 20px auto;
display: flex;
justify-content: center;
}
}
</style>

View File

@ -0,0 +1,108 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="400px" :before-close="handleClose" center :close-on-click-modal="false">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
name: 'DictionaryEdit',
props: {
type: {
type: String,
required: true
}
},
data() {
return {
dialogVisible: false,
formModel: {
id: '',
name: ''
// pattern: '',
// val: ''
}
};
},
computed: {
form() {
const form = {
labelWidth: '100px',
items: [
{ prop: 'name', label: '参数名', type: 'text' }
// { prop: 'pattern', label: '', type: 'text' },
// { prop: 'val', label: '', type: 'text' }
]
};
return form;
},
rules() {
return {
// pattern: [
// { required: true, message: '', trigger: 'blur' }
// ],
name: [
{ required: true, message: '请输入内容', trigger: 'blur' }
]
// val: [
// { required: true, message: '', trigger: 'blur' }
// ]
};
},
title() {
if (this.type === 'ADD') {
return this.$t('system.createDirectory');
} else {
return this.$t('system.editDictionary');
}
}
},
methods: {
doShow(data) {
this.dialogVisible = true;
if (data) {
this.formModel = {
name: data.name,
pattern: data.pattern,
val: data.val
};
}
},
doSave() {
const self = this;
this.$refs.dataform.validateForm(() => {
if (self.type === 'ADD') {
self.create();
} else {
self.update();
}
});
},
getData() {
return {
id: this.formModel.id,
name: this.formModel.name
// pattern: this.formModel.pattern,
// val: this.formModel.val
};
},
create() {
this.$emit('addData', this.getData());
this.handleClose();
},
update() {
this.$emit('editData', this.getData());
this.handleClose();
},
handleClose() {
this.$refs.dataform.resetForm();
this.dialogVisible = false;
}
}
};
</script>

View File

@ -1,24 +1,28 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<dictionary-edit ref="create" type="ADD" @reloadTable="reloadTable" />
<dictionary-edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
</div> </div>
</template> </template>
<script> <script>
import { getCommandList, delCommand } from '@/api/management/dictionary'; import { getCommandList, delCommand } from '@/api/management/dictionary';
import { listPublishMap } from '@/api/jmap/map'; import { getLineCodeList } from '@/api/management/mapline';
import DictionaryEdit from './edit';
export default { export default {
name: 'CommandDictionary', name: 'CommandDictionary',
components: { components: {
DictionaryEdit
}, },
data() { data() {
return { return {
taskStatusList: [], taskStatusList: [],
deviceTypeList: [
{ label: '区段', value: 'section' },
{ label: '道岔', value: 'switch' },
{ label: '信号机', value: 'signal' },
{ label: '站台', value: 'station' },
{ label: '控制模式', value: 'stationConter' },
{ label: '临时全线限速', value: 'limitConter' }
],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
@ -34,7 +38,7 @@ export default {
data: [] data: []
} }
}, },
deviceType: { operateObject: {
type: 'select', type: 'select',
label: this.$t('system.deviceType'), label: this.$t('system.deviceType'),
config: { config: {
@ -48,38 +52,50 @@ export default {
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
{
title: this.$t('system.controlMode'), //
prop: 'controlMode'
},
{
title: this.$t('system.deviceType'), //
prop: 'deviceType'
},
{ {
title: this.$t('system.lineCode'), // 线 title: this.$t('system.lineCode'), // 线
prop: 'lineCode', prop: 'lineCode',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$convertField(row.lineCode, this.taskStatusList, ['lineCode', 'name']); }, columnValue: (row) => { return this.$convertField(row.lineCode, this.taskStatusList, ['code', 'name']); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('system.controlMode'), //
prop: 'controlMode',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.controlMode, this.$ConstSelect.controlMode, ['value', 'label']); },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
}, },
{ {
title: this.$t('system.simulationRole'), // 仿 title: this.$t('system.simulationRole'), // 仿
prop: 'role' prop: 'simulationRole',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.simulationRole, this.$ConstSelect.simulationRole, ['value', 'label']); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('system.deviceType'), //
prop: 'operateObject',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.operateObject, this.deviceTypeList, ['value', 'label']); },
tagType: (row) => { return 'success'; }
}, },
{ {
title: this.$t('system.instructionType'), // title: this.$t('system.instructionType'), //
prop: 'type' prop: 'operate'
},
{
title: this.$t('system.parameterName'), //
prop: 'paramList',
type: 'tagMore',
columnValue: (row) => { return this.replace(row.paramList); },
tagType: (row) => { return 'success'; }
}, },
{ {
type: 'button', type: 'button',
title: this.$t('global.operate'), title: this.$t('global.operate'),
width: '250', width: '250',
buttons: [ buttons: [
{
name: this.$t('system.paramDetail'),
handleClick: this.handleDetail
},
{ {
name: this.$t('global.edit'), name: this.$t('global.edit'),
handleClick: this.handleEdit handleClick: this.handleEdit
@ -109,10 +125,13 @@ export default {
try { try {
this.taskStatusList = []; this.taskStatusList = [];
this.mapList = []; this.mapList = [];
const list = await listPublishMap(); const list = await getLineCodeList();
this.taskStatusList = list.data; this.taskStatusList = list.data;
list.data.forEach(elem => { list.data.forEach(elem => {
this.queryForm.queryObject.lineCode.config.data.push({ value: elem.lineCode, label: elem.name }); this.queryForm.queryObject.lineCode.config.data.push({ value: elem.code, label: elem.name });
});
this.deviceTypeList.forEach(elem => {
this.queryForm.queryObject.operateObject.config.data.push(elem);
}); });
} catch (error) { } catch (error) {
console.log(error); console.log(error);
@ -126,19 +145,23 @@ export default {
return getCommandList(params); return getCommandList(params);
}, },
handleDetail(index, row) { replace(fieldValue) {
console.log(index, row); const arr = [];
if (fieldValue && fieldValue.length) {
fieldValue.forEach((v, j) => {
if (v.name) {
arr.push(v.name);
}
});
}
return arr;
}, },
handleEdit(index, row) { handleEdit(index, row) {
console.log(index, row); this.$router.push({ path: `/system/commands/Detail`, query: { type: 'edit', id: row.id } });
// this.$refs.edit.show(row.id);
}, },
handleAdd() { handleAdd() {
this.$refs.create.show(); this.$router.push({ path: `/system/commands/Detail`, query: { type: 'add' } });
}, },
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), { this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
@ -154,7 +177,6 @@ export default {
}); });
}); });
}, },
reloadTable() { reloadTable() {
this.queryList.reload(); this.queryList.reload();
} }

View File

@ -83,6 +83,7 @@ module.exports = {
'nprogress': 'NProgress', 'nprogress': 'NProgress',
'echarts': 'echarts', 'echarts': 'echarts',
'element-ui': 'ELEMENT' 'element-ui': 'ELEMENT'
// 'sockjs': 'sockjs'
}; };
}, },