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",
|
"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",
|
||||||
|
@ -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>
|
||||||
|
@ -27,7 +27,7 @@ export default {
|
|||||||
this.subscribeMessage(val);
|
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'), {
|
this.$alert(this.$t('tip.logoutTips'), this.$t('tip.hint'), {
|
||||||
confirmButtonText: this.$t('tip.confirm'),
|
confirmButtonText: this.$t('tip.confirm'),
|
||||||
callback: action => {
|
callback: action => {
|
||||||
|
@ -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'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -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'
|
||||||
};
|
};
|
||||||
|
@ -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: '参数名称'
|
||||||
};
|
};
|
||||||
|
@ -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: '请选择进路物理区段数据'
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -61,5 +61,6 @@ export default {
|
|||||||
instructionType: '指令类型',
|
instructionType: '指令类型',
|
||||||
paramDetail: '查看参数',
|
paramDetail: '查看参数',
|
||||||
createDirective: '新增指令',
|
createDirective: '新增指令',
|
||||||
editDirective: '修改指令'
|
editDirective: '修改指令',
|
||||||
|
parameterName: '参数名称'
|
||||||
};
|
};
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -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' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -12,90 +12,90 @@ Vue.component('QueryListPage', QueryListPage);
|
|||||||
Vue.component('TurnbackBar', TurnbackBar);
|
Vue.component('TurnbackBar', TurnbackBar);
|
||||||
|
|
||||||
Vue.prototype.$ConstSelect = (function() {
|
Vue.prototype.$ConstSelect = (function() {
|
||||||
ConstConfig.ConstSelect.translate = function(value, codeName) {
|
ConstConfig.ConstSelect.translate = function(value, codeName) {
|
||||||
if (codeName) {
|
if (codeName) {
|
||||||
const obj = this[codeName].filter(function(item) {
|
const obj = this[codeName].filter(function(item) {
|
||||||
return item.value === value;
|
return item.value === value;
|
||||||
})[0];
|
})[0];
|
||||||
return obj && obj.label;
|
return obj && obj.label;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return ConstConfig.ConstSelect;
|
return ConstConfig.ConstSelect;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
Vue.prototype.$Dictionary = Dictionary;
|
Vue.prototype.$Dictionary = Dictionary;
|
||||||
|
|
||||||
Vue.prototype.__windowResizeFlag = false;
|
Vue.prototype.__windowResizeFlag = false;
|
||||||
Vue.prototype.$addWindowResizeListener = function(cb) {
|
Vue.prototype.$addWindowResizeListener = function(cb) {
|
||||||
window.addEventListener('resize', function() {
|
window.addEventListener('resize', function() {
|
||||||
if (!Vue.__windowResizeFlag) {
|
if (!Vue.__windowResizeFlag) {
|
||||||
Vue.__windowResizeFlag = true;
|
Vue.__windowResizeFlag = true;
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
Vue.__windowResizeFlag = false;
|
Vue.__windowResizeFlag = false;
|
||||||
cb();
|
cb();
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
Vue.prototype.$theme = new Theme();
|
Vue.prototype.$theme = new Theme();
|
||||||
Vue.prototype.$messageBox = function(msge) {
|
Vue.prototype.$messageBox = function(msge) {
|
||||||
if (this.$confirm) {
|
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'),
|
confirmButtonText: this.$t('global.confirm'),
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
showCancelButton: false,
|
showCancelButton: false,
|
||||||
center: true
|
center: true
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Vue.prototype.$convertField = function(fieldValue, enumList, converFormat, isList = false) {
|
Vue.prototype.$convertField = function(fieldValue, enumList, converFormat, isList = false) {
|
||||||
const arr = [];
|
const arr = [];
|
||||||
if (enumList && converFormat && converFormat.length >= 2) {
|
if (enumList && converFormat && converFormat.length >= 2) {
|
||||||
const value = converFormat[0];
|
const value = converFormat[0];
|
||||||
const label = converFormat[1];
|
const label = converFormat[1];
|
||||||
if (isList) {
|
if (isList) {
|
||||||
enumList.forEach((element, i) => {
|
enumList.forEach((element, i) => {
|
||||||
fieldValue.forEach((v, j) => {
|
fieldValue.forEach((v, j) => {
|
||||||
if ('' + fieldValue[j] === '' + enumList[i][value]) {
|
if ('' + fieldValue[j] === '' + enumList[i][value]) {
|
||||||
arr.push(enumList[i][label]);
|
arr.push(enumList[i][label]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
for (let i = 0; i < enumList.length; i++) {
|
for (let i = 0; i < enumList.length; i++) {
|
||||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||||
return enumList[i][label];
|
return enumList[i][label];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return isList ? arr: '';
|
return isList ? arr : '';
|
||||||
};
|
};
|
||||||
|
|
||||||
Vue.prototype.$convertSpecifiedField = function(dataDict, enumList, key, value, fieldList) {
|
Vue.prototype.$convertSpecifiedField = function(dataDict, enumList, key, value, fieldList) {
|
||||||
if (dataDict && enumList && fieldList && enumList.length && fieldList.length) {
|
if (dataDict && enumList && fieldList && enumList.length && fieldList.length) {
|
||||||
fieldList.forEach(field => {
|
fieldList.forEach(field => {
|
||||||
enumList.forEach(elem => {
|
enumList.forEach(elem => {
|
||||||
if (elem[key] === dataDict[field]) {
|
if (elem[key] === dataDict[field]) {
|
||||||
dataDict[field] = elem[value];
|
dataDict[field] = elem[value];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Vue.prototype.$convertList = function(FromList, ToList, checktypeFunction) {
|
Vue.prototype.$convertList = function(FromList, ToList, checktypeFunction) {
|
||||||
if (FromList) {
|
if (FromList) {
|
||||||
ToList.length = 0;
|
ToList.length = 0;
|
||||||
FromList.forEach(elem => {
|
FromList.forEach(elem => {
|
||||||
if (checktypeFunction(elem)) {
|
if (checktypeFunction(elem)) {
|
||||||
ToList.push({ value: elem.code, label: elem.name });
|
ToList.push({ value: elem.code, label: elem.name });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -530,7 +530,7 @@ const map = {
|
|||||||
if (map && map.skinVO) {
|
if (map && map.skinVO) {
|
||||||
state.map = map;
|
state.map = map;
|
||||||
state.mapDevice = parser(map, map.skinVO.code);
|
state.mapDevice = parser(map, map.skinVO.code);
|
||||||
Vue.prototype.$jlmap.setMapDevice(state.mapDevice);
|
Vue.prototype.$jlmap && Vue.prototype.$jlmap.setMapDevice(state.mapDevice);
|
||||||
} else {
|
} else {
|
||||||
state.map = null;
|
state.map = null;
|
||||||
state.mapDevice = {};
|
state.mapDevice = {};
|
||||||
|
@ -9,9 +9,6 @@ function handle(state, data) {
|
|||||||
case 'Order_Pay_Result': // 订单支付结果消息
|
case 'Order_Pay_Result': // 订单支付结果消息
|
||||||
state.payOrder = msg;
|
state.payOrder = msg;
|
||||||
break;
|
break;
|
||||||
case 'Be_Logged_Out': // 重复登录被登出
|
|
||||||
state.beLogout = msg;
|
|
||||||
break;
|
|
||||||
case 'JointTraining_Room': // 综合演练室-房间消息
|
case 'JointTraining_Room': // 综合演练室-房间消息
|
||||||
if (!path.includes('/plan') || !path.includes('/dp/')) {
|
if (!path.includes('/plan') || !path.includes('/dp/')) {
|
||||||
state.jointRoomInfo = msg; // 房间信息
|
state.jointRoomInfo = msg; // 房间信息
|
||||||
@ -74,6 +71,9 @@ function handle(state, data) {
|
|||||||
case 'JointTraining_Device':
|
case 'JointTraining_Device':
|
||||||
state.realDeviceInfo++;
|
state.realDeviceInfo++;
|
||||||
break;
|
break;
|
||||||
|
case 'Be_Logged_Out': // 重复登录被登出
|
||||||
|
state.beLogoutCount++;
|
||||||
|
break;
|
||||||
case 'Simulation_Control_Pause': // 暂停中
|
case 'Simulation_Control_Pause': // 暂停中
|
||||||
store.dispatch('scriptRecord/updateSimulationPause', msg);
|
store.dispatch('scriptRecord/updateSimulationPause', msg);
|
||||||
break;
|
break;
|
||||||
@ -196,7 +196,6 @@ const socket = {
|
|||||||
|
|
||||||
state: {
|
state: {
|
||||||
payOrder: {}, // 支付消息
|
payOrder: {}, // 支付消息
|
||||||
beLogout: {}, // 被登出
|
|
||||||
jointRoomInfo: {}, // 受邀请房间信息
|
jointRoomInfo: {}, // 受邀请房间信息
|
||||||
chatContent: {}, // 聊天室聊天内容
|
chatContent: {}, // 聊天室聊天内容
|
||||||
roleList: [], // 设置角色信息
|
roleList: [], // 设置角色信息
|
||||||
@ -223,7 +222,8 @@ const socket = {
|
|||||||
permissionOver: {}, // 权限结束
|
permissionOver: {}, // 权限结束
|
||||||
|
|
||||||
tipOperateCount: 0, // 任务结束提示消息
|
tipOperateCount: 0, // 任务结束提示消息
|
||||||
realDeviceInfo: 0 // 真实设备信息
|
realDeviceInfo: 0, // 真实设备信息
|
||||||
|
beLogoutCount: 0 // 被登出
|
||||||
},
|
},
|
||||||
|
|
||||||
getters: {
|
getters: {
|
||||||
|
@ -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=`;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('map.mapName')" prop="name">
|
<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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@ -32,7 +32,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('map.mapName')" prop="name">
|
<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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@ -96,7 +96,7 @@ export default {
|
|||||||
{ required: true, message: this.$t('rules.pleaseSelectMapSource'), trigger: 'change' }
|
{ required: true, message: this.$t('rules.pleaseSelectMapSource'), trigger: 'change' }
|
||||||
],
|
],
|
||||||
name: [
|
name: [
|
||||||
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
|
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'blur' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
cityList: []
|
cityList: []
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('map.mapName')" prop="name">
|
<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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
@ -176,11 +176,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async confirm() {
|
confirm() {
|
||||||
const roleName = this.memberList.find(elem=>{ return elem.id == this.form.role; });
|
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.doClose();
|
||||||
this.roleDoClose();
|
this.roleDoClose();
|
||||||
|
this.$emit('selectQuest', this.row, this.form.role, this.mapLocation, roleName.role);
|
||||||
},
|
},
|
||||||
|
|
||||||
roleDoClose() {
|
roleDoClose() {
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
:offset="offset"
|
:offset="offset"
|
||||||
:group="group"
|
:group="group"
|
||||||
@switchMode="switchMode"
|
@switchMode="switchMode"
|
||||||
|
@selectQuest="selectQuest"
|
||||||
/>
|
/>
|
||||||
<!--@runPlanViewShow="runPlanViewShow"
|
<!--@runPlanViewShow="runPlanViewShow"
|
||||||
@faultChooseShow="faultChooseShow"
|
@faultChooseShow="faultChooseShow"
|
||||||
|
@ -172,7 +172,7 @@ export default {
|
|||||||
this.$refs.addQuest.doShow();
|
this.$refs.addQuest.doShow();
|
||||||
},
|
},
|
||||||
viewScriptRoles() {
|
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);
|
this.$refs.addQuest.handleLoad(1, row);
|
||||||
},
|
},
|
||||||
selectQuest(row, id, mapLocation, roleName) {
|
selectQuest(row, id, mapLocation, roleName) {
|
||||||
|
@ -104,7 +104,8 @@ export default {
|
|||||||
updateTime: ''
|
updateTime: ''
|
||||||
},
|
},
|
||||||
detailShow: false,
|
detailShow: false,
|
||||||
examIndex: 0
|
examIndex: 0,
|
||||||
|
scanInter:null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -115,12 +116,7 @@ export default {
|
|||||||
return this.$store.state.exam.totalTime - this.$store.state.exam.usedTime;
|
return this.$store.state.exam.totalTime - this.$store.state.exam.usedTime;
|
||||||
},
|
},
|
||||||
formatRemainTime() {
|
formatRemainTime() {
|
||||||
if (this.remainTime < 0) {
|
return this.remainTime >= 0 ? timeFormat(this.remainTime) : '';
|
||||||
this.$message.success(this.$t('display.exam.autoSubmit'));
|
|
||||||
this.submit();
|
|
||||||
}
|
|
||||||
|
|
||||||
return timeFormat(this.remainTime);
|
|
||||||
},
|
},
|
||||||
isFirst() {
|
isFirst() {
|
||||||
return this.examIndex == 0;
|
return this.examIndex == 0;
|
||||||
@ -129,8 +125,15 @@ export default {
|
|||||||
return this.examIndex == this.trainingList.length - 1;
|
return this.examIndex == this.trainingList.length - 1;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
watch: {
|
||||||
this.loadInitData();
|
'$store.state.map.mapViewLoadedCount': function() {
|
||||||
|
this.$store.dispatch('exam/stopCountTime');
|
||||||
|
this.loadInitData();
|
||||||
|
this.$store.dispatch('exam/countUsedTime');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.clearScanCommit();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
backList() {
|
backList() {
|
||||||
@ -170,13 +173,13 @@ export default {
|
|||||||
this.detailShow = false;
|
this.detailShow = false;
|
||||||
},
|
},
|
||||||
// 获取试题列表
|
// 获取试题列表
|
||||||
loadInitData() {
|
async loadInitData() {
|
||||||
// 刷新考试列表
|
// 刷新考试列表
|
||||||
refreshExamList(this.$route.query.userExamId).then(response => {
|
refreshExamList(this.$route.query.userExamId).then(response => {
|
||||||
this.examName = response.data.examName;
|
this.examName = response.data.examName;
|
||||||
this.$store.dispatch('exam/setUsedTime', response.data.usedTime);
|
this.$store.commit('exam/setUsedTime', response.data.usedTime);
|
||||||
this.$store.dispatch('exam/setTotalTime', response.data.duration);
|
this.$store.commit('exam/setTotalTime', response.data.duration);
|
||||||
this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { });
|
this.$store.commit('trainingList/setTrainingList', response.data.userExamQuestionsVOs);
|
||||||
const obj = {
|
const obj = {
|
||||||
trainingId: '',
|
trainingId: '',
|
||||||
id: ''
|
id: ''
|
||||||
@ -190,6 +193,7 @@ export default {
|
|||||||
obj.id = response.data.userExamQuestionsVOs[0].id;
|
obj.id = response.data.userExamQuestionsVOs[0].id;
|
||||||
}
|
}
|
||||||
this.selectedTraining(obj);
|
this.selectedTraining(obj);
|
||||||
|
this.scanCommit();
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
// 如果时50009则表示考试已完成,不能再次进行y
|
// 如果时50009则表示考试已完成,不能再次进行y
|
||||||
if (error.code === 500009) {
|
if (error.code === 500009) {
|
||||||
@ -199,9 +203,22 @@ export default {
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.shrink();
|
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() {
|
nextExam() {
|
||||||
const obj = {
|
const obj = {
|
||||||
trainingId: '',
|
trainingId: '',
|
||||||
|
@ -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"
|
||||||
|
@ -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(() => {
|
||||||
|
@ -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 }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-form ref="form" :model="newModel" label-width="140px" size="mini" :rules="rules" @submit.native.prevent>
|
<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-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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -35,7 +35,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="this.$t('planMonitor.runGraphName')+this.$t('global.colon')" prop="name">
|
<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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -91,8 +91,8 @@ export default {
|
|||||||
this.$message.success(this.$t('tip.runGraphNameModifiedSuccessfully'));
|
this.$message.success(this.$t('tip.runGraphNameModifiedSuccessfully'));
|
||||||
this.$emit('renewal');
|
this.$emit('renewal');
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}).catch(() => {
|
}).catch(error => {
|
||||||
this.$messageBox(this.$t('tip.modifyRunGraphNameFailed'));
|
this.$messageBox(this.$t('tip.modifyRunGraphNameFailed') + error.message);
|
||||||
this.doClose();
|
this.doClose();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -356,6 +356,7 @@ export default {
|
|||||||
this.PlanConvert = this.$theme.loadPlanConvert(lineCode);
|
this.PlanConvert = this.$theme.loadPlanConvert(lineCode);
|
||||||
|
|
||||||
const editData = this.$store.state.runPlan.editData[this.editModel.serviceNumber];
|
const editData = this.$store.state.runPlan.editData[this.editModel.serviceNumber];
|
||||||
|
debugger;
|
||||||
if (editData) {
|
if (editData) {
|
||||||
const tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex; });
|
const tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex; });
|
||||||
const trainInfo = editData.trainMap[tripNumberList[0]];
|
const trainInfo = editData.trainMap[tripNumberList[0]];
|
||||||
|
@ -27,6 +27,7 @@ import { getStationList, queryRunPlan } from '@/api/runplan';
|
|||||||
import {getRpDetailByUserMapId, getUserMapDetailByMapId} from '@/api/designPlatform';
|
import {getRpDetailByUserMapId, getUserMapDetailByMapId} from '@/api/designPlatform';
|
||||||
import { loadMapDataById } from '@/utils/loaddata';
|
import { loadMapDataById } from '@/utils/loaddata';
|
||||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||||
|
import {getMapDetail} from '@/api/jmap/mapdraft';
|
||||||
import DataTable from './menus/components/dataTable';
|
import DataTable from './menus/components/dataTable';
|
||||||
import echarts from 'echarts';
|
import echarts from 'echarts';
|
||||||
|
|
||||||
@ -373,13 +374,20 @@ export default {
|
|||||||
this.$store.dispatch('runPlan/clear').then(() => {
|
this.$store.dispatch('runPlan/clear').then(() => {
|
||||||
this.loadInitChart().then(() => {
|
this.loadInitChart().then(() => {
|
||||||
if (this.$route.query.mapId) {
|
if (this.$route.query.mapId) {
|
||||||
loadMapDataById(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 => {
|
getStationList(this.$route.query.mapId).then(resp => {
|
||||||
this.$store.dispatch('runPlan/setStations', resp.data).then(() => {
|
this.$store.dispatch('runPlan/setStations', resp.data).then(() => {
|
||||||
this.loadInitData();
|
this.loadInitData();
|
||||||
if (this.planId) {
|
if (this.planId) {
|
||||||
this.myChart && this.myChart.showLoading();
|
this.myChart && this.myChart.showLoading();
|
||||||
|
|
||||||
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
if (/^\/plan\/usertool/.test(this.$route.fullPath)) {
|
||||||
getRpDetailByUserMapId(this.planId).then(rest => {
|
getRpDetailByUserMapId(this.planId).then(rest => {
|
||||||
this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
|
this.$store.dispatch('runPlan/setPlanData', rest.data).then(() => {
|
||||||
|
@ -38,8 +38,8 @@ export default {
|
|||||||
const form = {
|
const form = {
|
||||||
labelWidth: '150px',
|
labelWidth: '150px',
|
||||||
items: [
|
items: [
|
||||||
{ prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text', required: true},
|
{ prop: 'name', label: this.$t('scriptRecord.scriptName'), type: 'text' },
|
||||||
{ prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea', required: true}
|
{ prop: 'description', label: this.$t('scriptRecord.scriptDescription'), type: 'textarea' }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
return form;
|
return form;
|
||||||
@ -47,18 +47,28 @@ export default {
|
|||||||
rules() {
|
rules() {
|
||||||
const crules = {
|
const crules = {
|
||||||
name: [
|
name: [
|
||||||
{ required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'blur' },
|
// { required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'blur' },
|
||||||
{ required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'change' }
|
// { required: true, message: this.$t('scriptRecord.inputScriptName'), trigger: 'change' }
|
||||||
],
|
{ validator: this.validateScriptName, trigger: 'blur' },
|
||||||
description:[
|
{ validator: this.validateScriptName, trigger: 'change' }
|
||||||
{ required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'blur' },
|
|
||||||
{ required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'change' }
|
|
||||||
]
|
]
|
||||||
|
// description:[
|
||||||
|
// { required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'blur' },
|
||||||
|
// { required: true, message: this.$t('scriptRecord.inputScriptDescription'), trigger: 'change' }
|
||||||
|
// ]
|
||||||
};
|
};
|
||||||
return crules;
|
return crules;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
doShow(questid) {
|
||||||
if (questid) {
|
if (questid) {
|
||||||
getQuestById(questid).then(resp=>{
|
getQuestById(questid).then(resp=>{
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<span> km/h</span>
|
<span> km/h</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('scriptRecord.signal')" class="conditionVO" prop="param.signal">
|
<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
|
<el-button
|
||||||
:type="field === 'selectSingalCode' ? 'danger' : 'primary'"
|
:type="field === 'selectSingalCode' ? 'danger' : 'primary'"
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -58,7 +58,8 @@ export default {
|
|||||||
{id:'NRM', name:'NRM'}
|
{id:'NRM', name:'NRM'}
|
||||||
],
|
],
|
||||||
field: '',
|
field: '',
|
||||||
fieldS:''
|
fieldS:'',
|
||||||
|
signalName:''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -84,7 +85,8 @@ export default {
|
|||||||
},
|
},
|
||||||
deviceSelect(em) {
|
deviceSelect(em) {
|
||||||
if (this.field.toUpperCase() === 'selectSingalCode'.toUpperCase() && em._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
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 = '';
|
this.field = '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -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">
|
||||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
<div class="joylink-card">
|
||||||
<span slot="footer" class="dialog-footer">
|
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||||
|
<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() {
|
|
||||||
if (this.type === 'ADD') {
|
|
||||||
return this.$t('system.createDirective');
|
|
||||||
} else {
|
|
||||||
return this.$t('system.editDirective');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted () {
|
||||||
|
this.loadInitData();
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
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>
|
||||||
|
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>
|
<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();
|
||||||
}
|
}
|
||||||
|
@ -83,6 +83,7 @@ module.exports = {
|
|||||||
'nprogress': 'NProgress',
|
'nprogress': 'NProgress',
|
||||||
'echarts': 'echarts',
|
'echarts': 'echarts',
|
||||||
'element-ui': 'ELEMENT'
|
'element-ui': 'ELEMENT'
|
||||||
|
// 'sockjs': 'sockjs'
|
||||||
};
|
};
|
||||||
|
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user