Merge branch 'dev' of https://git.qcloud.com/joylink/jl-nclient into dev
This commit is contained in:
commit
5a4f6f5999
@ -25,6 +25,7 @@
|
||||
"qrcode.vue": "^1.6.2",
|
||||
"script-loader": "^0.7.2",
|
||||
"sessionstorage": "^0.1.0",
|
||||
"sockjs-client": "^1.4.0",
|
||||
"stompjs": "^2.3.3",
|
||||
"storejs": "^1.0.25",
|
||||
"three": "^0.107.0",
|
||||
|
@ -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/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/sockjs-client/1.4.0/sockjs.min.js"></script> -->
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
|
@ -27,7 +27,7 @@ export default {
|
||||
this.subscribeMessage(val);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.beLogout': async function(val) {
|
||||
'$store.state.socket.beLogoutCount': async function(val) {
|
||||
this.$alert(this.$t('tip.logoutTips'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
callback: action => {
|
||||
|
@ -71,10 +71,36 @@ export function getCommandList(parmas) {
|
||||
});
|
||||
}
|
||||
|
||||
// 根据线路code分页查询指令
|
||||
// 删除指令对象
|
||||
export function delCommand(id) {
|
||||
return request({
|
||||
url: `/api/cmd/${id}`,
|
||||
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'
|
||||
});
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ export default {
|
||||
normalCreate: 'The normal to create',
|
||||
saveMapAs: 'Save the map as',
|
||||
create: 'establish',
|
||||
dataVerification: 'data verification',
|
||||
dataVerification: 'verify',
|
||||
edit3d: '3D editor',
|
||||
logicalView: 'logical view',
|
||||
physicalView: 'Physical view',
|
||||
@ -21,7 +21,7 @@ export default {
|
||||
deny: 'no',
|
||||
drawMap: 'draw',
|
||||
advanced: 'advanced',
|
||||
viewLayer: 'The view layer',
|
||||
viewLayer: 'display',
|
||||
layerDisplay: 'The layer display',
|
||||
viewShows: 'View shows',
|
||||
contentShows: 'content show',
|
||||
@ -87,7 +87,7 @@ export default {
|
||||
text: 'text',
|
||||
button: 'button',
|
||||
|
||||
mapName: 'Name of the map:',
|
||||
mapName: 'Name:',
|
||||
skinName: 'Skin style:',
|
||||
selectCity: 'city:',
|
||||
offsetXColon: 'X Offset:',
|
||||
@ -126,7 +126,7 @@ export default {
|
||||
abnormalOperation: 'abnormal operation',
|
||||
datQuestion: 'Data in question',
|
||||
dataList: 'Data list',
|
||||
saveFailed: 'Save failed',
|
||||
saveFailed: 'Save',
|
||||
|
||||
mapEditor: 'map editor',
|
||||
mapPublished: 'Map published as',
|
||||
@ -211,18 +211,18 @@ export default {
|
||||
hypomere: 'Bottom section',
|
||||
returnByGraph: 'Return by graph',
|
||||
|
||||
linkType: 'The Link type',
|
||||
linkCode: 'The Link code:',
|
||||
linkName: 'The Link name:',
|
||||
linkType: 'Link type',
|
||||
linkCode: 'Link code:',
|
||||
linkName: 'Link name:',
|
||||
linkDisplayLength: 'Link display length:',
|
||||
linkActualLength: 'Actual Link length:',
|
||||
linkColor: 'The Link colors:',
|
||||
linkColor: 'color:',
|
||||
linkLeftFdCode: 'Left forward Link:',
|
||||
linkLeftSdCode: 'Left lateral Link:',
|
||||
linkRightFdCode: 'Right forward Link:',
|
||||
linkRightSdCode: 'Right lateral Link:',
|
||||
linkLp: 'Link Start point coordinates:',
|
||||
linkRp: 'Link End point coordinates:',
|
||||
linkLp: 'Start point coordinates:',
|
||||
linkRp: 'End point coordinates:',
|
||||
|
||||
linePoint: 'point:',
|
||||
|
||||
@ -237,9 +237,9 @@ export default {
|
||||
aux: 'The first',
|
||||
sectionLine: 'Section of the line',
|
||||
sectionPolyline: 'Section polyline',
|
||||
switchSection: 'The switch section',
|
||||
switchSection: 'turnout section',
|
||||
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',
|
||||
sectionLogicalNumber: 'Number of logical extents',
|
||||
sectionLsectioncode: 'Left section name:',
|
||||
@ -249,8 +249,8 @@ export default {
|
||||
sectionType: 'Section type:',
|
||||
sectionNameColon: 'The name of the section:',
|
||||
sectionNameOffset: 'Extentname offset:',
|
||||
leftKilometerMark: 'Left kilometer mark (meter):',
|
||||
rightKilometerMark: 'Right kilometer mark (meter):',
|
||||
leftKilometerMark: 'Left kilometer mark:',
|
||||
rightKilometerMark: 'Right kilometer mark:',
|
||||
sectionColon: 'interval:',
|
||||
displayExtentName: 'Whether to display the extent name:',
|
||||
displayAxleCounter: 'Whether to display axis gauge:',
|
||||
@ -406,13 +406,13 @@ export default {
|
||||
stationstandHeight: 'highly h:',
|
||||
|
||||
switchCode: 'Switch coding:',
|
||||
switchName: 'The name of the switch:',
|
||||
switchNameC: 'The name of the switch',
|
||||
switchShowName: 'Whether the switch name is displayed:',
|
||||
switchName: 'name of turnout:',
|
||||
switchNameC: 'name of turnout',
|
||||
switchShowName: 'Whether turnout name is displayed:',
|
||||
switchPositionX: 'Switch name x offset:',
|
||||
switchPositionY: 'Switch name y offset:',
|
||||
switchPosition: 'Switch name offset:',
|
||||
turnTime: 'The switch changes time:',
|
||||
turnTime: 'turnout changes time:',
|
||||
timeoutShow: 'Whether to display switch countdown time:',
|
||||
sectionACode: 'Associated with A Section Code:',
|
||||
sectionBCode: 'Associated with B Section Code:',
|
||||
@ -546,5 +546,9 @@ export default {
|
||||
horizontal: 'Horizontal',
|
||||
vertical: 'Vertical',
|
||||
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'
|
||||
};
|
||||
|
@ -61,5 +61,6 @@ export default {
|
||||
instructionType: 'type of instruction',
|
||||
paramDetail: 'Check Parameters',
|
||||
createDirective: '新增指令',
|
||||
editDirective: '修改指令'
|
||||
editDirective: '修改指令',
|
||||
parameterName: '参数名称'
|
||||
};
|
||||
|
@ -232,8 +232,8 @@ export default {
|
||||
sectionType: '区段类型:',
|
||||
sectionNameColon: '区段名称:',
|
||||
sectionNameOffset: '区段名称偏移量:',
|
||||
leftKilometerMark: '左侧公里标(米):',
|
||||
rightKilometerMark: '右侧公里标(米):',
|
||||
leftKilometerMark: '左侧公里标:',
|
||||
rightKilometerMark: '右侧公里标:',
|
||||
sectionColon: '区间:',
|
||||
displayExtentName: '是否显示区段名称:',
|
||||
displayAxleCounter: '是否显示计轴:',
|
||||
@ -541,6 +541,10 @@ export default {
|
||||
horizontal: '水平',
|
||||
vertical: '垂直',
|
||||
piece: 'piece',
|
||||
setStationCode: '批量设置集中站'
|
||||
setStationCode: '批量设置集中站',
|
||||
physicalSection: '进路物理区段数据',
|
||||
entryTurnout: '进路道岔数据',
|
||||
accessGate: '进路屏蔽门数据',
|
||||
selectPhysicalSection: '请选择进路物理区段数据'
|
||||
|
||||
};
|
||||
|
@ -61,5 +61,6 @@ export default {
|
||||
instructionType: '指令类型',
|
||||
paramDetail: '查看参数',
|
||||
createDirective: '新增指令',
|
||||
editDirective: '修改指令'
|
||||
editDirective: '修改指令',
|
||||
parameterName: '参数名称'
|
||||
};
|
||||
|
@ -32,6 +32,7 @@ const SystemGenerate = () => import('@/views/system/systemGenerate/index');
|
||||
const IbpDraw = () => import('@/views/system/ibpDraw/index');
|
||||
const News = () => import('@/views/system/news/index');
|
||||
const CommandDictionary = () => import('@/views/system/commandDictionary/index');
|
||||
const CommandDictionaryDetail = () => import('@/views/system/commandDictionary/edit');
|
||||
|
||||
const Mapedit = () => import('@/views/mapdraft/index');
|
||||
|
||||
@ -820,6 +821,11 @@ export const asyncRouter = [
|
||||
meta: {
|
||||
i18n: 'router.commandDictionary'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'commands/Detail',
|
||||
hidden: true,
|
||||
component: CommandDictionaryDetail
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -117,6 +117,16 @@ export default {
|
||||
],
|
||||
customeredProductType: [
|
||||
{ enlabel: 'Plan Draw', label: '运行图编制', value: 'Plan'}
|
||||
],
|
||||
|
||||
controlMode: [
|
||||
{ label: '中控', value: '01' },
|
||||
{ label: '站控', value: '02' }
|
||||
],
|
||||
|
||||
simulationRole: [
|
||||
{ label: '行调操作', value: '01' },
|
||||
{ label: '现地操作', value: '02' }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
@ -41,7 +41,7 @@ Vue.prototype.$addWindowResizeListener = function(cb) {
|
||||
Vue.prototype.$theme = new Theme();
|
||||
Vue.prototype.$messageBox = function(msge) {
|
||||
if (this.$confirm) {
|
||||
this.$confirm(`${msge || this.$t('global.processFailure')}!`, this.$t('global.tips'), {
|
||||
this.$confirm(`${msge || this.$t('global.processFailure')}`, this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
type: 'warning',
|
||||
showCancelButton: false,
|
||||
@ -74,7 +74,7 @@ Vue.prototype.$convertField = function(fieldValue, enumList, converFormat, isLis
|
||||
}
|
||||
}
|
||||
|
||||
return isList ? arr: '';
|
||||
return isList ? arr : '';
|
||||
};
|
||||
|
||||
Vue.prototype.$convertSpecifiedField = function(dataDict, enumList, key, value, fieldList) {
|
||||
|
@ -530,7 +530,7 @@ const map = {
|
||||
if (map && map.skinVO) {
|
||||
state.map = map;
|
||||
state.mapDevice = parser(map, map.skinVO.code);
|
||||
Vue.prototype.$jlmap.setMapDevice(state.mapDevice);
|
||||
Vue.prototype.$jlmap && Vue.prototype.$jlmap.setMapDevice(state.mapDevice);
|
||||
} else {
|
||||
state.map = null;
|
||||
state.mapDevice = {};
|
||||
|
@ -9,9 +9,6 @@ function handle(state, data) {
|
||||
case 'Order_Pay_Result': // 订单支付结果消息
|
||||
state.payOrder = msg;
|
||||
break;
|
||||
case 'Be_Logged_Out': // 重复登录被登出
|
||||
state.beLogout = msg;
|
||||
break;
|
||||
case 'JointTraining_Room': // 综合演练室-房间消息
|
||||
if (!path.includes('/plan') || !path.includes('/dp/')) {
|
||||
state.jointRoomInfo = msg; // 房间信息
|
||||
@ -74,6 +71,9 @@ function handle(state, data) {
|
||||
case 'JointTraining_Device':
|
||||
state.realDeviceInfo++;
|
||||
break;
|
||||
case 'Be_Logged_Out': // 重复登录被登出
|
||||
state.beLogoutCount++;
|
||||
break;
|
||||
case 'Simulation_Control_Pause': // 暂停中
|
||||
store.dispatch('scriptRecord/updateSimulationPause', msg);
|
||||
break;
|
||||
@ -196,7 +196,6 @@ const socket = {
|
||||
|
||||
state: {
|
||||
payOrder: {}, // 支付消息
|
||||
beLogout: {}, // 被登出
|
||||
jointRoomInfo: {}, // 受邀请房间信息
|
||||
chatContent: {}, // 聊天室聊天内容
|
||||
roleList: [], // 设置角色信息
|
||||
@ -223,7 +222,8 @@ const socket = {
|
||||
permissionOver: {}, // 权限结束
|
||||
|
||||
tipOperateCount: 0, // 任务结束提示消息
|
||||
realDeviceInfo: 0 // 真实设备信息
|
||||
realDeviceInfo: 0, // 真实设备信息
|
||||
beLogoutCount: 0 // 被登出
|
||||
},
|
||||
|
||||
getters: {
|
||||
|
@ -3,9 +3,11 @@ import { checkLoginLine } from '@/api/login';
|
||||
import { getBaseUrl } from '@/utils/baseUrl';
|
||||
import { MessageBox } from 'element-ui';
|
||||
import store from '../store';
|
||||
import SockJS from 'sockjs-client';
|
||||
import Stomp from 'stompjs';
|
||||
|
||||
var SockJS = require('sockjs-client');
|
||||
var Stomp = require('stompjs');
|
||||
// var SockJS = require('sockjs-client');
|
||||
// var Stomp = require('stompjs');
|
||||
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
const websocketUrl = `${getBaseUrl()}/joylink-websocket?token=`;
|
||||
|
@ -15,7 +15,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.mapName')" prop="name">
|
||||
<el-input v-model="newModel.name" />
|
||||
<el-input v-model.trim="newModel.name" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
@ -32,7 +32,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.mapName')" prop="name">
|
||||
<el-input v-model="pullModel.name" />
|
||||
<el-input v-model.trim="pullModel.name" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
@ -96,7 +96,7 @@ export default {
|
||||
{ required: true, message: this.$t('rules.pleaseSelectMapSource'), trigger: 'change' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
|
||||
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
cityList: []
|
||||
|
@ -14,7 +14,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.mapName')" prop="name">
|
||||
<el-input v-model="editModel.name" />
|
||||
<el-input v-model.trim="editModel.name" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
@ -176,11 +176,11 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
async confirm() {
|
||||
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() {
|
||||
|
@ -35,6 +35,7 @@
|
||||
:offset="offset"
|
||||
:group="group"
|
||||
@switchMode="switchMode"
|
||||
@selectQuest="selectQuest"
|
||||
/>
|
||||
<!--@runPlanViewShow="runPlanViewShow"
|
||||
@faultChooseShow="faultChooseShow"
|
||||
|
@ -172,7 +172,7 @@ export default {
|
||||
this.$refs.addQuest.doShow();
|
||||
},
|
||||
viewScriptRoles() {
|
||||
const row = {id: this.$route.query.scriptId};
|
||||
const row = {id: this.$route.query.scriptId, group:this.$route.query.group};
|
||||
this.$refs.addQuest.handleLoad(1, row);
|
||||
},
|
||||
selectQuest(row, id, mapLocation, roleName) {
|
||||
|
@ -104,7 +104,8 @@ export default {
|
||||
updateTime: ''
|
||||
},
|
||||
detailShow: false,
|
||||
examIndex: 0
|
||||
examIndex: 0,
|
||||
scanInter:null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -115,12 +116,7 @@ export default {
|
||||
return this.$store.state.exam.totalTime - this.$store.state.exam.usedTime;
|
||||
},
|
||||
formatRemainTime() {
|
||||
if (this.remainTime < 0) {
|
||||
this.$message.success(this.$t('display.exam.autoSubmit'));
|
||||
this.submit();
|
||||
}
|
||||
|
||||
return timeFormat(this.remainTime);
|
||||
return this.remainTime >= 0 ? timeFormat(this.remainTime) : '';
|
||||
},
|
||||
isFirst() {
|
||||
return this.examIndex == 0;
|
||||
@ -129,8 +125,15 @@ export default {
|
||||
return this.examIndex == this.trainingList.length - 1;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
watch: {
|
||||
'$store.state.map.mapViewLoadedCount': function() {
|
||||
this.$store.dispatch('exam/stopCountTime');
|
||||
this.loadInitData();
|
||||
this.$store.dispatch('exam/countUsedTime');
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.clearScanCommit();
|
||||
},
|
||||
methods: {
|
||||
backList() {
|
||||
@ -170,13 +173,13 @@ export default {
|
||||
this.detailShow = false;
|
||||
},
|
||||
// 获取试题列表
|
||||
loadInitData() {
|
||||
async loadInitData() {
|
||||
// 刷新考试列表
|
||||
refreshExamList(this.$route.query.userExamId).then(response => {
|
||||
this.examName = response.data.examName;
|
||||
this.$store.dispatch('exam/setUsedTime', response.data.usedTime);
|
||||
this.$store.dispatch('exam/setTotalTime', response.data.duration);
|
||||
this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { });
|
||||
this.$store.commit('exam/setUsedTime', response.data.usedTime);
|
||||
this.$store.commit('exam/setTotalTime', response.data.duration);
|
||||
this.$store.commit('trainingList/setTrainingList', response.data.userExamQuestionsVOs);
|
||||
const obj = {
|
||||
trainingId: '',
|
||||
id: ''
|
||||
@ -190,6 +193,7 @@ export default {
|
||||
obj.id = response.data.userExamQuestionsVOs[0].id;
|
||||
}
|
||||
this.selectedTraining(obj);
|
||||
this.scanCommit();
|
||||
}).catch(error => {
|
||||
// 如果时50009则表示考试已完成,不能再次进行y
|
||||
if (error.code === 500009) {
|
||||
@ -199,9 +203,22 @@ export default {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
this.shrink();
|
||||
},
|
||||
scanCommit() {
|
||||
this.clearScanCommit();
|
||||
this.scanInter = setInterval(()=>{
|
||||
if (this.remainTime < 0) {
|
||||
this.$message.success(this.$t('display.exam.autoSubmit'));
|
||||
this.clearScanCommit();
|
||||
this.submit();
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
clearScanCommit() {
|
||||
clearInterval(this.scanInter);
|
||||
this.scanInter = null;
|
||||
},
|
||||
nextExam() {
|
||||
const obj = {
|
||||
trainingId: '',
|
||||
|
@ -13,7 +13,7 @@
|
||||
<el-button type="text" class="mapEdit_box" @click="showMap">{{ $t('map.viewLayer') }}</el-button>
|
||||
</div>
|
||||
<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
|
||||
ref="routeOperate"
|
||||
:map-info="mapInfo"
|
||||
@ -21,7 +21,7 @@
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</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
|
||||
ref="pathOperate"
|
||||
:map-info="mapInfo"
|
||||
@ -29,7 +29,7 @@
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</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
|
||||
ref="routingOperate"
|
||||
:map-info="mapInfo"
|
||||
@ -37,7 +37,7 @@
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</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
|
||||
ref="automaticOperate"
|
||||
:map-info="mapInfo"
|
||||
@ -45,7 +45,7 @@
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</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
|
||||
ref="SwitchOperate"
|
||||
:map-info="mapInfo"
|
||||
|
@ -117,8 +117,8 @@
|
||||
@click="hover('routeTriggerSectionList')"
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="进路物理区段数据:" prop="routeSectionList">
|
||||
<el-select v-model="addModel.routeSectionList" multiple :filterable="true" placeholder="请选择">
|
||||
<el-form-item :label="$t('map.physicalSection') +':'" prop="routeSectionList">
|
||||
<el-select v-model="addModel.routeSectionList" multiple :filterable="true">
|
||||
<el-option
|
||||
v-for="item in sectionList"
|
||||
:key="item.code"
|
||||
@ -129,10 +129,10 @@
|
||||
<el-button
|
||||
:type=" field === 'routeSectionList' ? 'danger' : 'primary'"
|
||||
@click="hover('routeSectionList')"
|
||||
>激活</el-button>
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="进路道岔数据:" prop="routeSwitchList">
|
||||
<el-select v-model="routeCode" clearable :filterable="true" placeholder="请选择道岔数据">
|
||||
<el-form-item :label="$t('map.entryTurnout')+':'" prop="routeSwitchList">
|
||||
<el-select v-model="routeCode" clearable :filterable="true">
|
||||
<el-option
|
||||
v-for="item in switchList"
|
||||
:key="item.code"
|
||||
@ -143,12 +143,12 @@
|
||||
<el-button
|
||||
:type=" field === 'routeSwitchList' ? 'danger' : 'primary'"
|
||||
@click="hover('routeSwitchList')"
|
||||
>激活</el-button>
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="pushSwitch(addModel.routeSwitchList, { switchCode: routeCode, switchLocateType: routeType, switchType: overlapType == '01' ? '定位' : '反位' } )"
|
||||
>添加</el-button>
|
||||
<el-select v-model="routeType" :filterable="true" placeholder="请选择道岔类型">
|
||||
>{{ $t('map.add') }}</el-button>
|
||||
<el-select v-model="routeType" :filterable="true">
|
||||
<el-option
|
||||
v-for="item in SwitchLocateTypeList"
|
||||
:key="item.code"
|
||||
@ -157,7 +157,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
<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">
|
||||
<span>{{ swictchName(scope.row.switchCode) }}</span>
|
||||
</template>
|
||||
@ -176,8 +176,8 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
<el-form-item label="进路屏蔽门数据:" prop="routeStandList">
|
||||
<el-select v-model="addModel.routeStandList" multiple :filterable="true" placeholder="请选择">
|
||||
<el-form-item :label="$t('map.accessGate') + ':'" prop="routeStandList">
|
||||
<el-select v-model="addModel.routeStandList" multiple :filterable="true">
|
||||
<el-option
|
||||
v-for="item in stationStandList"
|
||||
:key="item.code"
|
||||
@ -188,7 +188,7 @@
|
||||
<el-button
|
||||
:type=" field === 'routeStandList' ? 'danger' : 'primary'"
|
||||
@click="hover('routeStandList')"
|
||||
>激活</el-button>
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.routeFlankProtectionList')" prop="routeFlankProtectionList">
|
||||
<el-select v-model="flankCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
|
||||
@ -223,7 +223,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
<el-button
|
||||
type="text"
|
||||
@ -311,7 +311,6 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import { getUID } from '@/jmap/utils/Uid';
|
||||
import { createRouteRoute, updateRouteRoute } from '@/api/jmap/mapdraft';
|
||||
// import { ViewMode } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'RouteOperation',
|
||||
@ -436,7 +435,7 @@ export default {
|
||||
{ required: true, message: this.$t('rules.autoAccessType'), trigger: 'change' }
|
||||
],
|
||||
routeSectionList: [
|
||||
{ required: true, message: '请选择进路物理区段数据', trigger: 'change' }
|
||||
{ required: true, message: this.$t('map.selectPhysicalSection'), trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return baseRules;
|
||||
@ -540,7 +539,7 @@ export default {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
updateRouteRoute(this.buildModel()).then(response => {
|
||||
this.$message.success('更新成功');
|
||||
this.$message.success(this.$t('map.updateSuccessfully'));
|
||||
this.loading = false;
|
||||
this.clear();
|
||||
}).catch(() => {
|
||||
|
@ -396,13 +396,13 @@ export default {
|
||||
name: this.$t('map.mapData'),
|
||||
item: [
|
||||
{ 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: 'offsetRight', label: this.$t('map.sectionOffsetRight'), 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: this.$t('map.meter'), isHidden: !this.isSectionType },
|
||||
{ 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: '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: 'kmRangeRight', label: this.$t('map.rightKilometerMark'), 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, placeholder: this.$t('map.meter') },
|
||||
{ prop: 'trainPosType', label: this.$t('map.trainDirection'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.TrainPositionTypeList, isHidden: !this.isSectionType }
|
||||
]
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
<el-row>
|
||||
<el-form ref="form" :model="newModel" label-width="140px" size="mini" :rules="rules" @submit.native.prevent>
|
||||
<el-form-item :label="this.$t('planMonitor.runGraphName')+this.$t('global.colon')" prop="name">
|
||||
<el-input v-model="newModel.name" autofocus />
|
||||
<el-input v-model.trim="newModel.name" autofocus />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@ -35,7 +35,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('planMonitor.runGraphName')+this.$t('global.colon')" prop="name">
|
||||
<el-input v-model="pullModel.name" autofocus />
|
||||
<el-input v-model.trim="pullModel.name" autofocus />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
|
@ -91,8 +91,8 @@ export default {
|
||||
this.$message.success(this.$t('tip.runGraphNameModifiedSuccessfully'));
|
||||
this.$emit('renewal');
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.modifyRunGraphNameFailed'));
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('tip.modifyRunGraphNameFailed') + error.message);
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
|
@ -356,6 +356,7 @@ export default {
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(lineCode);
|
||||
|
||||
const editData = this.$store.state.runPlan.editData[this.editModel.serviceNumber];
|
||||
debugger;
|
||||
if (editData) {
|
||||
const tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex; });
|
||||
const trainInfo = editData.trainMap[tripNumberList[0]];
|
||||
|
@ -27,6 +27,7 @@ import { getStationList, queryRunPlan } from '@/api/runplan';
|
||||
import {getRpDetailByUserMapId, getUserMapDetailByMapId} from '@/api/designPlatform';
|
||||
import { loadMapDataById } from '@/utils/loaddata';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import {getMapDetail} from '@/api/jmap/mapdraft';
|
||||
import DataTable from './menus/components/dataTable';
|
||||
import echarts from 'echarts';
|
||||
|
||||
@ -373,13 +374,20 @@ export default {
|
||||
this.$store.dispatch('runPlan/clear').then(() => {
|
||||
this.loadInitChart().then(() => {
|
||||
if (this.$route.query.mapId) {
|
||||
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
||||
getMapDetail(this.$route.query.mapId).then(response => {
|
||||
this.$store.dispatch('map/setMapData', response.data).then(()=>{
|
||||
this.$store.dispatch('map/clearJlmapTrainView');
|
||||
});
|
||||
});
|
||||
} else {
|
||||
loadMapDataById(this.$route.query.mapId);
|
||||
}
|
||||
getStationList(this.$route.query.mapId).then(resp => {
|
||||
this.$store.dispatch('runPlan/setStations', resp.data).then(() => {
|
||||
this.loadInitData();
|
||||
if (this.planId) {
|
||||
this.myChart && this.myChart.showLoading();
|
||||
|
||||
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
||||
getRpDetailByUserMapId(this.planId).then(rest => {
|
||||
this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
|
||||
|
@ -38,8 +38,8 @@ export default {
|
||||
const form = {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text', required: true},
|
||||
{ prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea', required: true}
|
||||
{ prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text' },
|
||||
{ prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea' }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
@ -47,18 +47,28 @@ export default {
|
||||
rules() {
|
||||
const crules = {
|
||||
name: [
|
||||
{ required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'blur' },
|
||||
{ required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'change' }
|
||||
],
|
||||
description:[
|
||||
{ required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'blur' },
|
||||
{ required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'change' }
|
||||
// { 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:[
|
||||
// { required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'blur' },
|
||||
// { required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'change' }
|
||||
// ]
|
||||
};
|
||||
return crules;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
validateScriptName(rule, value, callback) {
|
||||
if (value.trim().length === 0) {
|
||||
this.formModel.name = this.formModel.name.replace(/\s/g, '');
|
||||
return callback(new Error(this.$t('scriptRecord.inputScriptName')));
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
},
|
||||
doShow(questid) {
|
||||
if (questid) {
|
||||
getQuestById(questid).then(resp=>{
|
||||
|
@ -23,7 +23,7 @@
|
||||
<span> km/h</span>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('scriptRecord.signal')" class="conditionVO" prop="param.signal">
|
||||
<el-input v-model="commandData.param.signal" disabled="disabled" style="width:130px" />
|
||||
<el-input v-model="signalName" disabled="disabled" style="width:130px" />
|
||||
<el-button
|
||||
:type="field === 'selectSingalCode' ? 'danger' : 'primary'"
|
||||
size="mini"
|
||||
@ -58,7 +58,8 @@ export default {
|
||||
{id:'NRM', name:'NRM'}
|
||||
],
|
||||
field: '',
|
||||
fieldS:''
|
||||
fieldS:'',
|
||||
signalName:''
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -84,7 +85,8 @@ export default {
|
||||
},
|
||||
deviceSelect(em) {
|
||||
if (this.field.toUpperCase() === 'selectSingalCode'.toUpperCase() && em._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.commandData.param.signal = em.name;
|
||||
this.commandData.param.signal = em.code;
|
||||
this.signalName = em.name;
|
||||
this.field = '';
|
||||
}
|
||||
},
|
||||
|
@ -1,46 +1,79 @@
|
||||
<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" />
|
||||
<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 @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-button @click="back">返回</el-button>
|
||||
</div>
|
||||
|
||||
<command-edit ref="create" type="ADD" @addData="addData" />
|
||||
<command-edit ref="edit" type="EDIT" @editData="editData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<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 {
|
||||
name: 'DictionaryEdit',
|
||||
components: {
|
||||
CommandEdit
|
||||
},
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
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: {
|
||||
code: '',
|
||||
name: '',
|
||||
status: '1',
|
||||
remarks: ''
|
||||
id: '',
|
||||
simulationRole: '',
|
||||
controlMode: '',
|
||||
lineCode: '',
|
||||
operateObject: '',
|
||||
operate: '',
|
||||
paramList: []
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const isAdd = this.type === 'ADD';
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'controlMode', label: this.$t('system.controlMode'), type: 'text', required: true, disabled: !isAdd },
|
||||
{ prop: 'deviceType', label: this.$t('system.deviceType'), type: 'select', required: true, options: this.$ConstSelect.Status },
|
||||
{ prop: 'lineCode', label: this.$t('system.lineCode'), type: 'select', required: true, options: this.$ConstSelect.Status },
|
||||
{ prop: 'role', label: this.$t('system.simulationRole'), type: 'select', required: true, options: this.$ConstSelect.Status },
|
||||
{ prop: 'type', label: this.$t('system.instructionType'), type: 'select', required: true, options: this.$ConstSelect.Status }
|
||||
{ prop: 'simulationRole', label: this.$t('system.simulationRole'), type: 'select', options: this.$ConstSelect.simulationRole },
|
||||
{ prop: 'controlMode', label: this.$t('system.controlMode'), type: 'select', options: this.$ConstSelect.controlMode },
|
||||
{ prop: 'lineCode', label: this.$t('system.lineCode'), type: 'select', options: this.taskStatusList },
|
||||
{ prop: 'operateObject', label: this.$t('system.deviceType'), type: 'select', options: this.deviceTypeList, change: true, onChange: this.deviceChange },
|
||||
{ prop: 'operate', label: this.$t('system.instructionType'), type: 'text' }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
@ -50,82 +83,137 @@ export default {
|
||||
controlMode: [
|
||||
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
|
||||
],
|
||||
deviceType: [
|
||||
operateObject: [
|
||||
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
|
||||
],
|
||||
lineCode: [
|
||||
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
|
||||
],
|
||||
role: [
|
||||
simulationRole: [
|
||||
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
|
||||
],
|
||||
type: [
|
||||
operate: [
|
||||
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
|
||||
]
|
||||
};
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.type === 'ADD') {
|
||||
return this.$t('system.createDirective');
|
||||
} else {
|
||||
return this.$t('system.editDirective');
|
||||
}
|
||||
}
|
||||
mounted () {
|
||||
this.loadInitData();
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
show(id) {
|
||||
this.dialogVisible = true;
|
||||
if (id) {
|
||||
getData(id).then(response => {
|
||||
this.formModel = response.data;
|
||||
this.$refs.dataform.resetForm();
|
||||
async loadInitData() {
|
||||
try {
|
||||
this.taskStatusList = [];
|
||||
const list = await getLineCodeList();
|
||||
list.data.forEach(elem => {
|
||||
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() {
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (self.type === 'ADD') {
|
||||
self.create();
|
||||
if (this.type == 'add') {
|
||||
this.create();
|
||||
} else {
|
||||
self.update();
|
||||
this.update();
|
||||
}
|
||||
});
|
||||
},
|
||||
create() {
|
||||
const self = this;
|
||||
create(this.formModel).then(response => {
|
||||
self.$message.success(this.$t('system.createSuccess'));
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
createCommand(this.formModel).then(response => {
|
||||
this.$message.success(this.$t('system.createSuccess'));
|
||||
this.handleBack();
|
||||
}).catch(error => {
|
||||
self.$message.error(`${this.$t('error.createDictionaryFailed')}:${error.message}`);
|
||||
console.log(error);
|
||||
this.$message.error('创建指令失败');
|
||||
});
|
||||
},
|
||||
update() {
|
||||
const self = this;
|
||||
update(this.formModel).then(response => {
|
||||
self.$message.success(this.$t('system.updateSuccess'));
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
editCommand(this.formModel).then(response => {
|
||||
this.$message.success(this.$t('system.updateSuccess'));
|
||||
this.handleBack();
|
||||
}).catch(error => {
|
||||
self.$message.error(`${this.$t('error.updateDictionaryFailed')}:${error.message}`);
|
||||
console.log(error);
|
||||
this.$message.error('更新指令失败');
|
||||
});
|
||||
},
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
code: '',
|
||||
name: '',
|
||||
status: '1',
|
||||
remarks: ''
|
||||
};
|
||||
this.$refs.dataform.resetForm();
|
||||
if (done) {
|
||||
done();
|
||||
} else {
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
handleBack() {
|
||||
this.$router.push({ path: `/system/commands`, query: { } });
|
||||
},
|
||||
back() {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
|
||||
editData(data) {
|
||||
this.formModel.paramList.splice(this.editIndex, 1, data);
|
||||
},
|
||||
addData(data) {
|
||||
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>
|
||||
|
||||
<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>
|
||||
|
108
src/views/system/commandDictionary/editParam.vue
Normal file
108
src/views/system/commandDictionary/editParam.vue
Normal 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>
|
@ -1,24 +1,28 @@
|
||||
<template>
|
||||
<div>
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCommandList, delCommand } from '@/api/management/dictionary';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import DictionaryEdit from './edit';
|
||||
import { getLineCodeList } from '@/api/management/mapline';
|
||||
|
||||
export default {
|
||||
name: 'CommandDictionary',
|
||||
components: {
|
||||
DictionaryEdit
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
taskStatusList: [],
|
||||
deviceTypeList: [
|
||||
{ label: '区段', value: 'section' },
|
||||
{ label: '道岔', value: 'switch' },
|
||||
{ label: '信号机', value: 'signal' },
|
||||
{ label: '站台', value: 'station' },
|
||||
{ label: '控制模式', value: 'stationConter' },
|
||||
{ label: '临时全线限速', value: 'limitConter' }
|
||||
],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
@ -34,7 +38,7 @@ export default {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
deviceType: {
|
||||
operateObject: {
|
||||
type: 'select',
|
||||
label: this.$t('system.deviceType'),
|
||||
config: {
|
||||
@ -48,38 +52,50 @@ export default {
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('system.controlMode'), // 控制模式
|
||||
prop: 'controlMode'
|
||||
},
|
||||
{
|
||||
title: this.$t('system.deviceType'), // 设备类型
|
||||
prop: 'deviceType'
|
||||
},
|
||||
{
|
||||
title: this.$t('system.lineCode'), // 线路编号
|
||||
prop: 'lineCode',
|
||||
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'; }
|
||||
},
|
||||
{
|
||||
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'), // 指令类型
|
||||
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',
|
||||
title: this.$t('global.operate'),
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('system.paramDetail'),
|
||||
handleClick: this.handleDetail
|
||||
},
|
||||
{
|
||||
name: this.$t('global.edit'),
|
||||
handleClick: this.handleEdit
|
||||
@ -109,10 +125,13 @@ export default {
|
||||
try {
|
||||
this.taskStatusList = [];
|
||||
this.mapList = [];
|
||||
const list = await listPublishMap();
|
||||
const list = await getLineCodeList();
|
||||
this.taskStatusList = list.data;
|
||||
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) {
|
||||
console.log(error);
|
||||
@ -126,19 +145,23 @@ export default {
|
||||
return getCommandList(params);
|
||||
},
|
||||
|
||||
handleDetail(index, row) {
|
||||
console.log(index, row);
|
||||
replace(fieldValue) {
|
||||
const arr = [];
|
||||
if (fieldValue && fieldValue.length) {
|
||||
fieldValue.forEach((v, j) => {
|
||||
if (v.name) {
|
||||
arr.push(v.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
return arr;
|
||||
},
|
||||
|
||||
handleEdit(index, row) {
|
||||
console.log(index, row);
|
||||
// this.$refs.edit.show(row.id);
|
||||
this.$router.push({ path: `/system/commands/Detail`, query: { type: 'edit', id: row.id } });
|
||||
},
|
||||
|
||||
handleAdd() {
|
||||
this.$refs.create.show();
|
||||
this.$router.push({ path: `/system/commands/Detail`, query: { type: 'add' } });
|
||||
},
|
||||
|
||||
handleDelete(index, row) {
|
||||
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
@ -154,7 +177,6 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
|
@ -83,6 +83,7 @@ module.exports = {
|
||||
'nprogress': 'NProgress',
|
||||
'echarts': 'echarts',
|
||||
'element-ui': 'ELEMENT'
|
||||
// 'sockjs': 'sockjs'
|
||||
};
|
||||
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user