Merge remote-tracking branch 'remotes/origin/master' into dev
# Conflicts: # src/i18n/langs/en/map.js # src/i18n/langs/en/tip.js # src/i18n/langs/zh/map.js # src/i18n/langs/zh/rules.js # src/i18n/langs/zh/tip.js # src/utils/baseUrl.js # src/views/map/mapdraft/mapedit/routingoperate/detail.vue # src/views/map/mapdraft/mapedit/routingoperate/route.vue # src/views/map/mapdraft/mapedit/switchoperate/detail.vue
This commit is contained in:
commit
2598087dac
@ -1,17 +1,16 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 分页查找个人录制的仿真任务*/
|
||||
export function getQuestPageList(params) {
|
||||
/** 查找个人录制的仿真任务*/
|
||||
export function getQuestPageList(mapId) {
|
||||
return request({
|
||||
url: `/api/quest/paging`,
|
||||
method: 'get',
|
||||
params: params
|
||||
url: `/api/script/${mapId}/list`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 创建任务 */
|
||||
export function createQuest(data) {
|
||||
return request({
|
||||
url: `/api/quest`,
|
||||
url: `/api/script`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
@ -19,14 +18,14 @@ export function createQuest(data) {
|
||||
/** 根据任务id删除任务 */
|
||||
export function deleteQuest(id) {
|
||||
return request({
|
||||
url: `/api/quest/${id}`,
|
||||
url: `/api/script/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 根据id查询任务基础信息 */
|
||||
export function getQuestById(id) {
|
||||
return request({
|
||||
url: `/api/quest/${id}`,
|
||||
url: `/api/script/${id}/basic`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@ -40,15 +39,7 @@ export function getQuestByIdList(id) {
|
||||
/** 更新任务基本信息 */
|
||||
export function updateQuest(id, data) {
|
||||
return request({
|
||||
url: `/api/quest/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 更新任务地图定位信息 */
|
||||
export function updateMapLocation(id, data) {
|
||||
return request({
|
||||
url: `/api/quest/${id}/mapLocation`,
|
||||
url: `/api/script/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
|
@ -169,9 +169,9 @@ export function getEveryDayRunPlanData(group) {
|
||||
// }
|
||||
|
||||
/** 录制脚本仿真*/
|
||||
export function scriptRecordNotify(questId) {
|
||||
export function scriptRecordNotify(scriptId) {
|
||||
return request({
|
||||
url: `/api/simulation/questRecord/${questId}`,
|
||||
url: `/api/simulation/scriptWrite/${scriptId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@ -179,16 +179,33 @@ export function scriptRecordNotify(questId) {
|
||||
/** 保存剧本背景*/
|
||||
export function saveScriptScenes(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/scenes`,
|
||||
method: 'post'
|
||||
url: `/api/simulation/${group}/scriptWrite/scenes`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/** 保存录制任务数据*/
|
||||
export function saveScriptData(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord`,
|
||||
method: 'post'
|
||||
url: `/api/simulation/${group}/scriptWrite/saveData`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新任务地图定位信息*/
|
||||
export function updateMapLocation(group, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/mapLocation`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取剧本编制的所有成员角色*/
|
||||
export function getScriptMemberData(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/scriptWrite/members`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
@ -216,85 +233,110 @@ export function getDesignatedTimeTrainNum(params, group) {
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/** 根据成员角色查询设备列表*/
|
||||
export function getDevicesByRole(group, params) {
|
||||
/** 添加剧本动作 */
|
||||
export function addScriptAction(group, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/role/devices`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 获取任务录制的成员角色列表 */
|
||||
export function getMembersByGroup(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/members`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 添加任务角色成员 */
|
||||
export function postQuestMember(group, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/member`,
|
||||
url: `/api/simulation/${group}/scriptWrite/action`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除任务角色成员 */
|
||||
export function deleteQuestMember(group, memberId) {
|
||||
/** 删除剧本动作 */
|
||||
export function deleteScriptAction(group, actionId) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/member/${memberId}`,
|
||||
url: `/api/simulation/${group}/scriptWrite/action/${actionId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
// /** 添加/修改任务角色行为 */
|
||||
export function postMemberBehavior(group, memberId, data) {
|
||||
/** 修改剧本动作 */
|
||||
export function modifyScriptAction(group, actionId, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/${memberId}/behavior`,
|
||||
method: 'post',
|
||||
url: `/api/simulation/${group}/scriptWrite/action/${actionId}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 删除任务角色行为 */
|
||||
export function deleteMemberBehavior(group, memberId, behaviorId) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 删除任务角色行为动作 */
|
||||
export function deleteMemberBehaviorAction(group, memberId, behaviorId, actionId) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action/${actionId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 添加/修改任务角色行为动作 */
|
||||
export function postMemberBehaviorAction(group, memberId, behaviorId, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 添加/修改任务目标条件*/
|
||||
export function postTargetConditionAction(group, data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/targetCondition`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 删除任务目标条件*/
|
||||
export function deleteTargetConditionAction(group, tcId) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/targetCondition/${tcId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
// /** 根据成员角色查询设备列表*/
|
||||
// export function getDevicesByRole(group, params) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/role/devices`,
|
||||
// method: 'get',
|
||||
// params
|
||||
// });
|
||||
// }
|
||||
// /** 获取任务录制的成员角色列表 */
|
||||
// export function getMembersByGroup(group) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/members`,
|
||||
// method: 'get'
|
||||
// });
|
||||
// }
|
||||
|
||||
// /** 添加任务角色成员 */
|
||||
// export function postQuestMember(group, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/member`,
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
|
||||
// /** 删除任务角色成员 */
|
||||
// export function deleteQuestMember(group, memberId) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/member/${memberId}`,
|
||||
// method: 'delete'
|
||||
// });
|
||||
// }
|
||||
|
||||
// // /** 添加/修改任务角色行为 */
|
||||
// export function postMemberBehavior(group, memberId, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/${memberId}/behavior`,
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
// /** 删除任务角色行为 */
|
||||
// export function deleteMemberBehavior(group, memberId, behaviorId) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}`,
|
||||
// method: 'delete'
|
||||
// });
|
||||
// }
|
||||
// /** 删除任务角色行为动作 */
|
||||
// export function deleteMemberBehaviorAction(group, memberId, behaviorId, actionId) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action/${actionId}`,
|
||||
// method: 'delete'
|
||||
// });
|
||||
// }
|
||||
// /** 添加/修改任务角色行为动作 */
|
||||
// export function postMemberBehaviorAction(group, memberId, behaviorId, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/${memberId}/behavior/${behaviorId}/action`,
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
// /** 添加/修改任务目标条件*/
|
||||
// export function postTargetConditionAction(group, data) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/targetCondition`,
|
||||
// method: 'post',
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
// /** 删除任务目标条件*/
|
||||
// export function deleteTargetConditionAction(group, tcId) {
|
||||
// return request({
|
||||
// url: `/api/simulation/${group}/questRecord/targetCondition/${tcId}`,
|
||||
// method: 'delete'
|
||||
// });
|
||||
// }
|
||||
|
||||
/** 分页查询存在的仿真 */
|
||||
export function getExistingSimulation(params) {
|
||||
@ -320,18 +362,19 @@ export function getDeviceCodeByDeviceType(group, params) {
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 根据设备类型获取设备条件列表 */
|
||||
export function getDeviceCoditionByDeviceType(params) {
|
||||
// /** 根据设备类型获取设备条件列表 */
|
||||
// export function getDeviceCoditionByDeviceType(params) {
|
||||
// return request({
|
||||
// url: `/api/simulation/deviceType/conditions`,
|
||||
// method: 'get',
|
||||
// params
|
||||
// });
|
||||
// }
|
||||
|
||||
/** 获取任务录制的数据 */
|
||||
export function getScriptRecord(group) {
|
||||
return request({
|
||||
url: `/api/simulation/deviceType/conditions`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 获取任务录制的数据*/
|
||||
export function getQuestRecord(group) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord`,
|
||||
url: `/api/simulation/${group}/scriptWrite`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -12,6 +12,9 @@ export default {
|
||||
physicalView: '物理视图',
|
||||
mixedView: '混合视图',
|
||||
normal: '正常',
|
||||
add: '添加',
|
||||
are: '是',
|
||||
deny: '否',
|
||||
|
||||
save: '保存',
|
||||
updata: '更新',
|
||||
@ -20,6 +23,8 @@ export default {
|
||||
saveAs: '另存为',
|
||||
publish: '发布',
|
||||
deleteObj: '删除',
|
||||
remove: '移除',
|
||||
lastStep: '上一步',
|
||||
confirm: '确 定',
|
||||
cancel: '取 消',
|
||||
cancelledDelete: '已取消删除',
|
||||
@ -113,6 +118,7 @@ export default {
|
||||
compile: '编辑',
|
||||
delete: '删除',
|
||||
empty: '清空',
|
||||
reset: '重置',
|
||||
sectionName: '区段名称',
|
||||
sectionList: '区段列表',
|
||||
automaticSignal: '自动信号',
|
||||
@ -138,6 +144,7 @@ export default {
|
||||
countMax: '计数器最大值:',
|
||||
pointX: '坐标 x:',
|
||||
pointY: '坐标 y:',
|
||||
meter: '米',
|
||||
|
||||
code: '编码:',
|
||||
imageName: '图片名称:',
|
||||
@ -385,5 +392,151 @@ export default {
|
||||
linkWidthInputPrompt: 'Please enter a valid Link width',
|
||||
sectionWidthInput: 'Please enter section width',
|
||||
sectionWidthInputPrompt: 'Please enter a valid segment width',
|
||||
selectShowWatermark: 'Select whether or not to watermark'
|
||||
selectShowWatermark: 'Select whether or not to watermark',
|
||||
stationstandName: '选择车站名称:',
|
||||
stationstandDirection: '站台方向:',
|
||||
stationstandHasDoor: '是否显示屏蔽门:',
|
||||
stationstandNameColon: '站台名称:',
|
||||
stationstandTopBottom: '上下行方向:',
|
||||
stationstandShowName: '是否显示名称:',
|
||||
stationstandWidth: '宽度 w:',
|
||||
stationstandHeight: '高度 h:',
|
||||
stationstandPositionX: '坐标 x:',
|
||||
stationstandPositionY: '坐标 y:',
|
||||
|
||||
switchCode: '道岔编码:',
|
||||
switchName: '道岔名称:',
|
||||
switchNameC: '道岔名称',
|
||||
switchShowName: '是否显示道岔名称:',
|
||||
switchPositionX: '道岔名称x偏移量:',
|
||||
switchPositionY: '道岔名称y偏移量:',
|
||||
turnTime: '道岔时间:',
|
||||
timeoutShow: '是否显示道岔时间:',
|
||||
sectionACode: '关联的A Section Code:',
|
||||
sectionBCode: '关联的B Section Code:',
|
||||
sectionCCode: '关联的C Section Code:',
|
||||
switchTpX: '时间x坐标偏移量:',
|
||||
switchTpY: '时间y坐标偏移量:',
|
||||
|
||||
textCode: '文字编码:',
|
||||
textContent: '文本内容:',
|
||||
textFont: '字体格式:',
|
||||
textFontColor: '字体颜色:',
|
||||
|
||||
trainCode: '列车编号:',
|
||||
groupNumber: '车组号:',
|
||||
modelCode: '车类型:',
|
||||
|
||||
trainmodelCreate: '新建车类型',
|
||||
trainmodelUpdate: '更新列车模型',
|
||||
trainTypeName: '列车类型名称:',
|
||||
trainLength: '列车长度:',
|
||||
trainSafeDistance: '安全距离:',
|
||||
trainMaxSafeDistance: '最大安全距离:',
|
||||
averageVelocity: '平均速度:',
|
||||
averageDeceleration: '平均减速度:',
|
||||
defaultVelocity: '默认速度:',
|
||||
maxVelocity: '最大速度:',
|
||||
|
||||
trainWindowCode: '车次窗编码:',
|
||||
trainWindowWidth: '车次窗宽度:',
|
||||
trainWindowHeight: '车次窗高度:',
|
||||
trainWindowSectionCode: '关联区段:',
|
||||
|
||||
deleteTrainWindow: '一键删除车次窗',
|
||||
createTrainWindow: '一键创建车次窗',
|
||||
|
||||
zcCodeColon: '编码:',
|
||||
showZc: '是否可见:',
|
||||
|
||||
pathUnitList: '路径单元列表',
|
||||
startSectionCode: '始端停车点',
|
||||
endSectionCode: '终端停车点',
|
||||
pathUnitCode: '路径单元code',
|
||||
pathUnitMapName: '所属地图名称',
|
||||
orderNum: '优先级',
|
||||
pathName: '进路名称',
|
||||
affiliationStationCode: '所属车站名称',
|
||||
startingSignalName: '始端信号机名称',
|
||||
endingSignalName: '终端信号机名称',
|
||||
|
||||
routeID: '进路ID',
|
||||
routeName: '进路名称:',
|
||||
routeMapId: '所属地图名称',
|
||||
routeStationName: '所属车站名称',
|
||||
routeStartSignalCode: '始端信号机名称',
|
||||
routeEndSignalCode: '终端信号机名称',
|
||||
|
||||
startSectionCodeColon: '始端停车点:',
|
||||
endSectionCodeColon: '终端停车点:',
|
||||
|
||||
routePreview: '进路预览',
|
||||
accessType: '进路性质类型',
|
||||
automaticAccessType: '自动进路类型',
|
||||
nearSectionCode: '接近区段名称',
|
||||
continueProtectSwitchData: '延续保护道岔数据',
|
||||
accessSideTurnoutData: '进路侧防道岔数据',
|
||||
|
||||
turnBackRailName: '折返轨名称',
|
||||
routeSegmentData: '进路自动触发区段数据',
|
||||
routeProtectsData: '进路延续保护区段数据',
|
||||
accessPhysical: '进路物理区段数据',
|
||||
routeAccessScreenData: '进路屏蔽门数据',
|
||||
routeAccessTurnoutData: '进路道岔数据',
|
||||
hostileApproachData: '敌对进路数据',
|
||||
relation: '关系',
|
||||
associatedRoute: '关联进路:',
|
||||
|
||||
associatedHostileRecord: '关联敌对记录',
|
||||
routeArc: '是否自动追踪/联锁自动触发:',
|
||||
routeFlt: '是否车队/联锁自动进路:',
|
||||
delayUnlockingTime: '延时解锁时间:',
|
||||
accessTypeColon: '进路性质类型:',
|
||||
|
||||
automaticAccessTypeColon: '自动进路类型:',
|
||||
startSignalId: '始端信号机ID:',
|
||||
endSignalId: '终端信号机ID:',
|
||||
|
||||
switchType: '道岔类型',
|
||||
switchId: '道岔ID',
|
||||
accessSwitchList: '进路道岔数据:',
|
||||
accessStandList: '进路屏蔽门数据:',
|
||||
accessSectionList: '进路物理区段数据:',
|
||||
turnBackSectionCode: '折返轨ID:',
|
||||
routeFlankProtectionList: '侧防道岔数据:',
|
||||
routeOverlapSwitchList: '延续保护道岔数据:',
|
||||
routeOverlapSectionList: '进路延续保护区段数据:',
|
||||
routeTriggerSectionList: '进路自动触发区段数据:',
|
||||
nearSectionCodeColon: '接近区段ID:',
|
||||
|
||||
thenList: '交路列表',
|
||||
startStation: '起始站',
|
||||
endStation: '终到站',
|
||||
|
||||
routingCode: '交路code',
|
||||
routingName: '交路名称',
|
||||
startStationCodeColon: '起始站:',
|
||||
startStationCode: '起始站台',
|
||||
endStationCode: '终到站台',
|
||||
routingDirection: '方向',
|
||||
remarks: '描述',
|
||||
remarksColon: '描述:',
|
||||
trafficSegmentData: '交路区段数据:',
|
||||
startSectionColon: '起始区段:',
|
||||
endStationColon: '终到站:',
|
||||
endSectionColon: '终到区段:',
|
||||
|
||||
stationCodeClomn: '车站编码',
|
||||
blockCodingClomn: '区段编码',
|
||||
|
||||
routing: '交路',
|
||||
|
||||
linkageSwitchList: '联动道岔列表',
|
||||
|
||||
switchACode: '道岔1编号',
|
||||
switchBCode: '道岔2编号',
|
||||
|
||||
switchACodeNum: '道岔ID 1:',
|
||||
switchBCodeNum: '道岔ID 2:'
|
||||
|
||||
};
|
||||
|
@ -80,6 +80,68 @@ export default {
|
||||
stationControlJjzkContent: '请输入紧急站控内容',
|
||||
stationControlZzkContent: '请输入站中控内容',
|
||||
stationControlPositionX: '请输入坐标x',
|
||||
stationControlPositionY: '请输入坐标y'
|
||||
stationControlPositionY: '请输入坐标y',
|
||||
|
||||
pleaseReSelectDevice: '请重新选择设备',
|
||||
stationCode: '请选择关联车站',
|
||||
stationstandCountName: '请输入计数器名称',
|
||||
doorLocationType: '请选择站台方向',
|
||||
deviceStationCode: '请选择所属设备集中站',
|
||||
stationstandDirection: '请选择上下行方向',
|
||||
stationstandWidth: '请输入车站宽度',
|
||||
stationstandHeight: '请输入车站高度',
|
||||
stationstandPositionX: '请输入x坐标',
|
||||
stationstandPositionY: '请输入y坐标',
|
||||
|
||||
switchName: '请输入道岔名称',
|
||||
switchNamePointX: '请输入道岔名称坐标x',
|
||||
switchNamePointY: '请输入道岔名称坐标y',
|
||||
switchStationCode: '请输入设备集中站',
|
||||
switchTurnTime: '请输入道岔时间',
|
||||
switchTpX: '请输入时间坐标x',
|
||||
switchTpY: '请输入时间坐标y',
|
||||
|
||||
selectText: '请选择Text',
|
||||
pleaseEnterContent: '请输入内容',
|
||||
textFont: '请选择文字格式',
|
||||
textFontColor: '请选择文字颜色',
|
||||
pleaseEnterGroupNumber: '请输入车组号',
|
||||
selectTrainType: '请选择车类型',
|
||||
trainPositionX: '请输入x坐标位置',
|
||||
trainPositionY: '请输入y坐标位置',
|
||||
pleaseEnterTrainNumber: '请填写车组号',
|
||||
|
||||
trainCode: '列车模型Code不能为空',
|
||||
pleaseEnterTrainTypeName: '请输入列车类型名称',
|
||||
trainLength: '请输入列车长度',
|
||||
safeDistance: '请输入安全距离',
|
||||
maxSafeDistance: '请输入最大安全距离',
|
||||
averageVelocity: '请输入平均速度',
|
||||
averageDeceleration: '请输入平均减速度',
|
||||
defaultVelocity: '请输入默认速度',
|
||||
maxVelocity: '请输入最大速度',
|
||||
|
||||
trainWindowWidth: '请输入车次窗宽度',
|
||||
trainWindowHeight: '请输入车次窗高度',
|
||||
trainWindowSectionCode: '请输入关联区段',
|
||||
|
||||
visible: '请选择是否可见',
|
||||
pleaseSelectStartSignal: '请选择开始信号机',
|
||||
pleaseSelectEndSignal: '请选择结束信号机',
|
||||
|
||||
pleaseEnterPathName: '请输入进路名称',
|
||||
proximitySection: '请选择接近区段',
|
||||
accessPropertyType: '请选择进路性质类型',
|
||||
autoAccessType: '请选择自动进路类型',
|
||||
physicalSegmentData: '请选择进路物理区段数据',
|
||||
|
||||
routingName: '请输入交路名称',
|
||||
startStationCode: '请选择起始车站',
|
||||
startSectionCode: '请选择起始区段',
|
||||
endStationCode: '请选择终到车站',
|
||||
endSectionCode: '请选择终到区段',
|
||||
|
||||
selectTurnoutID: '请选择道岔ID',
|
||||
switchesCannot: '道岔不能为同一个'
|
||||
|
||||
};
|
||||
|
@ -10,15 +10,23 @@ export default {
|
||||
cancelGeneration: '已取消批量生成',
|
||||
|
||||
updateSuccessfully: '更新成功',
|
||||
saveSuccessfully: '保存成功',
|
||||
saveFailed: '保存失败',
|
||||
updateFailed: '更新失败',
|
||||
successfullyDelete: '删除成功',
|
||||
failDelete: '删除失败',
|
||||
operationAbnormal: '操作异常',
|
||||
createSuccess: '创建成功',
|
||||
|
||||
cannotCoincide: '起始坐标和结束坐标不能重合',
|
||||
cannotMerged: '存在非物理区段,不能合并',
|
||||
linkCannotMerged: '不在同一Link上的物理区段不能合并',
|
||||
|
||||
selectedSectionEmpty: '选择的区段为空',
|
||||
selectedStationEmpty: '选择的车站为空',
|
||||
|
||||
selectMap: '请先选择地图',
|
||||
selectTrainType: '请选择查看的列车模型',
|
||||
|
||||
stationFont: '车站字体',
|
||||
kilometerFont: '公里标字体',
|
||||
@ -48,6 +56,23 @@ export default {
|
||||
updateProductFailed: '更新产品失败',
|
||||
deleteProductSuccessfully: '删除产品成功',
|
||||
deleteProductFailed: '删除产品失败',
|
||||
cannotDeleteProduct: '产品已被使用无法删除'
|
||||
cannotDeleteProduct: '产品已被使用无法删除',
|
||||
|
||||
pleaseEnterNameQuery: '请输入名称查询',
|
||||
routeSameID: '相同ID的数据已存在',
|
||||
pathCreationSuccessful: '创建交路成功!',
|
||||
createRoutingFailed: '创建交路失败',
|
||||
pathUpdataSuccessful: '更新交路成功!',
|
||||
pathUpdataFailed: '更新交路失败',
|
||||
|
||||
failedLoadMap: '加载地图数据失败',
|
||||
sectionPointsDeficiency: '区段坐标缺失',
|
||||
|
||||
dataValidationFailed: '数据校验不通过',
|
||||
dataValidationSuccess: '数据校验通过!',
|
||||
|
||||
requestFailed: '请求失败',
|
||||
|
||||
dataQuestion: '有问题数据',
|
||||
dataList: '数据列表'
|
||||
};
|
||||
|
@ -120,6 +120,7 @@ export default {
|
||||
compile: '编辑',
|
||||
delete: '删除',
|
||||
empty: '清空',
|
||||
reset: '重置',
|
||||
sectionName: '区段名称',
|
||||
sectionList: '区段列表',
|
||||
automaticSignal: '自动信号',
|
||||
@ -325,6 +326,7 @@ export default {
|
||||
|
||||
switchCode: '道岔编码:',
|
||||
switchName: '道岔名称:',
|
||||
switchNameC: '道岔名称',
|
||||
switchShowName: '是否显示道岔名称:',
|
||||
switchPositionX: '道岔名称x偏移量:',
|
||||
switchPositionY: '道岔名称y偏移量:',
|
||||
@ -512,6 +514,31 @@ export default {
|
||||
linkWidthInputPrompt: '请输入有效Link宽度',
|
||||
sectionWidthInput: '请输入区段宽度',
|
||||
sectionWidthInputPrompt: '请输入有效区段宽度',
|
||||
selectShowWatermark: '请选择是否水印'
|
||||
selectShowWatermark: '请选择是否水印',
|
||||
routingCode: '交路code',
|
||||
routingName: '交路名称',
|
||||
startStationCodeColon: '起始站:',
|
||||
startStationCode: '起始站台',
|
||||
endStationCode: '终到站台',
|
||||
routingDirection: '方向',
|
||||
remarks: '描述',
|
||||
remarksColon: '描述:',
|
||||
trafficSegmentData: '交路区段数据:',
|
||||
startSectionColon: '起始区段:',
|
||||
endStationColon: '终到站:',
|
||||
endSectionColon: '终到区段:',
|
||||
|
||||
stationCodeClomn: '车站编码',
|
||||
blockCodingClomn: '区段编码',
|
||||
|
||||
routing: '交路',
|
||||
|
||||
linkageSwitchList: '联动道岔列表',
|
||||
|
||||
switchACode: '道岔1编号',
|
||||
switchBCode: '道岔2编号',
|
||||
|
||||
switchACodeNum: '道岔ID 1:',
|
||||
switchBCodeNum: '道岔ID 2:'
|
||||
|
||||
};
|
||||
|
@ -132,7 +132,16 @@ export default {
|
||||
pleaseEnterPathName: '请输入进路名称',
|
||||
proximitySection: '请选择接近区段',
|
||||
accessPropertyType: '请选择进路性质类型',
|
||||
autoRouteType: '请选择自动进路类型',
|
||||
physicalSegmentData: '请选择进路物理区段数据'
|
||||
autoAccessType: '请选择自动进路类型',
|
||||
physicalSegmentData: '请选择进路物理区段数据',
|
||||
|
||||
routingName: '请输入交路名称',
|
||||
startStationCode: '请选择起始车站',
|
||||
startSectionCode: '请选择起始区段',
|
||||
endStationCode: '请选择终到车站',
|
||||
endSectionCode: '请选择终到区段',
|
||||
|
||||
selectTurnoutID: '请选择道岔ID',
|
||||
switchesCannot: '道岔不能为同一个'
|
||||
|
||||
};
|
||||
|
@ -11,6 +11,7 @@ export default {
|
||||
|
||||
updateSuccessfully: '更新成功',
|
||||
saveSuccessfully: '保存成功',
|
||||
saveFailed: '保存失败',
|
||||
updateFailed: '更新失败',
|
||||
successfullyDelete: '删除成功',
|
||||
failDelete: '删除失败',
|
||||
@ -57,5 +58,20 @@ export default {
|
||||
updateProductFailed: '更新产品失败',
|
||||
deleteProductSuccessfully: '删除产品成功',
|
||||
deleteProductFailed: '删除产品失败',
|
||||
cannotDeleteProduct: '产品已被使用无法删除'
|
||||
cannotDeleteProduct: '产品已被使用无法删除',
|
||||
pathCreationSuccessful: '创建交路成功!',
|
||||
createRoutingFailed: '创建交路失败',
|
||||
pathUpdataSuccessful: '更新交路成功!',
|
||||
pathUpdataFailed: '更新交路失败',
|
||||
|
||||
failedLoadMap: '加载地图数据失败',
|
||||
sectionPointsDeficiency: '区段坐标缺失',
|
||||
|
||||
dataValidationFailed: '数据校验不通过',
|
||||
dataValidationSuccess: '数据校验通过!',
|
||||
|
||||
requestFailed: '请求失败',
|
||||
|
||||
dataQuestion: '有问题数据',
|
||||
dataList: '数据列表'
|
||||
};
|
||||
|
@ -36,7 +36,12 @@ import TrainingRuleList from '@/views/lesson/trainingRule/list';
|
||||
import TrainingRuleEdit from '@/views/lesson/trainingRule/detail/index';
|
||||
import Trainingmanage from '@/views/lesson/trainingmanage/index';
|
||||
import Lessoncategory from '@/views/lesson/lessoncategory/index';
|
||||
import Scriptmanage from '@/views/lesson/scriptmanage/list';
|
||||
// import Scriptmanage from '@/views/lesson/scriptmanage/list';
|
||||
|
||||
import Scriptmanage from '@/views/scriptManage/index';
|
||||
import ScriptmanageHome from '@/views/scriptManage/home';
|
||||
|
||||
import ScriptDetail from '@/views/scriptManage/detail/index';
|
||||
import Teach from '@/views/teach/index';
|
||||
import TeachHome from '@/views/teach/home';
|
||||
import TeachDetail from '@/views/teach/detail/index';
|
||||
@ -203,6 +208,10 @@ export const UrlConfig = {
|
||||
authorDraft: '/orderauthor/author/draft',
|
||||
transferDetail: '/orderauthor/transfer/detail',
|
||||
trainferPackage: '/orderauthor/transfer/package'
|
||||
},
|
||||
script: {
|
||||
prefix: '/script',
|
||||
detail: '/script/detail'
|
||||
}
|
||||
};
|
||||
|
||||
@ -445,11 +454,26 @@ export const asyncRouter = [
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'scriptManage',
|
||||
path: '',
|
||||
redirect: '/script/home',
|
||||
component: Scriptmanage,
|
||||
meta: {
|
||||
i18n: 'router.scriptManage'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
component: ScriptmanageHome,
|
||||
meta: {
|
||||
i18n: 'router.scriptManage'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'detail/:scriptId',
|
||||
component: ScriptDetail,
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -2,10 +2,10 @@
|
||||
export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
BASE_API = 'https://joylink.club/jlcloud';
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.4:9000' // 琰培
|
||||
} else {
|
||||
BASE_API = process.env.VUE_APP_BASE_API;
|
||||
|
@ -1,19 +1,29 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="modalData" ref="modalData" :rules="rules" label-width="80px" class="actionInfo" label-position="right">
|
||||
<el-form-item label="动作类型" class="conditionVO" prop="action.type">
|
||||
<el-select v-model="modalData.action.type " placeholder="请选择动作类型" @change="changeType" class="inputStyle">
|
||||
<el-option v-for="actionType in actionTypeList" :key="actionType.label" :label="actionType.label" :value="actionType.value"></el-option>
|
||||
<el-form :model="modalData" ref="modalData" :rules="rules" label-width="100px" class="actionInfo" label-position="right">
|
||||
<el-form-item label="主体角色" class="conditionVO" prop="actionVO.memberId">
|
||||
<el-select v-model="modalData.actionVO.memberId" placeholder="请选择主体角色">
|
||||
<el-option v-for="member in memberList" :key="member.id" :label="member.name" :value="member.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="完成时间" class="conditionVO">
|
||||
<el-input-number v-model="modalData.action.time " class="inputStyle" :min="0"></el-input-number>
|
||||
<el-input-number v-model="modalData.actionVO.time " class="inputStyle" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="回复消息" class="conditionVO" prop="action.reply" v-if="isConversitionAdd">
|
||||
<el-input v-model="modalData.action.reply" type="textarea" class="textareaStyle" rows="3"></el-input>
|
||||
<el-form-item label="动作类型" class="conditionVO" prop="actionVO.type">
|
||||
<el-select v-model="modalData.actionVO.type " placeholder="请选择动作类型" @change="changeType">
|
||||
<el-option v-for="actionType in actionTypeList" :key="actionType.label" :label="actionType.label" :value="actionType.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备指令" class="conditionVO" prop="action.deviceCommand" v-if="isCommandAdd">
|
||||
<el-select v-model="modalData.action.deviceCommand " placeholder="请选择设备指令" @change="changeCommand" class="inputStyle">
|
||||
<el-form-item label="目标角色" class="conditionVO" prop="actionVO.targetId" v-if="isConversitionAdd">
|
||||
<el-select v-model="modalData.actionVO.targetId" placeholder="请选择目标角色">
|
||||
<el-option v-for="member in memberList" :key="member.id" :label="member.name" :value="member.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="回复消息" class="conditionVO" prop="actionVO.reply" v-if="isConversitionAdd">
|
||||
<el-input v-model="modalData.actionVO.reply" type="textarea" class="textareaStyle" rows="3"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备指令" class="conditionVO" prop="actionVO.type" v-if="isCommandAdd">
|
||||
<el-select v-model="modalData.actionVO.deviceCommand " placeholder="请选择设备指令" @change="changeCommand" class="inputStyle">
|
||||
<el-option v-for="deviceCommand in deviceCommandList" :key="deviceCommand.deviceCommand" :label="deviceCommand.label" :value="deviceCommand.deviceCommand"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -27,10 +37,8 @@
|
||||
<el-option v-for="station in stationList" :key="station.code" :label="station.name" :value="station.code"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <command-Form :commandParam="form" :commandParamModal="formModel" :rules="commandRules"></command-Form> -->
|
||||
<!-- <div id="commandParam"></div> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="addQuestAction('modalData')">{{buttonName}}</el-button>
|
||||
<el-button type="primary" @click="addScriptActionInfo('modalData')">{{buttonName}}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@ -39,7 +47,7 @@
|
||||
import Vue from 'vue';
|
||||
import DeviceTypeDic from '@/scripts/DeviceTypeDic';
|
||||
// import CommandForm from "./commandForm";
|
||||
import {postMemberBehaviorAction,getAvailableDeviceCommand,getDeviceCodeByDeviceType} from '@/api/simulation';
|
||||
import {addScriptAction,modifyScriptAction,getAvailableDeviceCommand,getDeviceCodeByDeviceType,getScriptMemberData} from '@/api/simulation';
|
||||
export default {
|
||||
name: 'addAction',
|
||||
props: {
|
||||
@ -47,14 +55,6 @@
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
memberId:{
|
||||
type:String,
|
||||
required: true
|
||||
},
|
||||
behaviorId:{
|
||||
type:String,
|
||||
required: true
|
||||
},
|
||||
buttonName:{
|
||||
type:String,
|
||||
required: true
|
||||
@ -70,33 +70,37 @@
|
||||
data() {
|
||||
return {
|
||||
modalData:{
|
||||
action:{
|
||||
reply:"",
|
||||
actionVO:{
|
||||
memberId:"",
|
||||
targetId:"",
|
||||
time:0,
|
||||
reply:"",
|
||||
type:"Conversation",
|
||||
deviceCommand:null,
|
||||
// deviceCommand:"",
|
||||
commandParamList:[]
|
||||
},
|
||||
param:{
|
||||
startStation:"",
|
||||
endStation:"",
|
||||
}
|
||||
},
|
||||
},
|
||||
actionTypeList:DeviceTypeDic.ConstSelect.actionType,
|
||||
isConversitionAdd:true,
|
||||
isCommandAdd:false,
|
||||
deviceCommandList:[],
|
||||
actionTypeList:DeviceTypeDic.ConstSelect.actionType,
|
||||
isJinLu:false,
|
||||
stationList:[],
|
||||
memberList:[],
|
||||
deviceCommandList:[],
|
||||
rules:{
|
||||
action:{
|
||||
reply: [
|
||||
actionVO:{
|
||||
memberId:[
|
||||
{ required: true, message: '请选择主体角色', trigger: 'change' }
|
||||
],
|
||||
reply:[
|
||||
{ required: true, message: '请输入回复消息', trigger: 'blur' }
|
||||
],
|
||||
type:[
|
||||
{ required: true, message: '请选择角色类型', trigger: 'change' }
|
||||
],
|
||||
deviceCommand:[
|
||||
{ required: true, message: '请选择设备指令', trigger: 'change' }
|
||||
targetId:[
|
||||
{ required: true, message: '请选择目标角色', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
param:{
|
||||
@ -107,106 +111,85 @@
|
||||
{ required: true, message: '请选择终点站台', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
},
|
||||
commandRules:{},
|
||||
formModel:{},
|
||||
form:{},
|
||||
isJinLu:false,
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.initData();
|
||||
},
|
||||
methods:{
|
||||
addQuestAction(formName){
|
||||
initData(){
|
||||
getScriptMemberData(this.group).then(resp => {
|
||||
this.memberList=resp.data;
|
||||
getAvailableDeviceCommand().then(response=>{
|
||||
this.deviceCommandList=response.data;
|
||||
this.getDeviceCode();
|
||||
});
|
||||
}).catch(error => {})
|
||||
},
|
||||
getDeviceCode(){
|
||||
let params = {deviceType:"StationStand"};
|
||||
let group=this.group;
|
||||
getDeviceCodeByDeviceType(group,params).then(response =>{
|
||||
// debugger;
|
||||
let resultData=response.data;
|
||||
resultData=JSON.parse(JSON.stringify(response.data).replace(/groupNumber/g,"name"));
|
||||
this.stationList=resultData;
|
||||
})
|
||||
},
|
||||
addScriptActionInfo(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let group=this.$props.group;
|
||||
let memberId=this.$props.memberId;
|
||||
let behaviorId=this.$props.behaviorId;
|
||||
if(this.modalData.action.deviceCommand==null){
|
||||
delete this.modalData.action.deviceCommand;
|
||||
let group=this.group;
|
||||
if(this.modalData.actionVO.deviceCommand==""){
|
||||
delete this.modalData.actionVO.deviceCommand;
|
||||
}
|
||||
if(this.modalData.action.deviceCommand=="Train_Manual_Route_Blocking_Drive")
|
||||
{this.modalData.action.commandParamList=[this.modalData.param.startStation,this.modalData.param.endStation];}
|
||||
let data=this.modalData.action;
|
||||
if(this.modalData.actionVO.deviceCommand=="Train_Manual_Route_Blocking_Drive")
|
||||
{this.modalData.actionVO.commandParamList=[this.modalData.param.startStation,this.modalData.param.endStation];}
|
||||
let data=this.modalData.actionVO;
|
||||
let obj=this;
|
||||
postMemberBehaviorAction(group,memberId,behaviorId,data).then(response=>{
|
||||
delete this.modalData.action.id;
|
||||
obj.modalData.action.type="Conversation";
|
||||
obj.modalData.action.time=0;
|
||||
obj.modalData.action.reply="";
|
||||
obj.modalData.param.startStation="";
|
||||
obj.isConversitionAdd=true;
|
||||
obj.isCommandAdd=false;
|
||||
obj.isJinLu=false;
|
||||
obj.modalData.action.deviceCommand=null;
|
||||
this.modalData.param.endStation="";
|
||||
|
||||
if(this.$props.operateType=="add")
|
||||
{
|
||||
addScriptAction(group,data).then(response=>{
|
||||
this.initActionData();
|
||||
this.$message.success('添加动作成功');
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$emit('modifyButtonName');
|
||||
this.$message.success('修改动作成功');
|
||||
}
|
||||
this.$emit('create');
|
||||
}).catch(error => {
|
||||
if(this.$props.operateType=="add")
|
||||
{
|
||||
this.$messageBox(`添加动作失败: ${error.message}`);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
let actionId=this.modalData.actionVO.id;
|
||||
modifyScriptAction(group,actionId,data).then(response=>{
|
||||
this.initActionData();
|
||||
this.$emit('modifyButtonName');
|
||||
this.$message.success('修改动作成功');
|
||||
this.$emit('create');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`修改动作失败: ${error.message}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
initData(){
|
||||
getAvailableDeviceCommand().then(response=>{
|
||||
this.deviceCommandList=response.data;
|
||||
});
|
||||
let params = {deviceType:"StationStand"};
|
||||
let group=this.$props.group;
|
||||
getDeviceCodeByDeviceType(group,params).then(response =>{
|
||||
let resultData=response.data;
|
||||
resultData=JSON.parse(JSON.stringify(response.data).replace(/groupNumber/g,"name"));
|
||||
this.stationList=resultData;
|
||||
})
|
||||
},
|
||||
changeCommand(index){
|
||||
switch(index)
|
||||
{
|
||||
case "Train_Manual_Route_Blocking_Drive":{
|
||||
this.isJinLu=true;
|
||||
this.initData();
|
||||
// this.form={
|
||||
// labelWidth:'100px',
|
||||
// items: [
|
||||
// { prop: 'startStation', label: '起始车站', type: 'select', required: false, change: true },
|
||||
// ]
|
||||
// };
|
||||
// this.formModel={
|
||||
// startStation:"",
|
||||
// };
|
||||
// const cfConstructor = Vue.component(CommandForm);
|
||||
// const instance = new cfConstructor({}).$mount('#commandParam');
|
||||
// instance.$mount('#commandParam');
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
initActionData(){
|
||||
this.modalData.actionVO.memberId="";
|
||||
this.modalData.actionVO.targetId="";
|
||||
this.modalData.actionVO.type="Conversation";
|
||||
this.modalData.actionVO.time=0;
|
||||
this.modalData.actionVO.reply="";
|
||||
this.modalData.param.startStation="";
|
||||
this.isConversitionAdd=true;
|
||||
this.isCommandAdd=false;
|
||||
this.isJinLu=false;
|
||||
this.initData();
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.modalData.actionVO.deviceCommand=null;
|
||||
this.modalData.param.endStation="";
|
||||
},
|
||||
changeType(index){
|
||||
switch(index)
|
||||
@ -214,11 +197,21 @@
|
||||
case "Conversation":{
|
||||
this.isConversitionAdd=true;
|
||||
this.isCommandAdd=false;
|
||||
this.isJinLu=false;
|
||||
break;
|
||||
}
|
||||
case "Command":{
|
||||
this.isConversitionAdd=false;
|
||||
this.isCommandAdd=true;
|
||||
//
|
||||
if(this.modalData.actionVO.deviceCommand=="Train_Manual_Route_Blocking_Drive")
|
||||
{
|
||||
this.isJinLu=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.isJinLu=false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
@ -226,26 +219,43 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
changeCommand(index){
|
||||
switch(index)
|
||||
{
|
||||
case "Train_Manual_Route_Blocking_Drive":{
|
||||
this.isJinLu=true;
|
||||
this.getDeviceCode();
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
this.isJinLu=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
doShow(data){
|
||||
if(data)
|
||||
{
|
||||
// debugger;
|
||||
this.initData();
|
||||
this.modalData.action.id=data.id;
|
||||
this.modalData.action.type=data.type;
|
||||
this.modalData.action.time=data.time;
|
||||
this.modalData.actionVO.id=data.id;
|
||||
this.modalData.actionVO.memberId=data.memberId;
|
||||
this.modalData.actionVO.type=data.type;
|
||||
this.modalData.actionVO.time=data.time;
|
||||
if(data.type=="Conversation")
|
||||
{
|
||||
this.modalData.actionVO.targetId=data.targetId;
|
||||
this.isConversitionAdd=true;
|
||||
this.isCommandAdd=false;
|
||||
this.modalData.action.reply=data.reply;
|
||||
this.modalData.actionVO.reply=data.reply;
|
||||
}
|
||||
else if(data.type=="Command")
|
||||
{
|
||||
this.isConversitionAdd=false;
|
||||
this.isCommandAdd=true;
|
||||
this.modalData.action.reply="";
|
||||
this.modalData.action.deviceCommand=data.deviceCommand;
|
||||
if(this.modalData.action.deviceCommand=="Train_Manual_Route_Blocking_Drive")
|
||||
this.modalData.actionVO.reply="";
|
||||
this.modalData.actionVO.deviceCommand=data.deviceCommand;
|
||||
if(this.modalData.actionVO.deviceCommand=="Train_Manual_Route_Blocking_Drive")
|
||||
{
|
||||
this.isJinLu=true;
|
||||
this.modalData.param.startStation=data.commandParamList[0];
|
||||
|
@ -1,12 +1,11 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="actionList">
|
||||
<i class="el-icon-back" @click="backToMember"></i>
|
||||
<span class="titleStyle">{{memberName}}角色<span class="titleStyle">/</span><span class="titleStyle">{{behaviorName}}行为</span><span class="titleStyle">/</span><span class="titleStyle">动作信息</span></span>
|
||||
<span class="titleStyle">添加剧本动作</span>
|
||||
</div>
|
||||
<div class="tab-pane-big">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar">
|
||||
<add-action ref="addBehavior" :group="group" :memberId="memberId" :behaviorId="behaviorId" @create="create" :buttonName="buttonName" :operateType="operateType" @modifyButtonName="modifyButtonName"></add-action>
|
||||
<add-action ref="addBehavior" :group="group" @create="create" :buttonName="buttonName" :operateType="operateType" @modifyButtonName="modifyButtonName"></add-action>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="actionList" border class="actionListTable">
|
||||
@ -32,7 +31,7 @@
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import AddAction from './addAction';
|
||||
import {getQuestRecord,deleteMemberBehaviorAction} from '@/api/simulation';
|
||||
import {getScriptRecord,deleteScriptAction} from '@/api/simulation';
|
||||
export default {
|
||||
name: 'getAction',
|
||||
props: {
|
||||
@ -40,14 +39,6 @@
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
memberId:{
|
||||
type:String,
|
||||
required: true
|
||||
},
|
||||
behaviorId:{
|
||||
type:String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -64,29 +55,25 @@
|
||||
},
|
||||
mounted(){
|
||||
this.loadInitData(this.$route.query);
|
||||
this.memberName=this.$store.state.scriptRecord.memberName;
|
||||
this.behaviorName=this.$store.state.scriptRecord.behaviorName;
|
||||
// this.memberName=this.$store.state.scriptRecord.memberName;
|
||||
// this.behaviorName=this.$store.state.scriptRecord.behaviorName;
|
||||
},
|
||||
methods:{
|
||||
loadInitData(obj) {
|
||||
let group=obj.group;
|
||||
let memberId=this.$props.memberId;
|
||||
let behaviorId=this.$props.behaviorId;
|
||||
getQuestRecord(group).then(response=>{
|
||||
let datalist=response.data.memberVOList;
|
||||
let behaviorList=datalist.find(elem=>{return elem.id==memberId}).behaviorVOList;
|
||||
this.actionList=behaviorList.find(elem=>{return elem.id==behaviorId}).actionVOList;
|
||||
getScriptRecord(group).then(response=>{
|
||||
this.actionList=response.data.actionVOList;
|
||||
if(response.data.mapLocation)
|
||||
{
|
||||
let mapLocation={"offsetX":response.data.mapLocation.x,"offsetY":response.data.mapLocation.y,"scaleRate":response.data.mapLocation.scale};
|
||||
this.$store.dispatch('scriptRecord/updateMapLocation', mapLocation);
|
||||
}
|
||||
this.loading=false;
|
||||
});
|
||||
},
|
||||
backToMember:function(){
|
||||
this.$emit('backToBehavior');
|
||||
},
|
||||
deleteAction(row){
|
||||
let group=this.$props.group;
|
||||
let memberId=this.$props.memberId;
|
||||
let behaviorId=this.$props.behaviorId;
|
||||
deleteMemberBehaviorAction(group,memberId,behaviorId,row.id).then(resp => {
|
||||
deleteScriptAction(group,row.id).then(resp => {
|
||||
this.reloadTable();
|
||||
this.$message.success('删除行为动作成功');
|
||||
}).catch(error => {
|
||||
|
@ -10,15 +10,9 @@
|
||||
</div>
|
||||
<div class="tip-body-box" ref="dragBody">
|
||||
<div class="tip-body">
|
||||
<template v-if="displayType=='role'">
|
||||
<role-condition-script :group="group" @getBehaviorList="getBehaviorList"></role-condition-script>
|
||||
</template>
|
||||
<template v-if="displayType=='behavior'">
|
||||
<get-behavior ref="getBehavior" :group="group" :memberId="memberId" @backToMember="backToMember" @getActions="getActions"></get-behavior>
|
||||
</template>
|
||||
<template v-if="displayType=='action'">
|
||||
<get-action ref="getAction" :group="group" :memberId="memberId" :behaviorId="behaviorId" @backToBehavior="backToBehavior"></get-action>
|
||||
</template>
|
||||
<div>
|
||||
<get-action ref="getAction" :group="group"></get-action>
|
||||
</div>
|
||||
<el-button-group class="button-group">
|
||||
<el-button type="primary" @click="saveMaplocation">{{$t('scriptRecord.saveMaplocation')}}</el-button>
|
||||
<el-button type="primary" @click="saveScenesStage">{{$t('scriptRecord.saveBackground')}}</el-button>
|
||||
@ -32,13 +26,9 @@
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import GetBehavior from './scriptRecord/getBehavior';
|
||||
import GetAction from './scriptRecord/getAction';
|
||||
import RoleConditionScript from './scriptRecord/roleConditionScript';
|
||||
|
||||
import { launchFullscreen, exitFullscreen } from '@/utils/screen';
|
||||
import {saveScriptScenes, saveScriptData, dumpScriptData} from '@/api/simulation';
|
||||
import {updateMapLocation} from '@/api/quest';
|
||||
import {saveScriptScenes, saveScriptData, dumpScriptData,updateMapLocation} from '@/api/simulation';
|
||||
|
||||
export default {
|
||||
name: 'TipScriptRecord',
|
||||
@ -49,17 +39,13 @@
|
||||
},
|
||||
},
|
||||
components: {
|
||||
GetBehavior,
|
||||
GetAction,
|
||||
RoleConditionScript,
|
||||
},
|
||||
// this.$t('scriptRecord.scriptTitle')
|
||||
data() {
|
||||
return {
|
||||
title: this.$t('scriptRecord.scriptTitle'),
|
||||
title:"剧本编制",
|
||||
isShrink: false,
|
||||
memberId:null,
|
||||
behaviorId:null,
|
||||
displayType:"role",
|
||||
mapLocation:{},
|
||||
// isSaveStage: true,
|
||||
}
|
||||
@ -90,17 +76,11 @@
|
||||
this.isShrink = true;
|
||||
}
|
||||
},
|
||||
backToMember(){
|
||||
this.displayType="role";
|
||||
},
|
||||
backToBehavior(){
|
||||
this.displayType="behavior";
|
||||
},
|
||||
getActions(row){
|
||||
this.displayType="action";
|
||||
this.behaviorId=row.id;
|
||||
this.$store.dispatch('scriptRecord/updateBehaviorName',row.description);
|
||||
},
|
||||
// getActions(row){
|
||||
// this.displayType="action";
|
||||
// this.behaviorId=row.id;
|
||||
// this.$store.dispatch('scriptRecord/updateBehaviorName',row.description);
|
||||
// },
|
||||
saveScenesStage() {
|
||||
saveScriptScenes(this.group).then(resp => {
|
||||
// this.isSaveStage = false;
|
||||
@ -130,16 +110,12 @@
|
||||
})
|
||||
}).catch(error => { })
|
||||
},
|
||||
getBehaviorList(id){
|
||||
this.displayType="behavior";
|
||||
this.memberId=id;
|
||||
},
|
||||
saveMaplocation()
|
||||
{
|
||||
let data=Vue.prototype.$jlmap.$options;
|
||||
let scriptId=this.$route.query.scriptId;
|
||||
let group=this.$route.query.group;
|
||||
let dataZoom={scale:data.scaleRate,x:data.offsetX,y:data.offsetY};
|
||||
updateMapLocation(scriptId,dataZoom).then(response=>{
|
||||
updateMapLocation(group,dataZoom).then(response=>{
|
||||
this.$message.success('更新定位成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`更新定位失败: ${error.message}`);
|
||||
@ -200,7 +176,21 @@
|
||||
margin-left: 20px;
|
||||
float:right;
|
||||
}
|
||||
|
||||
.actionInfo{
|
||||
margin-top:30px;
|
||||
}
|
||||
.conditionVO{
|
||||
width:400px;
|
||||
}
|
||||
.actionList{
|
||||
margin-top: 10px;
|
||||
margin-left: 5px;
|
||||
font-size: 15px;
|
||||
margin-bottom:10px;
|
||||
}
|
||||
.titleStyle{
|
||||
margin-left:10px;
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
|
@ -112,7 +112,7 @@ export default {
|
||||
viewDraft: 'draft',
|
||||
autoSaveTask: null,
|
||||
selected: null,
|
||||
mapInfo: { name: '请选择地图' },
|
||||
mapInfo: { name: this.$t('map.pleaseSelectMap') },
|
||||
timeDemon: null
|
||||
};
|
||||
},
|
||||
@ -157,7 +157,7 @@ export default {
|
||||
loadInitPage() {
|
||||
this.$store.dispatch('training/changeMode', { mode: TrainingMode.MAP_EDIT });
|
||||
this.viewDraft = this.$route.params.view;
|
||||
this.mapInfo = { name: '请选择地图', id: this.$route.params.mapId };
|
||||
this.mapInfo = { name: this.$t('map.pleaseSelectMap'), id: this.$route.params.mapId };
|
||||
if (parseInt(this.mapInfo.id)) {
|
||||
this.mapInfo.name = this.$route.query.name;
|
||||
getMapDetail(this.$route.params.mapId).then(response => {
|
||||
@ -165,7 +165,7 @@ export default {
|
||||
this.setDelayUnlockStatus(response.data, '00');
|
||||
this.initAutoSaveTask();
|
||||
}).catch(() => {
|
||||
this.$messageBox('加载地图数据失败');
|
||||
this.$messageBox(this.$t('tip.failedLoadMap'));
|
||||
this.endViewLoading();
|
||||
});
|
||||
} else {
|
||||
@ -256,12 +256,12 @@ export default {
|
||||
if (map.sectionList[i].points.length > 0) {
|
||||
for (let index = 0; index < map.sectionList[i].points.length; index++) {
|
||||
if (String(map.sectionList[i].points[index].x) == 'undefined' || String(map.sectionList[i].points[index].y) == 'undefined') {
|
||||
this.$messageBox('区段坐标缺失');
|
||||
this.$messageBox(this.$t('tip.sectionPointsDeficiency'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$messageBox('区段坐标缺失');
|
||||
this.$messageBox(this.$t('tip.sectionPointsDeficiency'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -269,12 +269,12 @@ export default {
|
||||
this.mapSaveing = true;
|
||||
this.$store.dispatch('map/saveMapDeviceDefaultRelations').then(() => {
|
||||
saveMap(Object.assign(map, { mapId: this.$route.params.mapId })).then(response => {
|
||||
this.$message.success('保存成功');
|
||||
this.$message.success(this.$t('tip.saveSuccessfully'));
|
||||
this.mapSaveing = false;
|
||||
this.initAutoSaveTask();
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
this.$messageBox('保存失败');
|
||||
this.$messageBox(this.$t('tip.saveFailed'));
|
||||
this.mapSaveing = false;
|
||||
if (error.code === 40004 || error.code === 40005 || error.code === 40003) {
|
||||
this.clearAutoSave();
|
||||
@ -293,12 +293,12 @@ export default {
|
||||
verifyMap(this.$route.params.mapId).then(res => {
|
||||
if (res.data.length) {
|
||||
this.tableToExcel(res.data);
|
||||
this.$messageBox('数据校验不通过');
|
||||
this.$messageBox(this.$t('tip.dataValidationFailed'));
|
||||
} else {
|
||||
this.$message.success('数据校验通过!');
|
||||
this.$message.success(this.$t('tip.dataValidationSuccess'));
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$messageBox('请求失败');
|
||||
this.$messageBox(this.$t('tip.requestFailed'));
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -312,7 +312,7 @@ export default {
|
||||
});
|
||||
const dataList = this.formatJson(filterVal, arr);
|
||||
import('@/utils/Export2Excel').then(excel => {
|
||||
excel.export_json_to_excel(['有问题数据'], dataList, '数据列表');
|
||||
excel.export_json_to_excel([this.$t('tip.dataQuestion')], dataList, this.$t('tip.dataList'));
|
||||
});
|
||||
},
|
||||
formatJson(filterVal, jsonData) {
|
||||
|
@ -65,62 +65,58 @@ export default {
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '交路code',
|
||||
title: this.$t('map.routingCode'),
|
||||
prop: 'code'
|
||||
},
|
||||
{
|
||||
title: '起始站',
|
||||
title: this.$t('map.startStation'),
|
||||
prop: 'startStationCode'
|
||||
|
||||
},
|
||||
{
|
||||
title: '起始站台',
|
||||
title: this.$t('map.startStationCode'),
|
||||
prop: 'startSectionCode'
|
||||
},
|
||||
{
|
||||
title: '终到站',
|
||||
title: this.$t('map.endStation'),
|
||||
prop: 'endStationCode'
|
||||
},
|
||||
{
|
||||
title: '终到站台',
|
||||
title: this.$t('map.endStationCode'),
|
||||
prop: 'endSectionCode'
|
||||
},
|
||||
{
|
||||
title: '方向',
|
||||
title: this.$t('map.routingDirection'),
|
||||
prop: 'directionCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.directionCode, 'DirectionCodeList'); },
|
||||
tagType: (row) => { if (row.directionCode === '0') { return 'primary'; } else { return 'success'; } }
|
||||
},
|
||||
{
|
||||
title: '目的地码',
|
||||
prop: 'destinationCode'
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
title: this.$t('map.remarks'),
|
||||
prop: 'remarks'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '区段数据',
|
||||
title: this.$t('map.sectionData'),
|
||||
buttons: [
|
||||
{
|
||||
name: '预览',
|
||||
name: this.$t('map.preview'),
|
||||
handleClick: this.sectionDetail
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
title: this.$t('map.operation'),
|
||||
width: '200',
|
||||
buttons: [
|
||||
{
|
||||
name: '编辑',
|
||||
name: this.$t('map.compile'),
|
||||
handleClick: this.editObj
|
||||
},
|
||||
{
|
||||
name: '删除',
|
||||
name: this.$t('map.delete'),
|
||||
handleClick: this.deleteObj,
|
||||
type: 'danger'
|
||||
}
|
||||
@ -206,10 +202,10 @@ export default {
|
||||
if (this.mapInfo && this.mapInfo.id && row) {
|
||||
// 删除
|
||||
deleteRouting(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.$message.success(this.$t('map.successfullyDelete'));
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.$messageBox('删除失败');
|
||||
this.$messageBox(this.$t('map.failDelete'));
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -228,13 +224,13 @@ export default {
|
||||
model: {
|
||||
field: 'routingSectionList',
|
||||
items: [
|
||||
{ prop: 'stationCode', label: '车站编码', type: 'text' },
|
||||
{ prop: 'stationCode', label: this.$t('map.stationCodeClomn'), type: 'text' },
|
||||
{
|
||||
prop: 'stationCode', label: '区段名称', type: 'select', options: stationDict
|
||||
prop: 'stationCode', label: this.$t('map.sectionName'), type: 'select', options: stationDict
|
||||
},
|
||||
{ prop: 'sectionCode', label: '区段编码', type: 'text' },
|
||||
{ prop: 'sectionCode', label: this.$t('map.blockCodingClomn'), type: 'text' },
|
||||
{
|
||||
prop: 'sectionCode', label: '区段名称', type: 'select', options: sectionDict
|
||||
prop: 'sectionCode', label: this.$t('map.sectionName'), type: 'select', options: sectionDict
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -4,16 +4,16 @@
|
||||
<el-card>
|
||||
<div slot="header" class="clearfix">
|
||||
<span>
|
||||
地图名称:
|
||||
{{ $t('map.mapName') }}
|
||||
<b>{{ mapInfo.name }}</b>
|
||||
</span>
|
||||
<el-button type="text" style="float: right; padding: 3px 3px" @click="previewRouteEvent">预览
|
||||
<el-button type="text" style="float: right; padding: 3px 3px" @click="previewRouteEvent">{{ $t('map.preview') }}
|
||||
</el-button>
|
||||
<el-button type="text" style="float: right; padding: 3px 3px" @click="createRouteEvent">新建
|
||||
<el-button type="text" style="float: right; padding: 3px 3px" @click="createRouteEvent">{{ $t('map.newConstruction') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<el-tabs v-model="enabledTab" type="card">
|
||||
<el-tab-pane label="交路" name="Route">
|
||||
<el-tab-pane :label="$t('map.routing')" name="Route">
|
||||
<route-draft
|
||||
ref="routeEdit"
|
||||
:selected="selected"
|
||||
|
@ -3,10 +3,10 @@
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<el-form ref="form" :model="addModel" :rules="rules" label-width="120px" size="mini">
|
||||
<div class="definition">
|
||||
<el-form-item label="交路名称" prop="name">
|
||||
<el-form-item :label="$t('map.routingName')" prop="name">
|
||||
<el-input v-model="addModel.name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="起始站:" prop="startStationCode">
|
||||
<el-form-item :label="$t('map.startStationCodeColon')" prop="startStationCode">
|
||||
<el-select v-model="addModel.startStationCode" clearable :filterable="true">
|
||||
<el-option
|
||||
v-for="item in filterStationList"
|
||||
@ -18,9 +18,9 @@
|
||||
<el-button
|
||||
:type=" field === 'startStationCode' ? 'danger' : 'primary'"
|
||||
@click="hover('startStationCode')"
|
||||
>激活</el-button>
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="起始区段:" prop="startSectionCode">
|
||||
<el-form-item :label="$t('map.startSectionColon')" prop="startSectionCode">
|
||||
<el-select v-model="addModel.startSectionCode" clearable :filterable="true">
|
||||
<el-option
|
||||
v-for="item in filterSectionList"
|
||||
@ -32,9 +32,9 @@
|
||||
<el-button
|
||||
:type=" field === 'startSectionCode' ? 'danger' : 'primary'"
|
||||
@click="hover('startSectionCode')"
|
||||
>激活</el-button>
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="终到站:" prop="endStationCode">
|
||||
<el-form-item :label="$t('map.endStationColon')" prop="endStationCode">
|
||||
<el-select v-model="addModel.endStationCode" clearable :filterable="true">
|
||||
<el-option
|
||||
v-for="item in filterStationList"
|
||||
@ -46,9 +46,9 @@
|
||||
<el-button
|
||||
:type=" field === 'endStationCode' ? 'danger' : 'primary'"
|
||||
@click="hover('endStationCode')"
|
||||
>激活</el-button>
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="终到区段:" prop="endSectionCode">
|
||||
<el-form-item :label="$t('map.endSectionColon')" prop="endSectionCode">
|
||||
<el-select v-model="addModel.endSectionCode" clearable :filterable="true">
|
||||
<el-option
|
||||
v-for="item in filterSectionList"
|
||||
@ -60,10 +60,10 @@
|
||||
<el-button
|
||||
:type=" field === 'endSectionCode' ? 'danger' : 'primary'"
|
||||
@click="hover('endSectionCode')"
|
||||
>激活</el-button>
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="方向" prop="directionCode">
|
||||
<el-select v-model="addModel.directionCode" clearable :filterable="true" placeholder="请选择方向">
|
||||
<el-form-item :label="$t('map.routingDirection')" prop="directionCode">
|
||||
<el-select v-model="addModel.directionCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in DirectionCodeList"
|
||||
:key="item.value"
|
||||
@ -72,15 +72,12 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="目的地码:" prop="destinationCode">
|
||||
<el-input v-model="addModel.destinationCode" placeholder="请输入目的码" />
|
||||
<el-form-item :label="$t('map.remarksColon')" prop="remarks">
|
||||
<el-input v-model="addModel.remarks" type="textarea" :rows="4" :placeholder="$t('map.pleaseSelect')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述:" prop="remarks">
|
||||
<el-input v-model="addModel.remarks" type="textarea" :rows="4" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="交路区段数据:" prop="routingSectionList">
|
||||
<el-form-item :label="$t('map.trafficSegmentData')" prop="routingSectionList">
|
||||
<div>
|
||||
<el-select v-model="stationCode" clearable :filterable="true" placeholder="请选择车站数据">
|
||||
<el-select v-model="stationCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in filterStationList"
|
||||
:key="item.code"
|
||||
@ -91,10 +88,10 @@
|
||||
<el-button
|
||||
:type="field === 'routingStation' ? 'danger' : 'primary'"
|
||||
@click="hover('routingStation')"
|
||||
>激活</el-button>
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-select v-model="sectionCode" clearable :filterable="true" placeholder="请选择区段数据">
|
||||
<el-select v-model="sectionCode" clearable :filterable="true" :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in sectionList"
|
||||
:key="item.code"
|
||||
@ -105,33 +102,33 @@
|
||||
<el-button
|
||||
:type=" field === 'routingSection' ? 'danger' : 'primary'"
|
||||
@click="hover('routingSection')"
|
||||
>激活</el-button>
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="pushSection(addModel.routingSectionList, {stationCode: stationCode, sectionCode: sectionCode})"
|
||||
>
|
||||
添加
|
||||
{{ $t('map.add') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="addModel.routingSectionList" border style="width: 97%">
|
||||
<el-table-column prop="sectionCode" label="车站名称">
|
||||
<el-table-column prop="sectionCode" :label="$t('map.stationName')">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ formatName(scope.row.stationCode) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sectionCode" label="区段名称">
|
||||
<el-table-column prop="sectionCode" :label="$t('map.sectionName')">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ formatName(scope.row.sectionCode) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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"
|
||||
size="small"
|
||||
@click.native.prevent="deleteSection(addModel.routingSectionList, scope.$index)"
|
||||
>
|
||||
移除
|
||||
{{ $t('map.remove') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -139,9 +136,9 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">保存
|
||||
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
|
||||
</el-button>
|
||||
<el-button v-else type="warning" size="small" :loading="loading" @click="update">更新
|
||||
<el-button v-else type="warning" size="small" :loading="loading" @click="update">{{ $t('map.updata') }}
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
@ -209,19 +206,19 @@ export default {
|
||||
editShow: false,
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入交路名称', trigger: 'change' }
|
||||
{ required: true, message: this.$t('map.routingName'), trigger: 'change' }
|
||||
],
|
||||
startStationCode: [
|
||||
{ required: true, message: '请选择起始车站', trigger: 'change' }
|
||||
{ required: true, message: this.$t('map.startStationCode'), trigger: 'change' }
|
||||
],
|
||||
startSectionCode: [
|
||||
{ required: true, message: '请选择起始区段', trigger: 'change' }
|
||||
{ required: true, message: this.$t('map.startSectionCode'), trigger: 'change' }
|
||||
],
|
||||
endStationCode: [
|
||||
{ required: true, message: '请选择终到车站', trigger: 'change' }
|
||||
{ required: true, message: this.$t('map.endStationCode'), trigger: 'change' }
|
||||
],
|
||||
endSectionCode: [
|
||||
{ required: true, message: '请选择终到区段', trigger: 'change' }
|
||||
{ required: true, message: this.$t('map.endSectionCode'), trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -308,7 +305,7 @@ export default {
|
||||
if (index < 0) {
|
||||
list.push(data);
|
||||
} else {
|
||||
this.$messageBox('相同ID的数据已存在');
|
||||
this.$messageBox(this.$t('tip.routeSameID'));
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -335,11 +332,11 @@ export default {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
addRouting(this.buildModel(getUID('Routing'))).then(resp => {
|
||||
this.$message.success('创建交路成功!');
|
||||
this.$message.success(this.$t('tip.pathCreationSuccessful'));
|
||||
this.loading = false;
|
||||
this.clear();
|
||||
}).catch(() => {
|
||||
this.$messageBox('创建交路失败');
|
||||
this.$messageBox(this.$t('tip.createRoutingFailed'));
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
@ -351,11 +348,11 @@ export default {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
updateRouting(this.buildModel()).then(resp => {
|
||||
this.$message.success('更新交路成功!');
|
||||
this.$message.success(this.$t('tip.pathUpdataSuccessful'));
|
||||
this.loading = false;
|
||||
this.clear();
|
||||
}).catch(() => {
|
||||
this.$messageBox('更新交路失败');
|
||||
this.$messageBox(this.$t('tip.pathUpdataFailed'));
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog title="联动道岔列表" :visible.sync="show" width="85%" :before-do-close="doClose">
|
||||
<el-dialog :title="$t('map.linkageSwitchList')" :visible.sync="show" width="85%" :before-do-close="doClose">
|
||||
<div>
|
||||
<QueryListPage
|
||||
ref="queryListPage"
|
||||
@ -39,7 +39,7 @@ export default {
|
||||
queryObject: {
|
||||
switchCode: {
|
||||
type: 'select',
|
||||
label: '道岔名称',
|
||||
label: this.$t('map.switchNameC'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
@ -53,24 +53,24 @@ export default {
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '所属地图名称',
|
||||
title: this.$t('map.pathUnitMapName'),
|
||||
prop: 'mapId'
|
||||
},
|
||||
{
|
||||
title: '道岔1编号',
|
||||
title: this.$t('map.switchACode'),
|
||||
prop: 'switchACode'
|
||||
},
|
||||
{
|
||||
title: '道岔2编号',
|
||||
title: this.$t('map.switchBCode'),
|
||||
prop: 'switchBCode'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
title: this.$t('map.operation'),
|
||||
width: '200',
|
||||
buttons: [
|
||||
{
|
||||
name: '删除',
|
||||
name: this.$t('map.deleteObj'),
|
||||
handleClick: this.deleteObj,
|
||||
type: 'danger'
|
||||
}
|
||||
@ -135,11 +135,11 @@ export default {
|
||||
deleteObj(index, row) {
|
||||
if (this.mapInfo && this.mapInfo.id && row) {
|
||||
// 删除 双动道岔
|
||||
deleteLinkageSwitch(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
deleteLinkageSwitch(this.mapInfo.id, row.id).then(response => {
|
||||
this.$message.success(this.$t('tip.successfullyDelete'));
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.$messageBox('删除失败');
|
||||
this.$messageBox(this.$t('tip.failDelete'));
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -4,14 +4,14 @@
|
||||
<el-card>
|
||||
<div slot="header" class="clearfix">
|
||||
<span>
|
||||
地图名称:
|
||||
{{ $t('map.mapName') }}
|
||||
<b>{{ mapInfo.name }}</b>
|
||||
</span>
|
||||
<el-button type="text" style="float: right; padding: 3px 3px" @click="previewRouteEvent">预览</el-button>
|
||||
<el-button type="text" style="float: right; padding: 3px 3px" @click="createRouteEvent">重置</el-button>
|
||||
<el-button type="text" style="float: right; padding: 3px 3px" @click="previewRouteEvent">{{ $t('map.preview') }}</el-button>
|
||||
<el-button type="text" style="float: right; padding: 3px 3px" @click="createRouteEvent">{{ $t('map.reset') }}</el-button>
|
||||
</div>
|
||||
<el-tabs v-model="enabledTab" type="card">
|
||||
<el-tab-pane label="联动道岔" name="Route">
|
||||
<el-tab-pane :label="$t('map.setSwitch')" name="Route">
|
||||
<route-draft
|
||||
ref="routeEdit"
|
||||
:selected="selected"
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div :style="{ height: cardHeight +'px' }">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<el-form ref="form" :model="addModel" :rules="rules" label-width="120px" size="mini">
|
||||
<el-form-item label="道岔ID 1:" prop="switchACode">
|
||||
<el-form-item :label="$t('map.switchACodeNum')" prop="switchACode">
|
||||
<el-select v-model="addModel.switchACode" clearable :filterable="true">
|
||||
<el-option
|
||||
v-for="item in switchList"
|
||||
@ -11,10 +11,10 @@
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button :type=" field === 'switchACode' ? 'danger' : 'primary'" @click="hover('switchACode')">激活
|
||||
<el-button :type=" field === 'switchACode' ? 'danger' : 'primary'" @click="hover('switchACode')">{{ $t('map.activate') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="道岔ID 2:" prop="switchBCode">
|
||||
<el-form-item :label="$t('map.switchBCodeNum')" prop="switchBCode">
|
||||
<el-select v-model="addModel.switchBCode" clearable :filterable="true">
|
||||
<el-option
|
||||
v-for="item in switchList"
|
||||
@ -23,12 +23,12 @@
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button :type=" field === 'switchBCode' ? 'danger' : 'primary'" @click="hover('switchBCode')">激活
|
||||
<el-button :type=" field === 'switchBCode' ? 'danger' : 'primary'" @click="hover('switchBCode')">{{ $t('map.activate') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
<el-button type="primary" size="small" :loading="loading" @click="save">保存</el-button>
|
||||
<el-button type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}</el-button>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -71,11 +71,11 @@ export default {
|
||||
data() {
|
||||
var switchBCode = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('请选择道岔ID'));
|
||||
return callback(new Error(this.$t('rules.selectTurnoutID')));
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (value == this.addModel.switchACode) {
|
||||
callback(new Error('道岔不能为同一个'));
|
||||
callback(new Error(this.$t('rules.switchesCannot')));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
@ -94,7 +94,7 @@ export default {
|
||||
},
|
||||
rules: {
|
||||
switchACode: [
|
||||
{ required: true, message: '请选择道岔ID', trigger: 'change' }
|
||||
{ required: true, message: this.$t('rules.selectTurnoutID'), trigger: 'change' }
|
||||
],
|
||||
switchBCode: [
|
||||
{ required: true, validator: switchBCode, trigger: 'change' }
|
||||
@ -164,10 +164,10 @@ export default {
|
||||
// 创建联动道岔
|
||||
this.loading = true;
|
||||
createLinkageSwitch(this.buildModel()).then(response => {
|
||||
this.$message.success('创建成功');
|
||||
this.$message.success(this.$t('tip.createSuccess'));
|
||||
this.loading = false;
|
||||
}).catch(() => {
|
||||
this.$messageBox('操作异常');
|
||||
this.$messageBox(this.$t('tip.operationAbnormal'));
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
|
121
src/views/scriptManage/category/tree.vue
Normal file
121
src/views/scriptManage/category/tree.vue
Normal file
@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<el-card v-loading="loading" class="map-list-main">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>地图列表</span>
|
||||
</div>
|
||||
<el-select v-model="mapSelect" size="medium" class="mapSelect" @change="mapSelectChange">
|
||||
<el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<div class="addScript" @click="addScript">
|
||||
<i class="el-icon-plus"></i>
|
||||
<span class="addScriptText">添加剧本</span>
|
||||
</div>
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-125) +'px', width:'100%',margin:'5px 0 0 0' }">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="treeList"
|
||||
node-key="id"
|
||||
:props="defaultProps"
|
||||
highlight-current
|
||||
:span="22"
|
||||
@node-click="clickEvent"
|
||||
@node-contextmenu="showContextMenu"
|
||||
>
|
||||
<span slot-scope="{ node:tnode, data }">
|
||||
<span
|
||||
class="el-icon-tickets"
|
||||
:style="{color: data.valid ? 'green':''}"
|
||||
> {{ tnode.label }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
// import { getPublishLessonTree, getPublishLessonDetail } from '@/api/jmap/lesson';
|
||||
// import { PermissionType } from '@/scripts/ConstDic';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { getQuestPageList,createQuest,deleteQuest,updateQuest} from '@/api/quest';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'ScriptTree',
|
||||
props: {
|
||||
height: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadInitData();
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
mapList:[],
|
||||
mapSelect:"",
|
||||
treeData: [],
|
||||
treeList: [],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name',
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
|
||||
},
|
||||
methods:{
|
||||
loadInitData() {
|
||||
this.loading=true;
|
||||
this.mapList = [];
|
||||
listPublishMap().then(response => {
|
||||
this.mapList = response.data;
|
||||
this.mapSelect=this.mapList[0].id;
|
||||
this.getQuestPageList(this.mapSelect);
|
||||
})
|
||||
},
|
||||
mapSelectChange(id){
|
||||
this.loading = true;
|
||||
this.getQuestPageList(id);
|
||||
},
|
||||
getQuestPageList(id){
|
||||
getQuestPageList(id).then(response => {
|
||||
this.loading = false;
|
||||
this.treeList=response.data;
|
||||
}).catch((err) => {
|
||||
});
|
||||
},
|
||||
showContextMenu(e, obj, node, vueElem) {
|
||||
if (obj) {
|
||||
this.node = node;
|
||||
this.selected = obj;
|
||||
}
|
||||
},
|
||||
clickEvent(obj, data, ele) {
|
||||
setSessionStorage('scriptId', obj.id);
|
||||
this.$router.push({ path: `${UrlConfig.script.detail}/${obj.id}` });
|
||||
},
|
||||
addScript(){
|
||||
this.$router.push({ path: `${UrlConfig.script.prefix}` });
|
||||
this.refresh();
|
||||
},
|
||||
refresh() {
|
||||
this.getQuestPageList(this.mapSelect);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.mapSelect {
|
||||
width:100%;
|
||||
}
|
||||
.addScript{
|
||||
border: 1px #ccc solid;
|
||||
padding: 10px 10px;
|
||||
font-size: 14px;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
174
src/views/scriptManage/detail/index.vue
Normal file
174
src/views/scriptManage/detail/index.vue
Normal file
@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<el-card :style="{height: height+'px'}">
|
||||
<div class="home-box">
|
||||
<el-card class="box-card">
|
||||
<div id="scriptTitle">剧本详情</div>
|
||||
<div id="sciptForm">
|
||||
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
|
||||
</div>
|
||||
<div id="btnList">
|
||||
<span slot="footer" class="btn-footer">
|
||||
<el-button type="success" @click="drawUp">编制</el-button>
|
||||
<el-button type="primary" @click="modifyScript">修改</el-button>
|
||||
<el-button type="danger" @click="deleteScript">删除</el-button>
|
||||
</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import {listPublishMap} from '@/api/jmap/map'
|
||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import {getQuestById,updateQuest,deleteQuest} from '@/api/quest';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { scriptRecordNotify } from '@/api/simulation';
|
||||
|
||||
export default {
|
||||
name: 'ScriptDetail',
|
||||
mixins: [WindowResizeHandler],
|
||||
data() {
|
||||
return {
|
||||
mapList:[],
|
||||
taskStatusList: [],
|
||||
disabled:true,
|
||||
formModel: {
|
||||
name: '',
|
||||
mapId: '',
|
||||
description:''
|
||||
},
|
||||
isShow: false,
|
||||
height: 0,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
title: String,
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let isAdd = this.type === 'ADD'
|
||||
let form = {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'name', label: '剧本名称', type: 'text', required: true},
|
||||
{ prop: 'mapId', label: '地图', type: 'select', required: true, options: this.mapList,disabled:this.disabled},
|
||||
{ prop: 'description', label: '剧本描述', type: 'textarea', required: true},
|
||||
]
|
||||
}
|
||||
return form
|
||||
},
|
||||
rules() {
|
||||
let crules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入剧本', trigger: 'blur' },
|
||||
],
|
||||
mapId: [
|
||||
{ required: true, message: '请选择地图', trigger: 'change' },
|
||||
],
|
||||
description:[
|
||||
{ required: true, message: '请输入剧本描述', trigger: 'blur' },
|
||||
]
|
||||
}
|
||||
return crules
|
||||
},
|
||||
// title() {
|
||||
// return '创建剧本'
|
||||
// }
|
||||
},
|
||||
mounted() {
|
||||
listPublishMap().then(response => {
|
||||
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
|
||||
this.loadInitData();
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
$route(newVal) {
|
||||
this.loadInitData();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
resizeHandler() {
|
||||
this.height = this._clientHeight - 50;
|
||||
},
|
||||
loadInitData() {
|
||||
const scriptId =this.$route.params.scriptId;
|
||||
if (parseInt(scriptId)) {
|
||||
getQuestById(scriptId).then(resp=>{
|
||||
let data={'name':resp.data.name,'description':resp.data.description,'mapId':resp.data.mapId};
|
||||
this.formModel=data;
|
||||
this.formModel.id=scriptId;
|
||||
}).catch(error => {
|
||||
this.$message.error('获取剧本信息失败:' + error.message);
|
||||
});
|
||||
}
|
||||
},
|
||||
drawUp() {
|
||||
let data=this.formModel;
|
||||
scriptRecordNotify(data.id).then(resp => {
|
||||
let query = { mapId: data.mapId, group: resp.data, scriptId: data.id };
|
||||
this.$router.push({ path: `${UrlConfig.display}/script`, query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(`创建仿真失败: ${error.message}`);
|
||||
})
|
||||
},
|
||||
modifyScript(){
|
||||
let data=this.formModel;
|
||||
updateQuest(data.id,data).then(resp => {
|
||||
this.$emit('refresh');
|
||||
this.$message.success('修改剧本成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`修改剧本失败: ${error.message}`);
|
||||
})
|
||||
},
|
||||
deleteScript(){
|
||||
let data=this.formModel;
|
||||
this.$confirm('此操作将删除此剧本, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteQuest(data.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.$emit('refresh');
|
||||
this.$router.push({ path: `${UrlConfig.script.prefix}` });
|
||||
}).catch(error => {
|
||||
this.$messageBox('删除失败');
|
||||
})
|
||||
}).catch(() => { })
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.home-box {
|
||||
padding: 20px 100px;
|
||||
float: left;
|
||||
width: 100%;
|
||||
font-family: 'Microsoft YaHei';
|
||||
}
|
||||
.box-card {
|
||||
width:800px;
|
||||
margin: 0 auto;
|
||||
margin-top: 20px;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
#scriptTitle{
|
||||
padding: 30px 40px;
|
||||
}
|
||||
#sciptForm{
|
||||
margin-top: 10px;
|
||||
padding: 0px 130px 0px 100px;
|
||||
}
|
||||
#btnList{
|
||||
margin: 0px 100px;
|
||||
}
|
||||
.btn-footer{
|
||||
margin-left: 100px;
|
||||
margin-top: 10px;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
142
src/views/scriptManage/home.vue
Normal file
142
src/views/scriptManage/home.vue
Normal file
@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<el-card :style="{height: height+'px'}">
|
||||
<div class="home-box">
|
||||
<el-card class="box-card">
|
||||
<div id="scriptTitle">创建剧本</div>
|
||||
<div id="sciptForm">
|
||||
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
|
||||
</div>
|
||||
<div id="btnList">
|
||||
<span slot="footer" class="btn-footer">
|
||||
<el-button type="primary" @click="doCreate" :loading="loading">确 定</el-button>
|
||||
<!-- <el-button @click="doClose">取 消</el-button> -->
|
||||
</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listPublishMap} from '@/api/jmap/map';
|
||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import {createQuest} from '@/api/quest';
|
||||
|
||||
export default {
|
||||
name: 'ScriptDraft',
|
||||
mixins: [WindowResizeHandler],
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
mapList: [],
|
||||
taskStatusList: [],
|
||||
disabled:null,
|
||||
formModel: {
|
||||
name: '',
|
||||
mapId: '',
|
||||
description:''
|
||||
},
|
||||
isShow: false,
|
||||
height: 0,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
title: String,
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let isAdd = this.type === 'ADD'
|
||||
let form = {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'name', label: '剧本名称', type: 'text', required: true},
|
||||
{ prop: 'mapId', label: '地图', type: 'select', required: true, options: this.mapList,disabled:this.disabled},
|
||||
{ prop: 'description', label: '剧本描述', type: 'textarea', required: true},
|
||||
]
|
||||
}
|
||||
return form
|
||||
},
|
||||
rules() {
|
||||
let crules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入剧本', trigger: 'blur' },
|
||||
],
|
||||
mapId: [
|
||||
{ required: true, message: '请选择地图', trigger: 'change' },
|
||||
],
|
||||
description:[
|
||||
{ required: true, message: '请输入剧本描述', trigger: 'blur' },
|
||||
]
|
||||
}
|
||||
return crules
|
||||
},
|
||||
// title() {
|
||||
// return '创建剧本'
|
||||
// }
|
||||
},
|
||||
mounted() {
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
resizeHandler() {
|
||||
this.height = this._clientHeight - 50;
|
||||
},
|
||||
loadInitData() {
|
||||
this.mapList = [];
|
||||
listPublishMap().then(response => {
|
||||
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
|
||||
})
|
||||
},
|
||||
doCreate() {
|
||||
let self = this
|
||||
if(!this.loading)
|
||||
{
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
//self.$emit('create', Object.assign({}, this.formModel));
|
||||
this.loading=true;
|
||||
let data=this.formModel;
|
||||
createQuest(data).then(resp => {
|
||||
this.$emit('refresh');
|
||||
this.$message.success('创建剧本成功');
|
||||
this.formModel={};
|
||||
this.loading=false;
|
||||
}).catch(error => {
|
||||
this.loading=false;
|
||||
this.$messageBox(`创建剧本失败: ${error.message}`);
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.home-box {
|
||||
padding: 20px 100px;
|
||||
float: left;
|
||||
width: 100%;
|
||||
font-family: 'Microsoft YaHei';
|
||||
}
|
||||
.box-card {
|
||||
width:800px;
|
||||
margin: 0 auto;
|
||||
margin-top: 20px;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
#scriptTitle{
|
||||
padding: 30px 40px;
|
||||
}
|
||||
#sciptForm{
|
||||
margin-top: 10px;
|
||||
padding: 0px 130px 0px 100px;
|
||||
}
|
||||
#btnList{
|
||||
margin: 0px 100px;
|
||||
}
|
||||
.btn-footer{
|
||||
margin-left: 100px;
|
||||
margin-top: 10px;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
65
src/views/scriptManage/index.vue
Normal file
65
src/views/scriptManage/index.vue
Normal file
@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<div class="app-wrapper">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<div v-show="treeShow" class="list" :style="{width: widthLeft+'px'}">
|
||||
<script-tree ref="scriptTree" :height="height" />
|
||||
</div>
|
||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||
<transition>
|
||||
<router-view @refresh="refresh"/>
|
||||
</transition>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ScriptTree from './category/tree';
|
||||
import drapLeft from '@/views/components/drapLeft/index';
|
||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
export default {
|
||||
name: 'Script',
|
||||
components: {
|
||||
ScriptTree,
|
||||
drapLeft
|
||||
},
|
||||
mixins: [WindowResizeHandler],
|
||||
data() {
|
||||
return {
|
||||
height: 0,
|
||||
treeShow: true,
|
||||
widthLeft: 450
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
resizeHandler() {
|
||||
this.height = this._clientHeight - 50;
|
||||
},
|
||||
drapWidth(width) {
|
||||
this.widthLeft = Number(width);
|
||||
},
|
||||
refresh() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.scriptTree.refresh();
|
||||
});
|
||||
}
|
||||
// refresh(filterSelect) {
|
||||
// this.$refs && this.$refs.tree && this.$refs.tree.refresh(filterSelect);
|
||||
// }
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.app-wrapper {
|
||||
@include clearfix;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.list {
|
||||
float: left;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user