Merge remote-tracking branch 'origin/dev' into test
This commit is contained in:
commit
31beb32ae0
179
src/api/designPlatform.js
Normal file
179
src/api/designPlatform.js
Normal file
@ -0,0 +1,179 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export function getDraftLesson(params, mapId) {
|
||||
/** 根据mapId获取草稿课程 */
|
||||
return request({
|
||||
url: `/api/mapSystem/findDraftLessonBy/${mapId}`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 获取用户地图树 */
|
||||
export function getUserMapTree(cityCode) {
|
||||
return request({
|
||||
url: `/api/mapSystem/findDraftMapByCityCode?cityCode=${cityCode}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 运行图*/
|
||||
export function getRpListByUserMapId(mapId) {
|
||||
return request({
|
||||
url: `/api/draftMap/runPlan/findByDraftMapId/${mapId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
export function getMapList(cityCode) {
|
||||
/** 根据cityCode获取地图列表 */
|
||||
return request({
|
||||
url: `/api/mapSystem/queryMapByCityCode/${cityCode}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取用户自己的运行图详情*/
|
||||
export function getRpDetailByUserMapId(planId) {
|
||||
return request({
|
||||
url: `/api/draftMap/runPlan/selectDiagramData/${planId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取用户自己创建的草稿地图详情*/
|
||||
export function getUserMapDetailByMapId(mapId) {
|
||||
return request({
|
||||
url: `/api/mapBuild/findById/${mapId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 用户自己的运行图仿真测试*/
|
||||
export function runUserPlanNotify({ planId }) {
|
||||
return request({
|
||||
url: `/api/draftMap/runPlan/simulationCheck/${planId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 管理员获取需审核的课程列表 */
|
||||
export function reviewLessonList(params) {
|
||||
return request({
|
||||
url: `/api/review/query/lesson`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/** 管理员发布课程接口 */
|
||||
export function adminPublishLesson(data, id) {
|
||||
return request({
|
||||
url: `/api/review/${id}/publishLesson`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 管理员驳回课程发布申请 */
|
||||
export function rejectedLessonRelease(data, id) {
|
||||
return request({
|
||||
url: `/api/review/lesson/${id}`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// /** 普通用户申请课程发布和撤销申请 */
|
||||
// export function releaseOrCancel(id, status) {
|
||||
// return request({
|
||||
// url: `/api/review/lesson/releaseOrCancel/${id}/${status}`,
|
||||
// method: 'get'
|
||||
// });
|
||||
// }
|
||||
|
||||
/** 管理员获取需审核的剧本列表 ok */
|
||||
export function reviewScriptList(params) {
|
||||
return request({
|
||||
url: `/api/review/query/script`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 管理员发布剧本 ok */
|
||||
export function publishScript(id) {
|
||||
return request({
|
||||
url: `/api/review/${id}/publishScript`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
/** 管理员剧本申请驳回 ok */
|
||||
export function rejectScript(id, data) {
|
||||
return request({
|
||||
url: `/api/review/script/${id}`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 管理员获取需审核的运行图列表 */
|
||||
export function reviewRunPlanList(params) {
|
||||
return request({
|
||||
url: `/api/review/query/runPlan`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/** 管理员发布运行图 */
|
||||
export function publishRunPlan(planId, data) {
|
||||
return request({
|
||||
url: `/api/review/${planId}/publishRunPlan`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 普通用户申请或撤销运行图发布 */
|
||||
export function releaseOrCancelRunPlan(planId, status) {
|
||||
return request({
|
||||
url: `/api/review/runPlan/releaseOrCancel/${planId}/${status}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 管理员运行图申请驳回 */
|
||||
export function rejectRunPlan(id, data) {
|
||||
return request({
|
||||
url: `/api/review/runPlan/${id}`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 用户申请发布剧本或者撤销剧本申请 */
|
||||
export function releaseScript(id, status) {
|
||||
return request({
|
||||
url: `/api/review/script/releaseOrCancel/${id}/${status}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 查看课程详情 */
|
||||
export function reviewLessonDetail(id) {
|
||||
return request({
|
||||
url: `/api/review/previewLesson/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 管理员预览草稿运行图*/
|
||||
export function previewRunPlan(planId) {
|
||||
return request({
|
||||
url: `/api/review/previewRunPlan/${planId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 加载剧本 */
|
||||
export function loadDraftScript(scriptId, memberId, group) {
|
||||
return request({
|
||||
url: `api/simulation/${group}/scriptDraft/${scriptId}?memberId=${memberId}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
@ -1,16 +1,17 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 查找个人录制的仿真任务*/
|
||||
export function getQuestPageList(mapId) {
|
||||
/** 分页查找个人录制的仿真任务*/
|
||||
export function getQuestPageList(mapId, params) {
|
||||
return request({
|
||||
url: `/api/script/${mapId}/list`,
|
||||
method: 'get'
|
||||
url: `/api/script/draft/${mapId}/list`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
/** 创建任务 */
|
||||
export function createQuest(data) {
|
||||
return request({
|
||||
url: `/api/script`,
|
||||
url: `/api/script/draft`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
@ -18,28 +19,28 @@ export function createQuest(data) {
|
||||
/** 根据任务id删除任务 */
|
||||
export function deleteQuest(id) {
|
||||
return request({
|
||||
url: `/api/script/${id}`,
|
||||
url: `/api/script/draft/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 根据id查询任务基础信息 */
|
||||
export function getQuestById(id) {
|
||||
return request({
|
||||
url: `/api/script/${id}/basic`,
|
||||
url: `/api/script/draft/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 根据id查询任务基础信息 */
|
||||
/** 根据id查询任务详情信息 */
|
||||
export function getQuestByIdList(id) {
|
||||
return request({
|
||||
url: `/api/quest/${id}/detail`,
|
||||
url: `/api/script/draft/${id}/detail`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 更新任务基本信息 */
|
||||
export function updateQuest(id, data) {
|
||||
return request({
|
||||
url: `/api/script/${id}`,
|
||||
url: `/api/script/draft/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
@ -53,3 +54,21 @@ export function getQuestPageListOnline(params) {
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/** 剧本发布 */
|
||||
export function publishQuest(id, data) {
|
||||
return request({
|
||||
url: `/api/script/draft/${id}/publish`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 剧本撤销发布 */
|
||||
export function retractQuest(id, data) {
|
||||
return request({
|
||||
url: `/api/script/draft/${id}/retract`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,8 @@ import request from '@/utils/request';
|
||||
/** 分页查找上线的剧本*/
|
||||
export function getScriptPageListOnline(params) {
|
||||
return request({
|
||||
url: `/api/script/paging/online`,
|
||||
// url: `/api/script/paging/online`,
|
||||
url: `/api/script/paging/published`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
@ -17,10 +18,17 @@ export function getScriptByIdList(id) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 通过ID查询剧本的基础信息 */
|
||||
/** 通过ID查询发布的剧本的详细信息 */
|
||||
export function getScriptById(id) {
|
||||
return request({
|
||||
url: `/api/script/${id}/detail`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 通过ID查询未发布剧本的详细信息 */
|
||||
export function getDraftScriptById(id) {
|
||||
return request({
|
||||
url: `/api/script/draft/${id}/detail`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
35
src/api/trainingPlatform.js
Normal file
35
src/api/trainingPlatform.js
Normal file
@ -0,0 +1,35 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export function getTrainingSystemList(params) {
|
||||
/** 根据cityCode后去对应地图及其子系统 */
|
||||
return request({
|
||||
url: '/api/mapSystem/queryByCityCode',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export function querySystemByTypeAndPrdCode(params, prodCode) {
|
||||
/** 根据系统类型和地图产品code查询系统的内容(课程、章节、考试)*/
|
||||
return request({
|
||||
url: `/api/mapSystem/queryByTypeAndPrdCode/${prodCode}`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export function getTrainingSystemListByMapId(mapId) {
|
||||
/** 根据mapId去获取其子系统 */
|
||||
return request({
|
||||
url: `/api/mapSystem/${mapId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
export function generateMapSystem(mapId) {
|
||||
/** 根据mapId生成地图子系统 */
|
||||
return request({
|
||||
url: `/api/mapSystem/generate/${mapId}`,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
BIN
src/assets/logo_changan.png
Normal file
BIN
src/assets/logo_changan.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
@ -127,7 +127,7 @@
|
||||
</el-row>
|
||||
</template>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="0">
|
||||
<el-col :span="5" :offset="1">
|
||||
<el-button type="primary" size="small" :disabled="!canQuery" @click="query">{{ $t('global.query') }}</el-button>
|
||||
<el-button v-if="queryForm.reset" type="primary" size="small" :disabled="!canQuery" @click="doClean">{{ $t('global.reset') }}</el-button>
|
||||
<el-button v-if="exportFlag" type="primary" size="small" :disabled="!canQuery" @click="doExport">{{ $t('global.export') }}</el-button>
|
||||
@ -139,6 +139,7 @@
|
||||
size="small"
|
||||
:style="button.style"
|
||||
@click="button.handler"
|
||||
class="button_style"
|
||||
>{{ button.text }}</el-button>
|
||||
</template>
|
||||
</el-col>
|
||||
@ -480,4 +481,7 @@ export default {
|
||||
max-width: 240px;
|
||||
min-width: 100px;
|
||||
}
|
||||
.button_style {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
|
@ -453,7 +453,10 @@ export default {
|
||||
currentChoose() {
|
||||
return this.choose;
|
||||
},
|
||||
refresh() {
|
||||
refresh(flag) {
|
||||
if (flag){
|
||||
this.commitQuery();
|
||||
}
|
||||
this.queryList.data = [...this.queryList.data];
|
||||
}
|
||||
}
|
||||
|
36
src/i18n/langs/en/approval.js
Normal file
36
src/i18n/langs/en/approval.js
Normal file
@ -0,0 +1,36 @@
|
||||
export default {
|
||||
applicant: 'Applicant',
|
||||
map: 'Map',
|
||||
status: 'Status',
|
||||
unpublished: 'Unpublished',
|
||||
pendingReview: 'PendingReview',
|
||||
releaseSuccess: 'ReleaseSuccess',
|
||||
overrule: 'Overrule',
|
||||
scriptName: 'Script Name',
|
||||
scriptDescription: 'Script Description',
|
||||
applyTime: 'Apply Time',
|
||||
applyPassed: 'Apply Passed',
|
||||
applyReject: 'Apply Reject',
|
||||
scriptPreview: 'Script Preview',
|
||||
passedScript: 'Passed Script',
|
||||
rejectScript: 'Reject Script',
|
||||
explanation: 'Explanation',
|
||||
inputScriptName: 'Please input script name',
|
||||
inputRejectExplanation: 'Please input reject explanation',
|
||||
passedScriptSuccess: 'Passed script success',
|
||||
passedScriptFailed: 'Passed script failed',
|
||||
rejectScriptSuccess: 'Reject script success',
|
||||
rejectScriptFailed: 'Reject script failed',
|
||||
runPlanName: 'Run Plan Name',
|
||||
passedRunPlan: 'Passed Run Plan',
|
||||
rejectRunPlan: 'Reject Run Plan',
|
||||
runPlanPreview: 'RunPlan Preview',
|
||||
inputRunPlanName: 'Please input run plan name',
|
||||
courseDescription: 'Course description',
|
||||
lookOver: 'Look over',
|
||||
courseDetails: 'Course details',
|
||||
instructions: 'Instructions',
|
||||
chapterTrainingName: 'Chapter/training name',
|
||||
revokeScriptSuccess: 'Revoke script success',
|
||||
revokeScriptFailed: 'Revoke script failed'
|
||||
};
|
@ -1,7 +1,7 @@
|
||||
export default {
|
||||
simulationSystem: 'Urban rail transit simulation system',
|
||||
simulationSystemDescription: 'Based on the subway signal system, the urban rail transit simulation system is reformed for the training part, aiming to build a set of professional simulation system for driving demonstration. The system has high flexibility for future expansion and upgrading. Meanwhile, the simulation system has two modes of normal operation and fault operation. Besides normal functional operation, it can also conduct fault simulation of equipment.',
|
||||
simulationName: 'Simulation name:',
|
||||
simulationName: 'Simulation module:',
|
||||
noSimulationProducts: 'No simulation products',
|
||||
productDescription: 'Product description:',
|
||||
startSimulation: 'Start the simulation',
|
||||
|
@ -79,6 +79,7 @@ export default {
|
||||
schema: {
|
||||
selectProduct: 'Please select product type',
|
||||
loadScript: 'Load Script',
|
||||
selectRoles: 'Select Roles',
|
||||
previewRunDiagram: 'Preview Run Diagram',
|
||||
loadRunDiagram: 'Load Run Diagram',
|
||||
faultSetting: 'Fault Setting',
|
||||
@ -123,6 +124,7 @@ export default {
|
||||
dispatcher: 'Dispatcher',
|
||||
attendant: 'Station',
|
||||
audience: 'Audience',
|
||||
repair: 'Repair',
|
||||
driver: 'Train',
|
||||
none: 'None'
|
||||
},
|
||||
|
@ -91,5 +91,8 @@ export default {
|
||||
getRunGraphDataFailed: 'Failed to get run graph data',
|
||||
getStationListFail: 'Failed to get station list',
|
||||
obtainTrainGroupNumberFailed: 'Failed to obtain train group number',
|
||||
getTrainListFailed: 'Failed to get train list'
|
||||
getTrainListFailed: 'Failed to get train list',
|
||||
getDraftCourseDataFailed: 'Failed to get draft course data!',
|
||||
failedToGetCourseData: 'Failed to get course data!',
|
||||
failedToGetSystemData: 'Failed to get system data!'
|
||||
};
|
||||
|
@ -15,20 +15,21 @@ export default {
|
||||
returnToExamList: 'Return to the exam list',
|
||||
totalScore: 'Total score',
|
||||
itemList: 'Item list',
|
||||
courseName: 'Course name',
|
||||
permissionsDetails: 'Permissions for details',
|
||||
courseName: 'Examination subject',
|
||||
permissionsDetails: 'Permission details',
|
||||
buy: 'buy',
|
||||
distributePermission: 'Permission distribution (examination)',
|
||||
viewCoursePapers: 'View course papers',
|
||||
examStartTime: 'Exam start time',
|
||||
theExamIsReadyAnyTime: 'The exam is ready any time',
|
||||
testExplanation: 'Test Explanation',
|
||||
examTimeAvailable: 'Exam time available',
|
||||
fullMarksInTheExam: 'Full marks in the exam',
|
||||
passMarkTheExam: 'Pass mark the exam',
|
||||
examinationRules: 'Examination rules',
|
||||
examStartTime: 'Start time',
|
||||
theExamIsReadyAnyTime: 'Anytime you are available',
|
||||
minutes: 'min',
|
||||
testExplanation: 'Notes',
|
||||
examTimeAvailable: 'Duration',
|
||||
fullMarksInTheExam: 'Full marks',
|
||||
passMarkTheExam: 'Passing score',
|
||||
examinationRules: 'Rules',
|
||||
trainingType: 'Training type',
|
||||
numberOfQuestions: 'Number of questions',
|
||||
numberOfQuestions: 'Quantity',
|
||||
score: 'Score',
|
||||
startTheExam: 'Start the exam',
|
||||
examinationTiming: 'Examination timing',
|
||||
|
@ -40,7 +40,7 @@ export default {
|
||||
mobile: 'mobile',
|
||||
name: 'Name',
|
||||
code: 'Code',
|
||||
status: 'Status',
|
||||
status: 'State',
|
||||
remarks: 'Remarks',
|
||||
selectionTime: 'Selection of time',
|
||||
permissionNumber: 'Number of permissions',
|
||||
@ -56,11 +56,11 @@ export default {
|
||||
transferScreenPermission: 'Large screen rights transfer',
|
||||
today: 'Today',
|
||||
total: 'Total',
|
||||
index: 'Indexes',
|
||||
startTime: 'Start time',
|
||||
endTime: 'End time',
|
||||
isForever: 'Forever',
|
||||
remains: 'Remainder',
|
||||
index: 'Index',
|
||||
startTime: 'Start',
|
||||
endTime: 'End',
|
||||
isForever: 'Timelimit',
|
||||
remains: 'Remaining',
|
||||
hasPermissionTip: 'Public permission is {0}, private permission is {1}',
|
||||
create: 'Create',
|
||||
update: 'Update',
|
||||
|
@ -24,6 +24,7 @@ import joinTraining from './joinTraining';
|
||||
import trainRoom from './trainRoom';
|
||||
import menu from './menu';
|
||||
import ibp from './ibp';
|
||||
import approval from './approval';
|
||||
|
||||
export default {
|
||||
...enLocale,
|
||||
@ -51,5 +52,6 @@ export default {
|
||||
joinTraining,
|
||||
trainRoom,
|
||||
menu,
|
||||
ibp
|
||||
ibp,
|
||||
approval
|
||||
};
|
||||
|
@ -102,5 +102,19 @@ export default {
|
||||
train: 'Train',
|
||||
station: 'Station',
|
||||
trainWindow: 'Train window',
|
||||
editStepInfo: 'Edit step information'
|
||||
editStepInfo: 'Edit step information',
|
||||
trainingRecord: 'Training recording',
|
||||
lesson: 'Lesson',
|
||||
taskManage: 'Task manage',
|
||||
trainingRule: 'Training rule',
|
||||
trainingManage: 'Training manage',
|
||||
newConstruction: 'New',
|
||||
applicationForRelease: 'Application for release',
|
||||
rejectReason: 'Reason for rejection',
|
||||
withdraw: 'Withdraw',
|
||||
notRelease: 'Not release',
|
||||
pendingReview: 'Pending review',
|
||||
published: 'Published',
|
||||
rejected: 'Rejected',
|
||||
review: 'Review'
|
||||
};
|
||||
|
@ -1,16 +1,16 @@
|
||||
export default {
|
||||
updateStation: {
|
||||
level1: 'level one: ',
|
||||
level2: 'level two: ',
|
||||
level3: 'level three: ',
|
||||
level4: 'level four: ',
|
||||
level5: 'level five: ',
|
||||
level1: 'level1: ',
|
||||
level2: 'level2: ',
|
||||
level3: 'level3: ',
|
||||
level4: 'level4: ',
|
||||
level5: 'level5: ',
|
||||
updateData: 'Update data',
|
||||
pleaseInputLevel1: 'Please input level one',
|
||||
pleaseInputLevel2: 'Please input level two',
|
||||
pleaseInputLevel3: 'Please input level three',
|
||||
pleaseInputLevel4: 'Please input level four',
|
||||
pleaseInputLevel5: 'Please input level five',
|
||||
pleaseInputLevel1: 'Please input level1',
|
||||
pleaseInputLevel2: 'Please input level2',
|
||||
pleaseInputLevel3: 'Please input level3',
|
||||
pleaseInputLevel4: 'Please input level4',
|
||||
pleaseInputLevel5: 'Please input level5',
|
||||
systemOutPut: 'System output',
|
||||
selectPrintArea: 'Selec print area',
|
||||
selectDeleteRoute: 'Select delete route',
|
||||
@ -229,5 +229,9 @@ export default {
|
||||
editPlanningTrain: 'Edit planning train',
|
||||
runGraphName: 'Run graph name',
|
||||
tipOperationTime: '请先设置区段站间运行时间, 【文件】-> 【修改站间运行时间】',
|
||||
serverTrainNum: '表号车次号'
|
||||
serverTrainNum: '表号车次号',
|
||||
explanation: 'Explanation',
|
||||
creationDate: 'Creation date',
|
||||
load: 'Load',
|
||||
modifyName: 'Modify name'
|
||||
};
|
||||
|
@ -7,6 +7,9 @@ export default {
|
||||
runPlanManage: 'Run plan',
|
||||
productEdit: 'Product editor',
|
||||
|
||||
designhomePage: 'Public map',
|
||||
designUserPage: 'Personal map',
|
||||
|
||||
lessaonManage: 'Lesson',
|
||||
lessonEdit: 'Lesson editor',
|
||||
trainingRecord: 'Trainning recording',
|
||||
@ -58,5 +61,11 @@ export default {
|
||||
userExamManage: 'User examination management',
|
||||
userSimulationManage: 'User simulation management',
|
||||
existingSimulation: 'Existence simulation management',
|
||||
ibpDraw: 'ibp Draw'
|
||||
ibpDraw: 'Ibp Draw',
|
||||
trainingPlatform: 'trainingPlatform',
|
||||
releaseApplication: 'Release application',
|
||||
courseApplication: 'Course release application',
|
||||
scriptReleaseApplication: 'Script release application',
|
||||
runGraphReleaseApplication: 'Run graph release application',
|
||||
subsystemGeneration: 'Subsystem generation'
|
||||
};
|
||||
|
@ -239,9 +239,9 @@ export default {
|
||||
selectOneTrainingType: 'Only one training type can be selected',
|
||||
enterProductType: 'Please enter product type',
|
||||
selectAssociatedStation: 'Please select the associated station',
|
||||
pleaseSelectTrainDir: '请选择列车所在方向',
|
||||
pleaseEnterSplit: '请输入拆分数量',
|
||||
pleaseEnterSplitNumber: '请输入合理的拆分数量',
|
||||
pleaseSelectTrainDir: 'Please select the direction of the train',
|
||||
pleaseEnterSplit: 'Please enter the split number',
|
||||
pleaseEnterSplitNumber: 'Please enter a reasonable number of split',
|
||||
enterScale: 'Please enter the zoom ratio',
|
||||
enterXOffset: 'Please enter X offset',
|
||||
enterYOffset: 'Please enter Y offset',
|
||||
@ -276,7 +276,7 @@ export default {
|
||||
accessNumber: 'Please input the number of permissions',
|
||||
courseNameEmpty: 'Course name cannot be empty',
|
||||
purchaseMonth: 'Please input the number of months to buy',
|
||||
pleaseEnterGoodPrice: '请输入商品价格',
|
||||
pleaseEnterGoodPrice: 'Please enter the price of the goods',
|
||||
enterTheNameOfTheRunGraph: 'Please enter the name of the run graph',
|
||||
chooseToPublishTheRunGraph: 'Please choose to publish the run chart',
|
||||
enterTheAlarmCode: 'Please enter the alarm code',
|
||||
@ -306,5 +306,6 @@ export default {
|
||||
enterTheKeyWidth: 'Please enter the key width',
|
||||
enterTheKeyDirection: 'Please select the key direction',
|
||||
enterTheUpperText: 'Please enter the upper text',
|
||||
enterTheLowerText: 'Please enter the lower text'
|
||||
enterTheLowerText: 'Please enter the lower text',
|
||||
enterRejectReason: 'Please enter reject reason'
|
||||
};
|
||||
|
@ -4,6 +4,7 @@ export default {
|
||||
saveData: 'Save Data',
|
||||
mapList: 'Map List',
|
||||
createScript: 'Create Script',
|
||||
modifyScript: 'Modify Script',
|
||||
scriptName: 'Script Name',
|
||||
addScript: 'Add Script',
|
||||
map: 'Map',
|
||||
@ -15,6 +16,7 @@ export default {
|
||||
createScriptFail: 'Create script failure',
|
||||
scriptDetail: 'Script Detail',
|
||||
scriptRecord: 'Edit',
|
||||
scriptCreate: 'Create',
|
||||
scriptModify: 'Modify',
|
||||
scriptDelete: 'Delete',
|
||||
getScriptFail: 'Get script information failure',
|
||||
@ -81,7 +83,22 @@ export default {
|
||||
scriptBack: 'Back',
|
||||
speakTo: 'to',
|
||||
executeCommandTips: 'execute command: ',
|
||||
operate: 'Operate',
|
||||
scriptList: 'Script List',
|
||||
applyPublish: 'Apply for release',
|
||||
preview: 'Preview',
|
||||
status: 'Status',
|
||||
applyRevoke: 'Revoke',
|
||||
publish: 'Publish',
|
||||
revokeReason: 'Revoke explanation',
|
||||
language: 'language',
|
||||
chinese: 'Chinese Simplified',
|
||||
english: 'English'
|
||||
english: 'English',
|
||||
publishScript: 'Publish Script',
|
||||
releaseScriptSuccess: 'release script success',
|
||||
releaseScriptFailed: 'release script failed',
|
||||
publishScriptSuccess: 'Publish Script Success',
|
||||
publishScriptFailed: 'Publish Script Failed',
|
||||
releaseScriptTip: 'This action will apply to release script, whether to continue?',
|
||||
revokeScriptTip: 'This action will undo release script, whether to continue?'
|
||||
};
|
||||
|
@ -198,5 +198,12 @@ export default {
|
||||
runGraphNameModifiedSuccessfully: 'Run graph name modified successfully!',
|
||||
modifyRunGraphNameFailed: 'Modify run graph name failed!',
|
||||
planCreationSuccessful: 'Plan creation successful!',
|
||||
createPlanFailed: 'Failed to create plan!'
|
||||
createPlanFailed: 'Failed to create plan!',
|
||||
cancelCoursePublicationHint: 'This action will cancel the course publication application, is it OK?',
|
||||
cancelTheSuccessfulApplicationOfTheCourseRelease: 'Cancel the successful application of the course release!',
|
||||
cancellationOfCoursePublicationApplicationFailed: 'Cancellation of course publication application failed!',
|
||||
publishTheCourseHint: 'This operation will publish the course. Are you sure?',
|
||||
rejectedCourseReleaseApplicationSuccessful: 'Rejected course release application successful!',
|
||||
rejectedCourseReleaseApplicationFailed: 'Rejected course release application failed!',
|
||||
duplicatePlanFailedTips: 'The interval needs to be more than 30 seconds or the times is more than 1'
|
||||
};
|
||||
|
37
src/i18n/langs/zh/approval.js
Normal file
37
src/i18n/langs/zh/approval.js
Normal file
@ -0,0 +1,37 @@
|
||||
export default {
|
||||
applicant: '申请人',
|
||||
map: '地图',
|
||||
status: '状态',
|
||||
unpublished: '未发布',
|
||||
pendingReview: '待审核',
|
||||
releaseSuccess: '发布成功',
|
||||
overrule: '驳回',
|
||||
scriptName: '剧本名称',
|
||||
scriptDescription: '剧本简介',
|
||||
applyTime: '申请时间',
|
||||
applyPassed: '通过',
|
||||
applyReject: '驳回',
|
||||
scriptPreview: '预览',
|
||||
passedScript: '通过剧本',
|
||||
rejectScript: '驳回剧本',
|
||||
explanation: '驳回说明',
|
||||
inputScriptName: '请输入剧本名称',
|
||||
inputRejectExplanation: '请输入驳回说明',
|
||||
passedScriptSuccess: '通过剧本成功',
|
||||
passedScriptFailed: '通过剧本失败',
|
||||
rejectScriptSuccess: '驳回剧本成功',
|
||||
rejectScriptFailed: '驳回剧本失败',
|
||||
runPlanName: '运行图名称',
|
||||
passedRunPlan: '通过运行图',
|
||||
rejectRunPlan: '驳回运行图',
|
||||
runPlanPreview: '预览',
|
||||
inputRunPlanName: '请输入运行图名称',
|
||||
courseDescription: '课程说明',
|
||||
lookOver: '查看',
|
||||
courseDetails: '课程详情',
|
||||
instructions: '说明',
|
||||
chapterTrainingName: '章节/课程名称',
|
||||
revokeScriptSuccess: '撤回成功',
|
||||
revokeScriptFailed: '撤回失败'
|
||||
|
||||
};
|
@ -79,6 +79,7 @@ export default {
|
||||
schema: {
|
||||
selectProduct: '请选择产品类型',
|
||||
loadScript: '加载剧本',
|
||||
selectRoles: '选择角色',
|
||||
previewRunDiagram: '运行图预览',
|
||||
loadRunDiagram: '运行图加载',
|
||||
faultSetting: '故障设置',
|
||||
@ -123,6 +124,7 @@ export default {
|
||||
dispatcher: '行调',
|
||||
attendant: '车站',
|
||||
audience: '观众',
|
||||
repair: '通号',
|
||||
driver: '列车',
|
||||
none: '无'
|
||||
},
|
||||
|
@ -91,5 +91,8 @@ export default {
|
||||
getRunGraphDataFailed: '获取运行图数据失败',
|
||||
getStationListFail: '获取车站列表失败',
|
||||
obtainTrainGroupNumberFailed: '获取列车车组号失败',
|
||||
getTrainListFailed: '获取列车列表失败'
|
||||
getTrainListFailed: '获取列车列表失败',
|
||||
getDraftCourseDataFailed: '获取草稿课程数据失败!',
|
||||
failedToGetCourseData: '获取课程数据失败!',
|
||||
failedToGetSystemData: '获取系统数据失败!'
|
||||
};
|
||||
|
@ -22,6 +22,7 @@ export default {
|
||||
viewCoursePapers: '查看课程试卷',
|
||||
nameOfTestPaper: '试卷名称',
|
||||
examStartTime: '考试时间',
|
||||
minutes: '分钟',
|
||||
theExamIsReadyAnyTime: '随时都可以考试',
|
||||
testExplanation: '考试说明',
|
||||
examTimeAvailable: '考试时长',
|
||||
|
@ -24,6 +24,7 @@ import joinTraining from './joinTraining';
|
||||
import trainRoom from './trainRoom';
|
||||
import menu from './menu';
|
||||
import ibp from './ibp';
|
||||
import approval from './approval';
|
||||
|
||||
export default {
|
||||
...cnLocale,
|
||||
@ -51,5 +52,6 @@ export default {
|
||||
joinTraining,
|
||||
trainRoom,
|
||||
menu,
|
||||
ibp
|
||||
ibp,
|
||||
approval
|
||||
};
|
||||
|
@ -27,10 +27,10 @@ export default {
|
||||
wellDelTrainingRule: '此操作将删除此实训规则, 是否继续?',
|
||||
stepDetail: '步骤明细',
|
||||
generation: '自动生成',
|
||||
saveAs: '另存为',
|
||||
skinTypeFrom: '从',
|
||||
skinTypeTo: '到',
|
||||
copyLesson: '复制课程定义',
|
||||
saveAs: '另存为',
|
||||
skinTypeFrom: '从',
|
||||
skinTypeTo: '到',
|
||||
copyLesson: '复制课程定义',
|
||||
skinType: '皮肤类型',
|
||||
minDuration: '最佳用时',
|
||||
maxDuration: '最大用时',
|
||||
@ -101,6 +101,21 @@ export default {
|
||||
train: '列车',
|
||||
station: '车站',
|
||||
trainWindow: '车次窗',
|
||||
countSkinCode: '复制皮肤与被复制皮肤类型不能一样'
|
||||
countSkinCode: '复制皮肤与被复制皮肤类型不能一样',
|
||||
trainingRecord: '实训录制',
|
||||
lesson: '课程',
|
||||
taskManage: '任务管理',
|
||||
trainingRule: '操作定义',
|
||||
trainingManage: '实训管理',
|
||||
newConstruction: '新建',
|
||||
applicationForRelease: '申请发布',
|
||||
rejectReason: '驳回原因',
|
||||
withdraw: '撤销',
|
||||
notRelease: '未发布',
|
||||
pendingReview: '待审核',
|
||||
published: '已发布',
|
||||
rejected: '已驳回',
|
||||
review: '查看'
|
||||
|
||||
};
|
||||
|
||||
|
@ -232,5 +232,9 @@ export default {
|
||||
endTime: '终到时间',
|
||||
editPlanningTrain: '编辑计划车',
|
||||
tipOperationTime: '请先设置区段站间运行时间, 【文件】-> 【修改站间运行时间】',
|
||||
serverTrainNum: '表号车次号'
|
||||
serverTrainNum: '表号车次号',
|
||||
explanation: '驳回说明',
|
||||
creationDate: '创建日期',
|
||||
load: '加载',
|
||||
modifyName: '修改名称'
|
||||
};
|
||||
|
@ -1,6 +1,9 @@
|
||||
export default {
|
||||
homePage: '首页',
|
||||
|
||||
designhomePage: '公共地图',
|
||||
designUserPage: '个人地图',
|
||||
|
||||
mapManage: '地图管理',
|
||||
skinManage: '皮肤管理',
|
||||
mapDraw: '地图绘制',
|
||||
@ -59,5 +62,11 @@ export default {
|
||||
userSimulationManage: '用户仿真统计',
|
||||
existingSimulation: '存在仿真管理',
|
||||
|
||||
ibpDraw: 'Ibp盘绘制'
|
||||
ibpDraw: 'Ibp盘绘制',
|
||||
trainingPlatform: '实训平台',
|
||||
releaseApplication: '发布申请',
|
||||
courseApplication: '课程发布申请',
|
||||
scriptReleaseApplication: '剧本发布申请',
|
||||
runGraphReleaseApplication: '运行图发布申请',
|
||||
subsystemGeneration: '子系统生成'
|
||||
};
|
||||
|
@ -308,5 +308,6 @@ export default {
|
||||
enterTheKeyWidth: '请输入钥匙宽度',
|
||||
selectTheKeyDirection: '请选择钥匙朝向',
|
||||
enterTheUpperText: '请输入上侧文字',
|
||||
enterTheLowerText: '请输入下侧文字'
|
||||
enterTheLowerText: '请输入下侧文字',
|
||||
enterRejectReason: '请输入驳回说明'
|
||||
};
|
||||
|
@ -4,6 +4,7 @@ export default {
|
||||
saveData: '保存数据',
|
||||
mapList: '地图列表',
|
||||
createScript: '创建剧本',
|
||||
modifyScript: '修改剧本',
|
||||
scriptName: '剧本名称',
|
||||
addScript: '添加剧本',
|
||||
map: '所属地图',
|
||||
@ -15,6 +16,7 @@ export default {
|
||||
createScriptFail: '创建剧本失败',
|
||||
scriptDetail: '剧本详情',
|
||||
scriptRecord: '编制',
|
||||
scriptCreate: '创建',
|
||||
scriptModify: '修改',
|
||||
scriptDelete: '删除',
|
||||
getScriptFail: '获取剧本信息失败',
|
||||
@ -82,7 +84,22 @@ export default {
|
||||
scriptBack: '返回',
|
||||
speakTo: '对',
|
||||
executeCommandTips: '执行指令: ',
|
||||
operate: '操作',
|
||||
scriptList: '剧本列表',
|
||||
applyPublish: '申请发布',
|
||||
preview: '预览',
|
||||
status: '状态',
|
||||
applyRevoke: '撤回',
|
||||
publish: '发布',
|
||||
revokeReason: '驳回原因',
|
||||
language: '语言',
|
||||
chinese: '中文',
|
||||
english: '英文'
|
||||
english: '英文',
|
||||
publishScript: '发布剧本',
|
||||
releaseScriptSuccess: '申请发布成功',
|
||||
releaseScriptFailed: '申请发布失败',
|
||||
publishScriptSuccess: '发布成功',
|
||||
publishScriptFailed: '发布失败',
|
||||
releaseScriptTip: '此操作将申请发布剧本, 是否继续?',
|
||||
revokeScriptTip: '此操作将撤销发布剧本申请, 是否继续?'
|
||||
};
|
||||
|
@ -198,5 +198,12 @@ export default {
|
||||
runGraphNameModifiedSuccessfully: '修改运行图名称成功!',
|
||||
modifyRunGraphNameFailed: '修改运行图名称失败!',
|
||||
planCreationSuccessful: '创建计划成功!',
|
||||
createPlanFailed: '创建计划失败!'
|
||||
createPlanFailed: '创建计划失败!',
|
||||
cancelCoursePublicationHint: '此操作将撤销课程发布申请,是否确定?',
|
||||
cancelTheSuccessfulApplicationOfTheCourseRelease: '撤销课程发布申请成功!',
|
||||
cancellationOfCoursePublicationApplicationFailed: '撤销课程发布申请失败!',
|
||||
publishTheCourseHint: '此操作将发布课程,是否确定?',
|
||||
rejectedCourseReleaseApplicationSuccessful: '驳回课程发布申请成功!',
|
||||
rejectedCourseReleaseApplicationFailed: '驳回课程发布申请失败!',
|
||||
duplicatePlanFailedTips: '间隔时间需要大于30秒或次数大于1'
|
||||
};
|
||||
|
@ -73,7 +73,7 @@ export default {
|
||||
this.$store.state.training.roles == 'BigScreen';
|
||||
},
|
||||
isShowMenu() {
|
||||
return this.$store.state.training.prdType != '';
|
||||
return this.$store.state.training.prdType;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -72,7 +72,7 @@ export default {
|
||||
this.$store.state.training.roles != 'BigScreen';
|
||||
},
|
||||
isShowBar() {
|
||||
return this.$store.state.training.prdType != '';
|
||||
return this.$store.state.training.prdType;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -157,7 +157,7 @@ export default {
|
||||
operate: OperationEvent.Command.mBar.system,
|
||||
children: [
|
||||
{
|
||||
title: '登陆',
|
||||
title: '登录',
|
||||
click: this.undeveloped
|
||||
},
|
||||
{
|
||||
@ -424,7 +424,7 @@ export default {
|
||||
operate: OperationEvent.Command.mBar.system,
|
||||
children: [
|
||||
{
|
||||
title: '登陆',
|
||||
title: '登录',
|
||||
click: this.undeveloped
|
||||
},
|
||||
{
|
||||
|
326
src/jmap/theme/chengdu_03/menus/dialog/routeHandControl.vue
Normal file
326
src/jmap/theme/chengdu_03/menus/dialog/routeHandControl.vue
Normal file
@ -0,0 +1,326 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-dialogDrag class="chengdou-03__systerm route-hand-control" :title="title" :visible.sync="show" width="500px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
|
||||
<el-row class="header">
|
||||
<el-col :span="11"><span>车站</span></el-col>
|
||||
<el-col :span="11" :offset="2"><span>始端信号机</span></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-input v-model="stationName" size="small" disabled />
|
||||
</el-col>
|
||||
<el-col :span="11" :offset="2">
|
||||
<el-input v-model="signalName" size="small" disabled />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="table">
|
||||
<el-table ref="tempTable" :data="tempData" border style="width: 100%" size="mini" highlight-current-row :height="140">
|
||||
<el-table-column prop="name" label="选择" width="55" style="margin-left:50px; text-align: right;">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox
|
||||
v-model="scope.row.check"
|
||||
style="text-align: center; display: block;"
|
||||
:disabled="scope.row.disabled"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :id="domIdChoose" prop="name" width="155" label="描述" style="margin-left:30px">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :id="domIdChoose" prop="name" label="方向" style="">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">111</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :id="domIdChoose" prop="name" label="属性" style="">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">1111</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :id="domIdChoose" prop="name" label="控制" style="">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">2222</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :disabled="commitDisabled" :loading="loading" @click="commit">确定</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<confirm-control ref="confirmControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
|
||||
import ConfirmControl from './childDialog/confirmControl';
|
||||
import { mouseCancelState } from '../utils/menuItemStatus';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'RouteHandControl',
|
||||
components: {
|
||||
ConfirmControl,
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
selected: null,
|
||||
tempData: [],
|
||||
operation: null,
|
||||
selection: [],
|
||||
stationName: '',
|
||||
signalName: '',
|
||||
allSelect: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'signalList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
return OperationEvent.Signal.humanControl.choose.domId;
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
return OperationEvent.Signal.atsAutoControl.choose.domId;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? getDomIdByOperation(this.operation) : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
return '进路交人工控';
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
return '进路交自动控';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
commitDisabled() {
|
||||
let disabled = true;
|
||||
if (this.selection && this.selection.length) {
|
||||
disabled = false;
|
||||
}
|
||||
|
||||
return disabled;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 深度数据状态
|
||||
tempData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate, selected, tempData) {
|
||||
this.selected = selected;
|
||||
// 如果不是断点激活,而是第一次显示则初始化
|
||||
if (!this.dialogShow) {
|
||||
this.signalName = '';
|
||||
this.stationName = '';
|
||||
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
|
||||
this.signalName = selected.name;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
|
||||
if (station) {
|
||||
this.stationName = station.name;
|
||||
}
|
||||
}
|
||||
|
||||
// if (tempData && tempData.length > 0) {
|
||||
// tempData.forEach(elem => {
|
||||
// elem.check = false;
|
||||
// elem.disabled = false;
|
||||
// // 设置禁用状态
|
||||
// if (operate.operation === OperationEvent.Signal.humanControl.menu.operation &&
|
||||
// elem.controlType != '01') {
|
||||
// elem.disabled = true;
|
||||
// } if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation &&
|
||||
// elem.controlType == '01') {
|
||||
// elem.disabled = true;
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
this.tempData = tempData || [];
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$refs.tempTable.setCurrentRow();
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
mouseCancelState(this.selected);
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.check && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.handleChooseChange(selection);
|
||||
this.selection = selection;
|
||||
}
|
||||
let num = 0;
|
||||
this.allSelect = false;
|
||||
this.tempData.forEach(item => {
|
||||
if (item.check) {
|
||||
num++;
|
||||
if (num == this.tempData.length) {
|
||||
this.allSelect = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
allSelectChange() {
|
||||
if (this.allSelect) {
|
||||
this.tempData.forEach(item => {
|
||||
if (!item.disabled) {
|
||||
item.check = true;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.tempData.forEach(item => {
|
||||
if (!item.disabled) {
|
||||
item.check = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
serializeCodeListWithSeparator(sep) {
|
||||
const codeList = [];
|
||||
if (this.selection && this.selection.length) {
|
||||
this.selection.forEach(elem => {
|
||||
codeList.push(elem.code);
|
||||
});
|
||||
}
|
||||
return codeList.join(sep);
|
||||
},
|
||||
handleChooseChange(selection) {
|
||||
this.selection = selection;
|
||||
if (selection && selection.length) {
|
||||
const operate = {
|
||||
repeat: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: '',
|
||||
val: this.serializeCodeListWithSeparator('::'),
|
||||
selection: selection
|
||||
};
|
||||
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 进路交人工控*/
|
||||
operate.operation = OperationEvent.Signal.humanControl.choose.operation;
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 进路交自动控*/
|
||||
operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation;
|
||||
}
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
} else if (!selection) {
|
||||
this.$messageBox(`请选择一条数据`);
|
||||
}
|
||||
},
|
||||
commit() {
|
||||
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
|
||||
/** 进路交人工控*/
|
||||
this.humanControl();
|
||||
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
|
||||
/** 进路交自动控*/
|
||||
this.atsAutoControl();
|
||||
}
|
||||
},
|
||||
// 进路交人工控
|
||||
humanControl() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.humanControl.menu.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 进路交自动控
|
||||
atsAutoControl() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Signal.atsAutoControl.menu.operation
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.Signal.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => { this.doClose(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -74,7 +74,7 @@ export default {
|
||||
this.$store.state.training.roles != 'BigScreen';
|
||||
},
|
||||
isShowBar() {
|
||||
return this.$store.state.training.prdType != '';
|
||||
return this.$store.state.training.prdType;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -133,7 +133,7 @@ export default {
|
||||
operate: OperationEvent.Command.mBar.system,
|
||||
children: [
|
||||
{
|
||||
title: '登陆',
|
||||
title: '登录',
|
||||
click: this.undeveloped
|
||||
},
|
||||
{
|
||||
@ -400,7 +400,7 @@ export default {
|
||||
operate: OperationEvent.Command.mBar.system,
|
||||
children: [
|
||||
{
|
||||
title: '登陆',
|
||||
title: '登录',
|
||||
click: this.undeveloped
|
||||
},
|
||||
{
|
||||
|
@ -5,6 +5,7 @@
|
||||
<route-control ref="routeControl" />
|
||||
<route-detail ref="routeDetail" />
|
||||
<route-guide ref="routeGuide" />
|
||||
<route-hand-control ref="routeHandControl" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
</div>
|
||||
</template>
|
||||
@ -14,6 +15,7 @@ import PopMenu from '@/components/PopMenu';
|
||||
import RouteControl from './dialog/routeControl';
|
||||
import RouteSelection from './dialog/routeSelection';
|
||||
import RouteDetail from './dialog/routeDetail';
|
||||
import RouteHandControl from './dialog/routeHandControl';
|
||||
import RouteGuide from './dialog/routeGuide';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
@ -28,6 +30,7 @@ export default {
|
||||
PopMenu,
|
||||
RouteControl,
|
||||
RouteSelection,
|
||||
RouteHandControl,
|
||||
RouteDetail,
|
||||
RouteGuide,
|
||||
NoticeInfo
|
||||
@ -441,7 +444,7 @@ export default {
|
||||
tempData = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.routeControl.doShow(operate, this.selected, tempData);
|
||||
this.$refs.routeHandControl.doShow(operate, this.selected, tempData);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -462,7 +465,7 @@ export default {
|
||||
tempData = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.routeControl.doShow(operate, this.selected, tempData);
|
||||
this.$refs.routeHandControl.doShow(operate, this.selected, tempData);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -71,7 +71,7 @@ export default {
|
||||
this.$store.state.training.roles != 'BigScreen';
|
||||
},
|
||||
isShowBar() {
|
||||
return this.$store.state.training.prdType != '';
|
||||
return this.$store.state.training.prdType;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -158,7 +158,7 @@ export default {
|
||||
operate: OperationEvent.Command.mBar.system,
|
||||
children: [
|
||||
{
|
||||
title: '登陆',
|
||||
title: '登录',
|
||||
click: this.undeveloped
|
||||
},
|
||||
{
|
||||
@ -425,7 +425,7 @@ export default {
|
||||
operate: OperationEvent.Command.mBar.system,
|
||||
children: [
|
||||
{
|
||||
title: '登陆',
|
||||
title: '登录',
|
||||
click: this.undeveloped
|
||||
},
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ export default {
|
||||
this.$store.state.training.roles != 'BigScreen';
|
||||
},
|
||||
isShowBar() {
|
||||
return this.$store.state.training.prdType != '';
|
||||
return this.$store.state.training.prdType;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -1,472 +1,472 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm station-control-convert"
|
||||
:title="$t('menu.menuDialog.controlModeConversion')"
|
||||
:visible.sync="show"
|
||||
width="700px"
|
||||
:before-close="doClose"
|
||||
:show-close="true"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
border
|
||||
row-key="code"
|
||||
style="width: 100%"
|
||||
height="250"
|
||||
center
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm station-control-convert"
|
||||
:title="$t('menu.menuDialog.controlModeConversion')"
|
||||
:visible.sync="show"
|
||||
width="700px"
|
||||
:before-close="doClose"
|
||||
:show-close="true"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-table-column :id="domIdChoose" prop="check" :label="$t('menu.menuDialog.select')" width="60" style="margin-left:30px">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox ref="check" v-model="scope.row.check" :disabled="scope.row.disabled" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="operate" :label="$t('menu.menuDialog.operatingArea')" width="140">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="control" :label="$t('menu.menuDialog.controlMode')" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" :label="$t('menu.menuDialog.centerStationCommunicationStatus')" width="140">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.status }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="result" :label="$t('menu.menuDialog.transferExecutionStatus')">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.result }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="3" class="control_button">
|
||||
<el-button v-if="isFork" :id="domIdFork" :disabled="disabledCommit" @click="forkCommit">{{ $t('menu.menuDialog.forcedStationControl') }}</el-button>
|
||||
<el-button v-if="isRequest" :id="domIdRequest" :disabled="disabledCommit" @click="requestCommit">{{ $t('menu.menuDialog.requestStationControl') }}
|
||||
</el-button>
|
||||
<el-button v-if="isConter" :id="domIdConter" :disabled="disabledCommit" @click="conterCommit">{{ $t('menu.menuDialog.requestInTheControl') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdCancel" :disabled="disabledClose" @click="cancel">{{ $t('menu.menuDialog.close') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<two-confirmation ref="twoConfirmation" @setOperate="getOperate" />
|
||||
</el-dialog>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
border
|
||||
row-key="code"
|
||||
style="width: 100%"
|
||||
height="250"
|
||||
center
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column :id="domIdChoose" prop="check" :label="$t('menu.menuDialog.select')" width="60" style="margin-left:30px">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox ref="check" v-model="scope.row.check" :disabled="scope.row.disabled" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="operate" :label="$t('menu.menuDialog.operatingArea')" width="140">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="control" :label="$t('menu.menuDialog.controlMode')" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" :label="$t('menu.menuDialog.centerStationCommunicationStatus')" width="140">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.status }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="result" :label="$t('menu.menuDialog.transferExecutionStatus')">
|
||||
<template slot-scope="scope">
|
||||
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.result }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="10" :offset="3" class="control_button">
|
||||
<el-button v-if="isFork" :id="domIdFork" :disabled="disabledCommit" @click="forkCommit">{{ $t('menu.menuDialog.forcedStationControl') }}</el-button>
|
||||
<el-button v-if="isRequest" :id="domIdRequest" :disabled="disabledCommit" @click="requestCommit">{{ $t('menu.menuDialog.requestStationControl') }}
|
||||
</el-button>
|
||||
<el-button v-if="isConter" :id="domIdConter" :disabled="disabledCommit" @click="conterCommit">{{ $t('menu.menuDialog.requestInTheControl') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="4">
|
||||
<el-button :id="domIdCancel" :disabled="disabledClose" @click="cancel">{{ $t('menu.menuDialog.close') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<two-confirmation ref="twoConfirmation" @setOperate="getOperate" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import TwoConfirmation from './childDialog/twoConfirmation';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
|
||||
import TwoConfirmation from './childDialog/twoConfirmation';
|
||||
|
||||
export default {
|
||||
name: 'StationControlConvert',
|
||||
components: {
|
||||
TwoConfirmation
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operate: null,
|
||||
dialogShow: false,
|
||||
disabledSend: false,
|
||||
disabledSure: false,
|
||||
disabledClose: false,
|
||||
operation: '',
|
||||
controlProps: {
|
||||
'01': this.$t('menu.menuDialog.inTheControl'),
|
||||
'02': this.$t('menu.menuDialog.stationControl')
|
||||
},
|
||||
selection: [],
|
||||
tableData: [],
|
||||
timer: null,
|
||||
count: 0,
|
||||
flagListBit: [],
|
||||
backOperate: '',
|
||||
timeout: 61,
|
||||
counts: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList',
|
||||
'stationControlList'
|
||||
]),
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'started'
|
||||
]),
|
||||
disabledCommit() {
|
||||
return this.disabledSend || this.disabledSure;
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
isFork() {
|
||||
if (this.dialogShow) {
|
||||
return checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
isRequest() {
|
||||
if (this.dialogShow) {
|
||||
return checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
isConter() {
|
||||
if (this.dialogShow) {
|
||||
return checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
domIdChoose() {
|
||||
if (this.dialogShow) {
|
||||
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
return OperationEvent.StationControl.forcedStationControl.choose.domId;
|
||||
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
return OperationEvent.StationControl.requestStationControl.choose.domId;
|
||||
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
return OperationEvent.StationControl.requestCentralControl.choose.domId;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
domIdConter() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.requestCentralControl.menu.domId : '';
|
||||
},
|
||||
domIdFork() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.forcedStationControl.menu.domId : '';
|
||||
},
|
||||
domIdRequest() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.requestStationControl.menu.domId : '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem) {
|
||||
this.flagListBit[this.selection.forEach(elem => { return elem.stationControlCode == elem.code; })] = false;
|
||||
if (elem.hasOwnProperty('timeout')) {
|
||||
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.acceptConversionResponseTimeout') }, false);
|
||||
} else if (elem.hasOwnProperty('agree')) {
|
||||
if (elem.agree) {
|
||||
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.controlModeTransfersuccees') }, true);
|
||||
} else {
|
||||
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.controlModeTransferFailed') }, false);
|
||||
}
|
||||
}
|
||||
this.disabledClose = false;
|
||||
this.disabledSure = false;
|
||||
}
|
||||
},
|
||||
backOperate: function (operate) {
|
||||
if (this.dialogShow && operate) {
|
||||
if (operate.selection && operate.selection.length) {
|
||||
operate.selection.forEach(elem => {
|
||||
if (operate.commit) {
|
||||
this.updateTableValue(elem.code, { result: `${this.$t('menu.menuDialog.senedMessageOne')}${this.timeout} ${this.$t('menu.menuDialog.senedMessageTwo')}` }, false);
|
||||
} else if (operate.cancel) {
|
||||
this.updateTableValue(elem.code, { result: '' }, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
// 深度数据状态
|
||||
tableData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadTableData();
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
updateTableValue(code, result, success) {
|
||||
this.tableData.forEach((row, index) => {
|
||||
if (row.code == code) {
|
||||
for (const prop in result) {
|
||||
row[prop] = result[prop];
|
||||
}
|
||||
if (success) {
|
||||
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
row.control = this.controlProps['02']; // 01:中控, 02:站控
|
||||
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
row.control = this.controlProps['01']; // 01:中控, 02:站控
|
||||
}
|
||||
row.disabled = true;
|
||||
row.check = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.check && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
export default {
|
||||
name: 'StationControlConvert',
|
||||
components: {
|
||||
TwoConfirmation
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operate: null,
|
||||
dialogShow: false,
|
||||
disabledSend: false,
|
||||
disabledSure: false,
|
||||
disabledClose: false,
|
||||
operation: '',
|
||||
controlProps: {
|
||||
'01': this.$t('menu.menuDialog.inTheControl'),
|
||||
'02': this.$t('menu.menuDialog.stationControl')
|
||||
},
|
||||
selection: [],
|
||||
tableData: [],
|
||||
timer: null,
|
||||
count: 0,
|
||||
flagListBit: [],
|
||||
backOperate: '',
|
||||
timeout: 61,
|
||||
counts: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList',
|
||||
'stationControlList'
|
||||
]),
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'started'
|
||||
]),
|
||||
disabledCommit() {
|
||||
return this.disabledSend || this.disabledSure;
|
||||
},
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
isFork() {
|
||||
if (this.dialogShow) {
|
||||
return checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
isRequest() {
|
||||
if (this.dialogShow) {
|
||||
return checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
isConter() {
|
||||
if (this.dialogShow) {
|
||||
return checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
domIdChoose() {
|
||||
if (this.dialogShow) {
|
||||
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
return OperationEvent.StationControl.forcedStationControl.choose.domId;
|
||||
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
return OperationEvent.StationControl.requestStationControl.choose.domId;
|
||||
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
return OperationEvent.StationControl.requestCentralControl.choose.domId;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
domIdConter() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.requestCentralControl.menu.domId : '';
|
||||
},
|
||||
domIdFork() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.forcedStationControl.menu.domId : '';
|
||||
},
|
||||
domIdRequest() {
|
||||
return this.dialogShow ? OperationEvent.StationControl.requestStationControl.menu.domId : '';
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem) {
|
||||
this.flagListBit[this.selection.forEach(elem => { return elem.stationControlCode == elem.code; })] = false;
|
||||
if (elem.hasOwnProperty('timeout')) {
|
||||
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.acceptConversionResponseTimeout') }, false);
|
||||
} else if (elem.hasOwnProperty('agree')) {
|
||||
if (elem.agree) {
|
||||
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.controlModeTransfersuccees') }, true);
|
||||
} else {
|
||||
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.controlModeTransferFailed') }, false);
|
||||
}
|
||||
}
|
||||
this.disabledClose = false;
|
||||
this.disabledSure = false;
|
||||
}
|
||||
},
|
||||
backOperate: function (operate) {
|
||||
if (this.dialogShow && operate) {
|
||||
if (operate.selection && operate.selection.length) {
|
||||
operate.selection.forEach(elem => {
|
||||
if (operate.commit) {
|
||||
this.updateTableValue(elem.code, { result: `${$t('menu.menuDialog.senedMessageOne')}${this.timeout} ${this.$t('menu.menuDialog.senedMessageTwo')}` }, false);
|
||||
} else if (operate.cancel) {
|
||||
this.updateTableValue(elem.code, { result: '' }, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
// 深度数据状态
|
||||
tableData: {
|
||||
handler(val, oldVal) {
|
||||
this.checkTableDataSelction(val);
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadTableData();
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
updateTableValue(code, result, success) {
|
||||
this.tableData.forEach((row, index) => {
|
||||
if (row.code == code) {
|
||||
for (const prop in result) {
|
||||
row[prop] = result[prop];
|
||||
}
|
||||
if (success) {
|
||||
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
row.control = this.controlProps['02']; // 01:中控, 02:站控
|
||||
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
row.control = this.controlProps['01']; // 01:中控, 02:站控
|
||||
}
|
||||
row.disabled = true;
|
||||
row.check = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
checkTableDataSelction(data) {
|
||||
const selection = [];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach(row => {
|
||||
if (row.check && !row.disabled) {
|
||||
selection.push(row);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.disabledSend = !selection.length;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.handleChooseChange(selection);
|
||||
this.selection = selection;
|
||||
}
|
||||
},
|
||||
checkBoxDisabled(row) {
|
||||
const control = (this.$store.getters['map/getDeviceByCode'](row.code) || {});
|
||||
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
if (control && control.status == '02') { // 01:中控, 02:站控
|
||||
return true;
|
||||
}
|
||||
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
if (control && control.status == '01') { // 01:中控, 02:站控
|
||||
return true;
|
||||
}
|
||||
}
|
||||
this.disabledSend = !selection.length;
|
||||
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
|
||||
this.handleChooseChange(selection);
|
||||
this.selection = selection;
|
||||
}
|
||||
},
|
||||
checkBoxDisabled(row) {
|
||||
const control = (this.$store.getters['map/getDeviceByCode'](row.code) || {});
|
||||
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
if (control && control.status == '02') { // 01:中控, 02:站控
|
||||
return true;
|
||||
}
|
||||
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
if (control && control.status == '01') { // 01:中控, 02:站控
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
loadTableData() {
|
||||
this.tableData = [];
|
||||
this.stationControlList.forEach(control => {
|
||||
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
||||
this.tableData.push({
|
||||
code: control.code,
|
||||
operate: station.name || '',
|
||||
control: '',
|
||||
check: false,
|
||||
disabled: false,
|
||||
status: this.$t('menu.menuDialog.normal'),
|
||||
result: ''
|
||||
});
|
||||
});
|
||||
},
|
||||
initTableDataStatus() {
|
||||
this.tableData.forEach(row => {
|
||||
row.disabled = this.checkBoxDisabled(row);
|
||||
row.check = false;
|
||||
row.result = '';
|
||||
const control = this.$store.getters['map/getDeviceByCode'](row.code);
|
||||
if (control) {
|
||||
row.control = this.controlProps[control.status];
|
||||
}
|
||||
});
|
||||
},
|
||||
doShow(operate) {
|
||||
if (!this.dialogShow) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.disabledSure = false;
|
||||
this.initTableDataStatus();
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
doClose() {
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$refs.multipleTable.setCurrentRow();
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: 'bar',
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
},
|
||||
loadTableData() {
|
||||
this.tableData = [];
|
||||
this.stationControlList.forEach(control => {
|
||||
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
||||
this.tableData.push({
|
||||
code: control.code,
|
||||
operate: station.name || '',
|
||||
control: '',
|
||||
check: false,
|
||||
disabled: false,
|
||||
status: this.$t('menu.menuDialog.normal'),
|
||||
result: ''
|
||||
});
|
||||
});
|
||||
},
|
||||
initTableDataStatus() {
|
||||
this.tableData.forEach(row => {
|
||||
row.disabled = this.checkBoxDisabled(row);
|
||||
row.check = false;
|
||||
row.result = '';
|
||||
const control = this.$store.getters['map/getDeviceByCode'](row.code);
|
||||
if (control) {
|
||||
row.control = this.controlProps[control.status];
|
||||
}
|
||||
});
|
||||
},
|
||||
doShow(operate) {
|
||||
if (!this.dialogShow) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.disabledSure = false;
|
||||
this.initTableDataStatus();
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
doClose() {
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
this.$refs.multipleTable.setCurrentRow();
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: 'bar',
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
setTimer() {
|
||||
this.clearTimer();
|
||||
this.flagListBit = new Array(this.selection.length).fill(true);
|
||||
this.timer = setInterval(() => {
|
||||
(this.selection || []).forEach((elem, index) => {
|
||||
if (this.flagListBit[index]) {
|
||||
elem['count'] = (elem['count'] || 0) + 1;
|
||||
elem['count'] > this.timeout && (
|
||||
this.flagListBit[index] = false,
|
||||
this.setRequestTimeout(elem)
|
||||
);
|
||||
}
|
||||
});
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
setTimer() {
|
||||
this.clearTimer();
|
||||
this.flagListBit = new Array(this.selection.length).fill(true);
|
||||
this.timer = setInterval(() => {
|
||||
(this.selection || []).forEach((elem, index) => {
|
||||
if (this.flagListBit[index]) {
|
||||
elem['count'] = (elem['count'] || 0) + 1;
|
||||
elem['count'] > this.timeout && (
|
||||
this.flagListBit[index] = false,
|
||||
this.setRequestTimeout(elem)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
this.flagListBit.findIndex(elem => { return elem; }) < 0 && this.clearTimer();
|
||||
}, 1000);
|
||||
},
|
||||
clearTimer() {
|
||||
this.count = 0;
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
},
|
||||
setRequestTimeout(elem) {
|
||||
elem['count'] = 0;
|
||||
this.$store.dispatch('socket/pushMsgQueue',
|
||||
{ type: 'resp', timeout: 'true', stationControlCode: elem.code }
|
||||
);
|
||||
},
|
||||
serializeCodeListWithSeparator(sep) {
|
||||
const codeList = [];
|
||||
if (this.selection && this.selection.length) {
|
||||
this.selection.forEach(elem => {
|
||||
codeList.push(elem.code);
|
||||
});
|
||||
}
|
||||
return codeList.join(sep);
|
||||
},
|
||||
handleChooseChange(selection) {
|
||||
this.selection = selection;
|
||||
if (selection && selection.length) {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: '',
|
||||
val: this.serializeCodeListWithSeparator('::'),
|
||||
selection: selection
|
||||
};
|
||||
this.flagListBit.findIndex(elem => { return elem; }) < 0 && this.clearTimer();
|
||||
}, 1000);
|
||||
},
|
||||
clearTimer() {
|
||||
this.count = 0;
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
},
|
||||
setRequestTimeout(elem) {
|
||||
elem['count'] = 0;
|
||||
this.$store.dispatch('socket/pushMsgQueue',
|
||||
{ type: 'resp', timeout: 'true', stationControlCode: elem.code }
|
||||
);
|
||||
},
|
||||
serializeCodeListWithSeparator(sep) {
|
||||
const codeList = [];
|
||||
if (this.selection && this.selection.length) {
|
||||
this.selection.forEach(elem => {
|
||||
codeList.push(elem.code);
|
||||
});
|
||||
}
|
||||
return codeList.join(sep);
|
||||
},
|
||||
handleChooseChange(selection) {
|
||||
this.selection = selection;
|
||||
if (selection && selection.length) {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
operation: '',
|
||||
val: this.serializeCodeListWithSeparator('::'),
|
||||
selection: selection
|
||||
};
|
||||
|
||||
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
operate.operation = OperationEvent.StationControl.forcedStationControl.choose.operation;
|
||||
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
operate.operation = OperationEvent.StationControl.requestStationControl.choose.operation;
|
||||
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
operate.operation = OperationEvent.StationControl.requestCentralControl.choose.operation;
|
||||
}
|
||||
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
operate.operation = OperationEvent.StationControl.forcedStationControl.choose.operation;
|
||||
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
|
||||
operate.operation = OperationEvent.StationControl.requestStationControl.choose.operation;
|
||||
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
|
||||
operate.operation = OperationEvent.StationControl.requestCentralControl.choose.operation;
|
||||
}
|
||||
|
||||
this.disabledSure = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.disabledSure = false;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
} else if (!selection) {
|
||||
this.$messageBox(this.$t('menu.menuDialog.selectData'));
|
||||
}
|
||||
},
|
||||
requestCommit() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
messages: [this.$t('menu.menuDialog.confirmStationControlTip')],
|
||||
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
|
||||
val: this.serializeCodeListWithSeparator('::'),
|
||||
selection: this.selection
|
||||
};
|
||||
this.disabledSure = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.disabledSure = false;
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
} else if (!selection) {
|
||||
this.$messageBox(this.$t('menu.menuDialog.selectData'));
|
||||
}
|
||||
},
|
||||
requestCommit() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
messages: [this.$t('menu.menuDialog.confirmStationControlTip')],
|
||||
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
|
||||
val: this.serializeCodeListWithSeparator('::'),
|
||||
selection: this.selection
|
||||
};
|
||||
|
||||
this.selection.forEach((elem, index) => {
|
||||
operate.messages.push(`${this.$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
|
||||
});
|
||||
this.selection.forEach((elem, index) => {
|
||||
operate.messages.push(`${$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
|
||||
});
|
||||
|
||||
this.disabledSure = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.twoConfirmation.doShow(operate);
|
||||
} else {
|
||||
this.disabledSure = false;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.disabledSure = false;
|
||||
});
|
||||
},
|
||||
forkCommit() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
messages: [this.$t('menu.menuDialog.confirmInTheControlTip')],
|
||||
operation: OperationEvent.StationControl.forcedStationControl.menu.operation,
|
||||
val: this.serializeCodeListWithSeparator('::'),
|
||||
selection: this.selection
|
||||
};
|
||||
this.disabledSure = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.twoConfirmation.doShow(operate);
|
||||
} else {
|
||||
this.disabledSure = false;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.disabledSure = false;
|
||||
});
|
||||
},
|
||||
forkCommit() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
messages: [this.$t('menu.menuDialog.confirmInTheControlTip')],
|
||||
operation: OperationEvent.StationControl.forcedStationControl.menu.operation,
|
||||
val: this.serializeCodeListWithSeparator('::'),
|
||||
selection: this.selection
|
||||
};
|
||||
|
||||
this.selection.forEach((elem, index) => {
|
||||
operate.messages.push(`${this.$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
|
||||
});
|
||||
this.selection.forEach((elem, index) => {
|
||||
operate.messages.push(`${$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
|
||||
});
|
||||
|
||||
this.disabledSure = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.twoConfirmation.doShow(operate);
|
||||
} else {
|
||||
this.disabledSure = false;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.disabledSure = false;
|
||||
});
|
||||
},
|
||||
conterCommit() { // 请求中控
|
||||
const operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
messages: [this.$t('menu.menuDialog.confirmInTheControlTip')],
|
||||
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
|
||||
val: this.serializeCodeListWithSeparator('::'),
|
||||
selection: this.selection
|
||||
};
|
||||
this.disabledSure = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.twoConfirmation.doShow(operate);
|
||||
} else {
|
||||
this.disabledSure = false;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.disabledSure = false;
|
||||
});
|
||||
},
|
||||
conterCommit() { // 请求中控
|
||||
const operate = {
|
||||
type: MapDeviceType.StationControl.type,
|
||||
messages: [this.$t('menu.menuDialog.confirmInTheControlTip')],
|
||||
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
|
||||
val: this.serializeCodeListWithSeparator('::'),
|
||||
selection: this.selection
|
||||
};
|
||||
|
||||
this.selection.forEach((elem, index) => {
|
||||
operate.messages.push(`${this.$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
|
||||
});
|
||||
this.selection.forEach((elem, index) => {
|
||||
operate.messages.push(`${$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
|
||||
});
|
||||
|
||||
this.disabledSure = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.twoConfirmation.doShow(operate);
|
||||
} else {
|
||||
this.disabledSure = false;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.disabledSure = false;
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
this.backOperate = operate;
|
||||
if (operate.cancel) {
|
||||
this.disabledSure = this.disabledSend = false;
|
||||
}
|
||||
if (operate.commit || operate.timeout) {
|
||||
this.disabledSend = this.disabledSure = true;
|
||||
}
|
||||
this.setTimer();
|
||||
this.disabledClose = true;
|
||||
this.counts = 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
this.disabledSure = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.twoConfirmation.doShow(operate);
|
||||
} else {
|
||||
this.disabledSure = false;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.disabledSure = false;
|
||||
});
|
||||
},
|
||||
getOperate(operate) {
|
||||
this.backOperate = operate;
|
||||
if (operate.cancel) {
|
||||
this.disabledSure = this.disabledSend = false;
|
||||
}
|
||||
if (operate.commit || operate.timeout) {
|
||||
this.disabledSend = this.disabledSure = true;
|
||||
}
|
||||
this.setTimer();
|
||||
this.disabledClose = true;
|
||||
this.counts = 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.fuzhou-01__systerm .el-dialog .control_button button{
|
||||
max-width:180px;
|
||||
width:auto ;
|
||||
padding-left: 5px ;
|
||||
padding-right: 5px ;
|
||||
min-width: 80px;
|
||||
}
|
||||
.fuzhou-01__systerm .el-dialog .control_button button{
|
||||
max-width:180px;
|
||||
width:auto ;
|
||||
padding-left: 5px ;
|
||||
padding-right: 5px ;
|
||||
min-width: 80px;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,209 +1,209 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm alarm-detail"
|
||||
:title="level+$t('menu.passiveDialog.alarmDetailInformation')"
|
||||
:visible.sync="show"
|
||||
width="760px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form label-width="80px" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('menu.passiveDialog.lineName')">
|
||||
<el-input v-model="model.lineName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('menu.passiveDialog.unitName')">
|
||||
<el-input v-model="model.unitName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('menu.passiveDialog.moduleName')">
|
||||
<el-input v-model="model.moduleName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<el-form-item :label="$t('menu.passiveDialog.alarmDate')">
|
||||
<el-date-picker v-model="model.alarmDate" type="datetime" :placeholder="$t('menu.passiveDialog.selectDate')" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item>
|
||||
<span slot="label">{{ $t('menu.passiveDialog.level') }}</span>
|
||||
<el-input v-model="model.level" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('menu.passiveDialog.confirmStatus')">
|
||||
<el-input v-model="model.confirm" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9" class="alarm-type">
|
||||
<el-form-item>
|
||||
<span slot="label">{{ $t('menu.passiveDialog.type') }}</span>
|
||||
<el-input v-model="model.type" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="15" class="alarm-child-type">
|
||||
<el-form-item :label="$t('menu.passiveDialog.childType')">
|
||||
<el-input v-model="model.childType" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item :label="$t('menu.passiveDialog.timeSummary')">
|
||||
<el-input v-model="model.timeSummary" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.passiveDialog.recommendedOperation')">
|
||||
<el-input v-model="model.recommendedOperation" disabled />
|
||||
</el-form-item>
|
||||
<div class="alarm-detail-description">
|
||||
<span>{{ $t('menu.passiveDialog.alarmDetailedDescription') }}</span><br>
|
||||
<el-input v-model="model.alarmDetail" type="textarea" :rows="5" :placeholder="$t('menu.passiveDialog.inputContent')" disabled />
|
||||
</div>
|
||||
</el-form>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="3" :offset="9">
|
||||
<el-button :id="domIdCancel" type="primary" :loading="loading" @click="commit">{{ $t('menu.passiveDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<span style="line-height:26px">{{ $t('menu.passiveDialog.unconfirmedMessageOne') }}{{ level }}{{ $t('menu.passiveDialog.unconfirmedMessageTwo') }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm alarm-detail"
|
||||
:title="level+$t('menu.passiveDialog.alarmDetailInformation')"
|
||||
:visible.sync="show"
|
||||
width="760px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form label-width="80px" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('menu.passiveDialog.lineName')">
|
||||
<el-input v-model="model.lineName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('menu.passiveDialog.unitName')">
|
||||
<el-input v-model="model.unitName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('menu.passiveDialog.moduleName')">
|
||||
<el-input v-model="model.moduleName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<el-form-item :label="$t('menu.passiveDialog.alarmDate')">
|
||||
<el-date-picker v-model="model.alarmDate" type="datetime" :placeholder="$t('menu.passiveDialog.selectDate')" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item>
|
||||
<span slot="label">{{ $t('menu.passiveDialog.level') }}</span>
|
||||
<el-input v-model="model.level" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('menu.passiveDialog.confirmStatus')">
|
||||
<el-input v-model="model.confirm" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="9" class="alarm-type">
|
||||
<el-form-item>
|
||||
<span slot="label">{{ $t('menu.passiveDialog.type') }}</span>
|
||||
<el-input v-model="model.type" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="15" class="alarm-child-type">
|
||||
<el-form-item :label="$t('menu.passiveDialog.childType')">
|
||||
<el-input v-model="model.childType" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item :label="$t('menu.passiveDialog.timeSummary')">
|
||||
<el-input v-model="model.timeSummary" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('menu.passiveDialog.recommendedOperation')">
|
||||
<el-input v-model="model.recommendedOperation" disabled />
|
||||
</el-form-item>
|
||||
<div class="alarm-detail-description">
|
||||
<span>{{ $t('menu.passiveDialog.alarmDetailedDescription') }}</span><br>
|
||||
<el-input v-model="model.alarmDetail" type="textarea" :rows="5" :placeholder="$t('menu.passiveDialog.inputContent')" disabled />
|
||||
</div>
|
||||
</el-form>
|
||||
<el-row class="button-group">
|
||||
<el-col :span="3" :offset="9">
|
||||
<el-button :id="domIdCancel" type="primary" :loading="loading" @click="commit">{{ $t('menu.passiveDialog.confirm') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<span style="line-height:26px">{{ $t('menu.passiveDialog.unconfirmedMessageOne') }}{{ level }}{{ $t('menu.passiveDialog.unconfirmedMessageTwo') }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'AlarmDetail',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
level: 0,
|
||||
operate: null,
|
||||
controlProps: {
|
||||
'01': this.$t('menu.passiveDialog.centralControl'),
|
||||
'02': this.$t('menu.passiveDialog.stationControl')
|
||||
},
|
||||
model: {
|
||||
lineName: '',
|
||||
unitName: '',
|
||||
moduleName: '',
|
||||
level: '',
|
||||
confirm: '',
|
||||
alarmDate: '',
|
||||
type: '',
|
||||
childType: '',
|
||||
timeSummary: '',
|
||||
recommendedOperation: '',
|
||||
alarmDetail: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'name'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.alarm.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && elem.type == 'resp' && elem.agree) {
|
||||
if (elem.agree) {
|
||||
const operate = this.$store.state.training.operate;
|
||||
const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
|
||||
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
||||
const newOperate = {
|
||||
type: operate.type,
|
||||
name: station.name,
|
||||
currentMode: elem.currentMode
|
||||
};
|
||||
export default {
|
||||
name: 'AlarmDetail',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
level: 0,
|
||||
operate: null,
|
||||
controlProps: {
|
||||
'01': this.$t('menu.passiveDialog.centralControl'),
|
||||
'02': this.$t('menu.passiveDialog.stationControl')
|
||||
},
|
||||
model: {
|
||||
lineName: '',
|
||||
unitName: '',
|
||||
moduleName: '',
|
||||
level: '',
|
||||
confirm: '',
|
||||
alarmDate: '',
|
||||
type: '',
|
||||
childType: '',
|
||||
timeSummary: '',
|
||||
recommendedOperation: '',
|
||||
alarmDetail: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'name'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.close.alarm.domId : '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.msgHead': function (elem) {
|
||||
if (elem && elem.type == 'resp' && elem.agree) {
|
||||
if (elem.agree) {
|
||||
const operate = this.$store.state.training.operate;
|
||||
const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
|
||||
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
||||
const newOperate = {
|
||||
type: operate.type,
|
||||
name: station.name,
|
||||
currentMode: elem.currentMode
|
||||
};
|
||||
|
||||
this.doShow(newOperate);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.model = {
|
||||
lineName: this.name,
|
||||
unitName: this.operate.name,
|
||||
moduleName: this.$t('menu.passiveDialog.cmmControlModeConversionMode'),
|
||||
level: this.$t('menu.passiveDialog.zeroLevelAlarm'),
|
||||
confirm: this.$t('menu.passiveDialog.confirmStatus'),
|
||||
alarmDate: new Date(),
|
||||
type: this.$t('menu.passiveDialog.systemEvent'),
|
||||
childType: this.$t('menu.passiveDialog.childTypeTips'),
|
||||
timeSummary: this.$t('menu.passiveDialog.controlModeSummary'),
|
||||
recommendedOperation: '',
|
||||
alarmDetail: `${this.$t('menu.passiveDialog.controlModeTransfer')} ${this.operate.name}${this.$t('menu.passiveDialog.alarmDetailOne')}${operate.currentMode == '01' ? this.$t('menu.passiveDialog.stationToCentral') : this.$t('menu.passiveDialog.centralToStation')}!`
|
||||
};
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.alarm.operation
|
||||
};
|
||||
this.doShow(newOperate);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow(operate) {
|
||||
this.operate = operate || {};
|
||||
this.model = {
|
||||
lineName: this.name,
|
||||
unitName: this.operate.name,
|
||||
moduleName: this.$t('menu.passiveDialog.cmmControlModeConversionMode'),
|
||||
level: this.$t('menu.passiveDialog.zeroLevelAlarm'),
|
||||
confirm: this.$t('menu.passiveDialog.confirmStatus'),
|
||||
alarmDate: new Date(),
|
||||
type: this.$t('menu.passiveDialog.systemEvent'),
|
||||
childType: this.$t('menu.passiveDialog.childTypeTips'),
|
||||
timeSummary: this.$t('menu.passiveDialog.controlModeSummary'),
|
||||
recommendedOperation: '',
|
||||
alarmDetail: `${$t('menu.passiveDialog.controlModeTransfer')} ${this.operate.name}${this.$t('menu.passiveDialog.alarmDetailOne')}${operate.currentMode == '01' ? this.$t('menu.passiveDialog.stationToCentral') : this.$t('menu.passiveDialog.centralToStation')}!`
|
||||
};
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
if (this.dialogShow) {
|
||||
this.$store.dispatch('socket/shiftMsgQueue');
|
||||
}
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.alarm.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.alarm.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
isClose() {
|
||||
return this.dialogShow;
|
||||
}
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
type: this.operate.type,
|
||||
operation: OperationEvent.Command.close.alarm.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
isClose() {
|
||||
return this.dialogShow;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -26,7 +26,7 @@ export default {
|
||||
handle: this.quickEntry
|
||||
},
|
||||
{
|
||||
name: 'global.scan',
|
||||
name: 'global.scan',
|
||||
handle: this.qcodeEntry,
|
||||
hidden: process.env.NODE_ENV != 'development'
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
<script>
|
||||
import Language from './Language';
|
||||
|
||||
import { UrlConfig } from '@/router/index';
|
||||
export default {
|
||||
name: 'Logout',
|
||||
components: {
|
||||
@ -34,11 +34,13 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
},
|
||||
mounted(){
|
||||
},
|
||||
computed: {
|
||||
username() {
|
||||
return this.$store.state.user.nickname;
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
language() {
|
||||
@ -48,7 +50,10 @@ export default {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
location.reload(); // 为了重新实例化vue-router对象 避免bug
|
||||
});
|
||||
}
|
||||
},
|
||||
selfPermission(){
|
||||
this.$router.push({ path: `${UrlConfig.permission.prefix}/manage`});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -2,12 +2,13 @@
|
||||
<el-menu
|
||||
class="navbar"
|
||||
router
|
||||
:default-active="$route.path"
|
||||
:default-active="activePath"
|
||||
mode="horizontal"
|
||||
background-color="#545c64"
|
||||
text-color="#fff"
|
||||
active-text-color="#ffd04b"
|
||||
>
|
||||
<system-title></system-title>
|
||||
<template v-for="(item,idx) in routers">
|
||||
<template v-if="!item.hidden&&item.children">
|
||||
<template v-if="hasOneScreenShowingChildren(item.children) &&!item.alwaysShow">
|
||||
@ -23,6 +24,7 @@
|
||||
</template>
|
||||
<template v-else-if="hasOneShowingChildren(item.children) &&!item.alwaysShow">
|
||||
<template :to="item.path+'/'+item.children[0].path">
|
||||
<!-- -->
|
||||
<el-menu-item :key="idx" :index="item.redirect ? item.redirect : (item.path+'/'+item.children[0].path)">
|
||||
<span
|
||||
v-if="item.children[0].meta&&item.children[0].meta.i18n"
|
||||
@ -66,7 +68,7 @@
|
||||
</el-submenu>
|
||||
</template>
|
||||
</template>
|
||||
<quick-entry ref="quickEntry" />
|
||||
<quick-entry ref="quickEntry" v-if="isShow"/>
|
||||
<user-logout ref="userLogout" />
|
||||
</el-menu>
|
||||
</template>
|
||||
@ -75,15 +77,20 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import UserLogout from './Logout';
|
||||
import QuickEntry from './Entry';
|
||||
import SystemTitle from './Title';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
UserLogout,
|
||||
QuickEntry
|
||||
QuickEntry,
|
||||
SystemTitle
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
routes: []
|
||||
routes: [],
|
||||
isShow:false,
|
||||
activePath:'',
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -93,7 +100,22 @@ export default {
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
this.routes = this.$router.options.routes;
|
||||
this.routes = this.$router.options.routes;
|
||||
if (getSessionStorage('design')) {
|
||||
this.isShow=false;
|
||||
}
|
||||
else{
|
||||
this.isShow=true;
|
||||
}
|
||||
if(this.$route.fullPath.indexOf('design/userlist')>=0){
|
||||
this.activePath='/design/userlist/home';
|
||||
}
|
||||
else if(this.$route.fullPath.indexOf('design/lesson')>=0 || this.$route.fullPath.indexOf('design/script')>=0 || this.$route.fullPath.indexOf('design/runPlan')>=0){
|
||||
this.activePath='/design/home';
|
||||
}
|
||||
else{
|
||||
this.activePath=this.$route.path;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggleSideBar() {
|
||||
@ -103,7 +125,7 @@ export default {
|
||||
const showingChildren = children.filter(item => {
|
||||
if (!item.hidden && !item.target) { return item; }
|
||||
});
|
||||
if (showingChildren.length === 1) {
|
||||
if (showingChildren.length === 1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
57
src/layout/components/Title.vue
Normal file
57
src/layout/components/Title.vue
Normal file
@ -0,0 +1,57 @@
|
||||
|
||||
<template>
|
||||
<div class="avatar-container" style="margin-left:40px;">
|
||||
<img class="logo" :src="logoImg" @click="goToMain"/>
|
||||
<div class="titleInner" style="margin-left:60px;" @click="goToMain">{{systemTitle}}</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import logoImg from '@/assets/logo_changan.png';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { loginTitle } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
logoImg: logoImg,
|
||||
systemTitle:"城市轨道交通实训平台"
|
||||
};
|
||||
},
|
||||
mounted(){
|
||||
if (getSessionStorage('design')) {
|
||||
this.systemTitle="城市轨道交通设计平台";
|
||||
}
|
||||
else{
|
||||
this.systemTitle=loginTitle[getSessionStorage('project')||'default'];
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
goToMain(){
|
||||
// if (getSessionStorage('design')) {
|
||||
// this.$router.push({ path: `${UrlConfig.design.prefix}/home`});
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.main-container .navbar .avatar-container {
|
||||
height: 61px;
|
||||
position: relative;
|
||||
right: 35px;
|
||||
float: left;
|
||||
}
|
||||
.titleInner{
|
||||
display:inline-block;
|
||||
color: #fff;
|
||||
font-size:24px;
|
||||
font-weight:bold;
|
||||
}
|
||||
.logo{
|
||||
position: absolute;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
top: 10px;
|
||||
}
|
||||
</style>
|
@ -3,9 +3,11 @@ import store from '@/store';
|
||||
import router from './router';
|
||||
import NProgress from 'nprogress'; // Progress 进度条
|
||||
import 'nprogress/nprogress.css';// Progress 进度条样式
|
||||
import { admin } from './router';
|
||||
import { getToken, getScreenToken, getPlanToken } from '@/utils/auth'; // 验权
|
||||
import { admin, userDesign} from './router';
|
||||
import { getToken, getScreenToken, getDesignToken} from '@/utils/auth'; // 验权
|
||||
// getPlanToken
|
||||
import { LoginParams } from '@/utils/login';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
|
||||
function hasPermission(roles, permissionRoles) {
|
||||
if (roles.indexOf(admin) >= 0) return true;
|
||||
@ -13,13 +15,24 @@ function hasPermission(roles, permissionRoles) {
|
||||
return roles.some(role => permissionRoles.indexOf(role) >= 0);
|
||||
}
|
||||
|
||||
const whiteList = ['/login', '/dp/login', '/plan/login', '/en/login']; // 不重定向白名单
|
||||
const project = getSessionStorage('project');
|
||||
|
||||
// const whiteList = ['/login', '/login1', '/dp/login', '/dp/login1', '/design/login1']; // 不重定向白名单
|
||||
//
|
||||
// const loginPage = whiteList[0] + (('/'+project) || '');
|
||||
//
|
||||
// const loginScreenPage = isDev ? whiteList[3] : whiteList[2];
|
||||
//
|
||||
// const loginPlanPage = isDev ? whiteList[5] : whiteList[4];
|
||||
// const loginDesignPage = isDev ? whiteList[4] : whiteList[4];
|
||||
|
||||
const whiteList = ['/login', '/dp/login', '/en/login', '/design/login', '/en/design/login', '/login/xty']; // 不重定向白名单
|
||||
|
||||
const loginPage = whiteList[0];
|
||||
|
||||
const loginScreenPage = whiteList[1];
|
||||
|
||||
const loginPlanPage = whiteList[2];
|
||||
const loginDesignPage = whiteList[3];
|
||||
|
||||
// 获取路径数据
|
||||
function getRouteInfo(to) {
|
||||
@ -32,10 +45,21 @@ function getRouteInfo(to) {
|
||||
loginPath = loginScreenPage;
|
||||
getTokenInfo = getScreenToken;
|
||||
clientId = LoginParams.DaPing.clientId;
|
||||
} else if (/^\/plan/.test(toRoutePath) || /^\/display\/plan/.test(toRoutePath) || /^\/planEdit/.test(toRoutePath)) {
|
||||
loginPath = loginPlanPage;
|
||||
getTokenInfo = getPlanToken;
|
||||
clientId = LoginParams.LianJiHua.clientId;
|
||||
} else if (/^\/design/.test(toRoutePath) || /^\/scriptDisplay/.test(toRoutePath) || /^\/publish/.test(toRoutePath) || /^\/orderauthor/.test(toRoutePath) || /^\/system/.test(toRoutePath) || /^\/display\/manage/.test(toRoutePath) || /^\/apply/.test(toRoutePath)) {
|
||||
loginPath = loginDesignPage;
|
||||
getTokenInfo = getDesignToken;
|
||||
clientId = LoginParams.Design.clientId;
|
||||
} else if (/^\/plan/.test(toRoutePath) || /^\/display\/plan/.test(toRoutePath)) {
|
||||
const flag = getSessionStorage('design');
|
||||
if (flag == 'true') {
|
||||
loginPath = loginDesignPage;
|
||||
getTokenInfo = getDesignToken;
|
||||
clientId = LoginParams.Design.clientId;
|
||||
} else {
|
||||
loginPath = loginPage;
|
||||
getTokenInfo = getToken;
|
||||
clientId = null;
|
||||
}
|
||||
} else {
|
||||
loginPath = loginPage;
|
||||
getTokenInfo = getToken;
|
||||
@ -50,11 +74,15 @@ function handleRoute(to, from, next, routeInfo) {
|
||||
// 拉取用户信息
|
||||
store.dispatch('GetInfo', routeInfo.getTokenInfo).then(res => {
|
||||
// 根据roles权限生成可访问的路由表
|
||||
// debugger;
|
||||
const roles = res.roles;
|
||||
|
||||
if (getSessionStorage('design')) {
|
||||
roles.push(userDesign);
|
||||
}
|
||||
store.dispatch('GenerateRoutes', { roles, clientId: routeInfo.clientId }).then(() => {
|
||||
// 动态添加可访问路由表
|
||||
router.addRoutes(store.getters.addRouters);
|
||||
// router.addRoutes(asyncRouter1);
|
||||
if (to.redirectedFrom) {
|
||||
next({ path: to.redirectedFrom, replace: true });
|
||||
} else {
|
||||
@ -64,7 +92,7 @@ function handleRoute(to, from, next, routeInfo) {
|
||||
|
||||
}).catch(() => {
|
||||
store.dispatch('FedLogOut', routeInfo.clientId).then(() => {
|
||||
Vue.prototype.$messageBox('验证失败,请重新登陆!');
|
||||
Vue.prototype.$messageBox('验证失败,请重新登录!');
|
||||
next({ path: routeInfo.loginPath });
|
||||
});
|
||||
});
|
||||
|
@ -8,21 +8,20 @@ import Layout from '@/layout';
|
||||
import Login from '@/views/login/index';
|
||||
// 英文默认登陆窗口
|
||||
import LoginEn from '@/views/login/loginEn';
|
||||
|
||||
// import LoginNewScreen from '@/views/login/loginNewScreen';
|
||||
import LoginScreen from '@/views/login/loginScreen';
|
||||
import LoginPlan from '@/views/login/loginPlan';
|
||||
import LoginDesign from '@/views/login/loginDesign';
|
||||
import LoginDesignEn from '@/views/login/loginEnDesign';
|
||||
|
||||
import Jlmap3dedit from '@/views/jlmap3d/edit/jlmap3dedit';
|
||||
import Jlmap3d from '@/views/jlmap3d/drive/jl3ddrive';
|
||||
import Display from '@/views/display/index';
|
||||
import DesignDisplay from '@/views/display/designIndex';
|
||||
|
||||
import TrainRoom from '@/views/trainRoom/index';
|
||||
import JointTraining from '@/views/jointTraining/index';
|
||||
|
||||
import Error401 from '@/views/error-page/401';
|
||||
import Errpr404 from '@/views/error-page/404';
|
||||
import Dashboard from '@/views/dashboard/index';
|
||||
import Dashboard1 from '@/views/dashboard/index.vue';
|
||||
import SkinCode from '@/views/map/skinCode/index';
|
||||
import SkinCodeDraft from '@/views/map/skinCode/draft';
|
||||
import Mapdraft from '@/views/map/mapdraft/index';
|
||||
@ -36,41 +35,38 @@ import Taskmanage from '@/views/lesson/taskmanage/list';
|
||||
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 LessonEdit from '@/views/lesson/lessoncategory/index';
|
||||
import LessonHome from '@/views/lesson/home';
|
||||
|
||||
import Scriptmanage from '@/views/scriptManage/index';
|
||||
import ScriptmanageHome from '@/views/scriptManage/home';
|
||||
import ScriptDisplay from '@/views/scriptManage/display/index';
|
||||
|
||||
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';
|
||||
import TeachPractical from '@/views/teach/practical/index';
|
||||
import Pay from '@/views/components/pay/index';
|
||||
import Exam from '@/views/exam/index';
|
||||
import ExamHome from '@/views/exam/home';
|
||||
import ExamDetail from '@/views/exam/detail/examDetail';
|
||||
import ExamCourseDetail from '@/views/exam/detail/courseDetail';
|
||||
import ExamQuestionDetail from '@/views/exam/detail/questionDetail';
|
||||
import ExamResult from '@/views/exam/result';
|
||||
|
||||
import PublishExamRule from '@/views/publish/examRule/index';
|
||||
import PublishExamRuleDraft from '@/views/publish/examRule/draft/index';
|
||||
|
||||
import Demonstration from '@/views/demonstration/index';
|
||||
import DemonstrationHome from '@/views/demonstration/home';
|
||||
import DemonstrationDetail from '@/views/demonstration/detail/index';
|
||||
import ScreenMonitor from '@/views/screenMonitor/index';
|
||||
import ScreenMonitorHome from '@/views/screenMonitor/home';
|
||||
import ScreenMonitorDetail from '@/views/screenMonitor/detail/index';
|
||||
|
||||
import PlanMonitorEditTool from '@/views/planMonitor/editTool/index';
|
||||
import PlanMonitorEditUserTool from '@/views/planMonitor/editTool/userindex';
|
||||
|
||||
import PlanMonitor from '@/views/planMonitor/index';
|
||||
import PlanMonitorHome from '@/views/planMonitor/home';
|
||||
import PlanMonitorDetail from '@/views/planMonitor/detail';
|
||||
|
||||
import DesignPlatformHome from '@/views/designPlatform/home';
|
||||
import DesignPlatform from '@/views/designPlatform/index';
|
||||
import DesignPlatformUser from '@/views/designPlatform/userIndex';
|
||||
|
||||
import Replay from '@/views/replay/index';
|
||||
import Package from '@/views/package/index';
|
||||
import PackageDraft from '@/views/package/draft/ruleForm';
|
||||
@ -85,8 +81,10 @@ import RunPlanTemplate from '@/views/publish/runPlanTemplate/index';
|
||||
import RunPlanEveryDay from '@/views/publish/runPlanEveryDay/index';
|
||||
import ProductStatus from '@/views/publish/productStatus/index';
|
||||
import PublishLesson from '@/views/publish/publishLesson/index';
|
||||
// import SimulationScript from '@/views/publish/simulationScript/index';
|
||||
|
||||
import IbpEdit from '@/views/ibp/ibpDraft/ibpEdit/index';
|
||||
import TrainingPlatform from '@/views/trainingPlatform/index';
|
||||
import TrainingPlatformHome from '@/views/trainingPlatform/home';
|
||||
|
||||
import Commodity from '@/views/orderauthor/commodity/index';
|
||||
import CommodityDraft from '@/views/orderauthor/commodity/draft';
|
||||
@ -110,9 +108,17 @@ import UserTraining from '@/views/management/userTraining/index';
|
||||
import UserExam from '@/views/management/userExam/index';
|
||||
import UserSimulation from '@/views/management/userSimulation/index';
|
||||
import ExistingSimulation from '@/views/management/existingSimulation/index';
|
||||
|
||||
import CacheControl from '@/views/management/cacheControl/index';
|
||||
|
||||
import LessonApproval from '@/views/approval/lesson/index';
|
||||
import ScriptApproval from '@/views/approval/script/index';
|
||||
import RunPlanApproval from '@/views/approval/runPlan/index';
|
||||
|
||||
import SystemGenerate from '@/views/systemGenerate/index';
|
||||
|
||||
import { loginTitle } from '@/scripts/ConstDic';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
|
||||
/**
|
||||
* Note: sub-menu only appear when route children.length >= 1
|
||||
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
|
||||
@ -143,6 +149,7 @@ export const userLesson = '012'; // 教学系统
|
||||
export const userSimulation = '013'; // 仿真系统
|
||||
export const userScreen = '014'; // 大屏系统
|
||||
export const userPlan = '015'; // 计划系统
|
||||
export const userDesign='016'; // 设计系统
|
||||
|
||||
export const UrlConfig = {
|
||||
display: '/display',
|
||||
@ -152,8 +159,8 @@ export const UrlConfig = {
|
||||
map: {
|
||||
prefix: '/map',
|
||||
draft: '/map/draw',
|
||||
skinCode: '/map/skinCode',
|
||||
skinCodeDraft: '/map/skinCode/draft',
|
||||
skinCode: '/system/skinCode',
|
||||
skinCodeDraft: '/system/skinCode/draft',
|
||||
runPlan: '/map/runPlan',
|
||||
runPlanView: '/map/runPlan/view',
|
||||
product: '/map/product',
|
||||
@ -164,24 +171,6 @@ export const UrlConfig = {
|
||||
record: '/lesson/record/training',
|
||||
manage: '/lesson/manage/training'
|
||||
},
|
||||
teach: {
|
||||
prefix: '/teach',
|
||||
detail: '/teach/detail',
|
||||
practical: '/teach/practical',
|
||||
pay: '/teach/pay'
|
||||
},
|
||||
exam: {
|
||||
prefix: '/exam',
|
||||
detail: '/exam/detail',
|
||||
course: '/exam/course',
|
||||
examRuleManage: '/exam/examRule/manage',
|
||||
pay: '/exam/pay'
|
||||
},
|
||||
demonstration: {
|
||||
prefix: '/demonstration',
|
||||
detail: '/demonstration/detail',
|
||||
pay: '/demonstration/pay'
|
||||
},
|
||||
dp: {
|
||||
prefix: '/dp',
|
||||
detail: '/dp/detail',
|
||||
@ -191,18 +180,39 @@ export const UrlConfig = {
|
||||
plan: {
|
||||
prefix: '/plan',
|
||||
tool: '/plan/tool',
|
||||
usertool: '/plan/usertool',
|
||||
detail: '/plan/detail',
|
||||
pay: '/plan/pay'
|
||||
},
|
||||
design: {
|
||||
prefix: '/design/home',
|
||||
// tool: '/design/tool',
|
||||
// detail: '/plan/detail',
|
||||
// pay: '/plan/pay'
|
||||
mapDraw: '/design/map/draw',
|
||||
lessonEdit: '/design/lesson/edit',
|
||||
lessonHome: '/design/lesson/home',
|
||||
lessonManage: '/design/lesson/manage',
|
||||
taskManage: '/design/lesson/taskManage',
|
||||
trainingRule: '/design/lesson/trainingRule',
|
||||
trainingRuleDetail: '/design/lesson/trainingRule/detail',
|
||||
trainingManage: '/design/lesson/trainingManage',
|
||||
lessonTraining: '/design/lesson/training',
|
||||
trainingRecord: '/design/lesson/training',
|
||||
runPlan: '/design/runPlan/detail',
|
||||
scriptHome: '/design/script/home',
|
||||
display: '/design/display'
|
||||
},
|
||||
designUser: {
|
||||
prefix: '/design/userlist/home',
|
||||
scriptHome: '/design/userlist/script/home',
|
||||
mapDraw: '/design/userlist/map/draw',
|
||||
lessonHome: '/design/userlist/lesson/home',
|
||||
runPlan: '/design/userlist/runPlan/detail'
|
||||
},
|
||||
replay: {
|
||||
prefix: '/replay'
|
||||
},
|
||||
permission: {
|
||||
prefix: '/permission',
|
||||
permissionList: '/permission/manage',
|
||||
permissionDraft: '/permission/draft',
|
||||
permission: '/permission/restore'
|
||||
},
|
||||
publish: {
|
||||
prefix: '/publish',
|
||||
map: '/publish/map',
|
||||
@ -234,6 +244,22 @@ export const UrlConfig = {
|
||||
prefix: 'ibp',
|
||||
draft: '/ibp/draft',
|
||||
edit: 'ibp/edit'
|
||||
},
|
||||
trainingPlatform: {
|
||||
trainingPlatform: '/trainingPlatform',
|
||||
trainingPlatformHome: '/trainingPlatform/home',
|
||||
prodDetail: '/trainingPlatform/detail',
|
||||
teachDetail: '/trainingPlatform/teach',
|
||||
examDetail: '/trainingPlatform/exam',
|
||||
examRuleManage: '/trainingPlatform/examRule/manage',
|
||||
examRuleDraft: '/trainingPlatform/examRule/Draft',
|
||||
course: '/trainingPlatform/course',
|
||||
practical: '/trainingPlatform/practical',
|
||||
permission: '/trainingPlatform/permission',
|
||||
permissionDetails: '/trainingPlatform/permission/detail',
|
||||
draft: '/trainingPlatform/draft',
|
||||
pay: '/trainingPlatform/pay',
|
||||
runPlan: '/trainingPlatform/runPlan/manage'
|
||||
}
|
||||
};
|
||||
|
||||
@ -243,13 +269,19 @@ export const UrlConfig = {
|
||||
* all roles can be accessed
|
||||
*/
|
||||
export const constantRoutes = [
|
||||
// 默认登陆窗口
|
||||
// 实训平台登录
|
||||
{
|
||||
path: '/login',
|
||||
component: Login,
|
||||
hidden: true
|
||||
},
|
||||
// 英文登陆窗口
|
||||
// 项目系统登录
|
||||
{
|
||||
path: '/login/:project',
|
||||
component: Login,
|
||||
hidden: true
|
||||
},
|
||||
// 实训平台英文登录
|
||||
{
|
||||
path: '/en/login',
|
||||
component: LoginEn,
|
||||
@ -261,13 +293,18 @@ export const constantRoutes = [
|
||||
component: LoginScreen,
|
||||
hidden: true
|
||||
},
|
||||
// 琏计划登陆
|
||||
// 设计平台登录
|
||||
{
|
||||
path: '/plan/login',
|
||||
component: LoginPlan,
|
||||
path: '/design/login',
|
||||
component: LoginDesign,
|
||||
hidden: true
|
||||
},
|
||||
// 设计平台英文登录
|
||||
{
|
||||
path: '/design/en/login',
|
||||
component: LoginDesignEn,
|
||||
hidden: true
|
||||
},
|
||||
|
||||
{
|
||||
path: '/jlmap3d/edit',
|
||||
component: Jlmap3dedit,
|
||||
@ -284,34 +321,152 @@ export const constantRoutes = [
|
||||
component: Errpr404,
|
||||
hidden: true
|
||||
},
|
||||
|
||||
{
|
||||
path: '/',
|
||||
component: Layout,
|
||||
redirect: '/dashboard',
|
||||
children: [{
|
||||
path: 'dashboard',
|
||||
component: Dashboard,
|
||||
meta: {
|
||||
i18n: 'router.homePage',
|
||||
icon: 'dashboard'
|
||||
}
|
||||
}]
|
||||
},
|
||||
|
||||
{ path: '*', redirect: '/404', hidden: true }
|
||||
];
|
||||
|
||||
export const asyncRouter = [
|
||||
{
|
||||
path: '/',
|
||||
path: '/design',
|
||||
component: Layout,
|
||||
redirect: '/dashboard',
|
||||
hidden: true,
|
||||
redirect: '/design/home',
|
||||
meta: {
|
||||
roles: [admin, user, userDesign]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'dashboard',
|
||||
component: Dashboard1
|
||||
path: '',
|
||||
redirect: '/design/home',
|
||||
component: DesignPlatform,
|
||||
meta: {
|
||||
i18n: 'router.designhomePage',
|
||||
icon: 'design'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
component: DesignPlatformHome,
|
||||
meta: {
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'map/draw/:mapId/:view',
|
||||
component: Mapedit,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'lesson/edit/:type',
|
||||
component: LessonEdit,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'runPlan/detail/:mapId',
|
||||
component: PlanMonitorDetail,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'script/home/:mapId',
|
||||
component: ScriptmanageHome,
|
||||
meta: {
|
||||
i18n: 'router.scriptManage'
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'lesson/home/:mapId/:skinCode',
|
||||
component: LessonHome,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'lesson/training/:trainingId/:trainingName',
|
||||
component: TrainingrecordManage,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'lesson/taskManage',
|
||||
component: Taskmanage,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'lesson/trainingRule',
|
||||
component: TrainingRuleList,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'lesson/trainingRule/detail',
|
||||
hidden: true,
|
||||
component: TrainingRuleEdit
|
||||
},
|
||||
{
|
||||
path: 'lesson/trainingManage/:skinCode',
|
||||
component: Trainingmanage,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'lesson/training/:trainingId/:trainingName',
|
||||
component: TrainingrecordManage,
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/design/userlist',
|
||||
redirect: '/design/userlist/home',
|
||||
component: Layout,
|
||||
meta: {
|
||||
roles: [admin, user, userDesign]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
redirect: '/design/userlist/home',
|
||||
component: DesignPlatformUser,
|
||||
meta: {
|
||||
i18n: 'router.designUserPage',
|
||||
icon: 'design'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
component: DesignPlatformHome,
|
||||
meta: {
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'map/draw/:mapId/:view',
|
||||
component: Mapedit,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'lesson/edit/:type',
|
||||
component: LessonEdit,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'runPlan/detail/:mapId',
|
||||
component: PlanMonitorDetail,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'script/home/:mapId',
|
||||
component: ScriptmanageHome,
|
||||
meta: {
|
||||
i18n: 'router.scriptManage'
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'lesson/home/:mapId',
|
||||
component: LessonHome,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'lesson/training/:trainingId/:trainingName',
|
||||
component: TrainingrecordManage,
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -322,6 +477,13 @@ export const asyncRouter = [
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/design/display/:mode',
|
||||
component: DesignDisplay,
|
||||
meta: {
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/scriptDisplay/:mode',
|
||||
component: ScriptDisplay,
|
||||
@ -352,22 +514,11 @@ export const asyncRouter = [
|
||||
path: '/map',
|
||||
meta: {
|
||||
i18n: 'router.mapManage',
|
||||
roles: [admin, mapCreater]
|
||||
roles: [admin, mapCreater, userDesign]
|
||||
},
|
||||
hidden: true,
|
||||
component: Layout,
|
||||
children: [
|
||||
{
|
||||
path: 'skinCode',
|
||||
component: SkinCode,
|
||||
meta: {
|
||||
i18n: 'router.skinManage'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'skinCode/draft/:mode/:skinCodeId',
|
||||
hidden: true,
|
||||
component: SkinCodeDraft
|
||||
},
|
||||
{
|
||||
path: 'draw',
|
||||
redirect: '/map/draw/0/draft',
|
||||
@ -383,13 +534,6 @@ export const asyncRouter = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'ibp/edit',
|
||||
component: IbpEdit,
|
||||
meta: {
|
||||
i18n: 'router.ibpDraw'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'runPlan',
|
||||
redirect: '/map/runPlan/view/draft',
|
||||
@ -415,9 +559,10 @@ export const asyncRouter = [
|
||||
{
|
||||
path: '/lesson',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
meta: {
|
||||
i18n: 'router.lessaonManage',
|
||||
roles: [admin, lessonCreater]
|
||||
roles: [admin, lessonCreater, userDesign]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@ -435,13 +580,6 @@ export const asyncRouter = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'manage/taskManage',
|
||||
component: Taskmanage,
|
||||
meta: {
|
||||
i18n: 'router.taskManage'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'manage/trainingRule',
|
||||
component: TrainingRuleList,
|
||||
@ -462,186 +600,96 @@ export const asyncRouter = [
|
||||
meta: {
|
||||
i18n: 'router.trainingManage'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'edit',
|
||||
component: Lessoncategory,
|
||||
meta: {
|
||||
i18n: 'router.lessonEdit'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/script',
|
||||
component: Layout,
|
||||
meta: {
|
||||
roles: [admin, lessonCreater, user]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
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
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/teach',
|
||||
component: Layout,
|
||||
meta: {
|
||||
roles: [admin, userLesson, user]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
redirect: '/teach/home',
|
||||
component: Teach,
|
||||
meta: {
|
||||
i18n: 'router.teachSystem'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
component: TeachHome
|
||||
},
|
||||
{
|
||||
// 课程详情
|
||||
path: 'detail/:lessonId',
|
||||
component: TeachDetail,
|
||||
meta: {
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
// 实训详情
|
||||
path: 'practical/:trainingId/:lessonId',
|
||||
component: TeachPractical,
|
||||
meta: {
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'pay/:lessonId',
|
||||
component: Pay,
|
||||
meta: {
|
||||
},
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/exam',
|
||||
component: Layout,
|
||||
meta: {
|
||||
roles: [admin, userExam, user]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
redirect: '/exam/home',
|
||||
component: Exam,
|
||||
meta: {
|
||||
i18n: 'router.examSystem'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
component: ExamHome
|
||||
},
|
||||
{
|
||||
// 试卷详情
|
||||
path: 'detail/:examId',
|
||||
component: ExamDetail,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'course/:lessonId',
|
||||
component: ExamCourseDetail,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
// 规则管理
|
||||
path: 'examRule/manage',
|
||||
component: PublishExamRule,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'examRule/draft/:mode/:ruleId/:lessonId',
|
||||
hidden: true,
|
||||
component: PublishExamRuleDraft
|
||||
},
|
||||
{
|
||||
path: 'pay/:lessonId',
|
||||
component: Pay,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
// 开始考试
|
||||
path: 'questionDetail/:examQuestionId',
|
||||
component: ExamQuestionDetail,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
// 考试结果
|
||||
path: 'result/:userExamId',
|
||||
component: ExamResult,
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/demonstration',
|
||||
path: '/trainingPlatform',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
meta: {
|
||||
roles: [admin, userSimulation, user]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
redirect: '/demonstration/home',
|
||||
component: Demonstration,
|
||||
redirect: '/trainingPlatform/home',
|
||||
component: TrainingPlatform,
|
||||
meta: {
|
||||
i18n: 'router.demonstrationSystem'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
component: DemonstrationHome,
|
||||
redirect: '/trainingPlatform/permission/14',
|
||||
component: TrainingPlatformHome,
|
||||
meta: {
|
||||
i18n: 'router.demonstrationSystem'
|
||||
}
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'detail/:mapId',
|
||||
component: DemonstrationDetail,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'teach',
|
||||
component: TeachDetail,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'exam/:examId',
|
||||
component: ExamDetail,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'practical/:trainingId/:lessonId',
|
||||
component: TeachPractical,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'pay/:lessonId',
|
||||
component: Pay,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'course/:mapId',
|
||||
component: ExamCourseDetail,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'result/:userExamId',
|
||||
component: ExamResult,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'permission/:mapId',
|
||||
component: Package,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'permission/detail/:id',
|
||||
component: PackageDetail,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'draft',
|
||||
component: PackageDraft,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'examRule/manage',
|
||||
component: PublishExamRule,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'examRule/draft/:mode/:ruleId/:lessonId',
|
||||
component: PublishExamRuleDraft,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'runPlan/manage/:mapId',
|
||||
component: PlanMonitorDetail,
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -649,6 +697,7 @@ export const asyncRouter = [
|
||||
},
|
||||
{
|
||||
path: '/dp',
|
||||
hidden: true,
|
||||
redirect: '/dp/home',
|
||||
component: ScreenMonitor,
|
||||
meta: {
|
||||
@ -675,6 +724,13 @@ export const asyncRouter = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/plan/usertool',
|
||||
component: PlanMonitorEditUserTool,
|
||||
meta: {
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/plan/tool',
|
||||
component: PlanMonitorEditTool,
|
||||
@ -686,8 +742,9 @@ export const asyncRouter = [
|
||||
path: '/plan',
|
||||
redirect: '/plan/home',
|
||||
component: PlanMonitor,
|
||||
hidden: true,
|
||||
meta: {
|
||||
roles: [admin, user]
|
||||
roles: [admin, user, userDesign]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@ -713,8 +770,9 @@ export const asyncRouter = [
|
||||
{
|
||||
path: '/replay',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
meta: {
|
||||
roles: [admin]
|
||||
roles: [admin, userDesign]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@ -726,38 +784,12 @@ export const asyncRouter = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/permission',
|
||||
component: Layout,
|
||||
meta: {
|
||||
roles: [admin, user]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'manage',
|
||||
component: Package,
|
||||
meta: {
|
||||
i18n: 'router.selfPermission'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'manage/detail/:id',
|
||||
component: PackageDetail,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'draft',
|
||||
component: PackageDraft,
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/publish',
|
||||
component: Layout,
|
||||
meta: {
|
||||
i18n: 'router.pulishManage',
|
||||
roles: [admin]
|
||||
roles: [admin, userDesign]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@ -848,7 +880,7 @@ export const asyncRouter = [
|
||||
component: Layout,
|
||||
meta: {
|
||||
i18n: 'router.orderAuthorityManage',
|
||||
roles: [admin]
|
||||
roles: [admin, userDesign]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@ -940,9 +972,28 @@ export const asyncRouter = [
|
||||
component: Layout,
|
||||
meta: {
|
||||
i18n: 'router.systemManage',
|
||||
roles: [admin]
|
||||
roles: [admin, userDesign]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'skinCode',
|
||||
component: SkinCode,
|
||||
meta: {
|
||||
i18n: 'router.skinManage'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'skinCode/draft/:mode/:skinCodeId',
|
||||
hidden: true,
|
||||
component: SkinCodeDraft
|
||||
},
|
||||
{
|
||||
path: 'ibp/edit',
|
||||
component: IbpEdit,
|
||||
meta: {
|
||||
i18n: 'router.ibpDraw'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'dictionary',
|
||||
component: Dictionary,
|
||||
@ -999,6 +1050,44 @@ export const asyncRouter = [
|
||||
meta: {
|
||||
i18n: 'router.existingSimulation'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'systemGenerate',
|
||||
component: SystemGenerate,
|
||||
meta: {
|
||||
i18n: 'router.subsystemGeneration'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/apply',
|
||||
component: Layout,
|
||||
meta: {
|
||||
i18n: 'router.releaseApplication',
|
||||
roles: [admin, userDesign]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'lesson',
|
||||
component: LessonApproval,
|
||||
meta: {
|
||||
i18n: 'router.courseApplication'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'script',
|
||||
component: ScriptApproval,
|
||||
meta: {
|
||||
i18n: 'router.scriptReleaseApplication'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'runGraph',
|
||||
component: RunPlanApproval,
|
||||
meta: {
|
||||
i18n: 'router.runGraphReleaseApplication'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1016,11 +1105,17 @@ router.beforeEach((to, from, next) => {
|
||||
const name = to.fullPath;
|
||||
if (name.includes('/dp/') || name.includes('display/dp')) {
|
||||
document.title = '琏课堂-大屏系统';
|
||||
} else if (name.includes('/plan/') || name.includes('/planEdit/')) {
|
||||
document.title = '琏计划';
|
||||
} else if (name.includes('/trainingPlatform/')) {
|
||||
const project = getSessionStorage('project');
|
||||
document.title = loginTitle[project || 'default'];
|
||||
} else if (name.includes('/design/') || name.includes('/scriptDisplay/') || name.includes('/plan/') || name.includes('/publish/') || name.includes('/orderauthor/') || name.includes('/system/') || name.includes('/display/plan/') || name.includes('/apply/') || name.includes('/display/manage/')) {
|
||||
document.title = '城市轨道交通设计平台';
|
||||
} else {
|
||||
document.title = '琏课堂';
|
||||
}
|
||||
// else if (name.includes('/plan/') || name.includes('/planEdit/')) {
|
||||
// document.title = '琏计划';
|
||||
// }
|
||||
next();
|
||||
});
|
||||
|
||||
|
@ -97,6 +97,12 @@ export default {
|
||||
{ label: '北京一号线', value: '03'},
|
||||
{ label: '成都三号线', value: '04'},
|
||||
{ label: '北京八通线', value: '05'}
|
||||
],
|
||||
releaseReview: [
|
||||
{ enlabel: 'Unpublished', label: '未发布', value: '0'},
|
||||
{ enlabel: 'Pending review', label: '待审核', value: '1'},
|
||||
{ enlabel: 'Successfully released', label: '发布成功', value: '2'},
|
||||
{ enlabel: 'Overrule', label: '被驳回', value: '3'}
|
||||
]
|
||||
|
||||
}
|
||||
|
@ -1094,7 +1094,7 @@ export const OperationEvent = {
|
||||
event: '2',
|
||||
button: {
|
||||
operation: '4020',
|
||||
domId: '_Tips-Section-Fault-Mbm{TOP}'
|
||||
domId: '_Tips-Section-Fault-Mbm'
|
||||
},
|
||||
menu: {
|
||||
operation: '402',
|
||||
@ -2192,3 +2192,8 @@ export const IbpOperation = {
|
||||
Down_Hold_Train: {operate: '03', status: 'on'},
|
||||
Down_Cancel_Hold_Train: {operate: '04', status: 'off'}
|
||||
};
|
||||
|
||||
export const loginTitle = {
|
||||
xty: '西铁院城市轨道交通实训平台',
|
||||
default: '城市轨道交通实训平台'
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -29,7 +29,7 @@ OperateHandler.prototype = {
|
||||
if (order >= steps) {
|
||||
return valid;
|
||||
}
|
||||
|
||||
// debugger;
|
||||
const standard = steps[order];
|
||||
if (operate && standard && operate.code == standard.code && operate.type == standard.type &&
|
||||
operate.operation == standard.operation &&
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin } from '@/router';
|
||||
import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin, userDesign } from '@/router';
|
||||
import { PermissionType } from '@/utils/PermissionType';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
|
||||
function setHonePagePath(route, roles) {
|
||||
if (roles && roles.length === 2 && roles.indexOf(user) >= 0 && (route.path === '/' || route.path === 'dashboard')) {
|
||||
@ -27,7 +28,38 @@ function hasPermission(roles, route, parentsRoles) {
|
||||
setHonePagePath(route, roles);
|
||||
if (route.meta && route.meta.roles) {
|
||||
// 如果存在本级路由,则使用自己的roles过滤
|
||||
return roles.some(role => route.meta.roles.indexOf(role) >= 0);
|
||||
// debugger;
|
||||
// if (getSessionStorage('design')) {
|
||||
// if (route.meta.roles.indexOf(userDesign)===-1) {
|
||||
// route.hidden = true;
|
||||
// } else {
|
||||
// if ((route.meta.roles.indexOf(admin)>=0 && roles.indexOf(admin)>=0)) {
|
||||
// route.hidden = false;
|
||||
// } else if (route.meta.roles.indexOf(user)>=0 && roles.indexOf(user)>=0) {
|
||||
// route.hidden = false;
|
||||
// } else {
|
||||
// route.hidden = true;
|
||||
// }
|
||||
// }
|
||||
|
||||
// } else {
|
||||
// if (route.meta.roles.indexOf(userDesign)>0) {
|
||||
// route.hidden = true;
|
||||
// }
|
||||
// }
|
||||
// return roles.some(role => route.meta.roles.indexOf(role) >= 0);
|
||||
if (getSessionStorage('design')) {
|
||||
roles= roles.filter(function (role) {
|
||||
return route.meta.roles.indexOf(role) >= 0;
|
||||
});
|
||||
const result=roles.every(role => route.meta.roles.indexOf(role) >= 0);
|
||||
return result && ((roles.indexOf(admin)>=0 && route.meta.roles.indexOf(admin)>=0) || (roles.indexOf(user)>=0 && route.meta.roles.indexOf(user)>=0 ));
|
||||
} else {
|
||||
roles= roles.filter(function (role) {
|
||||
return route.meta.roles.indexOf(role) >= 0;
|
||||
});
|
||||
return roles.some(role => route.meta.roles.indexOf(role) >= 0) && route.meta.roles.indexOf(userDesign)<0;
|
||||
}
|
||||
} else if (parentsRoles) {
|
||||
// 如果没有本级路由,有父级路由,则使用父级路由过滤
|
||||
return roles.some(role => parentsRoles.indexOf(role) >= 0);
|
||||
@ -93,12 +125,15 @@ const permission = {
|
||||
return new Promise(resolve => {
|
||||
const { roles } = convertRouterRoles(data);
|
||||
let accessedRouters;
|
||||
if (roles.indexOf(superAdmin) >= 0) {
|
||||
accessedRouters = asyncRouter;
|
||||
} else {
|
||||
accessedRouters = filterAsyncRouter(asyncRouter, roles);
|
||||
if (roles.indexOf(superAdmin) >= 0 && roles.indexOf(admin) < 0) {
|
||||
roles.push(admin);
|
||||
}
|
||||
|
||||
// if (roles.indexOf(superAdmin) >= 0) {
|
||||
// accessedRouters = asyncRouter;
|
||||
// } else {
|
||||
// eslint-disable-next-line prefer-const
|
||||
accessedRouters = filterAsyncRouter(asyncRouter, roles);
|
||||
// }
|
||||
commit('SET_ROUTERS', accessedRouters);
|
||||
resolve();
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { setSessionStorage } from '@/utils/auth';
|
||||
import { setSessionStorage, removeSessionStorage } from '@/utils/auth';
|
||||
import { login, logout, getInfo } from '@/api/login';
|
||||
import { getToken, setToken, removeToken, removeScreenToken, setScreenToken, getScreenToken, setPlanToken, getPlanToken, removePlanToken, handleToken, handleRemoveToken } from '@/utils/auth';
|
||||
import { getToken, setToken, removeToken, removeScreenToken, setScreenToken, getScreenToken, setPlanToken, getDesignToken, setDesignToken, getPlanToken, removeDesignToken, removePlanToken, handleToken, handleRemoveToken } from '@/utils/auth';
|
||||
import { getUserConfigInfo } from '@/api/management/user';
|
||||
import { LoginParams } from '@/utils/login';
|
||||
import { creatSubscribe, perpetualTopic } from '@/utils/stomp';
|
||||
@ -10,6 +10,7 @@ const user = {
|
||||
token: getToken(),
|
||||
tokenScreen: getScreenToken(),
|
||||
tokenPlan: getPlanToken(),
|
||||
tokenDesign: getDesignToken(),
|
||||
name: '',
|
||||
nickname: '',
|
||||
nationcode: '',
|
||||
@ -17,7 +18,8 @@ const user = {
|
||||
id: '',
|
||||
admin: false,
|
||||
wxId: '',
|
||||
wxUnionId: ''
|
||||
wxUnionId: '',
|
||||
account: ''
|
||||
},
|
||||
|
||||
mutations: {
|
||||
@ -27,6 +29,9 @@ const user = {
|
||||
SET_TOKENSCREEN: (state, token) => {
|
||||
state.tokenScreen = token;
|
||||
},
|
||||
SET_TOKENDESIGN: (state, token) => {
|
||||
state.tokenDesign = token;
|
||||
},
|
||||
SET_TOKENPLAN: (state, token) => {
|
||||
state.tokenPlan = token;
|
||||
},
|
||||
@ -50,6 +55,9 @@ const user = {
|
||||
},
|
||||
SET_WXUNIONID: (state, wxUnionId) => {
|
||||
state.wxUnionId = wxUnionId;
|
||||
},
|
||||
SET_ACCOUNT: (state, account) => {
|
||||
state.account = account;
|
||||
}
|
||||
},
|
||||
|
||||
@ -69,12 +77,22 @@ const user = {
|
||||
const header = { group: '', 'X-Token': getScreenToken() };
|
||||
creatSubscribe(perpetualTopic, header);
|
||||
};
|
||||
} else if (userInfo.type == 'plan') {
|
||||
params = Object.assign({ account: username, password }, LoginParams.LianJiHua);
|
||||
}
|
||||
// else if (userInfo.type == 'plan') {
|
||||
// params = Object.assign({ account: username, password }, LoginParams.LianJiHua);
|
||||
// execFc = (token) => {
|
||||
// setPlanToken(token);
|
||||
// commit('SET_TOKENPLAN', token);
|
||||
// const header = { group: '', 'X-Token': getPlanToken() };
|
||||
// creatSubscribe(perpetualTopic, header);
|
||||
// };
|
||||
// }
|
||||
else if (userInfo.type == 'design') {
|
||||
params = Object.assign({ account: username, password }, LoginParams.Design);
|
||||
execFc = (token) => {
|
||||
setPlanToken(token);
|
||||
commit('SET_TOKENPLAN', token);
|
||||
const header = { group: '', 'X-Token': getPlanToken() };
|
||||
setDesignToken(token);
|
||||
commit('SET_TOKENDESIGN', token);
|
||||
const header = { group: '', 'X-Token': getDesignToken() };
|
||||
creatSubscribe(perpetualTopic, header);
|
||||
};
|
||||
} else {
|
||||
@ -82,6 +100,7 @@ const user = {
|
||||
execFc = (token) => {
|
||||
setToken(token);
|
||||
commit('SET_TOKEN', token);
|
||||
setSessionStorage('project', userInfo.project||'');
|
||||
const header = { group: '', 'X-Token': getToken() };
|
||||
creatSubscribe(perpetualTopic, header);
|
||||
};
|
||||
@ -89,6 +108,12 @@ const user = {
|
||||
|
||||
// 登录系统
|
||||
login(params).then(resp => {
|
||||
if (userInfo.type == 'design') {
|
||||
removeSessionStorage('design');
|
||||
setSessionStorage('design', true);
|
||||
} else {
|
||||
removeSessionStorage('design');
|
||||
}
|
||||
execFc(resp.data);
|
||||
resolve();
|
||||
}).catch(error => { reject(error); });
|
||||
@ -149,12 +174,17 @@ const user = {
|
||||
FedLogOut({ commit }, clientId) {
|
||||
return new Promise(resolve => {
|
||||
if (clientId == LoginParams.DaPing.clientId) {
|
||||
commit('SET_TOKENSCREEN', '');
|
||||
commit('SET_TOKENDESIGN', '');
|
||||
removeScreenToken();
|
||||
} else if (clientId == LoginParams.LianJiHua.clientId) {
|
||||
commit('SET_TOKENPLAN', '');
|
||||
removePlanToken();
|
||||
} else {
|
||||
} else if (clientId == LoginParams.Design.clientId) {
|
||||
commit('SET_TOKENSCREEN', '');
|
||||
removeDesignToken();
|
||||
}
|
||||
// else if (clientId == LoginParams.LianJiHua.clientId) {
|
||||
// commit('SET_TOKENPLAN', '');
|
||||
// removePlanToken();
|
||||
// }
|
||||
else {
|
||||
commit('SET_TOKEN', '');
|
||||
removeToken();
|
||||
}
|
||||
@ -170,12 +200,17 @@ const user = {
|
||||
commit('SET_TOKEN', '');
|
||||
commit('SET_ROLES', []);
|
||||
commit('SET_ID', '');
|
||||
removeSessionStorage('design');
|
||||
handleRemoveToken();
|
||||
resolve();
|
||||
}).catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
SetAccount({ commit }, account) {
|
||||
commit('SET_ACCOUNT', account);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -7,6 +7,8 @@ const TokenScreenKey = 'Screen-Token';
|
||||
|
||||
const TokenPlanKey = 'Plan-Token';
|
||||
|
||||
const TokenDesignKey='Design-Token';
|
||||
|
||||
// 设置教学,实训,仿真系统token
|
||||
export function getToken() {
|
||||
return SessionStorage.getItem(TokenKey);
|
||||
@ -28,6 +30,17 @@ export function removeScreenToken() {
|
||||
return SessionStorage.removeItem(TokenScreenKey);
|
||||
}
|
||||
|
||||
// 设置城市轨道交通设计平台token
|
||||
export function getDesignToken() {
|
||||
return SessionStorage.getItem(TokenDesignKey);
|
||||
}
|
||||
export function setDesignToken(token) {
|
||||
return SessionStorage.setItem(TokenDesignKey, token);
|
||||
}
|
||||
export function removeDesignToken() {
|
||||
return SessionStorage.removeItem(TokenDesignKey);
|
||||
}
|
||||
|
||||
// 设置琏计划token
|
||||
export function getPlanToken() {
|
||||
return SessionStorage.getItem(TokenPlanKey);
|
||||
@ -54,8 +67,10 @@ export function handleToken() {
|
||||
const path = window.location.href;
|
||||
if (path.includes('/dp/') || path.includes('/display/dp')) {
|
||||
return getScreenToken();
|
||||
} else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system') || path.includes('/display/manage') || path.includes('/apply/')) {
|
||||
return getDesignToken();
|
||||
} else if (path.includes('/plan') || path.includes('/display/plan')) {
|
||||
return getPlanToken();
|
||||
return getDesignToken() || getToken();
|
||||
} else {
|
||||
return getToken();
|
||||
}
|
||||
@ -66,8 +81,8 @@ export function handleRemoveToken() {
|
||||
const path = window.location.href;
|
||||
if (path.includes('/dp/') || path.includes('/display/dp')) {
|
||||
return removeScreenToken();
|
||||
} else if (path.includes('/plan') || path.includes('/display/plan')) {
|
||||
return removePlanToken();
|
||||
} else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/plan') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system') || path.includes('/display/plan') || path.includes('/display/manage') || path.includes('/apply/')) {
|
||||
return removeDesignToken();
|
||||
} else {
|
||||
return removeToken();
|
||||
}
|
||||
@ -79,8 +94,12 @@ export function gainClientId() {
|
||||
let clientId = null;
|
||||
if (path.includes('/dp/') || path.includes('/display/dp')) {
|
||||
clientId = LoginParams.DaPing.clientId;
|
||||
} else if (path.includes('/plan') || path.includes('/display/plan')) {
|
||||
clientId = LoginParams.LianJiHua.clientId;
|
||||
}
|
||||
// else if (path.includes('/plan') || path.includes('/display/plan')) {
|
||||
// clientId = LoginParams.LianJiHua.clientId;
|
||||
// }
|
||||
else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/plan') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system') || path.includes('/display/plan') || path.includes('/display/manage') || path.includes('/apply/')) {
|
||||
clientId = LoginParams.Design.clientId;
|
||||
}
|
||||
|
||||
return clientId;
|
||||
|
@ -4,5 +4,6 @@ export const LoginParams = {
|
||||
LianKeTang: { clientId: '1', secret: 'joylink' }, // "琏课堂"
|
||||
DaPing: { clientId: '2', secret: 'bigscreen' }, // "大屏系统"
|
||||
LianJiHua: { clientId: '3', secret: 'linkplan' }, // "琏计划"
|
||||
Assistant: { clientId: '4', secret: 'linkassistant' } // "琏课堂助手"
|
||||
Assistant: { clientId: '4', secret: 'linkassistant' }, // "琏课堂助手"
|
||||
Design: { clientId: '6', secret: 'design' } // "城市轨道交通设计平台"
|
||||
};
|
||||
|
100
src/views/approval/lesson/detail.vue
Normal file
100
src/views/approval/lesson/detail.vue
Normal file
@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="this.$t('approval.courseDetails')"
|
||||
:visible.sync="showDetail"
|
||||
top="20px"
|
||||
width="90%"
|
||||
:before-do-close="doClose"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div>
|
||||
<el-card v-loading="loading">
|
||||
<div slot="header" style="text-align: center;">
|
||||
<b>{{ $t('global.courseName') }}: {{ lessonName }}</b>
|
||||
</div>
|
||||
<div style="margin:50px">
|
||||
<p style="font-size: 14px; margin-bottom: 20px"> {{ $t('approval.courseDescription')}}:
|
||||
<span style="color: #808080 !important;">{{ lessonRemark }}</span>
|
||||
</p>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card v-loading="loading">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height -60 + 'px'}">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
row-key="id"
|
||||
border
|
||||
default-expand-all
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
border
|
||||
:label="this.$t('approval.chapterTrainingName')">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remarks"
|
||||
border
|
||||
:label="this.$t('approval.instructions')">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-scrollbar>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {reviewLessonDetail} from '@/api/designPlatform';
|
||||
|
||||
export default {
|
||||
name: 'LessonApprovalDetail',
|
||||
components: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
computed: {
|
||||
height() {
|
||||
return this.$store.state.app.height - 260;
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return{
|
||||
loading: false,
|
||||
tableData: [],
|
||||
lessonName: '',
|
||||
lessonRemark: '',
|
||||
showDetail: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
// this.loadInitData();
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
},
|
||||
methods: {
|
||||
show(lessonId){
|
||||
this.showDetail = true;
|
||||
this.loadInitData(lessonId);
|
||||
},
|
||||
loadInitData(lessonId) {
|
||||
this.loading =true;
|
||||
reviewLessonDetail(lessonId).then(response =>{
|
||||
this.tableData = response.data[0].children;
|
||||
this.lessonName = response.data[0].name;
|
||||
this.lessonRemark = response.data[0].remarks;
|
||||
this.loading = false;
|
||||
}).catch(error=>{
|
||||
this.$messageBox(this.$t('approval.failedToGetCourseData'))
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
214
src/views/approval/lesson/index.vue
Normal file
214
src/views/approval/lesson/index.vue
Normal file
@ -0,0 +1,214 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"></QueryListPage>
|
||||
<el-dialog :title="this.$t('approval.explanation')" :visible.sync="dialogFormVisible" v-dialogDrag>
|
||||
<!--<el-input type="textarea"
|
||||
:rows="2"
|
||||
:placeholder="this.$t('rules.enterRejectReason')"
|
||||
@focus="inputFocus"
|
||||
@blur="inputBlur"
|
||||
v-model="textarea"></el-input>
|
||||
<span v-show="needReason" style="color: red">{{'*'+$t('rules.enterRejectReason')}}</span>-->
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="rejectCancel">{{$t('global.cancel')}}</el-button>
|
||||
<el-button type="primary" @click="rejectConfirm">{{$t('global.confirm')}}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<lesson-detail ref="lessonDetail"></lesson-detail>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {adminPublishLesson,rejectedLessonRelease,reviewLessonList} from '@/api/designPlatform';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import LessonDetail from './detail';
|
||||
|
||||
export default {
|
||||
name: 'LessonApproval',
|
||||
components: {
|
||||
LessonDetail
|
||||
},
|
||||
data() {
|
||||
return{
|
||||
dialogFormVisible: false,
|
||||
rejectId: '',
|
||||
formModel: {
|
||||
explanation: ''
|
||||
},
|
||||
mapList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '120px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
mapId: {
|
||||
type: 'select',
|
||||
label: this.$t('approval.map')+this.$t('global.colon'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
lessonName: {
|
||||
type: 'text',
|
||||
label: this.$t('lesson.courseName')
|
||||
},
|
||||
userName: {
|
||||
type: 'text',
|
||||
label: this.$t('approval.applicant')+this.$t('global.colon'),
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: reviewLessonList,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('lesson.courseName'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.map'),
|
||||
prop: 'mapId ',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId , this.mapList, ['value', 'label']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.courseDescription'),
|
||||
prop: 'remarks'
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.applicant'),
|
||||
prop: 'userName'
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.applyTime'),
|
||||
prop: 'uploadTime',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.handleTime(row.uploadTime)},
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('approval.lookOver'),
|
||||
handleClick: this.goDetail,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: this.$t('approval.applyPassed'),
|
||||
handleClick: this.pass,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: this.$t('approval.applyReject'),
|
||||
handleClick: this.noPass,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
form :{
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ prop: 'explanation', label: this.$t('approval.explanation'), type: 'textarea', required: true},
|
||||
]
|
||||
},
|
||||
rules :{
|
||||
explanation: [
|
||||
{ required: true, message: this.$t('rules.enterRejectReason'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created(){
|
||||
listPublishMap().then(response=>{
|
||||
response.data.forEach(elem => {
|
||||
this.mapList.push({ value: elem.id, label: elem.name });
|
||||
});
|
||||
this.queryForm.queryObject.mapId.config.data = this.mapList;
|
||||
});
|
||||
},
|
||||
mounted(){
|
||||
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
goDetail(index,row) {
|
||||
this.$refs.lessonDetail.show(row.id);
|
||||
},
|
||||
pass(index,row) {
|
||||
this.$confirm(this.$t('tip.publishTheCourseHint'), this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const params = {
|
||||
cityCode: row.cityCode,
|
||||
mapId: row.mapId,
|
||||
name: row.name,
|
||||
prdCode: row.prdCode
|
||||
};
|
||||
adminPublishLesson(params,row.id).then(response => {
|
||||
this.loading = false;
|
||||
this.$message.success(this.$t('tip.coursePublishSuccessful'));
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('tip.coursePublishFailed'));
|
||||
})
|
||||
});
|
||||
},
|
||||
noPass(index,row) {
|
||||
this.dialogFormVisible = true;
|
||||
this.rejectId = row.id;
|
||||
},
|
||||
handleTime(time) {
|
||||
let timeList = time.split("T");
|
||||
return timeList[0] + ' ' +timeList[1];
|
||||
},
|
||||
doClose() {
|
||||
this.$refs.queryListPage.refresh(true);
|
||||
},
|
||||
rejectConfirm() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (this.rejectId){
|
||||
rejectedLessonRelease(this.formModel,this.rejectId).then(resp =>{
|
||||
this.loading = false;
|
||||
this.$message.success(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
|
||||
this.dialogFormVisible = false;
|
||||
this.rejectId = '';
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('tip.rejectedCourseReleaseApplicationSuccessful'));
|
||||
this.dialogFormVisible = false;
|
||||
this.rejectId = '';
|
||||
this.doClose();
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
rejectCancel() {
|
||||
this.dialogFormVisible = false;
|
||||
this.rejectId = '';
|
||||
this.textarea = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
180
src/views/approval/runPlan/index.vue
Normal file
180
src/views/approval/runPlan/index.vue
Normal file
@ -0,0 +1,180 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<run-plan-operate ref='applyPassed' @reloadTable="reloadTable" @create="handleConfirmPass" :title="$t('approval.passedRunPlan')" type="applyPassed">
|
||||
</run-plan-operate>
|
||||
<run-plan-operate ref='applyReject' @reloadTable="reloadTable" @create="handleConfirmReject" :title="$t('approval.rejectRunPlan')" type="applyReject">
|
||||
</run-plan-operate>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import RunPlanOperate from './operate';
|
||||
import { reviewRunPlanList,publishRunPlan,rejectRunPlan,previewRunPlan } from '@/api/designPlatform';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
export default {
|
||||
name: 'ScriptApproval',
|
||||
components: {
|
||||
RunPlanOperate
|
||||
},
|
||||
data() {
|
||||
return{
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '100px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
mapId: {
|
||||
type: 'select',
|
||||
label: this.$t('approval.map'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
'scriptName':{
|
||||
type: 'text',
|
||||
label: this.$t('approval.runPlanName')
|
||||
},
|
||||
'userName': {
|
||||
type: 'text',
|
||||
label: this.$t('approval.applicant')
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('approval.runPlanName'),
|
||||
width:250,
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.map'),
|
||||
prop: 'mapId ',
|
||||
width:250,
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId , this.mapList, ['value', 'label']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.applicant'),
|
||||
prop: 'userName'
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.applyTime'),
|
||||
prop: 'uploadTime',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.uploadTime.replace("T"," ")},
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '450',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('approval.applyPassed'),
|
||||
handleClick: this.applyPassed,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: this.$t('approval.applyReject'),
|
||||
handleClick: this.applyReject,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: this.$t('approval.runPlanPreview'),
|
||||
handleClick: this.runPlanPreview,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created(){
|
||||
},
|
||||
mounted(){
|
||||
this.loadInitData();
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
reloadTable() {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
this.queryList.reload();
|
||||
}
|
||||
},
|
||||
goDetail() {
|
||||
this.$router.push({path:``});
|
||||
},
|
||||
async loadInitData() {
|
||||
try {
|
||||
// 获取地图
|
||||
this.mapList = [];
|
||||
const res = await listPublishMap();
|
||||
res.data.forEach(elem => {
|
||||
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
|
||||
this.mapList.push({ value: elem.id, label: elem.name });
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error, '获取发布地图');
|
||||
}
|
||||
},
|
||||
queryFunction(params) {
|
||||
return reviewRunPlanList(params);
|
||||
},
|
||||
applyPassed(index,row){
|
||||
this.$refs.applyPassed.doShow(row);
|
||||
},
|
||||
applyReject(index,row){
|
||||
this.$refs.applyReject.doShow(row);
|
||||
},
|
||||
runPlanPreview(index,row){
|
||||
previewRunPlan(row.id).then(resp => {
|
||||
const query = {
|
||||
skinCode: row.skinCode, prdType: '01', group: resp.data, mapId: row.mapId, planId: row.id,from:''
|
||||
};
|
||||
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('tip.createSimulationFaild')+this.$t('global.colon')+error.message);
|
||||
});
|
||||
},
|
||||
handleConfirmPass(data){
|
||||
publishRunPlan(data.id,data).then(resp => {
|
||||
if(resp.data.length<=0){
|
||||
this.$message.success(this.$t('approval.passedScriptSuccess'));
|
||||
}
|
||||
else{
|
||||
this.$messageBox(`${this.$t('approval.passedScriptFailed')}: ${resp.data[0]}`);
|
||||
}
|
||||
this.reloadTable();
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('approval.passedScriptFailed')}: ${error.message}`);
|
||||
})
|
||||
},
|
||||
handleConfirmReject(data){
|
||||
rejectRunPlan(data.id,data).then(resp => {
|
||||
this.reloadTable();
|
||||
this.$message.success(this.$t('approval.rejectScriptSuccess'));
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('approval.rejectScriptFailed')}: ${error.message}`);
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
98
src/views/approval/runPlan/operate.vue
Normal file
98
src/views/approval/runPlan/operate.vue
Normal file
@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center>
|
||||
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doCreate">{{$t('global.confirm')}}</el-button>
|
||||
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'ScriptOperate',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel:{
|
||||
runPlanName:'',
|
||||
id:'',
|
||||
explanation:'',
|
||||
},
|
||||
isShow: false,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
title: String,
|
||||
type:String,
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let form={};
|
||||
if(this.type=="applyPassed"){
|
||||
form = {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ prop: 'runPlanName', label: this.$t('approval.runPlanName'), type: 'text', required: true},
|
||||
]
|
||||
}
|
||||
}
|
||||
else{
|
||||
form = {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
|
||||
{ prop: 'explanation', label: this.$t('approval.explanation'), type: 'textarea', required: true},
|
||||
]
|
||||
}
|
||||
}
|
||||
return form
|
||||
},
|
||||
rules() {
|
||||
let crules ={};
|
||||
if(this.type=="applyPassed"){
|
||||
crules={
|
||||
runPlanName: [
|
||||
{ required: true, message: this.$t('approval.inputRunPlanName'), trigger: 'blur' },
|
||||
]
|
||||
}
|
||||
}
|
||||
else{
|
||||
crules={
|
||||
explanation:[
|
||||
{ required: true, message: this.$t('approval.inputRejectExplanation'), trigger: 'blur',max:200 },
|
||||
]
|
||||
}
|
||||
}
|
||||
return crules
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
doShow(row) {
|
||||
if(this.type=="applyPassed"){
|
||||
this.formModel.runPlanName=row.name;
|
||||
}
|
||||
this.formModel.id=row.id;
|
||||
this.dialogVisible = true
|
||||
},
|
||||
doCreate() {
|
||||
let self = this
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
self.$emit('create', Object.assign({}, this.formModel));
|
||||
self.doClose()
|
||||
})
|
||||
},
|
||||
doClose() {
|
||||
this.$refs.dataform.resetForm();
|
||||
this.isShow = false;
|
||||
this.dialogVisible = false
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .el-dialog--center .el-dialog__body{
|
||||
padding: 15px 65px 10px 10px;
|
||||
}
|
||||
</style>
|
161
src/views/approval/script/index.vue
Normal file
161
src/views/approval/script/index.vue
Normal file
@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<!-- <script-operate ref='applyPassed' @reloadTable="reloadTable" @create="handleConfirmPass" :title="$t('approval.passedScript')" type="applyPassed">
|
||||
</script-operate> -->
|
||||
<script-operate ref='applyReject' @reloadTable="reloadTable" @create="handleConfirmReject" :title="$t('approval.rejectScript')">
|
||||
</script-operate>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ScriptOperate from './operate';
|
||||
import { reviewScriptList,publishScript,rejectScript } from '@/api/designPlatform';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
export default {
|
||||
name: 'ScriptApproval',
|
||||
components: {
|
||||
ScriptOperate
|
||||
},
|
||||
data() {
|
||||
return{
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '100px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
mapId: {
|
||||
type: 'select',
|
||||
label: this.$t('approval.map'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
'scriptName':{
|
||||
type: 'text',
|
||||
label: this.$t('approval.scriptName')
|
||||
},
|
||||
'creatorName': {
|
||||
type: 'text',
|
||||
label: this.$t('approval.applicant')
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('approval.scriptName'),
|
||||
width:250,
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.map'),
|
||||
prop: 'mapId ',
|
||||
width:250,
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId , this.mapList, ['value', 'label']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.scriptDescription'),
|
||||
prop: 'description'
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.applicant'),
|
||||
prop: 'creatorName'
|
||||
},
|
||||
{
|
||||
title: this.$t('approval.applyTime'),
|
||||
prop: 'uploadTime',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.uploadTime.replace("T"," ")},
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '450',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('approval.applyPassed'),
|
||||
handleClick: this.applyPassed,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: this.$t('approval.applyReject'),
|
||||
handleClick: this.applyReject,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: this.$t('approval.scriptPreview'),
|
||||
handleClick: this.scriptPreview,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created(){
|
||||
},
|
||||
mounted(){
|
||||
this.loadInitData();
|
||||
},
|
||||
beforeDestroy(){
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
reloadTable() {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
this.queryList.reload();
|
||||
}
|
||||
},
|
||||
goDetail() {
|
||||
this.$router.push({path:``});
|
||||
},
|
||||
async loadInitData() {
|
||||
try {
|
||||
// 获取地图
|
||||
this.mapList = [];
|
||||
const res = await listPublishMap();
|
||||
res.data.forEach(elem => {
|
||||
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
|
||||
this.mapList.push({ value: elem.id, label: elem.name });
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error, '获取发布地图');
|
||||
}
|
||||
},
|
||||
queryFunction(params) {
|
||||
return reviewScriptList(params);
|
||||
},
|
||||
applyPassed(index,row){
|
||||
this.handleConfirmPass(row);
|
||||
},
|
||||
applyReject(index,row){
|
||||
this.$refs.applyReject.doShow(row);
|
||||
},
|
||||
scriptPreview(index,row){
|
||||
debugger;
|
||||
},
|
||||
handleConfirmReject(data){
|
||||
rejectScript(data.id,data).then(resp => {
|
||||
this.reloadTable();
|
||||
this.$message.success(this.$t('approval.rejectScriptSuccess'));
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('approval.rejectScriptFailed')}: ${error.message}`);
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
73
src/views/approval/script/operate.vue
Normal file
73
src/views/approval/script/operate.vue
Normal file
@ -0,0 +1,73 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center>
|
||||
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doCreate">{{$t('global.confirm')}}</el-button>
|
||||
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'ScriptOperate',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel:{
|
||||
id:'',
|
||||
explanation:'',
|
||||
},
|
||||
isShow: false,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
title: String,
|
||||
type:String,
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let form={
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
|
||||
{ prop: 'explanation', label: this.$t('approval.explanation'), type: 'textarea', required: true},
|
||||
]
|
||||
}
|
||||
return form
|
||||
},
|
||||
rules() {
|
||||
let crules ={
|
||||
explanation:[
|
||||
{ required: true, message: this.$t('approval.inputRejectExplanation'), trigger: 'blur',max:200 },
|
||||
]
|
||||
}
|
||||
return crules
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
doShow(row) {
|
||||
this.formModel.id=row.id;
|
||||
this.dialogVisible = true
|
||||
},
|
||||
doCreate() {
|
||||
let self = this
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
self.$emit('create', Object.assign({}, this.formModel));
|
||||
self.doClose()
|
||||
})
|
||||
},
|
||||
doClose() {
|
||||
this.$refs.dataform.resetForm();
|
||||
this.isShow = false;
|
||||
this.dialogVisible = false
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .el-dialog--center .el-dialog__body{
|
||||
padding: 15px 65px 10px 10px;
|
||||
}
|
||||
</style>
|
104
src/views/components/drapUp/index.vue
Normal file
104
src/views/components/drapUp/index.vue
Normal file
@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<div
|
||||
ref="drapBox"
|
||||
class="drapHeight"
|
||||
:style="{width: width + 'px', height: height + 'px', top: heightUp +'px'}"
|
||||
@mousedown="mousedown"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
name: 'DrapUp',
|
||||
props: {
|
||||
heightUp: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
isSave: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
max: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
min: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
width: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 36
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
heightUps: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
heightTotol() {
|
||||
return this.$store.state.app.height - 50;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
const oDiv = this.$refs.drapBox;
|
||||
oDiv.onmousedown = () => {
|
||||
return false;
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
mousedown(e) {
|
||||
const oDiv = this.$refs.drapBox;
|
||||
const maxNum = this.max || this.heightTotol-200;
|
||||
const minNum = this.min || 150;
|
||||
oDiv.onmousedown = function() {
|
||||
return false;
|
||||
};
|
||||
e.stopPropagation();
|
||||
window.event.cancelBubble = true;
|
||||
const odiv = e.target;
|
||||
const disY = e.clientY - odiv.offsetTop ;
|
||||
document.onmousemove = (e) => {
|
||||
let top = e.clientY - disY;
|
||||
if (top > maxNum) {
|
||||
top = maxNum;
|
||||
} else if (top < minNum) {
|
||||
top = minNum;
|
||||
}
|
||||
odiv.style.top = top + 'px';
|
||||
this.$emit('drapHeight', top);
|
||||
this.heightUps = top;
|
||||
};
|
||||
document.onmouseup = (e) => {
|
||||
if (this.isSave) {
|
||||
if (this.heightUps > minNum) {
|
||||
localStore('upHeight', JSON.stringify(this.heightUps));
|
||||
}
|
||||
}
|
||||
document.onmousemove = null;
|
||||
document.onmouseup = null;
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.drapHeight {
|
||||
float: left;
|
||||
width: 16px;
|
||||
background: red;
|
||||
opacity: 0;
|
||||
cursor: n-resize;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
z-index: 9999;
|
||||
}
|
||||
</style>
|
@ -21,7 +21,9 @@
|
||||
<script>
|
||||
import { setUserConfigInfo } from '@/api/management/user';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import {getUserMapTree} from '@/api/designPlatform';
|
||||
import { getPublishMapTree } from '@/api/management/mapprd';
|
||||
|
||||
import localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
@ -120,6 +122,7 @@ export default {
|
||||
},
|
||||
async loadInitData() {
|
||||
// 获取城市列表
|
||||
this.filterOptions=[];
|
||||
const resp = await this.$Dictionary.cityType();
|
||||
const cityList = resp.sort((a, b) => {
|
||||
return a.code.localeCompare(b.code);
|
||||
@ -146,10 +149,12 @@ export default {
|
||||
|
||||
this.loadSecondLevelFilterOptions(cityList, mapDict, nodeList);
|
||||
} else {
|
||||
|
||||
// 设置一级选择组件
|
||||
const mapDict = {};
|
||||
if (this.filterEmpty && this.queryFunction) {
|
||||
if (this.queryFunction === getPublishMapTree) {
|
||||
|
||||
if (this.queryFunction === getPublishMapTree || this.queryFunction === getUserMapTree) {
|
||||
// 查询同一种类citycode的mapList
|
||||
for (var i = 0; i < cityList.length; i++) {
|
||||
const response = await this.queryFunction(cityList[i].code);
|
||||
|
@ -104,7 +104,6 @@ export default {
|
||||
data['prdCode'] = this.$route.query.prdCode;
|
||||
data['lessonId'] = this.$route.query.lessonId;
|
||||
}
|
||||
|
||||
getCommodityDetailByParams(data).then(response => {
|
||||
this.active = 0;
|
||||
this.orderData = response.data;
|
||||
@ -128,13 +127,13 @@ export default {
|
||||
this.active = 0;
|
||||
const type = this.$route.query.permissionType;
|
||||
if (type === PermissionType.LESSON) {
|
||||
this.$router.replace({ path: `${UrlConfig.teach.detail}/${this.$route.params.lessonId}` });
|
||||
this.$router.replace({ path: `${UrlConfig.trainingPlatform.teachDetail}`,query: { prodId: this.$route.query.prdCode,type: '教学系统'} });
|
||||
} else if (type === PermissionType.EXAM) {
|
||||
this.$router.replace({ path: `${UrlConfig.exam.course}/${this.orderData.lessonId}` });
|
||||
this.$router.replace({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.mapId}`, query: { prodId:this.$route.query.prdCode, type: '考试系统' }});
|
||||
} else if (type === PermissionType.SCREEN) {
|
||||
this.$router.replace({ path: `${UrlConfig.dp.detail}/${this.$route.params.lessonId}` });
|
||||
} else if (type === PermissionType.SIMULATION) {
|
||||
this.$router.replace({ path: `${UrlConfig.demonstration.detail}/${this.$route.params.lessonId}` });
|
||||
this.$router.replace({ path: `${UrlConfig.trainingPlatform.prodDetail}/${this.$route.query.mapId}`,query: { prodId: this.$route.query.prdCode,type: '仿真系统'} });
|
||||
} else {
|
||||
this.$router.replace({ path: `/` });
|
||||
}
|
||||
|
@ -1,44 +1,38 @@
|
||||
<template>
|
||||
<el-card v-loading="loading">
|
||||
<div slot="header" style="text-align: center;">
|
||||
<span v-if="hasProduct"><b>{{ $t('demonstration.simulationName') + courseModel.name }}</b></span>
|
||||
<span v-else>{{ $t('demonstration.noSimulationProducts') }}</span>
|
||||
<span><b>{{ $t('demonstration.simulationName') + courseModel.name }}</b></span>
|
||||
</div>
|
||||
<div class="simulation-detail" :style="{ height: height-190 +'px' }">
|
||||
<p class="list-item">
|
||||
<span class="list-label">{{ $t('demonstration.productDescription') }}</span>
|
||||
<span class="list-elem">{{ courseModel.remarks }}</span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">{{ $t('global.permissionList') }}</span>
|
||||
</p>
|
||||
<limit-list :ref="`limit`" :course-model="courseModel" />
|
||||
</div>
|
||||
<div class="btn-buy">
|
||||
<el-button type="success" @click="buy">{{ $t('global.buy') }}</el-button>
|
||||
<el-button v-if="hasPermssion" type="primary" @click="distribute">{{ $t('global.distributePermission') }}</el-button>
|
||||
<el-button v-if="hasPermssion" type="primary" @click="transfer">{{ $t('global.transferQRCode') }}</el-button>
|
||||
<el-button v-show="isStartDemon" :loading="buttonLoading" type="primary" @click="start">{{ $t('demonstration.startSimulation') }}</el-button>
|
||||
<el-button v-show="isCreateRoom" :loading="buttonLoading" type="primary" @click="start">{{ $t('demonstration.createRoom') }}</el-button>
|
||||
<el-button v-show="isInRoom" :loading="buttonLoading" type="primary" @click="joinRoom">{{ $t('demonstration.enterRoom') }}</el-button>
|
||||
</div>
|
||||
<el-tabs type="border-card" :value="currentPrdCode" :style="{ height: height-50 +'px' }" @tab-click="handleLeave">
|
||||
<el-tab-pane v-for="item in productList" :key="item.code" :name="item.code" :label="item.name" style="padding: 5px" :style="{ height: height-160 +'px' }">
|
||||
<div>
|
||||
<p class="list-item">
|
||||
<span class="list-label">{{ $t('demonstration.productDescription') }}</span>
|
||||
<span class="list-elem">{{ courseModel.remarks }}</span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">{{ $t('global.permissionList') }}</span>
|
||||
</p>
|
||||
<limit-list :ref="`limit_${item.code}`" :course-model="courseModel" @initLoadPage="initLoadPage" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<div v-if="hasProduct" class="btn-buy">
|
||||
<el-button type="success" @click="buy">{{ $t('global.buy') }}</el-button>
|
||||
<el-button v-if="hasPermssion" type="primary" @click="distribute">{{ $t('global.distributePermission') }}</el-button>
|
||||
<el-button v-if="hasPermssion" type="primary" @click="transfer">{{ $t('global.transferQRCode') }}</el-button>
|
||||
<el-button v-show="isStartDemon" :loading="buttonLoading" type="primary" @click="start">{{ $t('demonstration.startSimulation') }}</el-button>
|
||||
<el-button v-show="isCreateRoom" :loading="buttonLoading" type="primary" @click="start">{{ $t('demonstration.createRoom') }}</el-button>
|
||||
<el-button v-show="isInRoom" :loading="buttonLoading" type="primary" @click="joinRoom">{{ $t('demonstration.enterRoom') }}</el-button>
|
||||
</div>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
// import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { getGoodsTryUse } from '@/api/management/goods';
|
||||
import { getCommodityMapProduct, getMapProductDetail } from '@/api/management/mapprd';
|
||||
import { getMapProductDetail } from '@/api/management/mapprd';
|
||||
import { PermissionType } from '@/scripts/ConstDic';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { queryPermissionSimulation } from '@/api/management/author';
|
||||
import { postCreateRoom, getjointTraining, checkRoomExist } from '@/api/chat';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { simulationNotify, schedulingNotify } from '@/api/simulation';
|
||||
import localStore from 'storejs';
|
||||
import LimitList from '@/views/components/limits/index';
|
||||
|
||||
export default {
|
||||
@ -66,15 +60,11 @@ export default {
|
||||
prdCode: '',
|
||||
pmsList: []
|
||||
},
|
||||
EffectiveTypeList: [],
|
||||
jointShow: false,
|
||||
jointGroup: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
hasProduct() {
|
||||
return this.productList.length;
|
||||
},
|
||||
hasPermssion() {
|
||||
let isShow = false;
|
||||
if (this.courseModel.pmsList && this.courseModel.pmsList.length) {
|
||||
@ -89,11 +79,14 @@ export default {
|
||||
return this.courseModel.prdType === '03' && this.hasPermssion && !this.jointShow;
|
||||
},
|
||||
isInRoom() {
|
||||
return this.courseModel.prdType == '03' && this.hasPermssion && this.jointShow;
|
||||
return this.courseModel.prdType === '03' && this.hasPermssion && this.jointShow;
|
||||
},
|
||||
mapId() {
|
||||
return this.$route.params.mapId;
|
||||
},
|
||||
prodId() {
|
||||
return this.$route.query.prodId;
|
||||
},
|
||||
height() {
|
||||
return this.$store.state.app.height - 50;
|
||||
}
|
||||
@ -101,9 +94,6 @@ export default {
|
||||
watch: {
|
||||
'$route': function (val) {
|
||||
this.loadInitData();
|
||||
},
|
||||
'currentPrdCode': function (code) {
|
||||
this.initLoadPage({ id: this.mapId, code: code });
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
@ -111,30 +101,49 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async loadInitData() {
|
||||
this.$Dictionary.effectiveType().then(list => {
|
||||
this.EffectiveTypeList = list;
|
||||
});
|
||||
|
||||
this.currentPrdCode = '';
|
||||
this.productList = [];
|
||||
this.loading = true;
|
||||
this.currentPrdCode = this.prodId;
|
||||
try {
|
||||
if (parseInt(this.mapId)) {
|
||||
this.getJointTrainingList();
|
||||
const rest = await getPublishMapInfo(this.mapId);
|
||||
if (rest && rest.code == 200) {
|
||||
const resp = await getCommodityMapProduct(rest.data.skinCode);
|
||||
if (resp.data && resp.data.length) {
|
||||
this.productList = resp.data.sort((a, b) => {
|
||||
return Number(b.prdType) - Number(a.prdType);
|
||||
});
|
||||
this.getJointTrainingList();
|
||||
const resp = await getMapProductDetail(this.prodId);
|
||||
this.tryUser = 0;
|
||||
this.loading = false;
|
||||
this.courseModel = {
|
||||
id: resp.data.id,
|
||||
name: resp.data.name,
|
||||
mapId: this.mapId,
|
||||
skinCode: resp.data.skinCode,
|
||||
remarks: resp.data.remarks,
|
||||
prdType: resp.data.prdType,
|
||||
prdCode: resp.data.code,
|
||||
pmsList: resp.data.pmsList || [],
|
||||
PermissionType: PermissionType.SIMULATION
|
||||
};
|
||||
const rest = await queryPermissionSimulation({ mapId: this.courseModel.mapId, prdCode: this.courseModel.prdCode });
|
||||
this.courseModel.pmsList = rest.data;
|
||||
if (!this.courseModel.pmsList) {
|
||||
this.tryUser = 1;
|
||||
const paras = {
|
||||
mapId: this.mapId,
|
||||
prdCode: this.prodId,
|
||||
permissionType: PermissionType.SIMULATION
|
||||
};
|
||||
|
||||
this.currentPrdCode = localStore.get(this.$route.path) || this.productList[0].code;
|
||||
try {
|
||||
const resr = await getGoodsTryUse(paras);
|
||||
if (resr.data.tryTime <= 0) {
|
||||
this.tryTime = 0;
|
||||
} else {
|
||||
this.tryTime = resr.data.tryTime;
|
||||
this.goodsId = resr.data.goodsId;
|
||||
}
|
||||
} catch (error) {
|
||||
this.tryTime = 0;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
this.loading = false;
|
||||
} catch (e) {
|
||||
this.$messageBox(this.$t('error.getProductListFailed'));
|
||||
this.$messageBox(this.$t('error.refreshFailed'));
|
||||
}
|
||||
},
|
||||
async getJointTrainingList() {
|
||||
@ -151,58 +160,6 @@ export default {
|
||||
console.error(error, '获取是否拥有综合演练房间');
|
||||
}
|
||||
},
|
||||
async handleLeave(tab) {
|
||||
this.currentPrdCode = tab.name;
|
||||
localStore.set(this.$route.path, this.currentPrdCode);
|
||||
},
|
||||
async initLoadPage(data) {
|
||||
this.loading = true;
|
||||
if (data && parseInt(data.id) && data.code) {
|
||||
try {
|
||||
const resp = await getMapProductDetail(data.code);
|
||||
this.tryUser = 0;
|
||||
this.loading = false;
|
||||
this.courseModel = {
|
||||
id: resp.data.id,
|
||||
name: resp.data.name,
|
||||
mapId: data.id,
|
||||
skinCode: resp.data.skinCode,
|
||||
remarks: resp.data.remarks,
|
||||
prdType: resp.data.prdType,
|
||||
prdCode: resp.data.code,
|
||||
pmsList: resp.data.pmsList || [],
|
||||
PermissionType: PermissionType.SIMULATION
|
||||
};
|
||||
const rest = await queryPermissionSimulation({ mapId: this.courseModel.mapId, prdCode: this.courseModel.prdCode });
|
||||
this.courseModel.pmsList = rest.data;
|
||||
if (!this.courseModel.pmsList) {
|
||||
this.tryUser = 1;
|
||||
const paras = {
|
||||
mapId: data.id,
|
||||
prdCode: data.code,
|
||||
permissionType: PermissionType.SIMULATION
|
||||
};
|
||||
|
||||
try {
|
||||
const resr = await getGoodsTryUse(paras);
|
||||
if (resr.data.tryTime <= 0) {
|
||||
this.tryTime = 0;
|
||||
} else {
|
||||
this.tryTime = resr.data.tryTime;
|
||||
this.goodsId = resr.data.goodsId;
|
||||
}
|
||||
} catch (error) {
|
||||
this.tryTime = 0;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('error.refreshFailed'));
|
||||
}
|
||||
} else {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
async joinRoom() {
|
||||
await getjointTraining(this.jointGroup);
|
||||
const query = { skinCode: this.courseModel.skinCode, group: this.jointGroup };
|
||||
@ -284,20 +241,20 @@ export default {
|
||||
buy() {
|
||||
this.buttonLoading = true;
|
||||
this.$router.push({
|
||||
path: `${UrlConfig.demonstration.pay}/${this.courseModel.id}`,
|
||||
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`,
|
||||
query: { permissionType: PermissionType.SIMULATION, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId }
|
||||
});
|
||||
},
|
||||
transfer() {
|
||||
this.buttonLoading = false;
|
||||
if (this.$refs) {
|
||||
this.$refs[`limit_${this.currentPrdCode}`][0].transfer(this.courseModel);
|
||||
this.$refs[`limit`].transfer(this.courseModel);
|
||||
}
|
||||
},
|
||||
distribute() {
|
||||
this.buttonLoading = false;
|
||||
if (this.$refs) {
|
||||
this.$refs[`limit_${this.currentPrdCode}`][0].distribute(this.courseModel);
|
||||
this.$refs[`limit`].distribute(this.courseModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -310,28 +267,12 @@ export default {
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.title {
|
||||
font-weight: bold
|
||||
}
|
||||
|
||||
.time-item {
|
||||
font-size: 24px;
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
.time-label {
|
||||
display: -moz-inline-box;
|
||||
display: inline-block;
|
||||
text-align: right;
|
||||
margin-left: 14px;
|
||||
}
|
||||
|
||||
.time-elem {
|
||||
color: rgb(90, 89, 89) !important;
|
||||
.simulation-detail {
|
||||
margin: 50px;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
margin-bottom: 20px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
229
src/views/designPlatform/demonList.vue
Normal file
229
src/views/designPlatform/demonList.vue
Normal file
@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card v-loading="loading" class="map-list-main" header="已发布地图列表">
|
||||
<filter-city ref="filerCity" filter-empty :query-function="queryFunction" @filterSelectChange="refresh" />
|
||||
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-125) +'px' }">
|
||||
<!-- :style="{ height: heightUp +'px' }" -->
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="treeList"
|
||||
node-key="id"
|
||||
:props="defaultProps"
|
||||
highlight-current
|
||||
:span="22"
|
||||
:filter-node-method="filterNode"
|
||||
@node-click="clickEvent"
|
||||
>
|
||||
<!-- @node-contextmenu="showContextMenu" -->
|
||||
<span slot-scope="{ node:tnode, data }">
|
||||
<span
|
||||
class="el-icon-tickets"
|
||||
:style="{color: data.valid ? 'green':''}"
|
||||
> {{ tnode.label }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { postBuildMapImport } from '@/api/jmap/mapdraft';
|
||||
import { getPublishMapTree } from '@/api/management/mapprd';
|
||||
import { getMapList } from '@/api/designPlatform';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
|
||||
import FilterCity from '@/views/components/filterCity';
|
||||
import localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
name: 'publicMapList',
|
||||
components: {
|
||||
FilterCity,
|
||||
},
|
||||
props: {
|
||||
height: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
width: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
defaultShowKeys: [],
|
||||
queryFunction: getPublishMapTree,
|
||||
filterText: '',
|
||||
treeData: [],
|
||||
treeList: [],
|
||||
selected: {},
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
node: {
|
||||
},
|
||||
// mapId: '',
|
||||
heightUp: 450,
|
||||
point: {
|
||||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
editModel: {},
|
||||
// skinCode:''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
role() {
|
||||
return this.$store.state.user.roles.includes('04') ||
|
||||
this.$store.state.user.roles.includes('05') ||
|
||||
this.$store.state.user.roles.includes('01');
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
this.treeList = this.treeData.filter((res) => {
|
||||
return res.name.includes(val);
|
||||
});
|
||||
}
|
||||
},
|
||||
beforeDestroy () {
|
||||
removeSessionStorage('demonList');
|
||||
},
|
||||
mounted() {
|
||||
this.heightUp = Number(localStore.get('upHeight')?localStore.get('upHeight'):(this.height)/2);
|
||||
},
|
||||
methods: {
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
showContextMenu(e, obj, node, vueElem) {
|
||||
if (obj) {
|
||||
this.node = node;
|
||||
this.selected = obj;
|
||||
}
|
||||
},
|
||||
clickEvent(obj, data, ele) {
|
||||
switch(obj.type){
|
||||
case 'scriptDesign':{
|
||||
setSessionStorage('designType', 'scriptDesign');
|
||||
this.$router.push({ path: `${UrlConfig.design.scriptHome}/${obj.mapId}?skinCode=${obj.skinCode}` });
|
||||
break;
|
||||
}
|
||||
case 'lessonDesign': {
|
||||
setSessionStorage('designType', 'lessonDesign');
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${obj.mapId}/${obj.skinCode}`,query: {cityCode:data.parent.data.cityCode} });
|
||||
break;
|
||||
}
|
||||
case 'runPlanDesign': {
|
||||
setSessionStorage('designType', 'runPlanDesign');
|
||||
this.$router.push({ path: `${UrlConfig.design.runPlan}/${obj.mapId}?skinCode=${obj.skinCode}` });
|
||||
break;
|
||||
}
|
||||
case 'map':{
|
||||
setSessionStorage('demonList', obj.id);
|
||||
}
|
||||
}
|
||||
// this.$refs.menu.doClose();
|
||||
},
|
||||
// async myrefresh(filterSelect){
|
||||
|
||||
// },
|
||||
async refresh(filterSelect) {
|
||||
this.loading = true;
|
||||
this.treeData = this.treeList = [];
|
||||
try {
|
||||
const res = await getMapList(filterSelect);
|
||||
res.data.forEach(elem=>{
|
||||
// debugger;
|
||||
// elem.children.find(n => { return n.name.includes("行调")})
|
||||
elem.children=[
|
||||
// {
|
||||
// id:'1',
|
||||
// name:'地图设计',
|
||||
// type:'mapDesign'
|
||||
// },
|
||||
{
|
||||
id:'2',
|
||||
name:'课程设计',
|
||||
type:'lessonDesign',
|
||||
mapId:elem.id,
|
||||
skinCode:elem.skinCode
|
||||
},
|
||||
{
|
||||
id:'3',
|
||||
name:'剧本设计',
|
||||
type:'scriptDesign',
|
||||
mapId:elem.id,
|
||||
skinCode:elem.skinCode,
|
||||
// code:elem.children.find(n => { return n.name.includes("行调")})
|
||||
},
|
||||
{
|
||||
id:'4',
|
||||
name:'运行图设计',
|
||||
type:'runPlanDesign',
|
||||
mapId:elem.id,
|
||||
skinCode:elem.skinCode
|
||||
},
|
||||
]
|
||||
});
|
||||
this.treeData = res.data;
|
||||
this.treeList = this.filterText
|
||||
? res.data.filter(elem => { return elem.name.includes(this.filterText); })
|
||||
: res.data;
|
||||
this.$nextTick(() => {
|
||||
const mapId = getSessionStorage('demonList') || null;
|
||||
this.$refs.tree.setCurrentKey(mapId);
|
||||
this.loading = false;
|
||||
});
|
||||
} catch (error) {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('error.refreshFailed'));
|
||||
}
|
||||
},
|
||||
// refresh1(){
|
||||
|
||||
// },
|
||||
drapHeight(height) {
|
||||
this.heightUp = Number(height);
|
||||
},
|
||||
resize() {
|
||||
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
|
||||
const width = this.$store.state.app.width - 521 - this.widthLeft;
|
||||
const height = this.$store.state.app.height - 90;
|
||||
this.$store.dispatch('config/resize', { width: width, height: height });
|
||||
},
|
||||
// createMap() {
|
||||
// this.$emit("createMap");
|
||||
// },
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.back-home {
|
||||
float: right;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: #3ea726;
|
||||
}
|
||||
}
|
||||
|
||||
.map-list-main{
|
||||
text-align:left;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.el-tree {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.el-tree-node.is-current>.el-tree-node__content {
|
||||
background-color: #e4e3e3 !important;
|
||||
}
|
||||
</style>
|
97
src/views/designPlatform/home.vue
Normal file
97
src/views/designPlatform/home.vue
Normal file
@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<el-card :style="{height: height+'px'}">
|
||||
<div class="home-box" :style="{height: height+'px'}">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<h1 class="title">
|
||||
城市轨道交通设计平台
|
||||
<img :src="logo" alt="" class="logo-img">
|
||||
</h1>
|
||||
<div class="card-box">
|
||||
<el-carousel :interval="4000" type="card" height="380px">
|
||||
<el-carousel-item v-for="(item, index) in listImg" :key="index">
|
||||
<img :src="item.src" alt="" height="100%" width="100%">
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
</div>
|
||||
<div class="brief-box">{{ $t('demonstration.simulationSystemDescription') }}</div>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import logo from '@/assets/logo.png';
|
||||
import home1 from '@/assets/home/home1.png';
|
||||
import home2 from '@/assets/home/home2.png';
|
||||
import home3 from '@/assets/home/demon1.jpg';
|
||||
import home4 from '@/assets/home/tring1.png';
|
||||
import home5 from '@/assets/home/tring4.jpg';
|
||||
import home6 from '@/assets/home/demon2.jpg';
|
||||
export default {
|
||||
name: 'Home',
|
||||
data() {
|
||||
return {
|
||||
listImg: [
|
||||
{ src: home1 },
|
||||
{ src: home2 },
|
||||
{ src: home3 },
|
||||
{ src: home4 },
|
||||
{ src: home5 },
|
||||
{ src: home6 }
|
||||
],
|
||||
logo: logo
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
height() {
|
||||
return this.$store.state.app.height - 50;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
/deep/ .el-carousel {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.home-box {
|
||||
padding: 15px 100px;
|
||||
float: left;
|
||||
width: 100%;
|
||||
font-family: 'Microsoft YaHei';
|
||||
|
||||
.title {
|
||||
font-size: 35px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-weight: 400;
|
||||
margin-top: 55px;
|
||||
border-bottom: 2px dashed #333;
|
||||
padding-bottom: 15px;
|
||||
margin-bottom: 70px;
|
||||
position: relative;
|
||||
|
||||
.logo-img {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 55px;
|
||||
}
|
||||
}
|
||||
|
||||
.card-box {
|
||||
width: 100%;
|
||||
padding: 0 50px;
|
||||
}
|
||||
|
||||
.brief-box {
|
||||
font-size: 18px;
|
||||
text-indent: 2em;
|
||||
line-height: 32px;
|
||||
padding: 40px 20px 0;
|
||||
font-family: unset;
|
||||
}
|
||||
}
|
||||
</style>
|
121
src/views/designPlatform/index.vue
Normal file
121
src/views/designPlatform/index.vue
Normal file
@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<div class="app-wrapper">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
||||
<demon-list ref="demonList" :height="height" :width="widthLeft"/>
|
||||
</div>
|
||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||
<transition>
|
||||
<router-view :product-list="productList" :style="{width:currentWidth+'px',display:'inline-block'}"/>
|
||||
</transition>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import demonList from './demonList';
|
||||
import drapLeft from '@/views/components/drapLeft/index';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import localStore from 'storejs';
|
||||
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||
import MapCreate from '@/views/map/mapdraft/mapmanage/create';
|
||||
|
||||
export default {
|
||||
name: 'DesignPlatform',
|
||||
components: {
|
||||
demonList,
|
||||
drapLeft,
|
||||
MapCreate
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
listShow: true,
|
||||
widthLeft: Number(localStore.get('LeftWidth')) || 450,
|
||||
productList: [],
|
||||
skinCode: '',
|
||||
currentWidth:'',
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'lessonbar'
|
||||
]),
|
||||
height() {
|
||||
return this.$store.state.app.height - 50;
|
||||
},
|
||||
width() {
|
||||
return this.$store.state.app.width;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'lessonbar.opened': function (val) {
|
||||
this.listShow = val;
|
||||
},
|
||||
widthLeft(val) {
|
||||
this.setMapResize(val);
|
||||
},
|
||||
'$store.state.app.windowSizeCount': function() {
|
||||
this.resize();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.currentWidth=this.$store.state.app.width - this.widthLeft;
|
||||
const againEnter = getSessionStorage('againEnter') || null;
|
||||
if (!againEnter){
|
||||
launchFullscreen();
|
||||
setSessionStorage('againEnter',true);
|
||||
}
|
||||
this.resize();
|
||||
this.widthLeft = Number(localStore.get('LeftWidth'));
|
||||
},
|
||||
methods: {
|
||||
refresh() {
|
||||
this.$refs && this.$refs.demonList && this.$refs.demonList.refresh();
|
||||
},
|
||||
drapWidth(width) {
|
||||
this.widthLeft = Number(width);
|
||||
},
|
||||
|
||||
refresh1() {
|
||||
|
||||
},
|
||||
mapSelected(data) {
|
||||
if (data && this.editModel) {
|
||||
this.$router.push({ path: `${UrlConfig.map.draft}/${this.editModel.id}/${data.view}`, query: { name: this.editModel.name } });
|
||||
}
|
||||
},
|
||||
resize() {
|
||||
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
|
||||
const width = this.$store.state.app.width - 521 - this.widthLeft;
|
||||
const height = this.$store.state.app.height - 90;
|
||||
this.$store.dispatch('config/resize', { width: width, height: height });
|
||||
},
|
||||
setMapResize(LeftWidth) {
|
||||
this.currentWidth=this.$store.state.app.width - this.widthLeft;
|
||||
const widths = this.$store.state.app.width - 521 - LeftWidth;
|
||||
const heights = this.$store.state.app.height - 90;
|
||||
this.$store.dispatch('config/resize', { width: widths, height: heights });
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</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;
|
||||
}
|
||||
|
||||
.examList {
|
||||
// position: fixed;
|
||||
// top: 61px;
|
||||
float: left;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
299
src/views/designPlatform/userDemonList.vue
Normal file
299
src/views/designPlatform/userDemonList.vue
Normal file
@ -0,0 +1,299 @@
|
||||
<template>
|
||||
<el-card v-loading="loading" class="map-list-main" header="我的地图列表">
|
||||
<filter-city ref="myfilerCity" filter-empty :query-function="queryFunction" @filterSelectChange="refresh" />
|
||||
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-185) +'px' }">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="treeList"
|
||||
node-key="id"
|
||||
:props="defaultProps"
|
||||
highlight-current
|
||||
:span="22"
|
||||
:filter-node-method="filterNode"
|
||||
@node-click="clickEvent"
|
||||
@node-contextmenu="showContextMenu"
|
||||
>
|
||||
<span slot-scope="{ node:tnode, data }">
|
||||
<span
|
||||
class="el-icon-tickets"
|
||||
:style="{color: data.valid ? 'green':''}"
|
||||
> {{ tnode.label }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
<div class="buttonList">
|
||||
<el-button size="small" type="primary" class="eachButton uploadDemo ">
|
||||
<input
|
||||
ref="files"
|
||||
type="file"
|
||||
class="file_box"
|
||||
accept=".json, application/json"
|
||||
@change="importf"
|
||||
>
|
||||
导入地图
|
||||
<!-- {{ $t('map.importMap') }} -->
|
||||
</el-button>
|
||||
<el-button size="small" type="primary" class="eachButton" @click="createMap" >新建地图</el-button>
|
||||
<!-- {{ $t('map.newConstruction') }} -->
|
||||
</div>
|
||||
<map-operate-menu
|
||||
ref="menu"
|
||||
:point="point"
|
||||
:edit-model="editModel"
|
||||
:skin-code="skinCode"
|
||||
@refresh="refresh1"
|
||||
@jlmap3d="jlmap3d"
|
||||
/>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { postBuildMapImport } from '@/api/jmap/mapdraft';
|
||||
import { getUserMapTree } from '@/api/designPlatform';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
|
||||
import FilterCity from '@/views/components/filterCity';
|
||||
import localStore from 'storejs';
|
||||
import MapOperateMenu from '@/views/map/mapdraft/mapmanage/operateMenu';
|
||||
|
||||
export default {
|
||||
name: 'userMapList',
|
||||
components: {
|
||||
FilterCity,
|
||||
MapOperateMenu
|
||||
},
|
||||
props: {
|
||||
height: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
width: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
defaultShowKeys: [],
|
||||
queryFunction:getUserMapTree,
|
||||
filterText: '',
|
||||
treeData: [],
|
||||
treeList: [],
|
||||
selected: {},
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
node: {
|
||||
},
|
||||
// mapId: '',
|
||||
// mapName:'',
|
||||
heightUp: 450,
|
||||
point: {
|
||||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
editModel: {},
|
||||
skinCode:''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
role() {
|
||||
return this.$store.state.user.roles.includes('04') ||
|
||||
this.$store.state.user.roles.includes('05') ||
|
||||
this.$store.state.user.roles.includes('01');
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
this.treeList = this.treeData.filter((res) => {
|
||||
return res.name.includes(val);
|
||||
});
|
||||
}
|
||||
},
|
||||
beforeDestroy () {
|
||||
removeSessionStorage('demonList');
|
||||
},
|
||||
mounted() {
|
||||
this.heightUp = Number(localStore.get('upHeight')?localStore.get('upHeight'):(this.height)/2);
|
||||
},
|
||||
methods:{
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
createMap() {
|
||||
this.$emit("createMap");
|
||||
},
|
||||
async refresh(filterSelect) {
|
||||
this.loading = true;
|
||||
this.treeData = this.treeList = [];
|
||||
try {
|
||||
const res = await getUserMapTree(filterSelect);
|
||||
res.data.forEach(elem=>{
|
||||
// if(elem.children)
|
||||
// {
|
||||
elem.type="map",
|
||||
elem.children=[
|
||||
{
|
||||
id:'1',
|
||||
name:'地图设计',
|
||||
type:'mapDesign',
|
||||
mapId:elem.id,
|
||||
mapName:elem.name,
|
||||
skinCode:elem.skinCode
|
||||
},
|
||||
// {
|
||||
// id:'2',
|
||||
// name:'课程设计',
|
||||
// type:'lessonDesign'
|
||||
// },
|
||||
// {
|
||||
// id:'3',
|
||||
// name:'剧本设计',
|
||||
// type:'scriptDesign'
|
||||
// },
|
||||
{
|
||||
id:'4',
|
||||
name:'运行图设计',
|
||||
type:'runPlanDesign',
|
||||
mapId:elem.id,
|
||||
mapName:elem.name,
|
||||
skinCode:elem.skinCode
|
||||
},
|
||||
]
|
||||
// }
|
||||
});
|
||||
|
||||
this.treeData = res.data;
|
||||
this.treeList = this.filterText
|
||||
? res.data.filter(elem => { return elem.name.includes(this.filterText); })
|
||||
: res.data;
|
||||
this.$nextTick(() => {
|
||||
// const mapId = getSessionStorage('demonList') || null;
|
||||
// this.$refs.tree.setCurrentKey(mapId);
|
||||
this.loading = false;
|
||||
});
|
||||
} catch (error) {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('error.refreshFailed'));
|
||||
}
|
||||
},
|
||||
clickEvent(obj, data, ele) {
|
||||
if (obj.type=="map"){
|
||||
// this.mapId = data.data.id;
|
||||
// this.mapName=data.data.name;
|
||||
// this.skinCode=data.data.skinCode;
|
||||
}
|
||||
switch(obj.type){
|
||||
// case 'scriptDesign':{
|
||||
// this.$router.push({ path: `${UrlConfig.designUser.scriptHome}/${this.mapId}` });
|
||||
// break;
|
||||
// }
|
||||
case 'mapDesign': {
|
||||
// this.resize();
|
||||
this.$router.push({ path: `${UrlConfig.designUser.mapDraw}/${obj.mapId}/draft`, query: { name: obj.mapName } });
|
||||
break;
|
||||
}
|
||||
// case 'lessonDesign': {
|
||||
// this.$router.push({ path: `${UrlConfig.designUser.lessonHome}/${this.mapId}` });
|
||||
// break;
|
||||
// }
|
||||
case 'runPlanDesign': {
|
||||
this.$router.push({ path: `${UrlConfig.designUser.runPlan}/${obj.mapId}?skinCode=${obj.skinCode}` })
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.$refs.menu.doClose();
|
||||
},
|
||||
showContextMenu(e, obj, node, vueElem) {
|
||||
if (obj && obj.type == 'map') {
|
||||
e.preventDefault();
|
||||
const menu = DeviceMenu.Map;
|
||||
|
||||
this.point = {
|
||||
x: e.clientX,
|
||||
y: e.clientY
|
||||
};
|
||||
this.editModel = obj;
|
||||
this.editModel.skinCode = obj.skinCode;
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||
}
|
||||
else{
|
||||
// 关掉右键操作
|
||||
}
|
||||
},
|
||||
refresh1(){
|
||||
this.$refs.myfilerCity.loadInitData();
|
||||
this.refresh();
|
||||
},
|
||||
refresh2(){
|
||||
this.$refs.myfilerCity.loadInitData();
|
||||
this.refresh();
|
||||
},
|
||||
jlmap3d() {
|
||||
this.$router.push({ path: '/jlmap3d/edit', query: { mapid: this.editModel.id } });
|
||||
},
|
||||
importf() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在导入中...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
setTimeout(() => {
|
||||
const obj = this.$refs.files;
|
||||
if (!obj.files) return;
|
||||
const f = obj.files[0];
|
||||
const reader = new FileReader();
|
||||
const that = this;
|
||||
reader.readAsText(f, 'utf-8');
|
||||
reader.onload = function(e) {
|
||||
const data = e.target.result;
|
||||
postBuildMapImport(JSON.parse(data)).then(res => {
|
||||
loading.close();
|
||||
that.$message.success('导入成功!');
|
||||
that.refresh();
|
||||
loading.close();
|
||||
}).catch(error => {
|
||||
loading.close();
|
||||
that.$message.error('导入失败' + error.message);
|
||||
});
|
||||
obj.value = '';
|
||||
};
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.buttonList{
|
||||
padding: 8px 0px 8px 0px;
|
||||
border-top: 1px #ccc solid;
|
||||
}
|
||||
.eachButton{
|
||||
margin-left:10px;
|
||||
}
|
||||
.uploadDemo {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
// float: right;
|
||||
padding: 9px 15px;
|
||||
margin-right: 3px;
|
||||
cursor: pointer;
|
||||
input {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.map-list-main{
|
||||
text-align:left;
|
||||
}
|
||||
</style>
|
147
src/views/designPlatform/userIndex.vue
Normal file
147
src/views/designPlatform/userIndex.vue
Normal file
@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<div class="app-wrapper">
|
||||
<map-create ref="mapCreate" :skin-code="skinCode" @refresh="refresh1" @editmap="handleNodeClick" />
|
||||
<!-- <el-scrollbar wrap-class="scrollbar-wrapper"> -->
|
||||
<div>
|
||||
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
||||
<demon-list ref="demonList" :height="height" :width="widthLeft" @createMap="createMap"/>
|
||||
</div>
|
||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||
<transition>
|
||||
<!-- position:'relative', -->
|
||||
<!-- :style="{left:widthLeft+'px', width: (width - widthLeft)+'px'}" -->
|
||||
<router-view :product-list="productList" />
|
||||
</transition>
|
||||
</div>
|
||||
|
||||
<!-- </el-scrollbar> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import demonList from './userDemonList';
|
||||
import drapLeft from '@/views/components/drapLeft/index';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import localStore from 'storejs';
|
||||
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||
import MapCreate from '@/views/map/mapdraft/mapmanage/create';
|
||||
|
||||
export default {
|
||||
name: 'DesignPlatform',
|
||||
components: {
|
||||
demonList,
|
||||
drapLeft,
|
||||
MapCreate
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
listShow: true,
|
||||
widthLeft: Number(localStore.get('LeftWidth')) || 450,
|
||||
productList: [],
|
||||
skinCode: '',
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'lessonbar'
|
||||
]),
|
||||
height() {
|
||||
return this.$store.state.app.height - 50;
|
||||
},
|
||||
width() {
|
||||
return this.$store.state.app.width;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'lessonbar.opened': function (val) {
|
||||
this.listShow = val;
|
||||
},
|
||||
widthLeft(val) {
|
||||
this.setMapResize(val);
|
||||
},
|
||||
'$store.state.app.windowSizeCount': function() {
|
||||
this.resize();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const againEnter = getSessionStorage('againEnter') || null;
|
||||
if (!againEnter){
|
||||
launchFullscreen();
|
||||
setSessionStorage('againEnter',true);
|
||||
}
|
||||
this.resize();
|
||||
this.widthLeft = Number(localStore.get('LeftWidth'));
|
||||
},
|
||||
methods: {
|
||||
refresh() {
|
||||
this.$refs && this.$refs.demonList && this.$refs.demonList.refresh();
|
||||
},
|
||||
drapWidth(width) {
|
||||
this.widthLeft = Number(width);
|
||||
},
|
||||
|
||||
createMap() {
|
||||
this.$refs.mapCreate.show();
|
||||
},
|
||||
|
||||
refresh1() {
|
||||
this.$refs.demonList.refresh2();
|
||||
},
|
||||
|
||||
getSkinCode(node) {
|
||||
let next = node;
|
||||
while (next) {
|
||||
if (next.data && next.data.type == 'skin') {
|
||||
this.skinCode = next.data.id;
|
||||
break;
|
||||
}
|
||||
next = next.parent;
|
||||
}
|
||||
},
|
||||
handleNodeClick(obj, node) {
|
||||
this.getSkinCode(node);
|
||||
if (obj && obj.type == 'map') {
|
||||
this.editModel = obj;
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
|
||||
this.mapSelected({ view: 'draft' });
|
||||
}
|
||||
},
|
||||
mapSelected(data) {
|
||||
if (data && this.editModel) {
|
||||
this.$router.push({ path: `${UrlConfig.map.draft}/${this.editModel.id}/${data.view}`, query: { name: this.editModel.name } });
|
||||
}
|
||||
},
|
||||
resize() {
|
||||
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
|
||||
const width = this.$store.state.app.width - 521 - this.widthLeft;
|
||||
const height = this.$store.state.app.height - 90;
|
||||
this.$store.dispatch('config/resize', { width: width, height: height });
|
||||
},
|
||||
setMapResize(LeftWidth) {
|
||||
const widths = this.$store.state.app.width - 521 - LeftWidth;
|
||||
const heights = this.$store.state.app.height - 90;
|
||||
this.$store.dispatch('config/resize', { width: widths, height: heights });
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</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;
|
||||
}
|
||||
|
||||
.examList {
|
||||
// position: fixed;
|
||||
// top: 61px;
|
||||
float: left;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
@ -51,7 +51,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getScriptPageListOnline, getScriptById } from '@/api/script';
|
||||
import { getScriptPageListOnline, getScriptById,getDraftScriptById } from '@/api/script';
|
||||
|
||||
export default {
|
||||
name: 'AddQuest',
|
||||
@ -82,6 +82,7 @@ export default {
|
||||
role: ''
|
||||
},
|
||||
memberList: [],
|
||||
mapLocation:null,
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
reset: false,
|
||||
@ -128,6 +129,7 @@ export default {
|
||||
'Attendant': this.$t('display.script.attendant'),
|
||||
'Audience': this.$t('display.script.audience'),
|
||||
'Driver': this.$t('display.script.driver'),
|
||||
'Repair':this.$t('display.script.repair'),
|
||||
'no': ''
|
||||
}
|
||||
};
|
||||
@ -152,11 +154,15 @@ export default {
|
||||
},
|
||||
async handleLoad(index, row) {
|
||||
this.row = row;
|
||||
const res = await getScriptById(row.id);
|
||||
const res = this.$route.fullPath.includes('design/display/demon')?await getDraftScriptById(row.id):await getScriptById(row.id);
|
||||
let newMemberList = [];
|
||||
if (res.code == 200) {
|
||||
if (res.data.memberVOList && res.data.memberVOList.length > 0) {
|
||||
newMemberList = res.data.memberVOList.filter(item => item.hasPlay === true);
|
||||
if (res.data.playerVOList && res.data.playerVOList.length > 0) {
|
||||
newMemberList = res.data.playerVOList.filter(item => item.hasPlay === true);
|
||||
}
|
||||
if(res.data.mapLocation)
|
||||
{
|
||||
this.mapLocation=res.data.mapLocation;
|
||||
}
|
||||
this.memberList = newMemberList || [];
|
||||
this.memberList.unshift({ id: '', name: this.$t('display.script.none'), role: 'no' });
|
||||
@ -171,11 +177,8 @@ export default {
|
||||
},
|
||||
|
||||
async confirm() {
|
||||
await this.$store.dispatch('training/over');
|
||||
await this.$store.dispatch('training/setMapDefaultState');
|
||||
await this.$store.dispatch('map/clearJlmapTrainView');
|
||||
await this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
this.$emit('selectQuest', this.row, this.form.role);
|
||||
let roleName=this.memberList.find(elem=>{return elem.id==this.form.role});
|
||||
this.$emit('selectQuest', this.row, this.form.role,this.mapLocation,roleName.role);
|
||||
this.doClose();
|
||||
this.roleDoClose();
|
||||
},
|
||||
@ -186,12 +189,14 @@ export default {
|
||||
},
|
||||
|
||||
checkDisabled(role) {
|
||||
if (this.$route.query.prdType == '01') {
|
||||
return role !== 'Attendant' && role !== 'no';
|
||||
} else if (this.$route.query.prdType == '02') {
|
||||
return role !== 'Dispatcher'&& role !== 'no';
|
||||
} else if (this.$route.query.prdType == '04') {
|
||||
return role !== 'Driver' && role !== 'no';
|
||||
if(!this.$route.fullPath.includes('design/display/demon')){
|
||||
if (this.$route.query.prdType == '01') {
|
||||
return role !== 'Attendant' && role !== 'no';
|
||||
} else if (this.$route.query.prdType == '02') {
|
||||
return role !== 'Dispatcher'&& role !== 'no';
|
||||
} else if (this.$route.query.prdType == '04') {
|
||||
return role !== 'Driver' && role !== 'no';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
651
src/views/display/designIndex.vue
Normal file
651
src/views/display/designIndex.vue
Normal file
@ -0,0 +1,651 @@
|
||||
<template>
|
||||
<div class="main" :style="{width: canvasWidth+'px'}" @mousemove="mousemove">
|
||||
<div v-show="panelShow" :panelShow="panelShow">
|
||||
<transition name="el-zoom-in-bottom">
|
||||
<map-system-draft ref="mapCanvas" @back="back" />
|
||||
</transition>
|
||||
|
||||
<menu-exam v-if="isExam" ref="menuExam" :offset="offset" :group="group" />
|
||||
|
||||
<menu-lesson v-if="isLesson" ref="lessonMenu" :offset="offset" :group="group" :training-obj="trainingObj" />
|
||||
|
||||
<menu-demon
|
||||
v-if="isDemon"
|
||||
ref="menuDemon"
|
||||
:offset="offset"
|
||||
:group="group"
|
||||
:quest-id="questId"
|
||||
@tryTime="tryTime"
|
||||
@hidepanel="hidepanel"
|
||||
@quitQuest="quitQuest"
|
||||
@showScheduling="showScheduling"
|
||||
/>
|
||||
|
||||
<menu-screen v-if="isScreen" ref="menuScreen" :offset="offset" :group="group" @tryTime="tryTime" />
|
||||
|
||||
<menu-plan v-if="isPlan" ref="menuPlan" :offset="offset" :group="group" />
|
||||
|
||||
<menu-replay v-if="isReplay" ref="menuReplay" :offset="offset" :group="group" />
|
||||
|
||||
<menu-script v-if="isScript" ref="menuScript" :offset="offset" :group="group" />
|
||||
|
||||
<menu-schema
|
||||
v-if="isDemon || isPlan || isScript "
|
||||
ref="menuSchema"
|
||||
:offset="offset"
|
||||
:group="group"
|
||||
@runPlanLoadShow="runPlanLoadShow"
|
||||
@runPlanViewShow="runPlanViewShow"
|
||||
@faultChooseShow="faultChooseShow"
|
||||
@runQuestLoadShow="runQuestLoadShow"
|
||||
@runAddRolesLoadShow="runAddRolesLoadShow"
|
||||
@switchMode="switchMode"
|
||||
/>
|
||||
|
||||
<menu-system-time ref="menuSystemTime" :offset="offset" :right="right" :group="group" />
|
||||
</div>
|
||||
|
||||
<Jl3d-Simulation v-show="simulationShow" ref="Jl3dSimulation" :panel-show="simulationShow" @showpanel="showpanel" />
|
||||
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
|
||||
|
||||
<fault-choose ref="faultChoose" :group="group" />
|
||||
<run-plan-Load ref="runPlanLoad" :group="group" />
|
||||
<run-plan-view ref="runPlanView" :group="group" />
|
||||
<add-quest ref="addQuest" @selectQuest="selectQuest" />
|
||||
<scheduling v-if="isShowScheduling" ref="scheduling" :group="group" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import RunPlanLoad from './demon/runPlanLoad';
|
||||
import RunPlanView from './demon/runPlanView';
|
||||
import FaultChoose from './demon/faultChoose';
|
||||
import MapSystemDraft from '@/views/mapsystem/index';
|
||||
import MenuExam from '@/views/display/menuExam';
|
||||
import MenuLesson from '@/views/display/menuLesson';
|
||||
import MenuReplay from '@/views/display/menuReplay';
|
||||
import MenuDemon from '@/views/display/menuDemon';
|
||||
import MenuScreen from '@/views/display/menuScreen';
|
||||
import MenuSchema from '@/views/display/menuSchema';
|
||||
import MenuSystemTime from '@/views/display/menuSystemTime';
|
||||
import MenuPlan from '@/views/display/menuPlan';
|
||||
import MenuScript from '@/views/display/menuScript';
|
||||
import AddQuest from './demon/addQuest';
|
||||
import Scheduling from './demon/scheduling';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { getTrainingDetail, getTrainingStepsDetail } from '@/api/jmap/training';
|
||||
import { setGoodsTryUse } from '@/api/management/goods';
|
||||
import { getProductDetail } from '@/api/management/mapprd';
|
||||
import { runDiagramQuit, loadScript, getSimulationInfo } from '@/api/simulation';
|
||||
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import { loadMapData, loadMapDataById } from '@/utils/loaddata';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import Vue from 'vue';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import {loadDraftScript} from '@/api/designPlatform'
|
||||
|
||||
// 三维
|
||||
import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation';
|
||||
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
|
||||
|
||||
export default {
|
||||
name: 'DisplayDraft',
|
||||
components: {
|
||||
RunPlanLoad,
|
||||
RunPlanView,
|
||||
FaultChoose,
|
||||
AddQuest,
|
||||
MenuExam,
|
||||
MenuLesson,
|
||||
MenuReplay,
|
||||
MapSystemDraft,
|
||||
MenuPlan,
|
||||
MenuDemon,
|
||||
MenuScreen,
|
||||
MenuScript,
|
||||
MenuSchema,
|
||||
MenuSystemTime,
|
||||
Jl3dSimulation,
|
||||
Jl3dDrive,
|
||||
Scheduling
|
||||
},
|
||||
props: {
|
||||
size: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mode: '',
|
||||
trainingObj: {},
|
||||
timeDemonNum: 0,
|
||||
checkLine: null,
|
||||
offset: 15,
|
||||
mouseNum: 1,
|
||||
ierval: null,
|
||||
mouseNumTime: 0,
|
||||
mapBox: null,
|
||||
mapBoxP: null,
|
||||
panelShow: true,
|
||||
simulationShow: false,
|
||||
drivingShow: false,
|
||||
questId: 0, // 加载任务的Id
|
||||
group: '',
|
||||
prdTypeMap: {
|
||||
'01': '01', // 现地 => 现地
|
||||
'02': '02', // 行调 => 行调
|
||||
'04': '02', // 司机 => 行调
|
||||
'05': '' // 派班 => null
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'canvasWidth',
|
||||
'canvasHeight'
|
||||
]),
|
||||
...mapGetters('map', [
|
||||
'map',
|
||||
'mapDeviceStatus'
|
||||
]),
|
||||
...mapGetters('training', [
|
||||
'offsetStationCode'
|
||||
]),
|
||||
...mapGetters('config', [
|
||||
'canvasId'
|
||||
]),
|
||||
width() {
|
||||
return this.$store.state.app.width;
|
||||
},
|
||||
height() {
|
||||
return this.$store.state.app.height;
|
||||
},
|
||||
right() {
|
||||
return this.$store.state.config.width / 2 - 55;
|
||||
},
|
||||
trainingId() {
|
||||
return this.$route.query.trainingId;
|
||||
},
|
||||
mapId() {
|
||||
return this.$route.query.mapId;
|
||||
},
|
||||
prdType() {
|
||||
// return this.$route.query.prdType;
|
||||
return this.$store.state.training.prdType;
|
||||
},
|
||||
skinCode() {
|
||||
return this.$route.query.skinCode;
|
||||
},
|
||||
isLesson() {
|
||||
return this.mode === 'teach' || this.mode === 'record' || this.mode === 'manage';
|
||||
},
|
||||
isExam() {
|
||||
return this.mode === 'exam';
|
||||
},
|
||||
isDemon() {
|
||||
return this.mode === 'demon';
|
||||
},
|
||||
isScreen() {
|
||||
return this.mode === 'dp';
|
||||
},
|
||||
isReplay() {
|
||||
return this.mode === 'replay';
|
||||
},
|
||||
isScript() {
|
||||
return this.mode === 'script';
|
||||
},
|
||||
isPlan() {
|
||||
return this.mode === 'plan';
|
||||
},
|
||||
isDrive() {
|
||||
return this.prdType == '04';
|
||||
},
|
||||
isShowScheduling() {
|
||||
return this.prdType == '05';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.config.menuBarLoadedCount': function (val) {
|
||||
this.setPosition();
|
||||
},
|
||||
'$store.state.map.mapViewLoadedCount': function (val) {
|
||||
this.mapBoxP = document.getElementById(this.canvasId).children[0];
|
||||
this.mapBox = document.getElementsByTagName('canvas');
|
||||
|
||||
if (this.trainingId) {
|
||||
getTrainingStepsDetail(this.trainingId, { group: this.group }).then(resp => {
|
||||
this.trainingObj = resp.data;
|
||||
this.$store.dispatch('training/setTrainingData', this.trainingObj);
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
'$store.state.training.prdType':function(val){
|
||||
// this.prdType=val;
|
||||
debugger;
|
||||
this.isDrive=(val == '04');
|
||||
this.isShowScheduling=(val == '05');
|
||||
},
|
||||
'$store.state.socket.permissionOver': function () {
|
||||
this.$alert('用户权限已被收回', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
this.back();
|
||||
}
|
||||
});
|
||||
},
|
||||
'$store.state.app.windowSizeCount': function() {
|
||||
this.setWindowSize();
|
||||
},
|
||||
$route() {
|
||||
this.$nextTick(() => {
|
||||
this.initLoadData();
|
||||
});
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.mode = this.$route.params.mode;
|
||||
this.group = this.$route.query.group || '';
|
||||
},
|
||||
async mounted() {
|
||||
EventBus.$on('clearCheckLogin', () => {
|
||||
this.clearCheckLogin();
|
||||
});
|
||||
|
||||
await this.setWindowSize();
|
||||
await this.initLoadData();
|
||||
},
|
||||
async beforeDestroy() {
|
||||
await this.clearAllTimer();
|
||||
if (!this.isReplay) {
|
||||
await this.quit();
|
||||
}
|
||||
await this.$store.dispatch('training/reset');
|
||||
await this.$store.dispatch('map/mapClear');
|
||||
EventBus.$off('clearCheckLogin');
|
||||
},
|
||||
methods: {
|
||||
// 清除检查在线定时器
|
||||
clearAllTimer() {
|
||||
if (this.ierval) {
|
||||
clearTimeout(this.ierval);
|
||||
this.ierval = null;
|
||||
}
|
||||
|
||||
if (this.checkLine) {
|
||||
clearTimeout(this.checkLine);
|
||||
this.checkLine = null;
|
||||
}
|
||||
},
|
||||
// 设置检查在线定时器
|
||||
checkLoginLineTimer() {
|
||||
if (this.checkLine) {
|
||||
clearTimeout(this.checkLine);
|
||||
}
|
||||
|
||||
this.checkLine = setInterval(() => {
|
||||
checkLoginLine();
|
||||
}, 5000 * 60);
|
||||
},
|
||||
// 设置手标显示状态
|
||||
checkMouseStatusTimer() {
|
||||
if (this.ierval) {
|
||||
clearTimeout(this.ierval);
|
||||
}
|
||||
|
||||
this.ierval = setInterval(() => {
|
||||
if (this.mouseNum) {
|
||||
this.mouseNum = 0;
|
||||
this.mouseNumTime = 0;
|
||||
} else {
|
||||
this.mouseNumTime += 1;
|
||||
}
|
||||
if (this.mapBox) {
|
||||
if (this.mouseNumTime >= 15) {
|
||||
for (let i = 0; i < this.mapBox.length; i++) {
|
||||
this.mapBox[i].style.cursor = 'none';
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < this.mapBox.length; i++) {
|
||||
this.mapBox[i].style.cursor = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
mousemove(e) {
|
||||
this.mouseNum = 1;
|
||||
},
|
||||
setPosition() {
|
||||
this.$nextTick(() => {
|
||||
let offset = 15;
|
||||
const menuBar = document.getElementById('menuBar');
|
||||
const menuTool = document.getElementById('menuTool');
|
||||
if (menuBar) {
|
||||
offset += (menuBar.offsetHeight || 0);
|
||||
}
|
||||
if (menuTool) {
|
||||
offset += (menuTool.offsetHeight || 0);
|
||||
}
|
||||
|
||||
if (this.offset != offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 结束加载状态
|
||||
endViewLoading(isSuccess) {
|
||||
if (!isSuccess) {
|
||||
this.$store.dispatch('map/mapClear');
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
EventBus.$emit('viewLoading', false);
|
||||
});
|
||||
},
|
||||
// 加载仿真信息
|
||||
async loadSimulationInfo() {
|
||||
const resp = await getSimulationInfo(this.group);
|
||||
if (resp && resp.code == 200) {
|
||||
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause);
|
||||
this.questId = Number(resp.data.questId) || 0;
|
||||
}
|
||||
},
|
||||
// 加载地图数据
|
||||
async initLoadData() {
|
||||
this.$store.dispatch('training/reset');
|
||||
|
||||
try {
|
||||
if (!this.isReplay) {
|
||||
await this.loadSimulationInfo();
|
||||
}
|
||||
|
||||
if (this.isReplay) {
|
||||
await this.initLoadReplayData();
|
||||
} else if (this.isDemon) {
|
||||
await this.initLoadDemonData();
|
||||
} else if (this.isScreen) {
|
||||
await this.initLoadScreenData();
|
||||
} else if (this.isPlan) {
|
||||
await this.initLoadTestRunData();
|
||||
} else if (this.isScript) {
|
||||
await this.initLoadTaskData();
|
||||
} else {
|
||||
await this.initLoadLessonOrExamData();
|
||||
}
|
||||
|
||||
this.checkLoginLineTimer();
|
||||
this.checkMouseStatusTimer();
|
||||
} catch (error) {
|
||||
this.$messageBox(`初始化失败: ${error.message}`);
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
// 课程和考试系统
|
||||
async initLoadLessonOrExamData() {
|
||||
this.$store.dispatch('training/end', null);
|
||||
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
||||
|
||||
if (parseInt(this.trainingId)) {
|
||||
// 设置地图数据
|
||||
// 设置实训数据
|
||||
const resp = await getTrainingDetail(this.trainingId);
|
||||
if (resp && resp.code == 200) {
|
||||
const detail = resp.data;
|
||||
const rest = await getProductDetail(detail.prdCode);
|
||||
if (rest && rest.code == 200) {
|
||||
const data = rest.data;
|
||||
await this.$store.dispatch('training/setPrdType', data.prdType);
|
||||
await this.loadMapData(detail.skinCode);
|
||||
}
|
||||
} else {
|
||||
this.$messageBox(`获取实训步骤数据失败`);
|
||||
this.endViewLoading();
|
||||
}
|
||||
} else {
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
// 回放系统
|
||||
async initLoadReplayData() {
|
||||
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
||||
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
||||
this.$store.dispatch('training/setPrdType', '');
|
||||
|
||||
if (parseInt(this.skinCode)) {
|
||||
await this.loadMapData(this.skinCode);
|
||||
|
||||
} else {
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
// 仿真系统
|
||||
async initLoadDemonData() {
|
||||
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
||||
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
||||
this.$store.dispatch('training/setPrdType', this.prdTypeMap[this.prdType]);
|
||||
|
||||
if (parseInt(this.skinCode)) {
|
||||
await this.loadMapData(this.skinCode);
|
||||
|
||||
} else {
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
// 大屏系统请求
|
||||
async initLoadScreenData() {
|
||||
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
||||
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
||||
this.$store.dispatch('training/setPrdType', '01');
|
||||
|
||||
if (parseInt(this.skinCode)) {
|
||||
await this.loadMapData(this.skinCode);
|
||||
|
||||
} else {
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
// 任务录制系统
|
||||
async initLoadTaskData() {
|
||||
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
||||
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
||||
this.switchMode('01');
|
||||
|
||||
if (parseInt(this.mapId)) {
|
||||
await this.loadMapDataById(this.mapId);
|
||||
} else {
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
// 测试跑车
|
||||
async initLoadTestRunData() {
|
||||
this.$store.dispatch('training/end', TrainingMode.NORMAL);
|
||||
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
||||
this.$store.dispatch('training/setPrdType', '01');
|
||||
|
||||
if (parseInt(this.skinCode)) {
|
||||
await this.loadMapData(this.skinCode);
|
||||
|
||||
} else {
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
// 加载剧本
|
||||
async runQuestLoadShow() {
|
||||
this.$refs.addQuest.doShow();
|
||||
},
|
||||
async runAddRolesLoadShow(){
|
||||
// this.$refs.addQuest.doShow();
|
||||
let row={id:this.$route.query.scriptId}
|
||||
this.$refs.addQuest.handleLoad(1, row);
|
||||
},
|
||||
// 选择脚本
|
||||
async selectQuest(row, id,mapLocation,roleName) {
|
||||
try {
|
||||
let prdType="";
|
||||
switch(roleName){
|
||||
case 'Attendant':{
|
||||
prdType="01";
|
||||
break;
|
||||
}
|
||||
case 'Dispatcher':{
|
||||
prdType="02";
|
||||
break;
|
||||
}
|
||||
case 'Driver':{
|
||||
prdType="04";
|
||||
break;
|
||||
}
|
||||
case 'Repair':{
|
||||
prdType="";
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.switchMode(prdType);
|
||||
const res = await loadDraftScript(row.id, id, this.group);
|
||||
if (res && res.code == 200) {
|
||||
this.questId = parseInt(row.id);
|
||||
if(mapLocation){
|
||||
const newMapLocation={'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale};
|
||||
Vue.prototype.$jlmap.setOptions(newMapLocation);
|
||||
}
|
||||
// if (res.data && res.data.mapLocation) {
|
||||
// const mapLocation={'offsetX': res.data.mapLocation.x, 'offsetY': res.data.mapLocation.y, 'scaleRate': res.data.mapLocation.scale};
|
||||
// Vue.prototype.$jlmap.setOptions(mapLocation);
|
||||
// }
|
||||
}
|
||||
if (this.$refs.menuDemon) {
|
||||
await this.$refs.menuDemon.initLoadPage();
|
||||
}
|
||||
|
||||
if (this.$refs.menuScript) {
|
||||
await this.$refs.menuScript.initLoadPage();
|
||||
}
|
||||
} catch (error) {
|
||||
this.$messageBox(error.message);
|
||||
}
|
||||
},
|
||||
// 退出脚本
|
||||
async quitQuest() {
|
||||
this.questId = 0;
|
||||
},
|
||||
// 加载地图数据
|
||||
async loadMapData(skinCode) {
|
||||
try {
|
||||
await loadMapData(skinCode);
|
||||
await this.$store.dispatch('training/setMapDefaultState');
|
||||
} catch (error) {
|
||||
this.$messageBox(`获取地图数据失败: ${error.message}`);
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
|
||||
// 通过id加载地图数据
|
||||
async loadMapDataById(mapId) {
|
||||
try {
|
||||
await loadMapDataById(mapId);
|
||||
await this.$store.dispatch('training/setMapDefaultState');
|
||||
} catch (error) {
|
||||
this.$messageBox(`获取地图数据失败: ${error.message}`);
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
|
||||
// 销毁仿真
|
||||
async quit() {
|
||||
await runDiagramQuit(this.group);
|
||||
await this.$store.dispatch('training/over');
|
||||
},
|
||||
// 仿真错误时,被动退出时调用
|
||||
async back() {
|
||||
if (this.isExam) {
|
||||
await this.$refs.menuExam.back();
|
||||
} else if (this.isLesson) {
|
||||
await this.$refs.lessonMenu.back();
|
||||
} else if (this.isDemon) {
|
||||
await this.$refs.menuDemon.back();
|
||||
} else if (this.isScreen) {
|
||||
await this.$refs.menuScreen.back();
|
||||
} else if (this.isPlan) {
|
||||
await this.$refs.menuPlan.back();
|
||||
} else if (this.isScript) {
|
||||
await this.$refs.menuScript.back();
|
||||
}
|
||||
},
|
||||
// 设置使用时间
|
||||
async tryTime(param) {
|
||||
const data = {
|
||||
goodsId: param.goodsId,
|
||||
time: param.time
|
||||
};
|
||||
if (data.goodsId) {
|
||||
await setGoodsTryUse(data);
|
||||
}
|
||||
},
|
||||
switchMode(prdType) {
|
||||
this.$store.dispatch('training/setPrdType', prdType);
|
||||
},
|
||||
hidepanel() {
|
||||
if (this.isDrive) {
|
||||
this.panelShow = false;
|
||||
this.drivingShow = true;
|
||||
this.$refs.Jl3dDrive.show(this.skinCode);
|
||||
} else {
|
||||
this.panelShow = false;
|
||||
this.simulationShow = true;
|
||||
this.$refs.Jl3dSimulation.show(this.skinCode);
|
||||
}
|
||||
},
|
||||
showScheduling() {
|
||||
this.$refs.scheduling.doShow();
|
||||
},
|
||||
showpanel() {
|
||||
this.panelShow = true;
|
||||
this.simulationShow = false;
|
||||
},
|
||||
showdriving() {
|
||||
this.panelShow = true;
|
||||
this.drivingShow = false;
|
||||
},
|
||||
runPlanViewShow() {
|
||||
this.$refs.runPlanView.doShow();
|
||||
},
|
||||
runPlanLoadShow() {
|
||||
this.$refs.runPlanLoad.doShow();
|
||||
},
|
||||
faultChooseShow() {
|
||||
this.$refs.faultChoose.doShow();
|
||||
},
|
||||
setWindowSize() {
|
||||
this.$nextTick(() => {
|
||||
const width = this.size ? this.size.width : this.width;
|
||||
const height = this.size ? this.size.height : this.height;
|
||||
|
||||
this.$store.dispatch('config/resize', { width, height });
|
||||
|
||||
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.main {
|
||||
z-index: 10;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
|
||||
-moz-user-select: none;
|
||||
-o-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
</style>
|
@ -38,6 +38,7 @@
|
||||
@runPlanViewShow="runPlanViewShow"
|
||||
@faultChooseShow="faultChooseShow"
|
||||
@runQuestLoadShow="runQuestLoadShow"
|
||||
@runAddRolesLoadShow="runAddRolesLoadShow"
|
||||
@switchMode="switchMode"
|
||||
/>
|
||||
|
||||
@ -236,6 +237,7 @@ export default {
|
||||
$route() {
|
||||
this.$nextTick(() => {
|
||||
this.initLoadData();
|
||||
console.log(1111);
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -470,25 +472,35 @@ export default {
|
||||
async runQuestLoadShow() {
|
||||
this.$refs.addQuest.doShow();
|
||||
},
|
||||
async runAddRolesLoadShow(){
|
||||
// this.$refs.addQuest.doShow();
|
||||
let row={id:this.$route.query.scriptId}
|
||||
this.$refs.addQuest.handleLoad(1, row);
|
||||
},
|
||||
// 选择脚本
|
||||
async selectQuest(row, id) {
|
||||
async selectQuest(row, id,mapLocation,roleName) {
|
||||
try {
|
||||
|
||||
const res = await loadScript(row.id, id, this.group);
|
||||
if (res && res.code == 200) {
|
||||
this.questId = parseInt(row.id);
|
||||
if (res.data && res.data.mapLocation) {
|
||||
const mapLocation={'offsetX': res.data.mapLocation.x, 'offsetY': res.data.mapLocation.y, 'scaleRate': res.data.mapLocation.scale};
|
||||
Vue.prototype.$jlmap.setOptions(mapLocation);
|
||||
if(mapLocation){
|
||||
const newMapLocation={'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale};
|
||||
Vue.prototype.$jlmap.setOptions(newMapLocation);
|
||||
}
|
||||
// if (res.data && res.data.mapLocation) {
|
||||
// const mapLocation={'offsetX': res.data.mapLocation.x, 'offsetY': res.data.mapLocation.y, 'scaleRate': res.data.mapLocation.scale};
|
||||
// Vue.prototype.$jlmap.setOptions(mapLocation);
|
||||
// }
|
||||
}
|
||||
|
||||
if (this.$refs.menuDemon) {
|
||||
this.$refs.menuDemon.initLoadPage();
|
||||
await this.$refs.menuDemon.initLoadPage();
|
||||
}
|
||||
|
||||
if (this.$refs.menuScript) {
|
||||
this.$refs.menuScript.initLoadPage();
|
||||
await this.$refs.menuScript.initLoadPage();
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
this.$messageBox(error.message);
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$emit('quit');
|
||||
this.$router.push({ path: `/exam/home` });
|
||||
this.$router.back();
|
||||
Notification.closeAll();
|
||||
exitFullscreen();
|
||||
}).catch(() => {
|
||||
@ -141,7 +141,7 @@ export default {
|
||||
}).catch(error => {
|
||||
// 如果时50009则表示考试已完成,不能再次进行y
|
||||
if (error.code === 500009) {
|
||||
this.$router.replace({ path: `/exam/result/${this.$route.params.userExamId}` });
|
||||
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}` });
|
||||
} else {
|
||||
this.$messageBox(this.$t('display.exam.refreshListError'));
|
||||
}
|
||||
|
@ -5,7 +5,9 @@
|
||||
</el-select>
|
||||
|
||||
<el-button-group>
|
||||
<el-button v-if="isDemon" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{$t('display.schema.loadScript')}}</el-button>
|
||||
<!-- viewRunQuest -->
|
||||
<el-button v-if="isDemon && isDesignPlatform" size="small" :disabled="viewDisabled" type="success" @click="viewScriptRoles">{{$t('display.schema.selectRoles')}}</el-button>
|
||||
<el-button v-if="isDemon && !isDesignPlatform" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{$t('display.schema.loadScript')}}</el-button>
|
||||
<el-button v-if="notScript && runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{$t('display.schema.previewRunDiagram')}}</el-button>
|
||||
<el-button v-if="!runing && !isPlan && notScript" size="small" :disabled="viewDisabled" type="warning" @click="loadRunPlan">{{$t('display.schema.loadRunDiagram')}}</el-button>
|
||||
<el-button v-if="mode==OperateMode.FAULT" size="small" type="danger" @click="setFault">{{$t('display.schema.faultSetting')}}</el-button>
|
||||
@ -22,6 +24,7 @@ import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { getStationListBySkinCode, queryRunPlan } from '@/api/runplan';
|
||||
import { getEveryDayRunPlanData } from '@/api/simulation';
|
||||
import {getRpDetailByUserMapId} from '@/api/designPlatform';
|
||||
|
||||
export default {
|
||||
name: 'MenuSchema',
|
||||
@ -64,6 +67,9 @@ export default {
|
||||
},
|
||||
isDemon() {
|
||||
return this.$route.params.mode === 'demon';
|
||||
},
|
||||
isDesignPlatform(){
|
||||
return this.$route.fullPath.includes('design/display/demon');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -90,14 +96,28 @@ export default {
|
||||
getStationListBySkinCode(opt.skinCode).then(response => {
|
||||
this.$store.dispatch('runPlan/setStations', response.data).then(() => {
|
||||
if (this.$route.params.mode == 'plan') {
|
||||
// 测试运行图功能
|
||||
queryRunPlan(this.$route.query.planId).then(resp => {
|
||||
this.$store.dispatch('runPlan/setPlanData', resp.data);
|
||||
this.viewDisabled = false;
|
||||
}).catch(() => {
|
||||
this.$store.dispatch('runPlan/setPlanData', []);
|
||||
this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
|
||||
});
|
||||
// debugger;
|
||||
if(this.$route.query.from=="user"){
|
||||
// 测试运行图功能
|
||||
getRpDetailByUserMapId(this.$route.query.planId).then(resp => {
|
||||
this.$store.dispatch('runPlan/setPlanData', resp.data);
|
||||
this.viewDisabled = false;
|
||||
}).catch(() => {
|
||||
this.$store.dispatch('runPlan/setPlanData', []);
|
||||
this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
|
||||
});
|
||||
}else{
|
||||
// 测试运行图功能
|
||||
queryRunPlan(this.$route.query.planId).then(resp => {
|
||||
this.$store.dispatch('runPlan/setPlanData', resp.data);
|
||||
this.viewDisabled = false;
|
||||
}).catch(() => {
|
||||
this.$store.dispatch('runPlan/setPlanData', []);
|
||||
this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
getEveryDayRunPlanData(this.group).then(resp => {
|
||||
this.$store.dispatch('runPlan/setPlanData', resp.data);
|
||||
@ -136,6 +156,9 @@ export default {
|
||||
viewRunQuest() {
|
||||
this.$emit('runQuestLoadShow');
|
||||
},
|
||||
viewScriptRoles(){
|
||||
this.$emit('runAddRolesLoadShow');
|
||||
},
|
||||
switchMode(swch) {
|
||||
this.$emit('switchMode', swch);
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
|
||||
<i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
|
||||
<p v-if="!isShrink" style="color: #fff;">
|
||||
<span class="time-label">{{ $t('display.exam.examTime') }}</span>
|
||||
<span class="time-label">{{$t('display.exam.examTime')}}</span>
|
||||
|
||||
<span class="time-elem">{{ formatRemainTime }}</span>
|
||||
</p>
|
||||
@ -38,12 +38,12 @@
|
||||
<span class="list-elem">{{ courseModel.name }}</span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">{{ $t('display.exam.bestTime') }}</span>
|
||||
<span class="list-elem">{{ courseModel.minDuration }} {{ $t('display.seconds') }} </span>
|
||||
<span class="list-label">{{$t('display.exam.bestTime')}}</span>
|
||||
<span class="list-elem">{{ courseModel.minDuration }} {{$t('display.seconds')}} </span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">{{ $t('display.exam.maximumTime') }}</span>
|
||||
<span class="list-elem">{{ courseModel.maxDuration }} {{ $t('display.seconds') }} </span>
|
||||
<span class="list-label">{{$t('display.exam.maximumTime')}}</span>
|
||||
<span class="list-elem">{{ courseModel.maxDuration }} {{$t('display.seconds')}} </span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label"> {{ $t('display.exam.trainingInstructions') }}</span>
|
||||
@ -59,10 +59,10 @@
|
||||
<el-button v-if="isLast" class="btn" type="primary" @click="overExam">{{ $t('display.exam.submitExaminationPaper') }}</el-button>
|
||||
</div>
|
||||
<div v-show="detailShow" class="foot-submit">
|
||||
<el-button class="btn" type="primary" @click="overExam">{{ $t('display.exam.submitExaminationPaper') }}</el-button>
|
||||
<el-button class="btn" type="primary" @click="overExam">{{$t('display.exam.submitExaminationPaper')}}</el-button>
|
||||
</div>
|
||||
<p style="color: #000; float: left;">
|
||||
<span class="time-label">{{ $t('display.exam.examTime') }}</span>
|
||||
<span class="time-label">{{$t('display.exam.examTime')}}</span>
|
||||
<span class="time-elem">{{ formatRemainTime }}</span>
|
||||
</p>
|
||||
</div>
|
||||
@ -260,7 +260,7 @@ export default {
|
||||
exitFullscreen();
|
||||
this.$store.dispatch('exam/over').then(() => {
|
||||
this.$store.dispatch('trainingList/clearTrainingList');
|
||||
this.$router.replace({ path: `/exam/result/${this.$route.query.userExamId}` });
|
||||
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.query.userExamId}` });
|
||||
});
|
||||
},
|
||||
shrink() {
|
||||
|
@ -15,21 +15,25 @@
|
||||
<div class="bullshit__headline">{{ message }}</div>
|
||||
<div class="bullshit__info">Please check that the URL you entered is correct, or click the button below to
|
||||
return to the homepage.</div>
|
||||
<a href="" class="bullshit__return-home">Back to home</a>
|
||||
<button @click="back" class="bullshit__return-home">Back</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'Page404',
|
||||
computed: {
|
||||
message() {
|
||||
return 'The webmaster said that you can not enter this page...'
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -4,20 +4,29 @@
|
||||
<b>{{ $t('exam.courseName') + ': '+ courseModel.name }}</b>
|
||||
</div>
|
||||
<div style=" margin:50px" :style="{ height: height - 150 +'px' }">
|
||||
<!-- <p style="font-size: 14px; margin-bottom: 20px"> 课程说明:
|
||||
<span style="color: #808080 !important;">
|
||||
{{ courseModel.remarks }}
|
||||
</span>
|
||||
</p> -->
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane :label="this.$t('exam.itemList')" name="first">
|
||||
<div v-if="courseModel.detail.length != 0" :style="{ height: height - 230 +'px' }">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<template v-for="item in courseModel.detail">
|
||||
<ul :key="item.code" type="circle">
|
||||
<li>{{ item.name }}</li>
|
||||
</ul>
|
||||
</template>
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="courseModel.treeList"
|
||||
node-key="id"
|
||||
:props="defaultProps"
|
||||
:filter-node-method="filterNode"
|
||||
highlight-current
|
||||
:span="22"
|
||||
:default-expanded-keys="expandList"
|
||||
@node-click="clickEvent"
|
||||
@node-expand="nodeExpand"
|
||||
@node-collapse="nodeCollapse"
|
||||
>
|
||||
<span slot-scope="{ node, data }">
|
||||
<span v-if="node.data.valid" class="el-icon-goods" />
|
||||
<span v-else class="el-icon-sold-out" />
|
||||
<span :style="{color: node.data.valid?'green':'black'}"> {{ node.label }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div v-else class="noList">
|
||||
@ -42,10 +51,12 @@
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import { getCourseLessonDetail } from '@/api/management/exam';
|
||||
// import { getCourseLessonDetail } from '@/api/management/exam';
|
||||
import { querySystemByTypeAndPrdCode } from '@/api/trainingPlatform';
|
||||
import { PermissionType } from '@/scripts/ConstDic';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import LimitList from '@/views/components/limits/index';
|
||||
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'ExamDetailView',
|
||||
@ -64,7 +75,12 @@ export default {
|
||||
pmsList: []
|
||||
},
|
||||
EffectiveTypeList: [],
|
||||
activeName: 'first'
|
||||
activeName: 'first',
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
expandList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -85,46 +101,52 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$route.params.lessonId': function (val) {
|
||||
this.loadInitPage(val);
|
||||
'$route.query.prodId': function (val) {
|
||||
this.loadInitPage(val, this.$route.query.type);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$Dictionary.effectiveType().then(list => {
|
||||
this.EffectiveTypeList = list;
|
||||
});
|
||||
this.loadInitPage(this.$route.params.lessonId);
|
||||
this.loadInitPage(this.$route.query.prodId, this.$route.query.type);
|
||||
},
|
||||
methods: {
|
||||
loadInitPage(lessonId = this.$route.params.lessonId) {
|
||||
if (lessonId) {
|
||||
getCourseLessonDetail({ lessonId: lessonId }).then(res => {
|
||||
this.courseModel = {
|
||||
id: res.data.id,
|
||||
name: res.data.name,
|
||||
skinCode: res.data.skinCode,
|
||||
price: res.data.price,
|
||||
remarks: res.data.remarks,
|
||||
detail: res.data.examDefinitionVOList || [],
|
||||
pmsList: res.data.permissionVOList || [],
|
||||
prdCode: res.data.prdCode,
|
||||
mapId: res.data.mapId,
|
||||
PermissionType: PermissionType.EXAM
|
||||
};
|
||||
loadInitPage(prodId = this.$route.query.prodId, type = this.$route.query.type) {
|
||||
if (prodId && type) {
|
||||
querySystemByTypeAndPrdCode( {type: type}, prodId ).then(res => {
|
||||
if (res.data.examsLessonVO){
|
||||
this.courseModel = {
|
||||
id: res.data.examsLessonVO.id,
|
||||
name: res.data.examsLessonVO.name,
|
||||
skinCode: res.data.examsLessonVO.skinCode,
|
||||
price: res.data.examsLessonVO.price,
|
||||
remarks: res.data.examsLessonVO.remarks,
|
||||
detail: res.data.examsLessonVO.examDefinitionVOList || [],
|
||||
pmsList: res.data.examsLessonVO.permissionVOList || [],
|
||||
prdCode: res.data.examsLessonVO.prdCode,
|
||||
mapId: res.data.examsLessonVO.mapId,
|
||||
PermissionType: PermissionType.EXAM,
|
||||
treeList: res.data.treeNodeList
|
||||
};
|
||||
}
|
||||
this.getExpandList(this.courseModel.id);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
buy() {
|
||||
this.loading = true;
|
||||
this.$router.push({
|
||||
path: `${UrlConfig.exam.pay}/${this.$route.params.lessonId}`,
|
||||
query: { permissionType: PermissionType.EXAM, lessonId: this.$route.params.lessonId, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId }
|
||||
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`,
|
||||
query: { permissionType: PermissionType.EXAM, lessonId: this.courseModel.id, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId }
|
||||
});
|
||||
},
|
||||
checkCourse() {
|
||||
this.loading = true;
|
||||
this.$router.push({
|
||||
path: `${UrlConfig.exam.examRuleManage}`,
|
||||
path: `${UrlConfig.trainingPlatform.examRuleManage}`,
|
||||
query: { lessonId: this.courseModel.id }
|
||||
});
|
||||
},
|
||||
@ -141,6 +163,44 @@ export default {
|
||||
this.activeName = 'second';
|
||||
this.$refs.limitList.distribute(this.courseModel);
|
||||
}
|
||||
},
|
||||
clickEvent(obj, node, data) {
|
||||
// setSessionStorage('trainingExamCheckId', obj.id);
|
||||
if (obj.type === 'exam') {
|
||||
if (obj.valid) {
|
||||
this.$router.push(`${UrlConfig.trainingPlatform.examDetail}/${obj.id}`);
|
||||
} else {
|
||||
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
cancelButtonText: this.$t('tip.cancel')
|
||||
}).then(() => {
|
||||
this.buy();
|
||||
}).catch(() => { });
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
nodeExpand(obj, node, ele) {
|
||||
const key = obj.id;
|
||||
this.expandList = this.expandList.filter(item => item!==key);
|
||||
this.expandList.push(key);
|
||||
setSessionStorage('trainingExamExpandList'+this.courseModel.id, this.expandList);
|
||||
},
|
||||
nodeCollapse(obj, node, ele) {
|
||||
const key = obj.id;
|
||||
this.expandList = this.expandList.filter(item => item!==key);
|
||||
setSessionStorage('trainingExamExpandList'+this.courseModel.id, this.expandList);
|
||||
},
|
||||
getExpandList(id) {
|
||||
let expand = getSessionStorage('trainingExamExpandList'+id);
|
||||
expand = expand?(expand+'').split(','):'';
|
||||
if (expand instanceof Array) {
|
||||
this.expandList = expand;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -6,7 +6,7 @@
|
||||
<div style="margin:50px; overflow-y: auto;">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height - 190 +'px' }">
|
||||
<p class="list-item">
|
||||
<span class="list-label">{{ $t('exam.examStartTime') +':'}}</span>
|
||||
<span class="list-label">{{ $t('exam.examStartTime') +':' }}</span>
|
||||
<span v-if="examDetails.startTime" class="list-elem">
|
||||
{{ examDetails.startTime }} - {{ examDetails.endTime }}</span>
|
||||
<span v-else class="list-elem">{{ $t('exam.theExamIsReadyAnyTime') }}</span>
|
||||
@ -17,15 +17,15 @@
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">{{ $t('exam.examTimeAvailable') + ':' }}</span>
|
||||
<span class="list-elem">{{ parseInt(examDetails.duration) / 60 + $t('global.minutes') }}</span>
|
||||
<span class="list-elem">{{ parseInt(examDetails.duration) / 60 + $t('exam.minutes') }}</span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">{{ $t('exam.fullMarksInTheExam') + ':' }}</span>
|
||||
<span class="list-elem">{{ examDetails.fullPoint + $t('exam.points') }}</span>
|
||||
<span class="list-elem">{{ examDetails.fullPoint }}</span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">{{ $t('exam.passMarkTheExam') + ':' }}</span>
|
||||
<span class="list-elem">{{ examDetails.passingPoint + $t('exam.points') }}</span>
|
||||
<span class="list-elem">{{ examDetails.passingPoint }}</span>
|
||||
</p>
|
||||
<p class="list-item">
|
||||
<span class="list-label">{{ $t('exam.examinationRules') + ':' }}</span>
|
||||
@ -44,6 +44,7 @@
|
||||
</div>
|
||||
<div class="btn-start">
|
||||
<el-button :loading="loading" type="primary" @click="exmaStart">{{ $t('exam.startTheExam') }}</el-button>
|
||||
<el-button @click="back" >{{ $t('global.back') }}</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
@ -153,8 +154,8 @@ export default {
|
||||
this.loading = true;
|
||||
getPublishLessonDetail({ id: this.examDetails.lessonId }).then((res) => {
|
||||
this.$router.push({
|
||||
path: `${UrlConfig.exam.pay}/${this.examDetails.lessonId}`,
|
||||
query: { permissionType: PermissionType.EXAM, prdCode: res.data.prdCode, mapId: res.data.mapId }
|
||||
path: `${UrlConfig.trainingPlatform.pay}/${this.examDetails.lessonId}`,
|
||||
query: { permissionType: PermissionType.EXAM,lessonId: this.examDetails.lessonId,prdCode: res.data.prdCode, mapId: res.data.mapId }
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.obtainCourseDetailsFailed'));
|
||||
@ -210,7 +211,10 @@ export default {
|
||||
} else {
|
||||
this.loading = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
back() {
|
||||
this.$router.back();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -105,7 +105,7 @@ export default {
|
||||
}).then(() => {
|
||||
// 放弃试卷接口
|
||||
setExamGive(this.$route.query.userExamId).then(() => {
|
||||
this.$router.push({ path: '/exam/home' });
|
||||
this.$router.back();
|
||||
});
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
|
@ -1,70 +0,0 @@
|
||||
<template>
|
||||
<div class="app-wrapper">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
||||
<exam-list ref="examlList" :height="height" />
|
||||
</div>
|
||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||
<transition>
|
||||
<router-view />
|
||||
</transition>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import ExamList from './list/examList';
|
||||
import drapLeft from '@/views/components/drapLeft/index';
|
||||
import localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
name: 'Exam',
|
||||
components: {
|
||||
ExamList,
|
||||
drapLeft
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
listShow: true,
|
||||
widthLeft: Number(localStore.get('LeftWidth')) || 450
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'lessonbar'
|
||||
]),
|
||||
height() {
|
||||
return this.$store.state.app.height;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'lessonbar.opened': function (val) {
|
||||
this.listShow = val;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
refresh() {
|
||||
this.$refs && this.$refs.examlList && this.$refs.examlList.refresh();
|
||||
},
|
||||
drapWidth(width) {
|
||||
this.widthLeft = Number(width);
|
||||
}
|
||||
}
|
||||
};
|
||||
</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;
|
||||
}
|
||||
|
||||
.examList {
|
||||
float: left;
|
||||
}
|
||||
</style>
|
@ -118,7 +118,7 @@ export default {
|
||||
},
|
||||
back() {
|
||||
const examId = this.resultModel.examId;
|
||||
this.$router.push(`${UrlConfig.exam.detail}/${examId}`);
|
||||
this.$router.push(`${UrlConfig.trainingPlatform.examDetail}/${examId}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -121,7 +121,7 @@ export default {
|
||||
await this.$store.dispatch('training/over');
|
||||
await runDiagramOver(this.group);
|
||||
await deljointTrainRoom(this.group);
|
||||
await this.$router.push({ path: `/demonstration/detail/${this.mapId}` });
|
||||
await this.$router.push({ path: `/trainingPlatform/prodDetail/${this.mapId}` });
|
||||
}
|
||||
});
|
||||
},
|
||||
|
261
src/views/lesson/home.vue
Normal file
261
src/views/lesson/home.vue
Normal file
@ -0,0 +1,261 @@
|
||||
<template>
|
||||
<div style="height: 100%; overflow: hidden">
|
||||
<el-card>
|
||||
<div class="button_group">
|
||||
<el-button size="mini" v-if="hasRelease" @click="trainingManage">{{$t('lesson.trainingManage')}}</el-button>
|
||||
<el-button size="mini" v-if="hasRelease" @click="taskManage">{{$t('lesson.taskManage')}}</el-button>
|
||||
<el-button size="mini" v-if="hasRelease" @click="operationManage">{{$t('lesson.trainingRule')}}</el-button>
|
||||
<el-button size="mini" type="primary" @click="lessonCreateByPublish">{{$t('lesson.createNewCoursesFromRelease')}}</el-button>
|
||||
<el-button size="mini" type="primary" @click="lessonCreate">{{$t('lesson.newConstruction')}}</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card v-loading="loading">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
row-key="id"
|
||||
border
|
||||
default-expand-all
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
border
|
||||
:label="this.$t('lesson.lesson')">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="this.$t('global.status')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{handlerStatus(scope.row)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="explanation"
|
||||
show-overflow-tooltip
|
||||
:label="this.$t('lesson.rejectReason')">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="500"
|
||||
:label="this.$t('global.operate')">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
v-if="scope.row.status!=='1'"
|
||||
@click="createChapter(scope.row)"
|
||||
>{{ scope.row.type==='lesson'? $t('lesson.createChapter'):$t('lesson.updateChapter')}}</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
v-if="scope.row.status==='1'"
|
||||
@click="goDetail(scope.row)"
|
||||
>
|
||||
{{$t('lesson.review')}}
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary" plain
|
||||
v-if="scope.row.type === 'lesson' && scope.row.status!=='1'"
|
||||
@click="treeSort(scope.row)"
|
||||
>{{$t('lesson.contentSorting')}}</el-button>
|
||||
<el-button size="mini"
|
||||
type="info"
|
||||
v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"
|
||||
@click="editLesson(scope.row)"
|
||||
>{{$t('lesson.editCourse')}}</el-button>
|
||||
<el-button size="mini"
|
||||
type="primary"
|
||||
v-if="scope.row.type === 'lesson'&& scope.row.status==='0'"
|
||||
@click="publish(scope.row)"
|
||||
>{{hasRelease?$t('global.release'):$t('lesson.applicationForRelease')}}</el-button>
|
||||
<el-button size="mini"
|
||||
type="danger"
|
||||
v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"
|
||||
@click="deleteLesson(scope.row)"
|
||||
>{{$t('global.delete')}}</el-button>
|
||||
<el-button size="mini"
|
||||
type="danger"
|
||||
v-if="scope.row.status ==='1'"
|
||||
@click="revertLesson(scope.row)"
|
||||
>
|
||||
{{$t('lesson.withdraw')}}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<publish-create @refresh="refresh" ref="publishCreate" />
|
||||
<publish-lesson ref="publishLesson" @refresh="refresh" />
|
||||
<lesson-detail ref="lessonDetail"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getDraftLesson,releaseOrCancel } from '@/api/designPlatform';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import PublishCreate from './lessoncategory/edit/create';
|
||||
import PublishLesson from './lessoncategory/edit/lesson/publish';
|
||||
import { delLesson } from '@/api/jmap/lessondraft';
|
||||
import LessonDetail from '@/views/approval/lesson/detail';
|
||||
|
||||
export default {
|
||||
name: 'LessonHome',
|
||||
components: {
|
||||
PublishCreate,
|
||||
PublishLesson,
|
||||
LessonDetail
|
||||
},
|
||||
computed: {
|
||||
mapId() {
|
||||
return this.$route.params.mapId;
|
||||
},
|
||||
hasRelease() {
|
||||
return this.$store.state.user.roles.includes('04') ||
|
||||
this.$store.state.user.roles.includes('05');
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
loading: false,
|
||||
showEdit: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
this.refresh();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loading = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
getDraftLesson({},this.mapId).then(response=> {
|
||||
response.data.forEach(elem => {
|
||||
if (elem.children) {
|
||||
elem.children.forEach( it => {
|
||||
it.parentId = elem.id;
|
||||
} )
|
||||
}
|
||||
});
|
||||
this.tableData = response.data;
|
||||
this.loading = false;
|
||||
}).catch(error=>{
|
||||
this.$messageBox(this.$t('error.getDraftCourseDataFailed'))
|
||||
});
|
||||
},
|
||||
refuse() {
|
||||
this.loading = true;
|
||||
getDraftLesson({},this.mapId).then(response=> {
|
||||
response.data.forEach(elem => {
|
||||
if (elem.children) {
|
||||
elem.children.forEach( it => {
|
||||
it.parentId = elem.id;
|
||||
} )
|
||||
}
|
||||
});
|
||||
this.tableData = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handlerStatus(row) {
|
||||
let lessonStatus = '';
|
||||
switch (row.status){
|
||||
case '0':
|
||||
lessonStatus = this.$t('lesson.notRelease');
|
||||
break;
|
||||
case '1':
|
||||
lessonStatus = this.$t('lesson.pendingReview');
|
||||
break;
|
||||
case '2':
|
||||
lessonStatus = this.$t('lesson.published');
|
||||
break;
|
||||
case '3':
|
||||
lessonStatus = this.$t('lesson.rejected');
|
||||
break;
|
||||
}
|
||||
return lessonStatus;
|
||||
},
|
||||
refresh() {
|
||||
this.loading = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
editLesson(row) {
|
||||
this.$router.push( {path: `${UrlConfig.design.lessonEdit}/lessonEdit`, query: {id: row.id, skinCode: row.code}} )
|
||||
},
|
||||
lessonCreate() {
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`,query: {skinCode: this.$route.params.skinCode} })
|
||||
},
|
||||
lessonCreateByPublish() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.publishCreate.doShow();
|
||||
});
|
||||
},
|
||||
publish(row) {
|
||||
row.skinCode = this.$route.params.skinCode;
|
||||
row.cityCode = this.$route.query.cityCode;
|
||||
this.$refs.publishLesson.doShow(row);
|
||||
},
|
||||
deleteLesson(row) {
|
||||
delLesson(row).then(response => {
|
||||
this.$message.success(this.$t('tip.successfullyDelete'));
|
||||
this.loading = true;
|
||||
this.loadInitData();
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('tip.failDelete'))
|
||||
});
|
||||
},
|
||||
createChapter(row) {
|
||||
if (row.type === 'lesson') {
|
||||
this.$router.push({path: `${UrlConfig.design.lessonEdit}/chapterCreate`, query: {lessonId: row.id}});
|
||||
} else if (row.type === 'chapter') {
|
||||
this.$router.push( {path: `${UrlConfig.design.lessonEdit}/chapterEdit`,query: {id: row.id, lessonId: row.parentId}} )
|
||||
}
|
||||
},
|
||||
treeSort(row){
|
||||
this.$router.push({path: `${UrlConfig.design.lessonEdit}/treeSort`, query: row});
|
||||
},
|
||||
taskManage() {
|
||||
this.$router.push({path: `${UrlConfig.design.taskManage}`, query: {mapId: this.$route.params.mapId, skinCode: this.$route.params.skinCode}})
|
||||
},
|
||||
trainingManage() {
|
||||
this.$router.push({path: `${UrlConfig.design.trainingManage}/${this.$route.params.skinCode}`, query: {mapId: this.$route.params.mapId}})
|
||||
},
|
||||
operationManage() {
|
||||
this.$router.push({path: `${UrlConfig.design.trainingRule}`, query: {mapId: this.$route.params.mapId, skinCode: this.$route.params.skinCode}})
|
||||
},
|
||||
revertLesson(row) {
|
||||
this.$confirm(this.$t('tip.cancelCoursePublicationHint'), this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
releaseOrCancel(row.id,"0").then(response => {
|
||||
this.loading = false;
|
||||
this.$message.success(this.$t('tip.cancelTheSuccessfulApplicationOfTheCourseRelease'));
|
||||
this.refuse();
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('tip.cancellationOfCoursePublicationApplicationFailed'));
|
||||
this.refuse();
|
||||
});
|
||||
});
|
||||
},
|
||||
goDetail(row) {
|
||||
this.$refs.lessonDetail.show(row.id);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.draft {
|
||||
width: 400px;
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
}
|
||||
.button_group {
|
||||
float: right;
|
||||
margin: 20px 10px;
|
||||
}
|
||||
</style>
|
@ -10,9 +10,9 @@
|
||||
<el-form-item :label="this.$t('lesson.courseName')" prop="lessonName">
|
||||
<el-input v-model="chapterModel.lessonName" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('lesson.parentChapter')" prop="parentName">
|
||||
<!--<el-form-item :label="this.$t('lesson.parentChapter')" prop="parentName">
|
||||
<el-input v-model="chapterModel.parentName" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-form-item>-->
|
||||
<el-form-item :label="this.$t('lesson.chapterName')" prop="name">
|
||||
<el-input v-model="chapterModel.name"></el-input>
|
||||
</el-form-item>
|
||||
@ -49,6 +49,7 @@
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="create" v-show="!isEdit">{{$t('global.append')}}</el-button>
|
||||
<el-button type="primary" @click="update" v-show="isEdit">{{$t('global.update')}}</el-button>
|
||||
<el-button type="primary" @click="back" >{{$t('global.back')}}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<train-list ref="pathRoute" :trainings="this.chapterModel.trainings" :detail="detail"
|
||||
@ -83,8 +84,6 @@
|
||||
lessonName: '',
|
||||
name: '',
|
||||
remarks: '',
|
||||
parentId: null,
|
||||
parentName: '',
|
||||
trainings: []
|
||||
},
|
||||
detail: {
|
||||
@ -105,30 +104,18 @@
|
||||
remarks: [
|
||||
{ required: true, message: this.$t('rules.enterChapterInstructions'), trigger: 'change' }
|
||||
],
|
||||
}
|
||||
};
|
||||
return baseRules;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initData(isNew, node) {
|
||||
initData(isNew, data) {
|
||||
this.isEdit = !isNew;
|
||||
this.clearForm();
|
||||
if (isNew) {
|
||||
let parent = null;
|
||||
if (node.data.type === 'chapter') {
|
||||
parent = node.data;
|
||||
}
|
||||
let lesson = this.getLesson(node);
|
||||
this.setLessonAndParent(parent, lesson);
|
||||
this.loadTrainingList(lesson);
|
||||
this.loadTrainingList(data);
|
||||
} else {
|
||||
let parent = null;
|
||||
if (node.parent.data.type === 'chapter') {
|
||||
parent = node.parent.data;
|
||||
}
|
||||
let lesson = this.getLesson(node);
|
||||
this.setLessonAndParent(parent, lesson);
|
||||
this.loadTrainingList(lesson, node);
|
||||
this.loadTrainingList(data);
|
||||
}
|
||||
},
|
||||
getChapter(data) {
|
||||
@ -157,26 +144,9 @@
|
||||
},
|
||||
setChapterModel(data) {
|
||||
let lessonName = this.chapterModel.lessonName;
|
||||
let parentName = this.chapterModel.parentName;
|
||||
this.chapterModel = data;
|
||||
this.chapterModel.trainings = data.trainings || [];
|
||||
this.chapterModel.lessonName = lessonName;
|
||||
this.chapterModel.parentName = parentName;
|
||||
},
|
||||
setLessonAndParent(parent, lesson) {
|
||||
this.chapterModel.lessonId = lesson.id;
|
||||
this.chapterModel.lessonName = lesson.name;
|
||||
if (parent) {
|
||||
this.chapterModel.parentId = parent.id;
|
||||
this.chapterModel.parentName = parent.name;
|
||||
}
|
||||
},
|
||||
getLesson(node) {
|
||||
if (node.data.type === 'lesson') {
|
||||
return node.data;
|
||||
} else {
|
||||
return this.getLesson(node.parent);
|
||||
}
|
||||
},
|
||||
clearForm() {
|
||||
this.chapterModel.trainingId = '';
|
||||
@ -185,12 +155,14 @@
|
||||
},
|
||||
|
||||
// 获取课程详情/章节详情
|
||||
loadTrainingList(model, node) {
|
||||
getLessonDetail(model).then(resp => {
|
||||
loadTrainingList(data) {
|
||||
getLessonDetail({ id: data.lessonId }).then(resp => {
|
||||
this.detail.mapId = resp.data.mapId;
|
||||
this.detail.prdCode = resp.data.prdCode;
|
||||
this.chapterModel.lessonId = resp.data.id;
|
||||
this.chapterModel.lessonName = resp.data.name;
|
||||
if (this.isEdit) {
|
||||
this.getChapter(node.data);
|
||||
this.getChapter(data);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('error.obtainCourseDetailsFailed'));
|
||||
@ -219,6 +191,9 @@
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
back() {
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,15 +45,14 @@
|
||||
<el-button-group>
|
||||
<template v-if="!isEdit">
|
||||
<el-button v-if="courseModel.skinCode" type="primary" @click="create">{{$t('global.create')}}</el-button>
|
||||
<el-button type="primary" @click="back">{{$t('global.back')}}</el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button type="primary" @click="update">{{$t('global.update')}}</el-button>
|
||||
<el-button type="primary" @click="publish">{{$t('global.release')}}</el-button>
|
||||
<el-button type="danger" @click="deleteLesson">{{$t('global.delete')}}</el-button>
|
||||
<el-button type="primary" @click="back">{{$t('global.back')}}</el-button>
|
||||
</template>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<publish-lesson ref="publishLesson" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -61,12 +60,10 @@
|
||||
import { createLesson, updateLesson, getLessonDetail, delLesson } from '@/api/jmap/lessondraft';
|
||||
import { getCommodityMapProduct } from '@/api/management/mapprd';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
import PublishLesson from './publish';
|
||||
|
||||
export default {
|
||||
name: 'CourseEdit',
|
||||
components: {
|
||||
PublishLesson
|
||||
},
|
||||
props: {
|
||||
height: {
|
||||
@ -119,17 +116,15 @@ export default {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData(isNew, node) {
|
||||
initData(isNew, data) {
|
||||
this.isEdit = !isNew;
|
||||
this.clearForm();
|
||||
if (!isNew) {
|
||||
this.refresh(node);
|
||||
this.refresh(data);
|
||||
} else {
|
||||
this.courseModel.skinCode = node.data.id;
|
||||
this.courseModel.skinCode = this.$route.query.skinCode;
|
||||
}
|
||||
|
||||
this.productList = [];
|
||||
getCommodityMapProduct(this.getParentSkin(node)).then(response => {
|
||||
getCommodityMapProduct(this.$route.query.skinCode).then(response => {
|
||||
this.productList = response.data || [];
|
||||
this.productList = this.productList.filter(elem => { return elem.prdType != '03'; });
|
||||
});
|
||||
@ -176,38 +171,14 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
publish() {
|
||||
this.$refs.publishLesson.doShow(this.courseModel);
|
||||
},
|
||||
deleteLesson() {
|
||||
delLesson(this.courseModel).then(response => {
|
||||
this.$message.success(this.$t('tip.successfullyDelete'));
|
||||
this.$refs.form.resetFields();
|
||||
this.isEdit = false,
|
||||
this.$emit('refresh');
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('tip.failDelete'));
|
||||
});
|
||||
},
|
||||
getParentSkin(node) {
|
||||
let next = node;
|
||||
let skinCode = '';
|
||||
while (next) {
|
||||
if (next.data && next.data.type == 'skin') {
|
||||
skinCode = next.data.id;
|
||||
}
|
||||
next = next.parent;
|
||||
}
|
||||
return skinCode;
|
||||
},
|
||||
refresh(node) {
|
||||
if (node && node.data) {
|
||||
getLessonDetail(node.data).then(response => {
|
||||
refresh(query) {
|
||||
if (query) {
|
||||
getLessonDetail(query).then(response => {
|
||||
const data = response.data;
|
||||
this.courseModel = {
|
||||
id: data.id,
|
||||
skinCode: this.getParentSkin(node),
|
||||
prdCode: data.prdCode,
|
||||
skinCode: this.$route.query.skinCode,
|
||||
prdCode: data.prdCode,
|
||||
name: data.name,
|
||||
remarks: data.remarks
|
||||
};
|
||||
@ -215,7 +186,10 @@ export default {
|
||||
this.$messageBox(this.$t('error.obtainCourseInformationFailed'));
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
back() {
|
||||
this.$router.back();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,140 +1,152 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="this.$t('lesson.courseRelease')" :visible.sync="dialogShow" width="30%" :before-do-close="doClose">
|
||||
<div>
|
||||
<el-form
|
||||
ref="form"
|
||||
label-position="right"
|
||||
:rules="rules"
|
||||
:model="editModel"
|
||||
label-width="140px"
|
||||
@submit.native.prevent
|
||||
>
|
||||
<el-form-item :label="this.$t('lesson.releaseAssociatedCity')" prop="cityCode">
|
||||
<el-select v-model="editModel.cityCode" :placeholder="this.$t('rules.pleaseSelect')" @change="cityChange">
|
||||
<el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.code" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('lesson.releaseAssociatedMap')" prop="mapId">
|
||||
<el-select v-model="editModel.mapId" :placeholder="this.$t('rules.pleaseSelect')" @change="mapChange">
|
||||
<el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('lesson.publishCourseName')" prop="name">
|
||||
<el-input v-model="editModel.name" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog :title="this.$t('lesson.courseRelease')" :visible.sync="dialogShow" width="30%" :before-do-close="doClose" v-dialogDrag>
|
||||
<div>
|
||||
<el-form label-position="right" ref="form" :rules="rules" :model="editModel" label-width="140px"
|
||||
@submit.native.prevent>
|
||||
<el-form-item :label="this.$t('lesson.releaseAssociatedCity')" prop="cityCode">
|
||||
<el-select v-model="editModel.cityCode" @change="cityChange" :placeholder="this.$t('rules.pleaseSelect')" :disabled="this.disabled">
|
||||
<el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('lesson.releaseAssociatedMap')" prop="mapId">
|
||||
<el-select v-model="editModel.mapId" @change="mapChange" :placeholder="this.$t('rules.pleaseSelect')" :disabled="this.disabled">
|
||||
<el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('lesson.publishCourseName')" prop="name">
|
||||
<el-input v-model="editModel.name" :disabled="!this.hasRelease"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogShow = false">{{$t('global.cancel')}}</el-button>
|
||||
<el-button type="primary" @click="doSave" :loading="loading">{{$t('global.confirm')}}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPublishMapListBySkinCode } from '@/api/jmap/map';
|
||||
import { getLessonNameByMapIdAndLessonId } from '@/api/jmap/lessondraft';
|
||||
import { publishLesson } from '@/api/jmap/lessondraft';
|
||||
import { getPublishMapListBySkinCode } from '@/api/jmap/map';
|
||||
import { getLessonNameByMapIdAndLessonId } from '@/api/jmap/lessondraft';
|
||||
import { adminPublishLesson,releaseOrCancel } from '@/api/designPlatform';
|
||||
|
||||
export default {
|
||||
name: 'LessonPublish',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
mapList: [],
|
||||
cityList: [],
|
||||
cityMapDict: {},
|
||||
editModel: {
|
||||
id: '',
|
||||
name: '',
|
||||
mapId: '',
|
||||
prdCode: '',
|
||||
cityCode: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
return {
|
||||
id: [
|
||||
{ required: true, message: this.$t('rules.courseIdIsEmpty'), trigger: 'change' }
|
||||
],
|
||||
cityCode: [
|
||||
{ required: true, message: this.$t('rules.selectCity'), trigger: 'change' }
|
||||
],
|
||||
mapId: [
|
||||
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
|
||||
]
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cityChange(code) {
|
||||
this.editModel.mapId = '';
|
||||
this.mapList = this.cityMapDict[code];
|
||||
},
|
||||
async mapChange(mapId) {
|
||||
const resp = await getLessonNameByMapIdAndLessonId({ mapId: mapId, lessonId: this.editModel.id });
|
||||
if (resp && resp.data) {
|
||||
this.editModel.name = resp.data.name;
|
||||
}
|
||||
},
|
||||
doShow(model) {
|
||||
this.mapList = [];
|
||||
this.cityList = [];
|
||||
this.cityMapDict = {};
|
||||
this.editModel = {
|
||||
id: model.id,
|
||||
name: model.name,
|
||||
mapId: '',
|
||||
prdCode: model.prdCode,
|
||||
cityCode: model.cityCode
|
||||
};
|
||||
export default {
|
||||
name: 'LessonPublish',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
disabled: true,
|
||||
mapList: [],
|
||||
cityList: [],
|
||||
cityMapDict: {},
|
||||
editModel: {
|
||||
id: '',
|
||||
name: '',
|
||||
mapId: '',
|
||||
prdCode: '',
|
||||
cityCode: '',
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
return {
|
||||
id: [
|
||||
{ required: true, message: this.$t('rules.courseIdIsEmpty'), trigger: 'change' }
|
||||
],
|
||||
cityCode: [
|
||||
{ required: true, message: this.$t('rules.selectCity'), trigger: 'change' }
|
||||
],
|
||||
mapId: [
|
||||
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
|
||||
],
|
||||
}
|
||||
},
|
||||
hasRelease() {
|
||||
return this.$store.state.user.roles.includes('04') ||
|
||||
this.$store.state.user.roles.includes('05');
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cityChange(code) {
|
||||
this.editModel.mapId = '';
|
||||
this.mapList = this.cityMapDict[code];
|
||||
},
|
||||
async mapChange(mapId) {
|
||||
let resp = await getLessonNameByMapIdAndLessonId({ mapId: mapId, lessonId: this.editModel.id });
|
||||
if (resp && resp.data) {
|
||||
this.editModel.name = resp.data.name;
|
||||
}
|
||||
},
|
||||
doShow(model) {
|
||||
this.mapList = [];
|
||||
this.cityList = [];
|
||||
this.cityMapDict = {};
|
||||
this.editModel = {
|
||||
id: model.id,
|
||||
name: model.name,
|
||||
mapId: this.$route.params.mapId,
|
||||
prdCode: model.prdCode,
|
||||
cityCode: model.cityCode,
|
||||
};
|
||||
|
||||
if (model.skinCode && model.id) {
|
||||
getPublishMapListBySkinCode(model.skinCode).then(resp => {
|
||||
const list = resp.data || [];
|
||||
list.forEach(elem => {
|
||||
if (!this.cityMapDict[elem.cityCode]) {
|
||||
this.cityMapDict[elem.cityCode] = [];
|
||||
}
|
||||
this.cityMapDict[elem.cityCode].push(elem);
|
||||
});
|
||||
if (model.skinCode && model.id) {
|
||||
getPublishMapListBySkinCode(model.skinCode).then(resp => {
|
||||
let list = resp.data || [];
|
||||
list.forEach(elem => {
|
||||
if (!this.cityMapDict[elem.cityCode]) {
|
||||
this.cityMapDict[elem.cityCode] = [];
|
||||
}
|
||||
this.cityMapDict[elem.cityCode].push(elem);
|
||||
});
|
||||
|
||||
this.$Dictionary.cityType().then(list => {
|
||||
this.cityList = list.filter(elem => { return this.cityMapDict[elem.code]; });
|
||||
});
|
||||
});
|
||||
}
|
||||
this.$Dictionary.cityType().then(list => {
|
||||
this.cityList = list.filter(elem => { return this.cityMapDict[elem.code] });
|
||||
})
|
||||
this.mapList = this.cityMapDict[model.cityCode];
|
||||
})
|
||||
}
|
||||
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.$refs.form.resetFields();
|
||||
this.dialogShow = false;
|
||||
},
|
||||
doSave() {
|
||||
this.loading = true;
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
publishLesson(this.editModel).then(response => {
|
||||
this.loading = false;
|
||||
this.$message.success(this.$t('tip.coursePublishSuccessful'));
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('tip.coursePublishFailed'));
|
||||
});
|
||||
} else {
|
||||
this.loading = false;
|
||||
}
|
||||
});
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.$refs.form.resetFields();
|
||||
this.dialogShow = false;
|
||||
this.$emit('refresh')
|
||||
},
|
||||
doSave() {
|
||||
this.loading = true;
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid && this.hasRelease) {
|
||||
adminPublishLesson(this.editModel,this.editModel.id).then(response => {
|
||||
this.loading = false;
|
||||
this.$message.success(this.$t('tip.coursePublishSuccessful'));
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('tip.coursePublishFailed'));
|
||||
});
|
||||
}else if(valid && !this.hasRelease){
|
||||
releaseOrCancel(this.editModel.id,"1").then(response => {
|
||||
this.loading = false;
|
||||
this.$message.success(this.$t('tip.coursePublishSuccessful'));
|
||||
this.doClose();
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('tip.coursePublishFailed'));
|
||||
});
|
||||
} else {
|
||||
this.loading = false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -30,6 +30,9 @@
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
</el-card>
|
||||
<div class="draft">
|
||||
<el-button type="primary" @click="goBack">{{$t('global.back')}}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -50,24 +53,28 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
height() {
|
||||
return this.$store.state.app.height - 140;
|
||||
return this.$store.state.app.height - 180;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
convertTreeData(list, node) {
|
||||
convertTreeData(list, data) {
|
||||
let tree = [];
|
||||
if (node && node.data && list && list.length) {
|
||||
if (data && list && list.length) {
|
||||
list.forEach(elem => {
|
||||
if (node.data.name == elem.name) {
|
||||
tree = [elem];
|
||||
}
|
||||
if (elem.children){
|
||||
elem.children.forEach( item => {
|
||||
if (data.id == item.id) {
|
||||
tree = [elem];
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
return tree;
|
||||
},
|
||||
initData(node) {
|
||||
initData(data) {
|
||||
getLessonTree({ mapId: '' }).then(response => {
|
||||
this.treeData = this.convertTreeData(response.data, node);
|
||||
this.treeData = this.convertTreeData(response.data, data);
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.refreshFailed'));
|
||||
});
|
||||
@ -85,16 +92,15 @@ export default {
|
||||
return draggingNode && (draggingNode.data.type === 'chapter' || draggingNode.data.type === 'training');
|
||||
},
|
||||
getLeesonId(node) {
|
||||
if (node.parent.parent !== null) {
|
||||
return this.getLeesonId(node.parent);
|
||||
} else {
|
||||
return node;
|
||||
}
|
||||
if (node.parent.data.type === 'lesson'){
|
||||
return node.parent.data.id;
|
||||
}else {
|
||||
return this.getLeesonId(node.parent)
|
||||
}
|
||||
},
|
||||
handleDragEnd(draggingNode, dropNode, dropType, ev) {
|
||||
if (draggingNode && dropNode && dropType !== 'none') {
|
||||
const lesson = this.getLeesonId(dropNode);
|
||||
const lessonId = lesson.data.id;
|
||||
const lessonId = this.getLeesonId(dropNode);
|
||||
const model = {
|
||||
location: dropType,
|
||||
sourceId: draggingNode.data.id,
|
||||
@ -109,7 +115,10 @@ export default {
|
||||
this.$emit('refresh');
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
goBack() {
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -142,4 +151,9 @@ export default {
|
||||
margin: 0 auto;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.draft {
|
||||
width: 300px;
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,18 +1,7 @@
|
||||
<template>
|
||||
<div class="mainContext">
|
||||
<div class="treeContext">
|
||||
<cource-category
|
||||
ref="tree"
|
||||
:height="height"
|
||||
@publishCreate="publishCreate"
|
||||
@lessonCreate="lessonCreate"
|
||||
@lessonEdit="lessonEdit"
|
||||
@chapterCreate="chapterCreate"
|
||||
@chapterEdit="chapterEdit"
|
||||
@treeSort="treeSort"
|
||||
/>
|
||||
</div>
|
||||
<div class="draftContext" :style="{width: width +'px'}">
|
||||
<div class="draftContext">
|
||||
<!--:style="{width: width +'px'} -->
|
||||
<div v-if="lessonShow">
|
||||
<lesson-edit ref="lesson" :height="height" @refresh="refresh" />
|
||||
</div>
|
||||
@ -22,7 +11,6 @@
|
||||
<div v-if="treeShow">
|
||||
<sort-tree ref="sortTree" :height="height" @refresh="refresh" />
|
||||
</div>
|
||||
<publish-create ref="publish" @refresh="refresh" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -32,13 +20,12 @@ import CourceCategory from './category/tree';
|
||||
import LessonEdit from './edit/lesson/index';
|
||||
import ChapterEdit from './edit/chapter/index';
|
||||
import SortTree from './edit/sorttree/index';
|
||||
import PublishCreate from './edit/create';
|
||||
import localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
name: 'LessonDraft',
|
||||
components: {
|
||||
CourceCategory,
|
||||
PublishCreate,
|
||||
LessonEdit,
|
||||
ChapterEdit,
|
||||
SortTree
|
||||
@ -55,12 +42,32 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
width() {
|
||||
return this.$store.state.app.width - 420;
|
||||
return this.$store.state.app.width - localStore.get('LeftWidth');
|
||||
},
|
||||
height() {
|
||||
return this.$store.state.app.height - 102;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const data = this.$route.query;
|
||||
switch (this.$route.params.type){
|
||||
case 'lessonCreate':
|
||||
this.lessonCreate(data);
|
||||
break;
|
||||
case 'lessonEdit':
|
||||
this.lessonEdit(data);
|
||||
break;
|
||||
case 'chapterCreate':
|
||||
this.chapterCreate(data);
|
||||
break;
|
||||
case 'chapterEdit':
|
||||
this.chapterEdit(data);
|
||||
break;
|
||||
case 'treeSort':
|
||||
this.treeSort(data);
|
||||
break;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
exchangeShow(model) {
|
||||
['lessonShow', 'chapterShow', 'treeShow'].forEach(elem => {
|
||||
@ -71,52 +78,43 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
publishCreate(node) {
|
||||
this.isNew = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.publish.doShow(node);
|
||||
});
|
||||
},
|
||||
lessonCreate(node) {
|
||||
lessonCreate(data) {
|
||||
this.isNew = true;
|
||||
this.exchangeShow({ lessonShow: true });
|
||||
this.$nextTick(() => {
|
||||
this.$refs.lesson.initData(true, node);
|
||||
this.$refs.lesson.initData(true, data);
|
||||
});
|
||||
},
|
||||
lessonEdit(node) {
|
||||
lessonEdit(data) {
|
||||
this.isNew = false;
|
||||
this.exchangeShow({ lessonShow: true });
|
||||
this.$nextTick(() => {
|
||||
this.$refs.lesson.initData(false, node);
|
||||
this.$refs.lesson.initData(false, data);
|
||||
});
|
||||
},
|
||||
chapterCreate(node) {
|
||||
chapterCreate(data) {
|
||||
this.isNew = true;
|
||||
this.exchangeShow({ chapterShow: true });
|
||||
this.$nextTick(() => {
|
||||
this.$refs.chapter.initData(true, node);
|
||||
this.$refs.chapter.initData(true, data);
|
||||
});
|
||||
},
|
||||
chapterEdit(node) {
|
||||
chapterEdit(data) {
|
||||
this.isNew = false;
|
||||
this.exchangeShow({ chapterShow: true });
|
||||
this.$nextTick(() => {
|
||||
this.$refs.chapter.initData(false, node);
|
||||
this.$refs.chapter.initData(false, data);
|
||||
});
|
||||
},
|
||||
treeSort(node) {
|
||||
treeSort(data) {
|
||||
this.isNew = false;
|
||||
this.exchangeShow({ treeShow: true });
|
||||
this.$nextTick(() => {
|
||||
this.$refs.sortTree.initData(node);
|
||||
this.$refs.sortTree.initData(data);
|
||||
});
|
||||
},
|
||||
refresh(filterSelect) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.tree.refresh(filterSelect);
|
||||
});
|
||||
}
|
||||
refresh(filterSelect) {
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -129,6 +127,6 @@ export default {
|
||||
}
|
||||
|
||||
.draftContext {
|
||||
float: left;
|
||||
// float: left;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,100 +1,100 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="25%" :before-close="doClose" center>
|
||||
<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="doClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="25%" :before-close="doClose" center>
|
||||
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"/>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">{{$t('global.confirm')}}</el-button>
|
||||
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addTrainingRulesList } from '@/api/management/dictionary';
|
||||
import { listPublishMap } from '@/api/jmap/mapdraft';
|
||||
import { OperationList } from '@/scripts/OperationConfig';
|
||||
import { addAutoGenerateTask } from '@/api/management/task';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
import { addTrainingRulesList } from '@/api/management/dictionary';
|
||||
import { listPublishMap } from '@/api/jmap/mapdraft';
|
||||
import { OperationList } from '@/scripts/OperationConfig';
|
||||
import { addAutoGenerateTask } from '@/api/management/task';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin'
|
||||
|
||||
export default {
|
||||
name: 'CreateTask',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
skinCodeList: [],
|
||||
taskStatusList: [],
|
||||
formModel: {
|
||||
parameter: '',
|
||||
type: '01'
|
||||
},
|
||||
isShow: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const isAdd = this.type === 'ADD';
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'parameter', label: this.$t('lesson.skinType'), type: 'select', required: true, options: this.skinCodeList }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
const crules = {
|
||||
parameter: [
|
||||
{ required: true, message: this.$t('rules.mapInput'), trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
return this.$t('lesson.generationOperation');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data.map(elem => { return { value: elem.code, label: elem.name }; });
|
||||
});
|
||||
export default {
|
||||
name: 'CreateTask',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
skinCodeList: [],
|
||||
taskStatusList: [],
|
||||
formModel: {
|
||||
parameter: this.$route.query.skinCode,
|
||||
type: '01'
|
||||
},
|
||||
isShow: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const isAdd = this.type === 'ADD';
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'parameter', label: this.$t('lesson.skinType'), type: 'select', required: true, options: this.skinCodeList, disabled: true }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
let crules = {
|
||||
parameter: [
|
||||
{ required: true, message: this.$t('rules.mapInput'), trigger: 'change' }
|
||||
]
|
||||
}
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
return this.$t('lesson.generationOperation');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data.map(elem => { return { value: elem.code, label: elem.name }; });
|
||||
});
|
||||
|
||||
this.taskStatusList = [];
|
||||
this.$Dictionary.taskStatus().then(list => {
|
||||
this.taskStatusList = list.map(elem => { return { value: elem.code, label: elem.name }; });
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
doSave() {
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
self.create();
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.formModel = {
|
||||
parameter: '',
|
||||
type: '01'
|
||||
};
|
||||
this.$refs.dataform.resetForm();
|
||||
this.isShow = false;
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
async create() {
|
||||
const self = this;
|
||||
try {
|
||||
const res = await addAutoGenerateTask(this.formModel);
|
||||
self.doClose();
|
||||
self.$emit('reloadTable'); // 刷新列表
|
||||
} catch (error) {
|
||||
this.$messageBox(this.$t('tip.creatingFailed'));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
this.taskStatusList = [];
|
||||
this.$Dictionary.taskStatus().then(list => {
|
||||
this.taskStatusList = list.map(elem => { return { value: elem.code, label: elem.name }; });
|
||||
})
|
||||
},
|
||||
doShow() {
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
doSave() {
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
self.create();
|
||||
})
|
||||
},
|
||||
doClose() {
|
||||
this.formModel = {
|
||||
parameter: this.$route.query.skinCode,
|
||||
type: '01'
|
||||
}
|
||||
this.$refs.dataform.resetForm();
|
||||
this.isShow = false;
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
async create() {
|
||||
let self = this
|
||||
try {
|
||||
let res = await addAutoGenerateTask(this.formModel);
|
||||
self.doClose()
|
||||
self.$emit('reloadTable'); // 刷新列表
|
||||
} catch (error) {
|
||||
this.$messageBox(this.$t('tip.creatingFailed'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -3,6 +3,11 @@
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<create-task ref='CreateTask' @reloadTable="reloadTable"></create-task>
|
||||
<div class="draft">
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -42,7 +47,7 @@
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: getTaskList,
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
@ -145,7 +150,7 @@
|
||||
})
|
||||
},
|
||||
taskCancel(index, node) {
|
||||
this.$confirm( this.$t('tip.startOperationHint'), this.$t('global.tips'), {
|
||||
this.$confirm( this.$t('tip.cancelsTaskHint'), this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
@ -165,6 +170,20 @@
|
||||
createTask() {
|
||||
this.$refs.CreateTask.doShow();
|
||||
},
|
||||
turnback() {
|
||||
this.$router.go(-1)
|
||||
},
|
||||
queryFunction(params) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
return getTaskList(params)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.draft {
|
||||
width: 400px;
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -20,7 +20,7 @@ export default {
|
||||
loading: false,
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
skinCode: ''
|
||||
skinCode: this.$route.query.skinCode
|
||||
},
|
||||
skinCodeList: [],
|
||||
isShow: false
|
||||
@ -32,7 +32,7 @@ export default {
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'skinCode', label: this.$t('lesson.skinType'), type: 'select', required: true, options: this.skinCodeList }
|
||||
{ prop: 'skinCode', label: this.$t('lesson.skinType'), type: 'select', required: true, options: this.skinCodeList, disabled: true }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
@ -104,7 +104,7 @@ export default {
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
skinCode: ''
|
||||
skinCode: this.$route.query.skinCode
|
||||
};
|
||||
this.$refs.dataform.resetForm();
|
||||
this.isShow = false;
|
||||
|
@ -46,7 +46,7 @@ export default {
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'skinCode', label: this.$t('lesson.skinType'), type: 'select', required: true, options: this.skinCodeList, disabled: !isAdd },
|
||||
{ prop: 'skinCode', label: this.$t('lesson.skinType'), type: 'select', required: true, options: this.skinCodeList, disabled: true },
|
||||
{ prop: 'trainingType', label: this.$t('lesson.trainingType'), type: 'select', required: true, options: this.trainingTypeList, disabled: !isAdd, change: true, onChange: this.changeList },
|
||||
{ prop: 'operateType', label: this.$t('lesson.operationType'), type: 'select', required: true, options: this.trainingOperateTypeMap[this.formModel.trainingType], disabled: !isAdd },
|
||||
{ label: '', type: 'button', options: this.placeholderList, style: 'margin-bottom: 0; margin-top: -10px;', typeBtn: 'info', click: this.addTrainName },
|
||||
@ -197,7 +197,11 @@ export default {
|
||||
maxDuration: data.maxDuration,
|
||||
trainingRemark: this.repliceName(data.trainingRemark, this.placeholderList)
|
||||
};
|
||||
}
|
||||
}else {
|
||||
this.formModel = {
|
||||
skinCode: this.$route.query.skinCode
|
||||
}
|
||||
}
|
||||
},
|
||||
repliceName(fieldValue, enumList) {
|
||||
if (enumList && enumList.length > 0) {
|
||||
|
@ -5,6 +5,11 @@
|
||||
<training-edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
|
||||
<add-batch ref="addBatch" @reloadTable="reloadTable" />
|
||||
<save-as ref="saveAs" @reloadTable="reloadTable" />
|
||||
<div class="draft">
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -14,13 +19,14 @@ import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
import TrainingEdit from './addEdit';
|
||||
import AddBatch from './addBatch';
|
||||
import SaveAs from './saveAs.vue';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
|
||||
export default {
|
||||
name: 'TrainingRule',
|
||||
components: {
|
||||
TrainingEdit,
|
||||
AddBatch,
|
||||
SaveAs
|
||||
SaveAs
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -37,13 +43,6 @@ export default {
|
||||
labelWidth: '140px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
skinCode: {
|
||||
type: 'select',
|
||||
label: this.$t('lesson.skinType'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
trainingType: {
|
||||
type: 'select',
|
||||
label: this.$t('lesson.trainingType'),
|
||||
@ -128,8 +127,8 @@ export default {
|
||||
],
|
||||
actions: [
|
||||
{ text: this.$t('global.add'), handler: this.handleAdd },
|
||||
{ text: this.$t('lesson.generation'), handler: this.handleBatchAdd },
|
||||
{ text: this.$t('lesson.saveAs'), handler: this.handleSaveAs }
|
||||
{ text: this.$t('lesson.generation'), handler: this.handleBatchAdd },
|
||||
{ text: this.$t('lesson.saveAs'), handler: this.handleSaveAs }
|
||||
]
|
||||
},
|
||||
currentModel: {}
|
||||
@ -179,9 +178,6 @@ export default {
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
response.data.forEach(elem => {
|
||||
this.queryForm.queryObject.skinCode.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
});
|
||||
|
||||
// 获取实训类型
|
||||
@ -218,12 +214,13 @@ export default {
|
||||
}
|
||||
},
|
||||
async getList(params) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
const res = await getTrainingRulesList(params);
|
||||
this.totals = res.data.total;
|
||||
return res;
|
||||
},
|
||||
handleViewDetail(index, row) {
|
||||
this.$router.push({ path: `/lesson/manage/trainingRule/detail`, query: { id: row.id, type: row.trainingType, skinCode: row.skinCode } });
|
||||
this.$router.push({ path: `${UrlConfig.design.trainingRuleDetail}`, query: { id: row.id, type: row.trainingType, skinCode: row.skinCode } });
|
||||
},
|
||||
|
||||
handleEdit(index, row) {
|
||||
@ -238,11 +235,11 @@ export default {
|
||||
this.$refs.addBatch.show(this.totals);
|
||||
},
|
||||
|
||||
handleSaveAs() {
|
||||
this.$refs.saveAs.show();
|
||||
},
|
||||
handleSaveAs() {
|
||||
this.$refs.saveAs.show();
|
||||
},
|
||||
|
||||
handleDelete(index, row) {
|
||||
handleDelete(index, row) {
|
||||
this.$confirm(this.$t('lesson.wellDelTrainingRule'), this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
@ -257,10 +254,19 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
turnback() {
|
||||
this.$router.go(-1)
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.draft {
|
||||
width: 400px;
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<el-dialog v-dialogDrag :title="operation.title" :visible.sync="dialogShow" width="500px" :before-close="close">
|
||||
<el-form ref="form" :model="operateModel" label-width="auto" :rules="rules" size="mini" label-position="right" class="dialog-form">
|
||||
<el-form-item :label="this.$t('lesson.skinType') + ':'" prop="skinCode">
|
||||
<el-select v-model="operateModel.skinCode" @change="skinCodeChoose">
|
||||
<el-select v-model="operateModel.skinCode" :disabled="this.disable" @change="skinCodeChoose">
|
||||
<el-option
|
||||
v-for="option in skinCodeList"
|
||||
:key="option.code"
|
||||
@ -77,7 +77,8 @@ export default {
|
||||
trainingOperateTypeMap: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
data() {
|
||||
var minDurations = (rule, value, callback) => {
|
||||
@ -128,6 +129,7 @@ export default {
|
||||
|
||||
return {
|
||||
dialogShow: false,
|
||||
disable: true,
|
||||
productTypesList: [],
|
||||
trainTypesList: [],
|
||||
productList: [],
|
||||
@ -135,7 +137,7 @@ export default {
|
||||
operateModel: {
|
||||
name: '',
|
||||
type: '',
|
||||
skinCode: '',
|
||||
skinCode: this.$route.params.skinCode,
|
||||
prdCode: '',
|
||||
operateType: [],
|
||||
maxDuration: 0,
|
||||
@ -179,6 +181,9 @@ export default {
|
||||
return this.operation.event == '02';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.skinCodeChoose(this.$route.params.skinCode);
|
||||
},
|
||||
methods: {
|
||||
show(data) {
|
||||
this.operation = {
|
||||
|
@ -8,6 +8,11 @@
|
||||
:training-operate-type-map="trainingOperateTypeMap"
|
||||
@refresh="reloadTable"
|
||||
/>
|
||||
<div class="draft">
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -38,16 +43,7 @@ export default {
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '120px',
|
||||
initLoadCallback: this.loadInitQueryList,
|
||||
queryObject: {
|
||||
skinCode: {
|
||||
type: 'select',
|
||||
label: this.$t('lesson.skinType'),
|
||||
change: this.skinCodeChoose,
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
prdCode: {
|
||||
type: 'select',
|
||||
label: this.$t('lesson.product'),
|
||||
@ -85,7 +81,7 @@ export default {
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: pageQueryTraining,
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
@ -142,14 +138,20 @@ export default {
|
||||
name: this.$t('lesson.demonstration'),
|
||||
handleClick: this.demoDisplay,
|
||||
type: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '实训录制',
|
||||
handleClick: this.trainingRecord,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: this.$t('lesson.generateTraining'), btnCode: 'employee_insert', handler: this.autoMaticTrainging },
|
||||
{ text: this.$t('lesson.updateTraining'), btnCode: 'employee_insert', handler: this.editTrainingByType, type: 'warning'},
|
||||
{ text: this.$t('lesson.deleteTraining'), btnCode: 'employee_insert', handler: this.delAutoMaticTrainging, type: 'danger'}
|
||||
{ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging },
|
||||
{ text: this.$t('lesson.updateTraining'), btnCode: 'employee_edit', handler: this.editTrainingByType, type: 'warning'},
|
||||
{ text: this.$t('lesson.deleteTraining'), btnCode: 'employee_delete', handler: this.delAutoMaticTrainging, type: 'danger'},
|
||||
{ text: '添加实训', btnCode: 'employee_add', handler:this.addTraining, type: 'primary' }
|
||||
]
|
||||
},
|
||||
|
||||
@ -159,23 +161,28 @@ export default {
|
||||
async created() {
|
||||
await this.loadInitData();
|
||||
const json = localStore.get(this.$route.path);
|
||||
if (json && json.type) {
|
||||
this.typeChoose(json);
|
||||
}
|
||||
if (json && json.prdCode) {
|
||||
this.skinCodeChoose(json);
|
||||
}
|
||||
json.type = '';
|
||||
json.prdCode = '';
|
||||
json.operateType = '';
|
||||
},
|
||||
methods: {
|
||||
async loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
this.queryForm.queryObject.skinCode.config.data = [];
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
response.data.forEach(elem => {
|
||||
this.queryForm.queryObject.skinCode.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
});
|
||||
this.queryForm.queryObject.prdCode.config.data = [];
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
});
|
||||
getCommodityMapProduct(this.$route.params.skinCode).then((response) => {
|
||||
const productList = response.data;
|
||||
if (productList && productList.length > 0) {
|
||||
productList.forEach(elem => {
|
||||
// 过滤综合演练产品
|
||||
if (elem.prdType != '03') {
|
||||
this.queryForm.queryObject.prdCode.config.data.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.prdTypeList = [];
|
||||
getProductList({ pageSize: 500, pageNum: 1 }).then(res => {
|
||||
@ -213,28 +220,6 @@ export default {
|
||||
this.trainingOperateTypeMap['08'] = list08; // 限速实训
|
||||
this.reloadTable();
|
||||
},
|
||||
loadInitQueryList(form) {
|
||||
if (form && form.skinCode) {
|
||||
getCommodityMapProduct(form.skinCode).then((response) => {
|
||||
const productList = response.data;
|
||||
if (productList && productList.length > 0) {
|
||||
productList.forEach(elem => {
|
||||
// 过滤综合演练产品
|
||||
if (elem.prdType != '03') {
|
||||
this.queryForm.queryObject.prdCode.config.data.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
skinCodeChoose(form) {
|
||||
this.queryForm.queryObject.prdCode.config.data = [];
|
||||
form.type = '';
|
||||
form.prdCode = '';
|
||||
form.operateType = '';
|
||||
this.loadInitQueryList(form);
|
||||
},
|
||||
prdChoose(form) {
|
||||
form.type = '';
|
||||
form.operateType = '';
|
||||
@ -270,7 +255,32 @@ export default {
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
},
|
||||
turnback() {
|
||||
this.$router.go(-1)
|
||||
},
|
||||
trainingRecord(index, node) {
|
||||
trainingNotify({ trainingId: node.id }).then(resp => {
|
||||
this.group = resp.data;
|
||||
this.$router.push({ path: `${UrlConfig.design.trainingRecord}/${node.id}/${node.name}`, query: { group: resp.data } });
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
return pageQueryTraining(params);
|
||||
},
|
||||
addTraining() {
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.draft {
|
||||
width: 400px;
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
}
|
||||
</style>
|
||||
|
160
src/views/lesson/trainingrecord/home.vue
Normal file
160
src/views/lesson/trainingrecord/home.vue
Normal file
@ -0,0 +1,160 @@
|
||||
<template>
|
||||
<el-card v-loading="loading" class="map-list-main">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{ $t(`lesson.trainingList`) }}</span>
|
||||
</div>
|
||||
<div style="{width: 150px}">
|
||||
<el-input v-model="filterText" :placeholder="$t(`lesson.filterPlaceholder`)" clearable />
|
||||
</div>
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-270) +'px' }">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="treeData"
|
||||
:props="defaultProps"
|
||||
node-key="id"
|
||||
:default-expanded-keys="defaultShowKeys"
|
||||
:filter-node-method="filterNode"
|
||||
expand-on-click-node
|
||||
highlight-current
|
||||
:span="22"
|
||||
@node-contextmenu="showContextMenu"
|
||||
@node-click="clickEvent"
|
||||
>
|
||||
<div slot-scope="{ node: nodeScop }">
|
||||
<span v-if="nodeScop.data.type == 'skin'" class="el-icon-news"> {{ nodeScop.label }}</span>
|
||||
<span v-else-if="nodeScop.data.type == 'prd'" class="el-icon-tickets"> {{ nodeScop.label }}</span>
|
||||
<span
|
||||
v-else-if="nodeScop.data.type == 'trainingType'"
|
||||
class="el-icon-document"
|
||||
> {{ nodeScop.label }}</span>
|
||||
<span
|
||||
v-else-if="nodeScop.data.type == 'training'"
|
||||
class="el-icon-edit-outline"
|
||||
> {{ nodeScop.label }}</span>
|
||||
</div>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
<operate-menu ref="menu" :point="point" :node="node" @refresh="refresh" @trainingShow="trainingShow" />
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { getTrainingTree } from '@/api/jmap/training';
|
||||
import { trainingNotify } from '@/api/simulation';
|
||||
import OperateMenu from './category/operateMenu';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
name: 'TrainingOperate',
|
||||
components: {
|
||||
OperateMenu
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
defaultShowKeys: [],
|
||||
filterText: '',
|
||||
treeData: [],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
point: {
|
||||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
node: {
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
height() {
|
||||
return this.$store.state.app.height - 50;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.refresh();
|
||||
},
|
||||
methods: {
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
clickEvent(obj, node, data) {
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
|
||||
if (obj && obj.type === 'training') {
|
||||
this.resize();
|
||||
trainingNotify({ trainingId: obj.id }).then(resp => {
|
||||
this.group = resp.data;
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonTraining}/${obj.id}/${obj.name}`, query: { group: resp.data } });
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
|
||||
});
|
||||
}
|
||||
},
|
||||
showContextMenu(e, obj, node, vueElem) {
|
||||
if (obj && obj.type === 'trainingType' || obj.type === 'training') {
|
||||
e.preventDefault();
|
||||
this.point = {
|
||||
x: e.clientX,
|
||||
y: e.clientY
|
||||
};
|
||||
this.node = node;
|
||||
const menu = DeviceMenu.Training;
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||
}
|
||||
},
|
||||
getParent(node) {
|
||||
while (node && node.data.type != 'skin') {
|
||||
node = node.parent;
|
||||
}
|
||||
|
||||
return node || {};
|
||||
},
|
||||
trainingShow() {
|
||||
this.$emit('trainingStart', { id: this.node.data.id, lessonId: this.getParent(this.node).data.id });
|
||||
},
|
||||
refresh() {
|
||||
this.loading = true;
|
||||
getTrainingTree().then(response => {
|
||||
this.treeData = response.data;
|
||||
this.defaultShowKeys = [this.$route.params.trainingId];
|
||||
this.$nextTick(() => {
|
||||
this.loading = false;
|
||||
this.$refs.tree.setCurrentKey(this.$route.params.trainingId); // value 绑定的node-key
|
||||
if (this.filterText) {
|
||||
this.$refs.tree.filter(this.filterText);
|
||||
}
|
||||
});
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('error.refreshFailed'));
|
||||
});
|
||||
},
|
||||
resize() {
|
||||
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
|
||||
const width = this.$store.state.app.width - 521 - this.widthLeft;
|
||||
const height = this.$store.state.app.height - 90;
|
||||
this.$store.dispatch('config/resize', { width: width, height: height });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-tree {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.map-list-main {
|
||||
text-align: center;
|
||||
}
|
||||
.el-tree-node.is-current>.el-tree-node__content {
|
||||
background-color: #e4e3e3 !important;
|
||||
}
|
||||
</style>
|
@ -43,7 +43,13 @@ export default {
|
||||
},
|
||||
trainingId() {
|
||||
return this.$route.params.trainingId;
|
||||
}
|
||||
},
|
||||
width() {
|
||||
return this.$store.state.app.width - 481 - this.widthLeft;
|
||||
},
|
||||
height() {
|
||||
return this.$store.state.app.height - 90;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route(newVal) {
|
||||
@ -112,7 +118,9 @@ export default {
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.blockContext {
|
||||
float: left;
|
||||
// float: left;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.mapContext {
|
||||
@ -121,7 +129,7 @@ export default {
|
||||
|
||||
.stepContext {
|
||||
float: right;
|
||||
width: 480px;
|
||||
width: 520px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
|
||||
}
|
||||
</style>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user