Merge remote-tracking branch 'remotes/origin/test'
This commit is contained in:
commit
293d09e320
@ -42,7 +42,7 @@
|
||||
"vue-i18n": "^8.12.0",
|
||||
"vue-quill-editor": "^3.0.6",
|
||||
"vue-router": "^3.1.6",
|
||||
"vuedraggable": "^2.23.2",
|
||||
"vuedraggable": "^2.24.3",
|
||||
"vuex": "^3.1.0",
|
||||
"xlsx": "^0.14.2",
|
||||
"zrender": "^4.0.4"
|
||||
|
@ -227,21 +227,6 @@ export function createStudent(orgId, data) {
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 获取班级关联课程 */
|
||||
export function getClassAssociatedLessons(orgId) {
|
||||
return request({
|
||||
url: `/api/company/orgLesson/${orgId}/list`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 关联课程班级 */
|
||||
export function setClassAssociatedLessons(orgId, data) {
|
||||
return request({
|
||||
url: `/api/company/orgLesson/${orgId}/update`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 创建修改 规则 */
|
||||
export function createRule(data) {
|
||||
return request({
|
||||
@ -309,18 +294,10 @@ export function getCanApplyToList(ruleId) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 给班级安排考试 */
|
||||
export function applyExamToClass(clsId, data) {
|
||||
/** 查询组织树结构 */
|
||||
export function getOrgTreeById(orgId) {
|
||||
return request({
|
||||
url: `/api/company/orgExam/${clsId}`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 查询班级下的考试 */
|
||||
export function getExamListInClass(clsId) {
|
||||
return request({
|
||||
url: `api/company/orgExam/${clsId}/list`,
|
||||
url: `api/company/orgTree/${orgId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
72
src/api/jmap/lesson3d.js
Normal file
72
src/api/jmap/lesson3d.js
Normal file
@ -0,0 +1,72 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export function getLesson3dDrftList(params) {
|
||||
return request({
|
||||
url: `/api/draft3dLesson/paging`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
export function getLesson3dData(lessonId) {
|
||||
return request({
|
||||
url: `/api/draft3dLesson/${lessonId}`,
|
||||
method: 'get',
|
||||
params: ''
|
||||
});
|
||||
}
|
||||
|
||||
//查询发布课程
|
||||
export function publishedLesson3d() {
|
||||
return request({
|
||||
url: `/api/lesson3d/paging`,
|
||||
method: 'get',
|
||||
params: ''
|
||||
});
|
||||
}
|
||||
|
||||
//保存
|
||||
export function createLesson3d(data) {
|
||||
return request({
|
||||
url: `/api/draft3dLesson`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
//发布课程
|
||||
export function publishLesson3d(lessonId) {
|
||||
return request({
|
||||
url: `/api/draft3dLesson/${lessonId}/publish`,
|
||||
method: 'post',
|
||||
data: ""
|
||||
});
|
||||
}
|
||||
|
||||
// 更新基本信息
|
||||
export function updateLesson3dBasic(lessonId,data) {
|
||||
return request({
|
||||
url: `/api/draft3dLesson/${lessonId}/basic`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
// 更新数据
|
||||
export function updateLesson3dData(lessonId,data) {
|
||||
return request({
|
||||
url: `/api/draft3dLesson/${lessonId}/data`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除课程*/
|
||||
export function delLesson3d(lessonId) {
|
||||
return request({
|
||||
url: `/api/draft3dLesson/${lessonId}`,
|
||||
method: 'delete',
|
||||
data: ''
|
||||
});
|
||||
}
|
||||
|
||||
//
|
@ -3,5 +3,6 @@ export default {
|
||||
mapDesign: 'Map Design',
|
||||
runPlanDesign: 'Run Plan Design',
|
||||
lessonDesign: 'Lesson Design',
|
||||
lesson3dDesign:'Lesson3d Design',
|
||||
scriptDesign: 'Script Design'
|
||||
};
|
||||
|
@ -145,6 +145,7 @@ export default {
|
||||
jlmap3d: '3d editing',
|
||||
publish3d: '3d',
|
||||
assetmanager3d: '3d Asset Manager',
|
||||
lesson3dedit:'3d Lesson Make',
|
||||
stationmanager3d:'3d Station Manager',
|
||||
automaticSignalList: 'Automatic signal list',
|
||||
automaticSignalCode: 'Automatic signal coding',
|
||||
|
@ -3,5 +3,6 @@ export default {
|
||||
mapDesign: '地图设计',
|
||||
runPlanDesign: '运行图设计',
|
||||
lessonDesign: '课程设计',
|
||||
lesson3dDesign: '三维课程设计',
|
||||
scriptDesign: '剧本设计'
|
||||
};
|
||||
|
@ -15,6 +15,7 @@ export default {
|
||||
edit3d: '三维编辑',
|
||||
publish3d: '三维发布',
|
||||
assetmanager3d: '三维资源管理',
|
||||
lesson3dedit:'三维课程制作',
|
||||
stationmanager3d: '三维车站管理',
|
||||
logicalView: '逻辑视图',
|
||||
physicalView: '物理视图',
|
||||
|
@ -87,7 +87,7 @@ export default {
|
||||
bankManage: '题库列表',
|
||||
practiceManage:'实操列表',
|
||||
sceneManage:'场景列表',
|
||||
companyManage: '单位管理',
|
||||
companyManage: '组织管理',
|
||||
authorApply: '授权申请',
|
||||
AuthorList: '授权列表',
|
||||
questionsRuleManage: '出题规则管理',
|
||||
|
@ -0,0 +1,34 @@
|
||||
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
export function AssetModelManager(scene) {
|
||||
let scope = this;
|
||||
this.assetList = [];
|
||||
|
||||
this.loadAsset = [];
|
||||
|
||||
//加载课程资源
|
||||
this.lessonAssetsLoader = function(){
|
||||
fbxpromise();
|
||||
}
|
||||
|
||||
//动态加载资源
|
||||
this.assetLoader = function(){
|
||||
|
||||
}
|
||||
|
||||
//fbx模型加载
|
||||
function fbxpromise(){
|
||||
return new Promise(function(resolve, reject){
|
||||
var loader = new THREE.FBXLoader();
|
||||
loader.load( BASE_ASSET_API+"/MODEL/2021-03-25/1370-3193.FBX", function ( object ) {
|
||||
|
||||
|
||||
scope.loadAsset.push(object);
|
||||
scene.add(object);
|
||||
resolve();
|
||||
} );
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
86
src/jlmap3d/lesson3dedit/lesson3deditor.js
Normal file
86
src/jlmap3d/lesson3dedit/lesson3deditor.js
Normal file
@ -0,0 +1,86 @@
|
||||
import store from '@/store/index';
|
||||
// import { Loading } from 'element-ui';
|
||||
import {Stats} from '@/jlmap3d/main/lib/stats.min.js';
|
||||
//静态资源文件路径
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
//loader
|
||||
import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader';
|
||||
//轨道视角控制
|
||||
import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
|
||||
//骨骼动画模型辅助工具
|
||||
import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js';
|
||||
|
||||
import { AssetModelManager } from '@/jlmap3d/lesson3dedit/assetmodelmanager/assetmodelmanager.js';
|
||||
|
||||
|
||||
|
||||
//动画播放相关
|
||||
let clock = new THREE.Clock();
|
||||
let delta;
|
||||
|
||||
let scene;
|
||||
|
||||
export function Lesson3dEditor(dom,lessonData) {
|
||||
|
||||
// let stats = new Stats();
|
||||
// dom.appendChild( stats.dom );
|
||||
|
||||
let scope = this;
|
||||
this.dom = dom;
|
||||
|
||||
//定义相机
|
||||
this.camerass = new THREE.PerspectiveCamera(70, dom.offsetWidth / dom.offsetHeight, 0.01, 1000);
|
||||
this.camerass.position.set(0, 80, 40);
|
||||
this.camerass.aspect = dom.offsetWidth / dom.offsetHeight;
|
||||
this.camerass.updateProjectionMatrix();
|
||||
|
||||
//定义场景(渲染容器)
|
||||
scene = new THREE.Scene();
|
||||
scene.background = new THREE.Color(0xa0a0a0);
|
||||
|
||||
|
||||
this.renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
this.renderer.setClearColor(new THREE.Color(0x000000));
|
||||
this.renderer.setViewport( 0, 0, dom.offsetWidth, dom.offsetHeight);
|
||||
this.renderer.setScissor( 0, 0, dom.offsetWidth, dom.offsetHeight);
|
||||
this.renderer.setScissorTest( false );
|
||||
this.renderer.setSize(dom.offsetWidth, dom.offsetHeight);
|
||||
this.renderer.sortObjects = true;
|
||||
dom.appendChild(scope.renderer.domElement);
|
||||
|
||||
//定义全局光
|
||||
let ambientLight = new THREE.AmbientLight(0xffffff, 1.3);
|
||||
scene.add(ambientLight);
|
||||
var light = new THREE.HemisphereLight( 0xffffff, 0x444444 );
|
||||
light.position.set( 0, 4000, 0 );
|
||||
scene.add( light );
|
||||
|
||||
this.controls = new THREE.OrbitControls(scope.camerass, dom);
|
||||
this.controls.maxPolarAngle = Math.PI / 2;
|
||||
this.controls.minPolarangle = Math.PI / 5;
|
||||
this.controls.maxDistance = 800;
|
||||
this.controls.screenSpacePanning = true;
|
||||
this.controls.update();
|
||||
|
||||
lesson3dUpdateControl(scope.controls);
|
||||
|
||||
let assetModelManager = new AssetModelManager(scene);
|
||||
assetModelManager.lessonAssetsLoader();
|
||||
animate();
|
||||
|
||||
|
||||
|
||||
//循环渲染函数
|
||||
function animate() {
|
||||
scope.renderer.render( scene, scope.camerass );
|
||||
scope.controls.update();
|
||||
// delta = clock.getDelta();
|
||||
requestAnimationFrame(animate);
|
||||
|
||||
}
|
||||
|
||||
window.onresize = function () {
|
||||
scope.renderer.setSize(dom.offsetWidth,dom.offsetHeight);
|
||||
}
|
||||
|
||||
}
|
141
src/jlmap3d/lesson3dedit/model/lessondata.js
Normal file
141
src/jlmap3d/lesson3dedit/model/lessondata.js
Normal file
@ -0,0 +1,141 @@
|
||||
|
||||
export function LessonData() {
|
||||
let scope = this;
|
||||
|
||||
this.lessonId = "";
|
||||
this.lessonName = "";
|
||||
this.lessonType = "";
|
||||
this.lessonStatus = "";
|
||||
this.lessonData = {
|
||||
//资源列表
|
||||
assetmodel:[],
|
||||
//课程组件启用状态
|
||||
lessonTools:[],
|
||||
dataType:"",
|
||||
//课程内容
|
||||
lessonProgress:[
|
||||
|
||||
]
|
||||
};
|
||||
|
||||
this.initLessonProgress = function(){
|
||||
let newLessonProgress = {
|
||||
progressName:"",
|
||||
roleName:"",
|
||||
roleUse:true,
|
||||
|
||||
progressScene:"",
|
||||
nextCode:"",
|
||||
nextNode:"",
|
||||
triggerType:"",
|
||||
triggerMode:"",
|
||||
triggerTime:"",
|
||||
triggerModel:"",
|
||||
controlMode:"",
|
||||
cameraMode:"",
|
||||
cameraPosition:"",
|
||||
cameraTarget:"",
|
||||
assetId:scope.lessonData.lessonProgress.length,
|
||||
assetPos:"",
|
||||
assetRot:"",
|
||||
assetType:"",
|
||||
index:"",
|
||||
stepTipsData:{
|
||||
tittle:"标题",
|
||||
text:"内容",
|
||||
},
|
||||
explainPane:{
|
||||
tittle:"标题",
|
||||
picurl:"url",
|
||||
text:"内容",
|
||||
},
|
||||
};
|
||||
|
||||
scope.lessonData.lessonProgress.push(newLessonProgress);
|
||||
|
||||
}
|
||||
|
||||
this.loadLessonProgress = function(loadData){
|
||||
console.log(loadData);
|
||||
for(let i=0;i<loadData.length;i++){
|
||||
let newLessonProgress = {
|
||||
progressName:loadData[i].progressName,
|
||||
roleName:loadData[i].roleName,
|
||||
roleUse:loadData[i].roleUse,
|
||||
|
||||
progressScene:loadData[i].progressScene,
|
||||
nextCode:loadData[i].nextCode,
|
||||
nextNode:loadData[i].nextNode,
|
||||
triggerType:loadData[i].triggerType,
|
||||
triggerMode:loadData[i].triggerMode,
|
||||
triggerTime:loadData[i].triggerTime,
|
||||
triggerModel:loadData[i].triggerModel,
|
||||
controlMode:loadData[i].controlMode,
|
||||
cameraMode:loadData[i].cameraMode,
|
||||
cameraPosition:loadData[i].cameraPosition,
|
||||
cameraTarget:loadData[i].cameraTarget,
|
||||
assetId:loadData[i].assetId,
|
||||
assetPos:loadData[i].assetPos,
|
||||
assetRot:loadData[i].assetRot,
|
||||
assetType:loadData[i].assetType,
|
||||
index:loadData[i].index,
|
||||
stepTipsData:loadData[i].stepTipsData,
|
||||
explainPane:loadData[i].explainPane,
|
||||
};
|
||||
|
||||
scope.lessonData.lessonProgress.push(newLessonProgress);
|
||||
}
|
||||
}
|
||||
|
||||
this.addLessonProgress = function(index){
|
||||
let inheirIndex = index - 1;
|
||||
let newLessonProgress = {
|
||||
progressName:"",
|
||||
roleName:scope.lessonData.lessonProgress[inheirIndex].roleName,
|
||||
roleUse:scope.lessonData.lessonProgress[inheirIndex].roleUse,
|
||||
|
||||
progressScene:scope.lessonData.lessonProgress[inheirIndex].progressScene,
|
||||
nextCode:"",
|
||||
nextNode:"",
|
||||
triggerType:"",
|
||||
triggerMode:"",
|
||||
triggerTime:"",
|
||||
triggerModel:"",
|
||||
controlMode:scope.lessonData.lessonProgress[inheirIndex].controlMode,
|
||||
cameraMode:scope.lessonData.lessonProgress[inheirIndex].cameraMode,
|
||||
cameraPosition:scope.lessonData.lessonProgress[inheirIndex].cameraPosition,
|
||||
cameraTarget:scope.lessonData.lessonProgress[inheirIndex].cameraTarget,
|
||||
assetId:scope.lessonData.lessonProgress.length,
|
||||
assetPos:"",
|
||||
assetRot:"",
|
||||
assetType:"",
|
||||
index:"",
|
||||
triger:[
|
||||
|
||||
],
|
||||
stepTipsData:{
|
||||
tittle:"标题",
|
||||
text:"内容",
|
||||
},
|
||||
explainPane:{
|
||||
tittle:"标题",
|
||||
picurl:"url",
|
||||
text:"内容",
|
||||
},
|
||||
};
|
||||
|
||||
scope.lessonData.lessonProgress.push(newLessonProgress);
|
||||
|
||||
}
|
||||
|
||||
this.changeLessonProgress = function(){
|
||||
|
||||
}
|
||||
|
||||
this.removeLessonProgress = function(index){
|
||||
scope.lessonData.lessonProgress.splice(index,1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -409,10 +409,10 @@ export default class ELines extends Group {
|
||||
}
|
||||
|
||||
setCrossBlock() {
|
||||
this.centerSquare && this.centerSquare.setStyle({fill:this.model.style.Section.cross.centerSquare.blockColor});
|
||||
this.crossSection && this.crossSection.setStyle({fill:this.model.style.Section.cross.centerSquare.blockColor});
|
||||
}
|
||||
setCrossUnBlock() {
|
||||
this.centerSquare && this.centerSquare.setStyle({fill:this.model.style.Section.cross.centerSquare.defaultColor});
|
||||
this.crossSection && this.crossSection.setStyle({fill:this.model.style.Section.cross.centerSquare.defaultColor});
|
||||
}
|
||||
setCrossSpeedUpperLimit(speedLimit) {
|
||||
this.crossSpeedText && this.crossSpeedText.setStyle({text:speedLimit, textFill: 'red' });
|
||||
|
@ -43,7 +43,7 @@ export default {
|
||||
return this.$store.state.user.companyAdmin;
|
||||
},
|
||||
isSameProject() {
|
||||
return this.$store.state.user.companyProject === (getSessionStorage('project').toUpperCase());
|
||||
return this.$store.state.user.companyProjectList.includes(getSessionStorage('project').toUpperCase());
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -13,6 +13,7 @@ const AuthorList = () => import('@/views/authorization/list');
|
||||
|
||||
const Jlmap3dedit = () => import('@/views/jlmap3d/edit/jlmap3dedit');
|
||||
const Jlmap3dAssetManager = () => import('@/views/jlmap3d/jl3dassetmanager/assetmanager');
|
||||
const Jlmap3dLesson3dEdit = () => import('@/views/jlmap3d/lesson3dedit/lesson3dedit');
|
||||
const Jlmap3d = () => import('@/views/jlmap3d/drive/jl3ddrive');
|
||||
const Jlmap3dSandbox = () => import('@/views/jlmap3d/simulation/jl3dsimulation');
|
||||
const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow');
|
||||
@ -68,6 +69,7 @@ const TrainingRuleEdit = () => import('@/views/lesson/trainingRule/detail/index'
|
||||
const Trainingmanage = () => import('@/views/lesson/trainingmanage/index');
|
||||
const LessonEdit = () => import('@/views/lesson/lessoncategory/index');
|
||||
const LessonHome = () => import('@/views/lesson/home');
|
||||
const Lesson3d = () => import('@/views/lesson/lesson3d');
|
||||
const LessonDetail = () => import('@/views/lesson/details');
|
||||
|
||||
const ScriptmanageHome = () => import('@/views/scriptManage/home');
|
||||
@ -143,7 +145,6 @@ const PreTheoryImport = () => import('@/views/competitionManage/bankList/preImpo
|
||||
const PlanScheduleWicket = () => import('@/views/newMap/displayNew/demon/planSchedule');
|
||||
const MessageBoard = () => import('@/views/messageBoard/index');
|
||||
const BoardManage = () => import('@/views/messageBoard/manage');
|
||||
const DraftLessonManage = () => import('@/views/teach/draftLessonManage');
|
||||
const OrganizationManage = () => import('@/views/organization/index');
|
||||
const OrgClassManage = () => import('@/views/organization/classManage/index');
|
||||
const OrgDraftLessonManage = () => import('@/views/organization/draftLessonManage/index');
|
||||
@ -162,6 +163,7 @@ const RunPlanViewWindow = () => import('@/views/newMap/displayNew/demon/runPlanV
|
||||
const SecondaryHome = () => import('@/views/trainingPlatform/secondaryHome');
|
||||
const Demo = () => import('@/views/demo');
|
||||
const DemoTraining = () => import('@/views/newMap/displayNew/demoTraining');
|
||||
const OrgDetail = () => import('@/views/system/companyManage/orgDetail');
|
||||
|
||||
// import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
|
||||
// import { getSessionStorage } from '@/utils/auth';
|
||||
@ -249,6 +251,11 @@ export const constantRoutes = [
|
||||
component: Jlmap3dAssetManager,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/design/jlmap3d/lesson3dedit',
|
||||
component: Jlmap3dLesson3dEdit,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/data2json',
|
||||
component: () => import('@/views/planMonitor/data2json/page.vue'),
|
||||
@ -613,6 +620,11 @@ export const asyncRouter = [
|
||||
component: LessonHome,
|
||||
hidden: true
|
||||
},
|
||||
{ // 三维课程列表
|
||||
path: 'lesson/lesson3d',
|
||||
component: Lesson3d,
|
||||
hidden: true
|
||||
},
|
||||
{ // 操作定义
|
||||
path: 'lesson/trainingRule',
|
||||
component: TrainingRuleList,
|
||||
@ -703,11 +715,6 @@ export const asyncRouter = [
|
||||
component: TeachDetail,
|
||||
hidden: true
|
||||
},
|
||||
{ // 草稿课程
|
||||
path: 'draftTeach/:subSystem',
|
||||
component: DraftLessonManage,
|
||||
hidden: true
|
||||
},
|
||||
{ // 运行图设计
|
||||
path: 'runPlan/:mapId',
|
||||
component: PlanMonitorDetail,
|
||||
@ -959,6 +966,11 @@ export const asyncRouter = [
|
||||
i18n: 'router.companyManage'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'companyManage/orgDetail',
|
||||
component: OrgDetail,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'boardManage',
|
||||
component: BoardManage,
|
||||
|
@ -159,6 +159,7 @@ export const UrlConfig = {
|
||||
prefix: '/design/home',
|
||||
lessonEdit: '/design/lesson/edit',
|
||||
lessonHome: '/design/lesson/home',
|
||||
lesson3d: '/design/lesson/lesson3d',
|
||||
taskManage: '/design/lesson/taskManage',
|
||||
trainingRule: '/design/lesson/trainingRule',
|
||||
trainingRuleDetail: '/design/lesson/trainingRule/detail',
|
||||
|
@ -59,7 +59,7 @@ const runPlan = {
|
||||
trainList.forEach((train, j) => {
|
||||
state.initialPlanData[service.serviceNumber].trainMap[`${train.tripNumber}`] = { oldIndex: j, tripNumber: train.tripNumber, right:train.right,
|
||||
directionCode: train.directionCode, reentry: train.reentry, stationTimeList: train.stationTimeList, endSecondTime:train.endSecondTime,
|
||||
startSecondTime: train.startSecondTime };
|
||||
startSecondTime: train.startSecondTime, startSectionCode:train.startSectionCode, endSectionCode:train.endSectionCode };
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -76,7 +76,7 @@ const runPlan = {
|
||||
state.editData[service.serviceNumber].trainMap[`${train.tripNumber}`] =
|
||||
{ oldIndex: j, tripNumber: train.tripNumber, directionCode: train.directionCode, right:train.right,
|
||||
reentry: train.reentry, stationTimeList: train.stationTimeList, endSecondTime:train.endSecondTime,
|
||||
startSecondTime: train.startSecondTime};
|
||||
startSecondTime: train.startSecondTime, startSectionCode:train.startSectionCode, endSectionCode:train.endSectionCode };
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -93,7 +93,7 @@ const runPlan = {
|
||||
trainList.forEach((train, j) => {
|
||||
state.draftEditData[service.serviceNumber].trainMap[`${train.tripNumber}`] = { oldIndex: j, tripNumber: train.tripNumber, right:train.right,
|
||||
directionCode: train.directionCode, reentry: train.reentry, stationTimeList: train.stationTimeList, endSecondTime:train.endSecondTime,
|
||||
startSecondTime: train.startSecondTime};
|
||||
startSecondTime: train.startSecondTime, startSectionCode:train.startSectionCode, endSectionCode:train.endSectionCode };
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ const user = {
|
||||
companyId: '',
|
||||
companyAdmin: false,
|
||||
companyName: '',
|
||||
companyProject: '',
|
||||
companyProjectList: [],
|
||||
baseUrl:''
|
||||
},
|
||||
|
||||
@ -61,8 +61,8 @@ const user = {
|
||||
SET_COMPANYNAME: (state, companyName) => {
|
||||
state.companyName = companyName;
|
||||
},
|
||||
SET_COMPANYPROJECT: (state, companyProject) => {
|
||||
state.companyProject = companyProject;
|
||||
SET_COMPANYPROJECTLIST: (state, companyProjectList) => {
|
||||
state.companyProjectList = companyProjectList;
|
||||
},
|
||||
CLEAR_AUTO_PARAMS: () => {
|
||||
Cookies.remove('UserDesignName');
|
||||
@ -139,7 +139,7 @@ const user = {
|
||||
commit('SET_COMPANYID', user.companyId);
|
||||
commit('SET_COMPANYADMIN', user.companyAdmin);
|
||||
commit('SET_COMPANYNAME', user.companyName);
|
||||
commit('SET_COMPANYPROJECT', user.projectCode);
|
||||
commit('SET_COMPANYPROJECTLIST', user.projectCodes);
|
||||
resolve(user);
|
||||
}).catch(error => {
|
||||
reject(error);
|
||||
|
@ -4,7 +4,7 @@ export function getBaseUrl() {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.8.129:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.8.169:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.8.119:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
|
||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||
|
@ -161,6 +161,7 @@ export default {
|
||||
this.loadInitData();
|
||||
},
|
||||
async enterIntegratedSimulation() {
|
||||
this.disabled = true;
|
||||
const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
|
||||
createSimulationNew(data).then(resp => {
|
||||
const query = { lineCode: this.courseModel.lineCode, group: resp.data, mapId: this.courseModel.mapId};
|
||||
|
@ -102,6 +102,10 @@ export default {
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${obj.mapId}?lineCode=${obj.lineCode}&cityCode=${obj.cityCode}` });
|
||||
break;
|
||||
}
|
||||
case 'lesson3dDesign': {
|
||||
this.$router.push({ path: `${UrlConfig.design.lesson3d}`});
|
||||
break;
|
||||
}
|
||||
case 'runPlanDesign': {
|
||||
this.$router.push({ path: `${UrlConfig.design.runPlan}/${obj.mapId}?lineCode=${obj.lineCode}` });
|
||||
break;
|
||||
@ -201,7 +205,10 @@ export default {
|
||||
lineCode: elem.lineCode,
|
||||
cityCode: elem.cityCode
|
||||
});
|
||||
// this.isAdministrator() ? elem.children.push({id: '8', name: this.$t('designPlatform.lesson3dDesign'), type: 'lesson3dDesign'}) : '';
|
||||
|
||||
});
|
||||
|
||||
this.treeData = res.data;
|
||||
this.treeList = this.filterText
|
||||
? res.data.filter(elem => { return elem.name.includes(this.filterText); })
|
||||
|
58
src/views/jlmap3d/lesson3dedit/component/assetsmodel.vue
Normal file
58
src/views/jlmap3d/lesson3dedit/component/assetsmodel.vue
Normal file
@ -0,0 +1,58 @@
|
||||
<template>
|
||||
|
||||
<div id="assetsmodel" class="assetsmodel">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
|
||||
|
||||
export default {
|
||||
name: 'AssetsModel',
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.assetsmodel {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
130
src/views/jlmap3d/lesson3dedit/component/lessonprogress.vue
Normal file
130
src/views/jlmap3d/lesson3dedit/component/lessonprogress.vue
Normal file
@ -0,0 +1,130 @@
|
||||
<template>
|
||||
|
||||
<div id="lessonprogressdiv" class="lessonprogressdiv">
|
||||
<div class="progressnum">当前课程页数:{{listLength}}</div>
|
||||
<el-tabs v-model="activeName" class="activediv" type="card" @tab-click="handleClick">
|
||||
<el-tab-pane label="客运值班员" name="progresslist" >
|
||||
<draggable v-model="lessonData.lessonData.lessonProgress" group="people" @start="drag=true" @end="drag=false" >
|
||||
<div class="progressdiv" v-for="(element,index) in lessonData.lessonData.lessonProgress">
|
||||
<div class="changeprogressdiv" @click="changeProgressView(index)">{{element.assetId}}</div>
|
||||
<div class="delprogressdiv" @click="removeProgress(index)" >X</div>
|
||||
</div>
|
||||
</draggable>
|
||||
<div class="progressdiv " icon="el-icon-folder-add" @click="addProgress"></div>
|
||||
</el-tab-pane>
|
||||
|
||||
</el-tabs>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
|
||||
import draggable from 'vuedraggable';
|
||||
|
||||
export default {
|
||||
name: 'LessonProgress',
|
||||
props:['lessonData'],
|
||||
components: {
|
||||
draggable
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'progresslist',
|
||||
progressList:[
|
||||
|
||||
],
|
||||
listLength:0,
|
||||
progressIndex:0,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.lessonData);
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
onDragStart (e) {
|
||||
e.target.classList.add('hideShadow')
|
||||
},
|
||||
onDragEnd (e) {
|
||||
e.target.classList.remove('hideShadow')
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
console.log(tab, event);
|
||||
},
|
||||
addProgress(){
|
||||
this.$emit('addProgress');
|
||||
},
|
||||
changeProgressView(viewIndex){
|
||||
this.$emit('changeProgressView',viewIndex);
|
||||
console.log(viewIndex);
|
||||
},
|
||||
removeProgress(viewIndex){
|
||||
console.log(viewIndex);
|
||||
this.$emit('removeProgress',viewIndex);
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.lessonprogressdiv {
|
||||
position: absolute;
|
||||
width: 70%;
|
||||
height: 30%;
|
||||
bottom: 0;
|
||||
left:15%;
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.progressnum{
|
||||
position: absolute;
|
||||
right:10px;
|
||||
top:5px;
|
||||
}
|
||||
.progressdiv{
|
||||
width:100px;
|
||||
height:100px;
|
||||
// display:inline;
|
||||
margin: 20px;
|
||||
float:left;
|
||||
border:solid 2px #000;
|
||||
}
|
||||
|
||||
.changeprogressdiv{
|
||||
// position: relative;
|
||||
width: 100%;
|
||||
height: 80%;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
border:solid 2px #000;
|
||||
}
|
||||
|
||||
.delprogressdiv{
|
||||
// position: relative;
|
||||
width: 100%;
|
||||
height: 20%;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
border:solid 2px #000;
|
||||
}
|
||||
|
||||
</style>
|
123
src/views/jlmap3d/lesson3dedit/component/lessonsetup.vue
Normal file
123
src/views/jlmap3d/lesson3dedit/component/lessonsetup.vue
Normal file
@ -0,0 +1,123 @@
|
||||
<template>
|
||||
|
||||
<div id="" class="lessonsetupdiv" v-show="showSetup">
|
||||
<div style="text-align:center;top:10%;font-size:30px">新建课程信息</div>
|
||||
<el-form ref="form" :model="form" label-width="80px">
|
||||
<el-form-item label="课程名称">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="课程类型">
|
||||
<el-select v-model="form.type" placeholder="请选择活动区域">
|
||||
<el-option label="ATC(CBTC)多媒体教学演练系统" value="1"></el-option>
|
||||
<el-option label="ZDJ9转辙机检修作业指导虚拟仿真系统" value="2"></el-option>
|
||||
<el-option label="城市轨道交通车站机电设备虚拟仿真系统" value="3"></el-option>
|
||||
<el-option label="城市轨道交通电客车虚拟仿真教学系统" value="4"></el-option>
|
||||
<el-option label="城市轨道交通服务礼仪一点通系统" value="5"></el-option>
|
||||
<el-option label="城市轨道交通基础知识系统(视频无必要做)" value="6"></el-option>
|
||||
<el-option label="城市轨道交通考试系统(开始系统另算)" value="7"></el-option>
|
||||
<el-option label="城市轨道交通手信号系统" value="8"></el-option>
|
||||
<el-option label="城市轨道交通行车组织系统" value="9"></el-option>
|
||||
<el-option label="城市轨道交通作业多媒体系统" value="10"></el-option>
|
||||
<el-option label="城市轨道线路系统" value="11"></el-option>
|
||||
<el-option label="单车实验虚拟仿真实训系统操作视频" value="12"></el-option>
|
||||
<el-option label="地铁应急仿真实训操作视频" value="13"></el-option>
|
||||
<el-option label="地铁站务人员各岗一日作业虚拟仿真实训系统" value="14"></el-option>
|
||||
<el-option label="电话闭塞" value="15"></el-option>
|
||||
<el-option label="机电设备短视频" value="16"></el-option>
|
||||
<el-option label="一次乘务" value="17"></el-option>
|
||||
<el-option label="一日作业完整版" value="18"></el-option>
|
||||
<el-option label="一日作业演示版" value="19"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="课程简介">
|
||||
<el-input type="textarea" v-model="form.desc"></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">立即创建</el-button>
|
||||
<el-button @click="unSubmit" >取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
|
||||
|
||||
export default {
|
||||
name: 'LessonSetup',
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
showSetup:false,
|
||||
form: {
|
||||
name: '',
|
||||
type: '',
|
||||
scene:[],
|
||||
desc: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
setupView(){
|
||||
if(this.showSetup == false){
|
||||
this.showSetup = true;
|
||||
}else{
|
||||
this.showSetup = false;
|
||||
}
|
||||
},
|
||||
onSubmit() {
|
||||
console.log(this.form.scene);
|
||||
console.log(this.form.role);
|
||||
console.log('submit!');
|
||||
this.showSetup = false;
|
||||
this.$emit('lessonCreate', { name: this.form.name, type: this.form.type });
|
||||
},
|
||||
unSubmit(){
|
||||
this.showSetup = false;
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.lessonsetupdiv {
|
||||
position: absolute;
|
||||
width: 30%;
|
||||
height: 30%;
|
||||
top:35%;
|
||||
left:35%;
|
||||
background-color: #fff;
|
||||
border-radius: 18px;
|
||||
border:solid 2px #000;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
@ -0,0 +1,96 @@
|
||||
<template>
|
||||
|
||||
<div id="lessontoolsdiv" class="lessontoolsdiv">
|
||||
|
||||
<el-tabs v-model="activeName" class="activediv" @tab-click="handleClick">
|
||||
<el-tab-pane label="课程组件" style="height:400px" name="lessoncomponent" >
|
||||
<div v-for="(item,index) in lessonTools" class="tooldiv" >
|
||||
<div>
|
||||
{{item.name}}
|
||||
</div>
|
||||
<el-switch
|
||||
v-model="item.isShow"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="场景触发器" name="lessonasset">
|
||||
<!-- <Assets-Model></Assets-Model> -->
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="三维资源" name="modelasset">
|
||||
<!-- <Assets-Model></Assets-Model> -->
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="图片资源列表" name="picasset">
|
||||
<!-- <Assets-Model></Assets-Model> -->
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
|
||||
|
||||
export default {
|
||||
name: 'LessonTools',
|
||||
props:['lessonTools'],
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'lessoncomponent',
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.lessonTools);
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleClick(tab, event) {
|
||||
console.log(tab, event);
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.lessontoolsdiv {
|
||||
position: absolute;
|
||||
width: 15%;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
// background-color: #abc;
|
||||
}
|
||||
|
||||
.tooldiv{
|
||||
text-align: center;
|
||||
width:98%;
|
||||
height:60px;
|
||||
margin: 1%;
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
}
|
||||
|
||||
</style>
|
193
src/views/jlmap3d/lesson3dedit/component/property.vue
Normal file
193
src/views/jlmap3d/lesson3dedit/component/property.vue
Normal file
@ -0,0 +1,193 @@
|
||||
<template>
|
||||
|
||||
<div id="propertydiv" class="propertydiv">
|
||||
<el-tabs v-model="activeName" class="activediv" type="card" @tab-click="handleClick">
|
||||
<el-tab-pane label="当前场景信息" name="cameraproperty">
|
||||
<el-form ref="form" class="camerapropertydiv" label-width="130px" size="mini" v-if="selectLesson3dControl">
|
||||
<el-select v-model="lessonData.lessonData.lessonProgress[lessonEditIndex].progressScene" placeholder="请选择场景">
|
||||
<el-option label="车站" value="standstation"></el-option>
|
||||
<el-option label="停车场" value="stopstation"></el-option>
|
||||
<el-option label="单体设备" value="device"></el-option>
|
||||
<el-option label="线路" value="xl"></el-option>
|
||||
<el-option label="道岔" value="dc"></el-option>
|
||||
</el-select>
|
||||
|
||||
<el-switch
|
||||
v-model="lessonData.lessonData.lessonProgress[lessonEditIndex].roleUse"
|
||||
active-text="启用角色"
|
||||
inactive-text="禁用角色">
|
||||
</el-switch>
|
||||
|
||||
<el-select v-model="lessonData.lessonData.lessonProgress[lessonEditIndex].roleName" :disabled="!lessonData.lessonData.lessonProgress[lessonEditIndex].roleUse" placeholder="请选择步骤归属角色">
|
||||
<el-option label="车站" value="standstation"></el-option>
|
||||
<el-option label="停车场" value="stopstation"></el-option>
|
||||
<el-option label="单体设备" value="device"></el-option>
|
||||
<el-option label="线路" value="xl"></el-option>
|
||||
<el-option label="道岔" value="dc"></el-option>
|
||||
</el-select>
|
||||
|
||||
<el-form-item label="相机坐标:" v-if="selectLesson3dControl.object.position" disabled="true">
|
||||
|
||||
<el-input v-model="selectLesson3dControl.object.position.x" ></el-input>
|
||||
<el-input v-model="selectLesson3dControl.object.position.y" ></el-input>
|
||||
<el-input v-model="selectLesson3dControl.object.position.z" ></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="相机角度:" v-if="selectLesson3dControl.target" disabled="true">
|
||||
|
||||
<el-input v-model="selectLesson3dControl.target.x" ></el-input>
|
||||
<el-input v-model="selectLesson3dControl.target.y" ></el-input>
|
||||
<el-input v-model="selectLesson3dControl.target.z" ></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-select v-model="value" placeholder="当前场景镜头控制模式">
|
||||
<el-option
|
||||
v-for="item in cameraMode"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<el-button v-if="selectLesson3dControl" @click="">重置镜头位置</el-button>
|
||||
<el-button v-if="selectLesson3dControl" @click="">记录初始镜头位置</el-button>
|
||||
|
||||
|
||||
</el-form>
|
||||
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="组件属性" name="toolproperty" v-if="lessonData.lessonData.lessonProgress[lessonEditIndex]">
|
||||
<el-form>
|
||||
<el-form-item label="标题:" v-if="selected.tittle" >
|
||||
<el-input v-model="selected.tittle" ></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="内容:" v-if="selected.text">
|
||||
<el-input v-model="selected.text" ></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="说明画面:" v-if="selected.picurl">
|
||||
<el-input v-model="selected.picurl" ></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-button @click="updateData">保存修改</el-button>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="模型属性" name="modelproperty">
|
||||
</el-tab-pane>
|
||||
|
||||
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
name: 'ProPerty',
|
||||
props:['lessonData','lessonEditIndex'],
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'cameraproperty',
|
||||
selectLesson3dControl:"",
|
||||
selected:"",
|
||||
editSelectTool:"",
|
||||
editSelectModel:"",
|
||||
cameraMode:[
|
||||
{
|
||||
value: 'non',
|
||||
label: '禁止移动控制'
|
||||
}, {
|
||||
value: 'fps',
|
||||
label: '第一人称控制'
|
||||
}, {
|
||||
value: 'free',
|
||||
label: '自由视角控制'
|
||||
}
|
||||
],
|
||||
value:'',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
window.lesson3dUpdateControl = this.lesson3dUpdateControl;
|
||||
window.lesson3dSelect = this.lesson3dSelect;
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleClick(tab, event) {
|
||||
console.log(tab, event);
|
||||
},
|
||||
lesson3dUpdateControl(control){
|
||||
this.activeName = 'cameraproperty';
|
||||
this.selectLesson3dControl = control;
|
||||
console.log(this.selectLesson3dControl);
|
||||
},
|
||||
reset(){
|
||||
console.log("reset");
|
||||
this.activeName = 'cameraproperty';
|
||||
},
|
||||
lesson3dSelect(mode,type){
|
||||
this.activeName = mode;
|
||||
// console.log(this.lessonData.lessonData.lessonProgress[this.lessonEditIndex].stepTipsData);
|
||||
// this.activeName = 'toolproperty';
|
||||
// this.activeName = 'modelproperty';
|
||||
if(type == "stepTips"){
|
||||
this.selected = this.lessonData.lessonData.lessonProgress[this.lessonEditIndex].stepTipsData;
|
||||
}
|
||||
if(type == "explainpane"){
|
||||
|
||||
this.selected = this.lessonData.lessonData.lessonProgress[this.lessonEditIndex].explainPane;
|
||||
}
|
||||
|
||||
},
|
||||
updateData(){
|
||||
// this.lessonData.lessonData.lessonProgress[this.lessonEditIndex].stepTipsData;
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.propertydiv {
|
||||
position: absolute;
|
||||
width: 15%;
|
||||
height: 80%;
|
||||
right:0;
|
||||
bottom:0;
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.camerapropertydiv{
|
||||
// width:100%;
|
||||
// height:100;
|
||||
// position: absolute;
|
||||
text-align: center;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
270
src/views/jlmap3d/lesson3dedit/lesson3dedit.vue
Normal file
270
src/views/jlmap3d/lesson3dedit/lesson3dedit.vue
Normal file
@ -0,0 +1,270 @@
|
||||
<template>
|
||||
|
||||
<div id="lesson3ddiv" class="lesson3ddiv">
|
||||
|
||||
<LessonTools-Manager :lessonTools='lessonTools'></LessonTools-Manager>
|
||||
|
||||
|
||||
<div class="lesson3dedit">
|
||||
<Step-Tips
|
||||
:lessonData='lessonData'
|
||||
:lessonEditIndex='lessonEditIndex'
|
||||
v-show="lessonTools[0].isShow && lessonData.lessonData.lessonProgress[lessonEditIndex].progressScene == 'standstation'">
|
||||
</Step-Tips>
|
||||
|
||||
<Process-Log
|
||||
|
||||
v-show="lessonTools[1].isShow && lessonData.lessonData.lessonProgress[lessonEditIndex].progressScene == 'standstation'">
|
||||
</Process-Log>
|
||||
|
||||
<Explain-Pane
|
||||
:lessonData='lessonData'
|
||||
:lessonEditIndex='lessonEditIndex'
|
||||
v-show="lessonTools[2].isShow && lessonData.lessonData.lessonProgress[lessonEditIndex].progressScene == 'standstation'">
|
||||
</Explain-Pane>
|
||||
|
||||
<Job-Pane v-show="lessonTools[3].isShow && lessonData.lessonData.lessonProgress[lessonEditIndex].progressScene == 'standstation'"></Job-Pane>
|
||||
<Tool-Bar v-show="lessonTools[4].isShow && lessonData.lessonData.lessonProgress[lessonEditIndex].progressScene == 'standstation'"></Tool-Bar>
|
||||
|
||||
<div id="lesson3ddraw" class="lesson3ddraw">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Lesson-Progress
|
||||
|
||||
:lessonData='lessonData'
|
||||
@addProgress="addProgress"
|
||||
@changeProgressView="changeProgressView"
|
||||
@removeProgress="removeProgress"
|
||||
>
|
||||
</Lesson-Progress>
|
||||
|
||||
<div class="lessonsetup" >
|
||||
|
||||
<el-row>
|
||||
当前课程信息
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button @click="setupclick">课程设置</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button>预览课程</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button @click="saveLesson3dData">保存当前课程</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<Pro-Perty ref="lessonProPerty" :lessonData='lessonData' :lessonEditIndex='lessonEditIndex' ></Pro-Perty>
|
||||
|
||||
|
||||
<canvas id="canvastexture" width="128px" height="64px"></canvas>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
|
||||
import LessonProgress from '@/views/jlmap3d/lesson3dedit/component/lessonprogress';
|
||||
import ProPerty from '@/views/jlmap3d/lesson3dedit/component/property';
|
||||
import LessonToolsManager from '@/views/jlmap3d/lesson3dedit/component/lessontoolsmanager';
|
||||
// import AssetsModel from '@/views/jlmap3d/lesson3dedit/component/assetsmodel';
|
||||
|
||||
import StepTips from '@/views/jlmap3d/lesson3dedit/tools/stepstips';
|
||||
import ProcessLog from '@/views/jlmap3d/lesson3dedit/tools/processlog';
|
||||
import ExplainPane from '@/views/jlmap3d/lesson3dedit/tools/explainpane';
|
||||
import JobPane from '@/views/jlmap3d/lesson3dedit/tools/jobpane';
|
||||
import ToolBar from '@/views/jlmap3d/lesson3dedit/tools/toolbar';
|
||||
|
||||
|
||||
import { Lesson3dEditor } from '@/jlmap3d/lesson3dedit/lesson3deditor.js';
|
||||
|
||||
import { LessonData } from '@/jlmap3d/lesson3dedit/model/lessondata.js';
|
||||
|
||||
import { getLesson3dData,updateLesson3dData } from '@/api/jmap/lesson3d';
|
||||
export default {
|
||||
name: 'Lesson3dEdit',
|
||||
components: {
|
||||
LessonProgress,
|
||||
ProPerty,
|
||||
LessonToolsManager,
|
||||
// AssetsModel,
|
||||
|
||||
StepTips,
|
||||
ProcessLog,
|
||||
ExplainPane,
|
||||
JobPane,
|
||||
ToolBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
jl3d: null,
|
||||
netData:{
|
||||
name:'',
|
||||
type:'',
|
||||
data:{},
|
||||
},
|
||||
lessonData:{
|
||||
lessonData:{
|
||||
lessonProgress:[
|
||||
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
lessonEditIndex:0,
|
||||
lessonTools:[
|
||||
{
|
||||
name:"步骤组件",
|
||||
isShow:false,
|
||||
},
|
||||
{
|
||||
name:"步骤进程日志",
|
||||
isShow:false,
|
||||
},
|
||||
{
|
||||
name:"步骤提示组件",
|
||||
isShow:false,
|
||||
},
|
||||
{
|
||||
name:"岗位联络操作",
|
||||
isShow:false,
|
||||
},
|
||||
{
|
||||
name:"导航工具栏",
|
||||
isShow:false,
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.init(this.$route.query.lessonId);
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
init(lessonId){
|
||||
|
||||
getLesson3dData(lessonId).then(data => {
|
||||
this.netData.name = data.data.name;
|
||||
this.netData.type = data.data.type;
|
||||
|
||||
let dom = document.getElementById('lesson3ddraw');
|
||||
|
||||
this.lessonData = new LessonData();
|
||||
if(data.data.data){
|
||||
let loadData = JSON.parse(data.data.data);
|
||||
|
||||
this.lessonTools = loadData.lessonTools;
|
||||
this.lessonData.loadLessonProgress(loadData.lessonProgress);
|
||||
}else{
|
||||
this.lessonData.initLessonProgress();
|
||||
}
|
||||
|
||||
this.jl3d = new Lesson3dEditor(dom,this.lessonData);
|
||||
}).catch(() => {
|
||||
});
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
saveLesson3dData(){
|
||||
this.lessonData.lessonData.lessonTools = this.lessonTools;
|
||||
let saveData = this.lessonData.lessonData;
|
||||
this.netData.data = JSON.stringify(saveData);
|
||||
// console.log();
|
||||
updateLesson3dData(this.$route.query.lessonId,this.netData).then(data => {
|
||||
console.log(data);
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
addProgress(){
|
||||
|
||||
this.lessonEditIndex = this.lessonData.lessonData.lessonProgress.length;
|
||||
console.log(this.lessonEditIndex);
|
||||
this.lessonData.addLessonProgress(this.lessonEditIndex);
|
||||
this.$refs.lessonProPerty.reset();
|
||||
},
|
||||
changeProgressView(viewIndex){
|
||||
this.lessonEditIndex = viewIndex;
|
||||
this.$refs.lessonProPerty.reset();
|
||||
},
|
||||
removeProgress(removeIndex){
|
||||
this.lessonData.removeLessonProgress(removeIndex);
|
||||
},
|
||||
setupclick(){
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
* {
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
.lesson3ddiv {
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.lesson3dedit{
|
||||
width:70%;
|
||||
height:70%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left:15%;
|
||||
border:solid 2px #000;
|
||||
}
|
||||
.lesson3ddraw {
|
||||
float: left;
|
||||
//left:20%;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-inde: -1;
|
||||
}
|
||||
|
||||
.activediv{
|
||||
position: absolute;
|
||||
width: 15%;
|
||||
height:100%;
|
||||
left:0;
|
||||
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
}
|
||||
|
||||
.lessonsetup {
|
||||
position: absolute;
|
||||
width: 15%;
|
||||
height: 20%;
|
||||
right:0;
|
||||
top:0;
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.el-tabs__content{
|
||||
position: absolute;
|
||||
}
|
||||
</style>
|
75
src/views/jlmap3d/lesson3dedit/lesson3dshow.vue
Normal file
75
src/views/jlmap3d/lesson3dedit/lesson3dshow.vue
Normal file
@ -0,0 +1,75 @@
|
||||
<template>
|
||||
|
||||
<div id="lesson3ddiv" class="lesson3ddiv">
|
||||
|
||||
<div id="lesson3ddraw" class="lesson3ddraw">
|
||||
</div>
|
||||
|
||||
|
||||
<canvas id="canvastexture" width="128px" height="64px"></canvas>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
|
||||
|
||||
|
||||
|
||||
var train;
|
||||
export default {
|
||||
name: 'Lesson3dEdit',
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
* {
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
.lesson3ddiv {
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.lesson3ddraw {
|
||||
float: left;
|
||||
//left:20%;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-inde: -1;
|
||||
}
|
||||
</style>
|
71
src/views/jlmap3d/lesson3dedit/tools/actiontips.vue
Normal file
71
src/views/jlmap3d/lesson3dedit/tools/actiontips.vue
Normal file
@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<div class="stepstipsdiv" >
|
||||
<div class="stepstipstittle" >
|
||||
{{tipsTittle}}
|
||||
</div>
|
||||
<div class="stepstipstext" >
|
||||
{{tipsText}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
//操作提示
|
||||
export default {
|
||||
name: 'ActionTips',
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tipsTittle:"步骤一",
|
||||
tipsText:"步骤一",
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.stepstipsdiv {
|
||||
position: absolute;
|
||||
width: 20%;
|
||||
height: 20%;
|
||||
left:0;
|
||||
top:0;
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
background-color: #fff;
|
||||
z-index:1;
|
||||
}
|
||||
.stepstipstittle{
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
}
|
||||
.stepstipstext{
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
71
src/views/jlmap3d/lesson3dedit/tools/errortips.vue
Normal file
71
src/views/jlmap3d/lesson3dedit/tools/errortips.vue
Normal file
@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<div class="stepstipsdiv" >
|
||||
<div class="stepstipstittle" >
|
||||
{{tipsTittle}}
|
||||
</div>
|
||||
<div class="stepstipstext" >
|
||||
{{tipsText}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
//报错警告提示
|
||||
export default {
|
||||
name: 'ErrorTips',
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tipsTittle:"步骤一",
|
||||
tipsText:"步骤一",
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.stepstipsdiv {
|
||||
position: absolute;
|
||||
width: 20%;
|
||||
height: 20%;
|
||||
left:0;
|
||||
top:0;
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
background-color: #fff;
|
||||
z-index:1;
|
||||
}
|
||||
.stepstipstittle{
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
}
|
||||
.stepstipstext{
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
82
src/views/jlmap3d/lesson3dedit/tools/explainpane.vue
Normal file
82
src/views/jlmap3d/lesson3dedit/tools/explainpane.vue
Normal file
@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<div class="explainpanediv" v-if="lessonData.lessonData.lessonProgress[lessonEditIndex]" @click="selectTool">
|
||||
<div class="explainpanetittle" >
|
||||
{{lessonData.lessonData.lessonProgress[lessonEditIndex].explainPane.tittle}}
|
||||
</div>
|
||||
<div class="explainpanepic" >
|
||||
|
||||
</div>
|
||||
<div class="explainpanetext" >
|
||||
{{lessonData.lessonData.lessonProgress[lessonEditIndex].explainPane.text}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
|
||||
export default {
|
||||
name: 'ExplainPane',
|
||||
props:['lessonData','lessonEditIndex'],
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
selectTool(){
|
||||
lesson3dSelect('toolproperty','explainpane');
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.explainpanediv {
|
||||
position: absolute;
|
||||
width: 25%;
|
||||
height: 25%;
|
||||
left:20%;
|
||||
top:0;
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
background-color: #fff;
|
||||
z-index:1;
|
||||
}
|
||||
.explainpanetittle{
|
||||
// height:15%;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.explainpanepic{
|
||||
height:65%;
|
||||
border:solid 2px #000;
|
||||
}
|
||||
|
||||
.explainpanetext{
|
||||
font-size: 14px;
|
||||
// height:20%;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
189
src/views/jlmap3d/lesson3dedit/tools/jobpane.vue
Normal file
189
src/views/jlmap3d/lesson3dedit/tools/jobpane.vue
Normal file
@ -0,0 +1,189 @@
|
||||
<template>
|
||||
|
||||
<div class="jobpanediv">
|
||||
<div class="jobshowbutton" @click="openList">岗位联络</div>
|
||||
|
||||
<div class="joblistdiv" v-show="showJobList">
|
||||
<div class="jobdiv" v-for="(jobitem,index) in jobList" >{{jobitem.name}}</div>
|
||||
</div>
|
||||
|
||||
<el-tabs class="jobtab" v-show="showJob">
|
||||
<el-tab-pane v-for="(item,index) in jobUse" label-width="33%" :key="item.name" :label="item.name">
|
||||
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
//岗位
|
||||
export default {
|
||||
name: 'JobPane',
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
jobList:[],
|
||||
showJobList:false,
|
||||
showJob:false,
|
||||
jobUse:[
|
||||
{
|
||||
name:"联控"
|
||||
},
|
||||
{
|
||||
name:"动作"
|
||||
},
|
||||
{
|
||||
name:"口呼"
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.initJobList();
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
openList(){
|
||||
if(this.showJobList ==false){
|
||||
this.showJobList = true;
|
||||
this.showJob = true;
|
||||
}else{
|
||||
this.showJobList = false;
|
||||
this.showJob = false;
|
||||
}
|
||||
|
||||
},
|
||||
initJobList(){
|
||||
this.jobList = [
|
||||
{
|
||||
name:"值班站长",
|
||||
picurl:"",
|
||||
},
|
||||
{
|
||||
name:"行车值班员",
|
||||
picurl:"",
|
||||
},
|
||||
{
|
||||
name:"客运值班员",
|
||||
picurl:"",
|
||||
},
|
||||
{
|
||||
name:"票厅岗",
|
||||
picurl:"",
|
||||
},
|
||||
{
|
||||
name:"站台岗",
|
||||
picurl:"",
|
||||
},
|
||||
{
|
||||
name:"站长",
|
||||
picurl:"",
|
||||
},
|
||||
{
|
||||
name:"分部助理",
|
||||
picurl:"",
|
||||
},
|
||||
{
|
||||
name:"行车调度",
|
||||
picurl:"",
|
||||
},
|
||||
{
|
||||
name:"生产调度",
|
||||
picurl:"",
|
||||
},
|
||||
{
|
||||
name:"厅巡岗",
|
||||
picurl:"",
|
||||
},
|
||||
{
|
||||
name:"地铁公安",
|
||||
picurl:"",
|
||||
},
|
||||
{
|
||||
name:"120",
|
||||
picurl:"",
|
||||
},
|
||||
{
|
||||
name:"119",
|
||||
picurl:"",
|
||||
},
|
||||
];
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.jobpanediv {
|
||||
position: absolute;
|
||||
// height: 500px;
|
||||
min-width: 100px;
|
||||
right:0;
|
||||
top:0;
|
||||
// border:solid 2px #000;
|
||||
|
||||
z-index:1;
|
||||
}
|
||||
|
||||
.jobshowbutton{
|
||||
position: absolute;
|
||||
width:100px;
|
||||
height:50px;
|
||||
right:0;
|
||||
top:0;
|
||||
border:solid 2px #000;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.joblistdiv{
|
||||
position: absolute;
|
||||
width:100px;
|
||||
height:450px;
|
||||
right:0;
|
||||
top:50px;
|
||||
border:solid 2px #000;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.jobdiv{
|
||||
width:75px;
|
||||
height:75px;
|
||||
margin-top: 5px;
|
||||
margin-left: 2px;
|
||||
border:solid 2px #000;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.jobtab{
|
||||
position: absolute;
|
||||
|
||||
right:100px;
|
||||
top:50px;
|
||||
width: 300px;
|
||||
height:450px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
82
src/views/jlmap3d/lesson3dedit/tools/processlog.vue
Normal file
82
src/views/jlmap3d/lesson3dedit/tools/processlog.vue
Normal file
@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<div class="processlogdiv" >
|
||||
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="进程">
|
||||
<div class="processtext" >
|
||||
{{processText}}
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="日志">
|
||||
<div class="logtext" >
|
||||
{{logText}}
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
//进程日志
|
||||
export default {
|
||||
name: 'ProcessLog',
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
processText:"",
|
||||
logText:"",
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.processlogdiv {
|
||||
position: absolute;
|
||||
width: 28%;
|
||||
height: 25%;
|
||||
right:0;
|
||||
bottom:0;
|
||||
// border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
background-color: #fff;
|
||||
z-index:1;
|
||||
}
|
||||
.processtext{
|
||||
font-size: 16px;
|
||||
}
|
||||
.logtext{
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
75
src/views/jlmap3d/lesson3dedit/tools/stepstips.vue
Normal file
75
src/views/jlmap3d/lesson3dedit/tools/stepstips.vue
Normal file
@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<div class="stepstipsdiv" v-if="lessonData.lessonData.lessonProgress[lessonEditIndex]" @click="selectTool">
|
||||
<div class="stepstipstittle" >
|
||||
{{lessonData.lessonData.lessonProgress[lessonEditIndex].stepTipsData.tittle}}
|
||||
</div>
|
||||
<div class="stepstipstext" >
|
||||
{{lessonData.lessonData.lessonProgress[lessonEditIndex].stepTipsData.text}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
//步骤提示
|
||||
export default {
|
||||
name: 'StepTips',
|
||||
props:['lessonData','lessonEditIndex'],
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
selectTool(){
|
||||
lesson3dSelect('toolproperty','stepTips');
|
||||
},
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.stepstipsdiv {
|
||||
position: absolute;
|
||||
width: 20%;
|
||||
height: 20%;
|
||||
left:0;
|
||||
top:0;
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
background-color: #fff;
|
||||
z-index:1;
|
||||
}
|
||||
.stepstipstittle{
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
}
|
||||
.stepstipstext{
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
201
src/views/jlmap3d/lesson3dedit/tools/toolbar.vue
Normal file
201
src/views/jlmap3d/lesson3dedit/tools/toolbar.vue
Normal file
@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<div class="toolbardiv" >
|
||||
<div class="toolbarbutton" @click="openGuide"></div>
|
||||
<div class="toolbarbutton" @click="openBag"></div>
|
||||
<div class="toolbarbutton" ></div>
|
||||
|
||||
<div class="toolbarguides" v-show="showGuide">
|
||||
<div class="toolbarguide" v-for="(guide,index) in guideList">
|
||||
{{guide.name}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="toolbarbag" v-show="showBag">
|
||||
<div class="toolbarplaid" v-for="(tool,index) in toolsList"></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import localStore from 'storejs';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
//导航道具栏
|
||||
export default {
|
||||
name: 'ToolBar',
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tipsTittle:"步骤一",
|
||||
tipsText:"步骤一",
|
||||
guideList:[],
|
||||
toolsList:[],
|
||||
showGuide:false,
|
||||
showBag:false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.initList();
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
openGuide(){
|
||||
if(this.showGuide == false){
|
||||
this.showGuide = true;
|
||||
this.showBag = false;
|
||||
}else{
|
||||
this.showGuide = false;
|
||||
this.showBag = false;
|
||||
}
|
||||
},
|
||||
openBag(){
|
||||
if(this.showBag == false){
|
||||
this.showGuide = false;
|
||||
this.showBag = true;
|
||||
}else{
|
||||
this.showGuide = false;
|
||||
this.showBag = false;
|
||||
}
|
||||
},
|
||||
initList(){
|
||||
for(let i=0;i<12;i++){
|
||||
this.toolsList.push(
|
||||
{
|
||||
name:"",
|
||||
picrul:"",
|
||||
uesmode:"",
|
||||
}
|
||||
);
|
||||
}
|
||||
this.guideList=[
|
||||
{
|
||||
name:"站台",
|
||||
pos:"",
|
||||
},
|
||||
{
|
||||
name:"站厅",
|
||||
pos:"",
|
||||
},
|
||||
{
|
||||
name:"车控台",
|
||||
pos:"",
|
||||
},
|
||||
{
|
||||
name:"票务室",
|
||||
pos:"",
|
||||
},
|
||||
{
|
||||
name:"站长室",
|
||||
pos:"",
|
||||
},
|
||||
{
|
||||
name:"备品间",
|
||||
pos:"",
|
||||
},
|
||||
{
|
||||
name:"电梯",
|
||||
pos:"",
|
||||
},
|
||||
{
|
||||
name:"上行站台",
|
||||
pos:"",
|
||||
},
|
||||
{
|
||||
name:"下行站台",
|
||||
pos:"",
|
||||
},
|
||||
];
|
||||
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.toolbardiv {
|
||||
position: absolute;
|
||||
width: 240px;
|
||||
height: 80px;
|
||||
left:0;
|
||||
bottom:0;
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
background-color: #fff;
|
||||
z-index:1;
|
||||
}
|
||||
|
||||
.toolbarbutton{
|
||||
float:left;
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
.toolbarguides{
|
||||
position: absolute;
|
||||
bottom: 80px;
|
||||
left:0;
|
||||
width:100px;
|
||||
height:350px;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
}
|
||||
|
||||
.toolbarguide{
|
||||
width: 90px;
|
||||
height: 30px;
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.toolbarbag{
|
||||
position: absolute;
|
||||
bottom: 80px;
|
||||
left:0;
|
||||
width:240px;
|
||||
height:320px;
|
||||
overflow-y: auto;
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
}
|
||||
|
||||
.toolbarplaid{
|
||||
float:left;
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
|
||||
.stepstipstittle{
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
}
|
||||
.stepstipstext{
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
216
src/views/lesson/lesson3d.vue
Normal file
216
src/views/lesson/lesson3d.vue
Normal file
@ -0,0 +1,216 @@
|
||||
<template>
|
||||
<div class="joylink-card">
|
||||
<div class="lesson-header">
|
||||
<div class="lesson-list">草稿{{ $t('lesson.courseList') }}</div>
|
||||
<div class="but-group">
|
||||
<el-button size="mini" type="primary" @click="lessonSetupCreate">{{ $t('lesson.newConstruction') }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<QueryListPage ref="queryListPage" :card-padding="50" :query-form="queryForm" :pager-config="pagerConfig" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;" />
|
||||
<publish-create ref="publishCreate" @refresh="refresh" />
|
||||
<publish-lesson ref="publishLesson" @refresh="refresh" />
|
||||
<lesson-detail ref="lessonDetail" />
|
||||
|
||||
<Lesson-Setup ref="lessonsetup" @lessonCreate="lessonCreate"></Lesson-Setup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { releaseOrCancel } from '@/api/lesson3d';
|
||||
|
||||
import { getLesson3dDrftList,createLesson3d,updateLesson3dBasic,delLesson3d } from '@/api/jmap/lesson3d';
|
||||
// import { delLesson } from '@/api/jmap/lesson3d';
|
||||
|
||||
|
||||
import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import PublishCreate from './lessoncategory/edit/create';
|
||||
import PublishLesson from './lessoncategory/edit/lesson/publish';
|
||||
import LessonDetail from '@/views/approval/detail';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
|
||||
import LessonSetup from '@/views/jlmap3d/lesson3dedit/component/lessonsetup';
|
||||
|
||||
export default {
|
||||
name: 'Lesson3d',
|
||||
components: {
|
||||
PublishCreate,
|
||||
PublishLesson,
|
||||
LessonDetail,
|
||||
LessonSetup
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
show: false
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '三维课程名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '三维课程类型',
|
||||
prop: 'type'
|
||||
},
|
||||
{
|
||||
title: '创建人',
|
||||
prop: 'userId'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
prop: 'createTime'
|
||||
},
|
||||
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '400',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('lesson.courseDetails'),
|
||||
handleClick: this.goDetail,
|
||||
type: 'primary',
|
||||
showControl: (row) => {
|
||||
return row.status !== '1';
|
||||
}
|
||||
},
|
||||
{
|
||||
name: this.$t('lesson.notRelease'),
|
||||
handleClick: this.release,
|
||||
type: 'primary',
|
||||
showControl: (row) => {
|
||||
return row.status !== '1';
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
name: this.$t('global.delete'),
|
||||
handleClick: this.deleteLesson,
|
||||
type: 'danger',
|
||||
showControl: (row) => {
|
||||
return row.status !== '1';
|
||||
}
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
mapId() {
|
||||
return this.$route.params.mapId;
|
||||
},
|
||||
isAdmin() {
|
||||
return this.$store.state.user.roles.includes('04') || this.$store.state.user.roles.includes('05');
|
||||
},
|
||||
hasRelease() {
|
||||
return this.$store.state.user.roles.includes('04') ||
|
||||
this.$store.state.user.roles.includes('05') || this.$store.state.user.roles.includes('03');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
this.refresh();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
queryFunction(params) {
|
||||
return getLesson3dDrftList();
|
||||
},
|
||||
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.$refs.queryListPage.refresh(true);
|
||||
},
|
||||
lessonSetupCreate() {
|
||||
this.$refs.lessonsetup.setupView();
|
||||
},
|
||||
lessonCreate(creator){
|
||||
createLesson3d(
|
||||
{
|
||||
name:creator.name,
|
||||
type:creator.type,
|
||||
}
|
||||
).then(response => {
|
||||
|
||||
this.refresh();
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
publish(index, row) {
|
||||
row.mapId = this.$route.params.mapId;
|
||||
row.cityCode = this.$route.query.cityCode;
|
||||
this.$refs.publishLesson.doShow(row);
|
||||
},
|
||||
deleteLesson(index, row) {
|
||||
// console.log(row);
|
||||
delLesson3d(row.id).then(response => {
|
||||
this.$message.success(this.$t('tip.successfullyDelete'));
|
||||
this.loading = true;
|
||||
this.refresh();
|
||||
this.loading = false;
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.failDelete'));
|
||||
});
|
||||
},
|
||||
|
||||
release(){
|
||||
|
||||
},
|
||||
goDetail(index, row) {
|
||||
console.log(row);
|
||||
this.$router.push({ path: '/design/jlmap3d/lesson3dedit', query: {lessonId: row.id} });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.joylink-card{
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
.lesson-header{
|
||||
display:inline-block;margin-top:40px;width: 90%;margin-left:5%;
|
||||
}
|
||||
.lesson-list{
|
||||
display:inline-block;padding:7px 0px
|
||||
}
|
||||
.but-group{
|
||||
float: right;
|
||||
margin-right:20px;
|
||||
}
|
||||
</style>
|
@ -12,16 +12,6 @@
|
||||
<el-form-item :label="$t('lesson.publishCourseName')" prop="name">
|
||||
<el-input v-model="editModel.name" :disabled="!hasRelease" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="showClassSelect" label="课程所属班级:" prop="classIdList">
|
||||
<el-select v-model="editModel.classIdList" multiple placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in calssList"
|
||||
:key="item.departmentId"
|
||||
:label="item.departmentName"
|
||||
:value="item.departmentId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
@ -33,7 +23,6 @@
|
||||
|
||||
<script>
|
||||
import { adminPublishLesson, releaseOrCancel } from '@/api/designPlatform';
|
||||
import { getCompanyDeptInfo } from '@/api/company';
|
||||
export default {
|
||||
name: 'LessonPublish',
|
||||
data() {
|
||||
@ -47,8 +36,7 @@ export default {
|
||||
name: '',
|
||||
mapId: '',
|
||||
prdType: '',
|
||||
cityCode: '',
|
||||
classIdList: []
|
||||
cityCode: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
@ -66,18 +54,12 @@ export default {
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
|
||||
],
|
||||
classIdList: [
|
||||
{ required: true, message: '请选择课程归属班级', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
},
|
||||
hasRelease() {
|
||||
return this.$store.state.user.roles.includes('04') ||
|
||||
this.$store.state.user.roles.includes('05') || this.$store.state.user.roles.includes('03');
|
||||
},
|
||||
showClassSelect() {
|
||||
return this.$store.state.user.companyId && this.$store.state.user.companyAdmin;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -87,17 +69,9 @@ export default {
|
||||
name: model.name,
|
||||
mapId: this.$route.query.mapId || this.$route.params.mapId,
|
||||
prdType: model.prdType,
|
||||
cityCode: model.cityCode,
|
||||
classIdList: []
|
||||
cityCode: model.cityCode
|
||||
};
|
||||
this.dialogShow = true;
|
||||
if (this.showClassSelect) {
|
||||
getCompanyDeptInfo(this.$store.state.user.companyId).then(resp => {
|
||||
this.calssList = resp.data;
|
||||
}).catch(() =>{
|
||||
this.$message.error('获取班级数据失败!');
|
||||
});
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.$refs.form.resetFields();
|
||||
@ -129,7 +103,6 @@ export default {
|
||||
this.loading = false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -7,18 +7,16 @@
|
||||
</div>
|
||||
<div class="display-draft" :style="{bottom: offsetBottom + 'px'}">
|
||||
<el-button-group>
|
||||
<el-button type="primary" class="back" @click="back">{{ $t('display.backBtn') }}</el-button>
|
||||
<el-button type="danger" :disabled="!isDisable || dataError" @click="end">{{ $t('display.endBtn') }}</el-button>
|
||||
<el-button type="success" :disabled="isDisable || dataError" :loading="startLoading" @click="start">{{ $t('display.startBtn') }}</el-button>
|
||||
<el-button type="danger" :disabled="!isDisable || dataError" @click="end">{{ $t('display.endBtn') }}</el-button>
|
||||
<el-button type="primary" class="back" @click="back">{{ $t('display.backBtn') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<tip-exam-list :offset-bottom="offsetBottom" />
|
||||
<!-- @refresh="refresh" -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { getTrainingDetailNew } from '@/api/jmap/training';
|
||||
import TipExamList from './tipExamList';
|
||||
import { Notification } from 'element-ui';
|
||||
import { startTrainingNew } from '@/api/jmap/training';
|
||||
|
@ -82,7 +82,6 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { refreshExamList } from '@/api/management/userexam';
|
||||
// loadTrainingInSimulation
|
||||
import { getTrainingDetailNew } from '@/api/jmap/training';
|
||||
|
||||
export default {
|
||||
@ -167,7 +166,6 @@ export default {
|
||||
}
|
||||
});
|
||||
if (obj) {
|
||||
// if (type) {
|
||||
getTrainingDetailNew(obj.trainingId).then(resp => {
|
||||
this.courseModel = {
|
||||
id: resp.data.id,
|
||||
@ -183,24 +181,6 @@ export default {
|
||||
}).catch(error => {
|
||||
this.$message.error(this.$t('display.exam.getTestInformation') + ':' + error.message);
|
||||
});
|
||||
// } else {
|
||||
// loadTrainingInSimulation(this.$route.query.group, this.$route.query.trainingId).then(resp => {
|
||||
// // getTrainingDetailNew(obj.trainingId).then(res => {
|
||||
// this.courseModel = {
|
||||
// id: resp.data.id,
|
||||
// name: resp.data.name,
|
||||
// maxDuration: resp.data.maxDuration,
|
||||
// remarks: resp.data.remarks,
|
||||
// minDuration: resp.data.minDuration,
|
||||
// updateTime: resp.data.updateTime
|
||||
// };
|
||||
// this.$store.dispatch('training/setPrdType', this.prdTypeMap[resp.data.prdType]);
|
||||
// this.$store.dispatch('exam/setCenter', resp.data.locateDeviceCode);
|
||||
// this.$store.dispatch('training/setTrainingData', resp.data); // 设置实训信息
|
||||
// }).catch(error => {
|
||||
// this.$message.error(this.$t('display.exam.getTestInformation') + ':' + error.message);
|
||||
// });
|
||||
// }
|
||||
}
|
||||
this.jump(obj);
|
||||
},
|
||||
|
@ -154,9 +154,6 @@ export default {
|
||||
assetmanager3d() {
|
||||
this.$router.push({ path: '/design/jlmap3d/assetmanager' });
|
||||
},
|
||||
|
||||
|
||||
|
||||
importMap() {
|
||||
this.$refs.mapImport.show();
|
||||
}
|
||||
|
@ -1,97 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="班级排考试" :visible.sync="dialogShow" width="400px" :before-close="doClose">
|
||||
<el-form ref="form" :model="classModel" :rules="rules" label-width="120px" size="mini">
|
||||
<el-form-item label="班级名称:" prop="name">
|
||||
<el-input v-model="classModel.name" style="width: 220px;" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="安排考试:" prop="lessonIds">
|
||||
<el-select v-model="classModel.examIds" multiple placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in examList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id+''"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="create">{{ $t('global.confirm') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getExamListProjectUnpage } from '@/api/management/exam';
|
||||
import { getExamListInClass, applyExamToClass } from '@/api/company';
|
||||
|
||||
export default {
|
||||
name: 'CreateClass',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
examList: [],
|
||||
classModel: {
|
||||
id: '',
|
||||
name: '',
|
||||
examIds: []
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
const baseRules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入班级名称', trigger: 'blur' }
|
||||
],
|
||||
examIds: [
|
||||
{ required: true, message: '请选择安排考试', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return baseRules;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async doShow(row) {
|
||||
try {
|
||||
this.examList = [];
|
||||
const resp = await getExamListProjectUnpage({ status: '1' });
|
||||
this.examList = resp.data;
|
||||
const rest = await getExamListInClass(row.id);
|
||||
this.classModel.id = row.id;
|
||||
this.classModel.name = row.name;
|
||||
this.classModel.examIds = rest.data;
|
||||
this.dialogShow = true;
|
||||
|
||||
} catch {
|
||||
this.$message.error('获取试卷列表或班级数据异常!');
|
||||
}
|
||||
|
||||
},
|
||||
create() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
applyExamToClass( this.classModel.id, this.classModel.examIds).then(response => {
|
||||
this.doClose();
|
||||
this.$message.success('班级安排考试成功!');
|
||||
}).catch(() => {
|
||||
this.$message.error('班级安排考试失败!');
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.$refs.form.resetFields();
|
||||
this.dialogShow = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.option-group {
|
||||
margin: 10px 100px;
|
||||
}
|
||||
</style>
|
@ -1,101 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="班级排课" :visible.sync="dialogShow" width="400px" :before-close="doClose">
|
||||
<el-form ref="form" :model="classModel" :rules="rules" label-width="120px" size="mini">
|
||||
<el-form-item label="班级名称:" prop="name">
|
||||
<el-input v-model="classModel.name" style="width: 220px;" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="安排课程:" prop="lessonIds">
|
||||
<el-select v-model="classModel.lessonIds" multiple placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in lessonList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="create">{{ $t('global.confirm') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getLessonProjectListNoPage } from '@/api/jmap/lesson';
|
||||
import { getClassAssociatedLessons, setClassAssociatedLessons } from '@/api/company';
|
||||
|
||||
export default {
|
||||
name: 'CreateClass',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
lessonList: [],
|
||||
classModel: {
|
||||
id: '',
|
||||
name: '',
|
||||
lessonIds: []
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
const baseRules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入班级名称', trigger: 'blur' }
|
||||
],
|
||||
lessonIds: [
|
||||
{ required: true, message: '请选择安排课程', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return baseRules;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async doShow(row) {
|
||||
try {
|
||||
this.lessonList = [];
|
||||
const resp = await getLessonProjectListNoPage({ status: '1' });
|
||||
this.lessonList = resp.data;
|
||||
const rest = await getClassAssociatedLessons(row.id);
|
||||
this.classModel.id = row.id;
|
||||
this.classModel.name = row.name;
|
||||
this.classModel.lessonIds = [];
|
||||
rest.data && rest.data.forEach(item => {
|
||||
this.classModel.lessonIds.push(item.id);
|
||||
});
|
||||
this.dialogShow = true;
|
||||
|
||||
} catch {
|
||||
this.$message.error('获取课程列表或班级数据异常!');
|
||||
}
|
||||
|
||||
},
|
||||
create() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
setClassAssociatedLessons( this.classModel.id, this.classModel.lessonIds).then(response => {
|
||||
this.doClose();
|
||||
this.$message.success('班级排课成功!');
|
||||
}).catch((error) => {
|
||||
this.$message.error('班级排课失败:' + error.message);
|
||||
});
|
||||
// setClassAssociatedLessons( this.classModel.id, this.classModel.lessonIds)
|
||||
}
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.$refs.form.resetFields();
|
||||
this.dialogShow = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.option-group {
|
||||
margin: 10px 100px;
|
||||
}
|
||||
</style>
|
@ -8,22 +8,16 @@
|
||||
style="width:96%;margin: 0 auto;"
|
||||
/>
|
||||
<create-class ref="createClass" @refresh="classRefresh" />
|
||||
<bind-lessons ref="bindLessons" />
|
||||
<bind-exams ref="bindExams" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getClassListPage, deleteDeptInfo } from '@/api/company';
|
||||
import CreateClass from './createClass';
|
||||
import BindLessons from './bindLessons';
|
||||
import BindExams from './bindExams';
|
||||
export default {
|
||||
name: 'ClassManage',
|
||||
components: {
|
||||
CreateClass,
|
||||
BindLessons,
|
||||
BindExams
|
||||
CreateClass
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -93,16 +87,6 @@ export default {
|
||||
handleClick: this.handleGradeCheck,
|
||||
type: 'primary'
|
||||
},
|
||||
// {
|
||||
// name: '排课',
|
||||
// handleClick: this.handleBindLesson,
|
||||
// type: 'primary'
|
||||
// },
|
||||
// {
|
||||
// name: '安排考试',
|
||||
// handleClick: this.handleBindExam,
|
||||
// type: 'primary'
|
||||
// },
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDeleteClass,
|
||||
@ -155,14 +139,8 @@ export default {
|
||||
handleStudentDetail( index, row ) {
|
||||
this.$router.push({ path: '/info/studentManage', query: { classId: row.id, className: row.name, creatorId: row.creatorId} });
|
||||
},
|
||||
handleBindLesson(index, row) {
|
||||
this.$refs.bindLessons.doShow(row);
|
||||
},
|
||||
classCreate() {
|
||||
this.$refs.createClass.doShow();
|
||||
},
|
||||
handleBindExam(index, row) {
|
||||
this.$refs.bindExams.doShow(row);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -203,7 +203,7 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteDepartUserRelation({ departmentId: row.departmentId, userId: row.userId }).then(response => {
|
||||
deleteDepartUserRelation({ departmentId: row.departmentId, userId: row.userId, orgRole: row.orgRole }).then(response => {
|
||||
_that.refresh();
|
||||
}).catch(() => {
|
||||
_that.$message.error('移出班级失败!');
|
||||
|
@ -137,7 +137,7 @@ import { getLessonTree, deleteLessonChapter } from '@/api/jmap/lessondraft';
|
||||
import { createLessonChapter, updateLessonChapter, updateLesson, getLessonDetail, getLessonChapterDetail } from '@/api/jmap/lessondraft';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import OperateMenu from './operateMenu';
|
||||
import TrainList from '@/views/teach/trainingList';
|
||||
import TrainList from './trainingList';
|
||||
|
||||
import Cookies from 'js-cookie';
|
||||
export default {
|
||||
|
@ -17,7 +17,7 @@ import ConstConfig from '@/scripts/ConstConfig';
|
||||
import { getLessonDraftListSelf, delLesson } from '@/api/jmap/lessondraft';
|
||||
import CreateByPublished from './createByPublished';
|
||||
import PublishLesson from './publishLesson';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { getPublishMapInfo, getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'Index',
|
||||
@ -28,6 +28,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
lineCode: '',
|
||||
mapIdList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
@ -48,12 +49,37 @@ export default {
|
||||
draftLessonQueryList: {
|
||||
query: getLessonDraftListSelf,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
indexShow: false,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('lesson.courseName'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '课程地图',
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
width: '250',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.mapId, this.mapIdList, ['id', 'name']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '产品类型',
|
||||
prop: 'prdType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
if (row.prdType === '01') {
|
||||
return '现地工作站';
|
||||
} else if (row.prdType === '02') {
|
||||
return '行调工作站';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('lesson.courseDescription'),
|
||||
prop: 'remarks'
|
||||
@ -111,6 +137,12 @@ export default {
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.mapIdList = [];
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
lessonCreate() {
|
||||
this.$router.push({ path: `/info/createLesson` });
|
||||
|
@ -11,7 +11,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getClassListUnPage } from '@/api/company';
|
||||
import { getExamListProject, setExamEffectivey, setExamEfficacy } from '@/api/management/exam';
|
||||
import localStore from 'storejs';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
@ -55,7 +54,7 @@ export default {
|
||||
examQueryList: {
|
||||
query: getExamListProject,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
indexShow: false,
|
||||
columns: [
|
||||
{
|
||||
title: '试卷名称',
|
||||
@ -65,6 +64,7 @@ export default {
|
||||
title: '归属地图',
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
width: '200',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapIdList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
@ -72,6 +72,7 @@ export default {
|
||||
title: '产品类型',
|
||||
prop: 'prdType',
|
||||
type: 'tag',
|
||||
width: '110',
|
||||
columnValue: (row) => { if (row.prdType === '01') { return '现地工作站'; } else if (row.prdType === '02') { return '行调工作站'; } },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
@ -79,18 +80,12 @@ export default {
|
||||
title: '启用/禁用',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
width: '80',
|
||||
columnValue: (row) => {
|
||||
return row.status == '1' ? '启用' : '禁用';
|
||||
},
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '班级',
|
||||
prop: 'clsIds',
|
||||
type: 'tagMore',
|
||||
columnValue: (row) => { return this.$convertField(row.clsIds || [], this.classList || [], ['id', 'name'], true); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
prop: 'startTime'
|
||||
@ -127,13 +122,21 @@ export default {
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '200',
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: '成绩查询',
|
||||
handleClick: this.handleQueryGrade,
|
||||
type: 'primary'
|
||||
},
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.handleEditExam,
|
||||
type: 'primary',
|
||||
showControl: (row) => {
|
||||
return row.creatorId == this.userId;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '启用',
|
||||
handleClick: this.handleEnableExam,
|
||||
@ -168,9 +171,6 @@ export default {
|
||||
const params = localStore.get(this.$route.path) || {};
|
||||
if (!params.status) { params.status = '1'; }
|
||||
localStore.set(this.$route.path, params);
|
||||
getClassListUnPage().then(response => {
|
||||
this.classList = response.data;
|
||||
});
|
||||
this.mapIdList = [];
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
@ -180,6 +180,9 @@ export default {
|
||||
handleQueryGrade(index, row) {
|
||||
this.$router.push({ path: '/info/gradeList', query: { examId: row.id, name: row.name } });
|
||||
},
|
||||
handleEditExam(index, row) {
|
||||
this.$router.push({ path: `/info/examRule/draft/edit/${row.id}/0`, query: { source: 'org' } });
|
||||
},
|
||||
examCreate() {
|
||||
this.$router.push({ path: `/info/examRule/draft/add/0/0`, query: { source: 'org' } });
|
||||
},
|
||||
|
@ -58,7 +58,7 @@ export default {
|
||||
lessonQueryList: {
|
||||
query: getLessonProjectList,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
indexShow: false,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('lesson.courseName'),
|
||||
|
@ -10,9 +10,6 @@
|
||||
@submit.native.prevent
|
||||
>
|
||||
<el-form-item label="班级:" prop="orgIds">
|
||||
<!--<el-tooltip class="item" effect="dark" content="此处班级经过规则中涉及到的课程和考试筛选处理" placement="top-start">-->
|
||||
<!--<i class="el-icon-info" />-->
|
||||
<!--</el-tooltip>-->
|
||||
<el-select v-model="editModel.orgIds" multiple placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in classList"
|
||||
|
@ -98,90 +98,83 @@ export default {
|
||||
const tripNumber = tripNumberList[index];
|
||||
const trainInfo = editData.trainMap[tripNumber];
|
||||
const lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
const model = {
|
||||
planId: this.$route.query.planId,
|
||||
SDTNumber: `${this.model.serviceNumber}${tripNumber}`
|
||||
|
||||
const taskObj = {
|
||||
id:index + 1,
|
||||
tripNumber: tripNumber,
|
||||
startStationCode:trainInfo.stationTimeList[0].stationCode,
|
||||
endStationCode:trainInfo.stationTimeList[lastIndex].stationCode,
|
||||
startTime: formatTime(trainInfo.startSecondTime + 7200),
|
||||
endTime: formatTime(trainInfo.endSecondTime + 7200),
|
||||
arriveConfigList: [],
|
||||
startSectionCode:trainInfo.startSectionCode,
|
||||
endSectionCode:trainInfo.endSectionCode,
|
||||
endTbFront:undefined,
|
||||
startTbFront:undefined
|
||||
};
|
||||
getRoutingBySDTNumber(model).then(resp => {
|
||||
const taskObj = {
|
||||
id:index + 1,
|
||||
tripNumber: tripNumber,
|
||||
startStationCode: resp.data.startStationCode,
|
||||
startTime: formatTime(trainInfo.stationTimeList[0].secondTime + 7200),
|
||||
endStationCode: resp.data.endStationCode,
|
||||
endTime: formatTime(trainInfo.stationTimeList[lastIndex - 1].secondTime + 7200),
|
||||
routingCode : resp.data.id,
|
||||
endSectionCode:resp.data.endSectionCode,
|
||||
startSectionCode:resp.data.startSectionCode,
|
||||
arriveConfigList: [],
|
||||
endTbFront:resp.data.endTbFront,
|
||||
startTbFront:resp.data.startTbFront
|
||||
if (trainInfo.startSectionCode != trainInfo.stationTimeList[0].sectionCode) {
|
||||
taskObj.startTbFront = false;
|
||||
taskObj.startTime = formatTime(trainInfo.startSecondTime + 7200);
|
||||
const newModel = {
|
||||
sectionCode:trainInfo.startSectionCode,
|
||||
stationCode:trainInfo.stationTimeList[0].stationCode,
|
||||
// // speedLevel:'默认',
|
||||
departureTime: formatTime(trainInfo.startSecondTime + 7200),
|
||||
arriveTime: formatTime(trainInfo.startSecondTime + 7200),
|
||||
stopTime:0
|
||||
};
|
||||
if (resp.data.startTbFront == false) {
|
||||
taskObj.startTime = formatTime(trainInfo.startSecondTime + 7200);
|
||||
const newModel = {
|
||||
sectionCode:resp.data.parkSectionCodeList[0].sectionCode,
|
||||
stationCode:resp.data.startStationCode,
|
||||
// // speedLevel:'默认',
|
||||
departureTime: formatTime(trainInfo.startSecondTime + 7200),
|
||||
arriveTime: formatTime(trainInfo.startSecondTime + 7200),
|
||||
stopTime:0
|
||||
};
|
||||
taskObj.arriveConfigList.push(newModel);
|
||||
}
|
||||
const newstationTimeList = [];
|
||||
let current = {};
|
||||
trainInfo.stationTimeList.forEach((stationTime, index)=>{
|
||||
if (index % 2 == 0) {
|
||||
current = {};
|
||||
current.stationCode = stationTime.stationCode;
|
||||
current.arriveTime = stationTime.secondTime;
|
||||
} else {
|
||||
current.departureTime = stationTime.secondTime;
|
||||
newstationTimeList.push(current);
|
||||
}
|
||||
});
|
||||
newstationTimeList.forEach((newstationTime, index)=>{
|
||||
const newModel = {
|
||||
stationCode:newstationTime.stationCode,
|
||||
// speedLevel:'默认',
|
||||
arriveTime: formatTime(newstationTime.arriveTime + 7200),
|
||||
departureTime: formatTime(newstationTime.departureTime + 7200),
|
||||
stopTime:newstationTime.departureTime - newstationTime.arriveTime
|
||||
};
|
||||
if (resp.data.startTbFront == false) {
|
||||
newModel.sectionCode = resp.data.parkSectionCodeList[index + 1].sectionCode;
|
||||
} else {
|
||||
newModel.sectionCode = resp.data.parkSectionCodeList[index].sectionCode;
|
||||
}
|
||||
if (index < newstationTimeList.length - 1) {
|
||||
newModel.speedLevelTime = newstationTimeList[index + 1].arriveTime - newstationTime.departureTime;
|
||||
// newModel.speedLevel=
|
||||
}
|
||||
taskObj.arriveConfigList.push(newModel);
|
||||
});
|
||||
if (resp.data.endTbFront == false) {
|
||||
taskObj.endTime = formatTime(trainInfo.endSecondTime + 7200);
|
||||
const length = resp.data.parkSectionCodeList.length - 1;
|
||||
const newModel = {
|
||||
sectionCode:resp.data.parkSectionCodeList[length].sectionCode,
|
||||
stationCode:resp.data.endStationCode,
|
||||
// // speedLevel:'默认',
|
||||
departureTime: formatTime(trainInfo.endSecondTime + 7200),
|
||||
arriveTime: formatTime(trainInfo.endSecondTime + 7200),
|
||||
stopTime:0
|
||||
};
|
||||
taskObj.arriveConfigList.push(newModel);
|
||||
}
|
||||
// arriveTime: ""
|
||||
// departureTime: "07:00:00"
|
||||
// speedLevel: "默认(等级三)"
|
||||
this.model.tripConfigList.push(taskObj);
|
||||
index++;
|
||||
if (index <= tripNumberList.length - 1) {
|
||||
this.getEachTripNumber(editData, tripNumberList, index);
|
||||
taskObj.arriveConfigList.push(newModel);
|
||||
}
|
||||
const newstationTimeList = [];
|
||||
let current = {};
|
||||
trainInfo.stationTimeList.forEach((stationTime, index)=>{
|
||||
if (index % 2 == 0) {
|
||||
current = {};
|
||||
current.stationCode = stationTime.stationCode;
|
||||
current.sectionCode = stationTime.sectionCode;
|
||||
current.arriveTime = stationTime.secondTime;
|
||||
} else {
|
||||
current.departureTime = stationTime.secondTime;
|
||||
newstationTimeList.push(current);
|
||||
}
|
||||
});
|
||||
|
||||
newstationTimeList.forEach((newstationTime, index)=>{
|
||||
if (trainInfo.startSectionCode != trainInfo.stationTimeList[0].sectionCode) {
|
||||
index += 1;
|
||||
}
|
||||
const newModel = {
|
||||
sectionCode:newstationTime.sectionCode,
|
||||
stationCode:newstationTime.stationCode,
|
||||
arriveTime: formatTime(newstationTime.arriveTime + 7200),
|
||||
departureTime: formatTime(newstationTime.departureTime + 7200),
|
||||
stopTime:newstationTime.departureTime - newstationTime.arriveTime
|
||||
};
|
||||
taskObj.arriveConfigList.push(newModel);
|
||||
});
|
||||
|
||||
if (trainInfo.endSectionCode != trainInfo.stationTimeList[lastIndex].sectionCode) {
|
||||
taskObj.endTbFront = false;
|
||||
taskObj.endTime = formatTime(trainInfo.endSecondTime + 7200);
|
||||
const newModel = {
|
||||
sectionCode:trainInfo.endSectionCode,
|
||||
stationCode:trainInfo.stationTimeList[lastIndex].stationCode,
|
||||
// // speedLevel:'默认',
|
||||
departureTime: formatTime(trainInfo.endSecondTime + 7200),
|
||||
arriveTime: formatTime(trainInfo.endSecondTime + 7200),
|
||||
stopTime:0
|
||||
};
|
||||
taskObj.arriveConfigList.push(newModel);
|
||||
} else {
|
||||
if (trainInfo.reentry) {
|
||||
taskObj.endTbFront = true;
|
||||
}
|
||||
}
|
||||
this.model.tripConfigList.push(taskObj);
|
||||
index++;
|
||||
if (index <= tripNumberList.length - 1) {
|
||||
this.getEachTripNumber(editData, tripNumberList, index);
|
||||
}
|
||||
},
|
||||
loadInitData(params) {
|
||||
this.isNew = params.isNew;
|
||||
@ -220,7 +213,6 @@ export default {
|
||||
});
|
||||
},
|
||||
handleEditTask() {
|
||||
// routingCode || this.currentRow.tripNumber
|
||||
if (this.currentRow.id) {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'modifyingTask', params: {
|
||||
|
@ -81,44 +81,6 @@
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 5px;">
|
||||
{{ $t('planMonitor.modifying.route') }}
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-table :data="routingList" border :height="140">
|
||||
<el-table-column prop="startStationCode" :label="$t('planMonitor.modifying.startingStation')">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.startStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="startSectionCode" :label="$t('planMonitor.modifying.startSection')">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.startSectionCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endStationCode" :label="$t('planMonitor.modifying.endStationTitle')">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.endStationCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endSectionCode" :label="$t('planMonitor.modifying.endSection')">
|
||||
<template slot-scope="scope">
|
||||
{{ formatName(scope.row.endSectionCode) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="routingType" label="交路类型">
|
||||
<template slot-scope="scope">
|
||||
{{ routingTypeMap[scope.row.routingType] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类别" width="240">
|
||||
<template slot-scope="scope">
|
||||
{{ `${frontMap[String(scope.row.startTbFront)]} - ${frontMap[String(scope.row.endTbFront)]}` }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remarks" width="auto" :label="this.$t('planMonitor.description')" />
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row style=" margin-bottom: 5px;margin-top: 10px;">
|
||||
{{ '经停转换轨 / 站台轨:' }}
|
||||
</el-row>
|
||||
@ -164,7 +126,7 @@
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { getRoutingBySDTNumber, updatePlanTrip, getMapStationRunUser, getStationStopTime } from '@/api/runplan';
|
||||
import { updatePlanTrip, getMapStationRunUser, getStationStopTime } from '@/api/runplan';
|
||||
import { getRunplanConfig } from '@/api/jmap/mapdraft';
|
||||
import { formatTime, formatName } from '@/jmapNew/theme/parser/util';
|
||||
|
||||
@ -190,12 +152,13 @@ export default {
|
||||
stopStationMap: {},
|
||||
stopTimeMap:{},
|
||||
defaultSpeedLevel: 'l1',
|
||||
routingList: [],
|
||||
tripNumber: '',
|
||||
serviceNumber: '',
|
||||
planId: '',
|
||||
startTbFront:undefined,
|
||||
endTbFront:undefined,
|
||||
editModel: {
|
||||
routingCode: '',
|
||||
// routingCode: '',
|
||||
endStationCode: '',
|
||||
startStationCode: '',
|
||||
startTime: '02:00:00',
|
||||
@ -203,9 +166,7 @@ export default {
|
||||
arriveConfigList: [],
|
||||
tripNumber: '',
|
||||
planId: '',
|
||||
serviceNumber: '',
|
||||
startTbFront: false,
|
||||
endTbFront: false
|
||||
serviceNumber: ''
|
||||
},
|
||||
tripNumberList: [{ value: '', label: this.$t('planMonitor.modifying.automatic') }],
|
||||
reentryData: {},
|
||||
@ -220,12 +181,6 @@ export default {
|
||||
OUTBOUND: '出库',
|
||||
INBOUND: '入库',
|
||||
LOOP: '环路'
|
||||
},
|
||||
frontMap: {
|
||||
'true': '折返轨(站前)',
|
||||
'false': '折返轨(站后)',
|
||||
'undefined': '转换轨',
|
||||
'null': '转换轨'
|
||||
}
|
||||
};
|
||||
},
|
||||
@ -257,8 +212,8 @@ export default {
|
||||
compuntedRunTime(list, index, runLevel) {
|
||||
let runTime = 0;
|
||||
|
||||
if ((index == 0 && String(this.editModel.startTbFront) == false) ||
|
||||
(index == list.length - 1 && String(this.editModel.endTbFront) == false)) {
|
||||
if ((index == 0 && String(this.startTbFront) == false) ||
|
||||
(index == list.length - 1 && String(this.endTbFront) == false)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -278,55 +233,55 @@ export default {
|
||||
return runTime;
|
||||
},
|
||||
computedDetailList(type = null) {
|
||||
if (this.editModel.routingCode) {
|
||||
let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000;
|
||||
const list = Object.assign([], this.editModel.arriveConfigList);
|
||||
const runLevel = this.defaultSpeedLevel || 'l1'; // 默认等级三
|
||||
// if (this.editModel.routingCode) {
|
||||
let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000;
|
||||
const list = Object.assign([], this.editModel.arriveConfigList);
|
||||
const runLevel = this.defaultSpeedLevel || 'l1'; // 默认等级三
|
||||
|
||||
list.forEach((elem, index) => {
|
||||
if (type == 'routingCode') {
|
||||
if (index == 0 || index == list.length - 1) {
|
||||
elem.stopTime = 0;
|
||||
} else if (this.stopTimeMap[elem.stationCode]) {
|
||||
elem.stopTime = this.stopTimeMap[elem.stationCode].parkingTime;
|
||||
} else {
|
||||
elem.stopTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
tempTime = tempTime || this.computedTimeByString('23:59:59') / 1000 + 1;
|
||||
elem.arriveTime = formatTime(tempTime);
|
||||
|
||||
if (index == list.length - 1 && String(this.editModel.endTbFront) == 'true') {
|
||||
const data = this.reentryData[list[index].stationCode] || {};
|
||||
elem.departureTime = formatTime(tempTime + elem.stopTime + data.tbFront || 0);
|
||||
list.forEach((elem, index) => {
|
||||
if (type == 'routingCode') {
|
||||
if (index == 0 || index == list.length - 1) {
|
||||
elem.stopTime = 0;
|
||||
} else if (this.stopTimeMap[elem.stationCode]) {
|
||||
elem.stopTime = this.stopTimeMap[elem.stationCode].parkingTime;
|
||||
} else {
|
||||
elem.departureTime = formatTime(tempTime + elem.stopTime);
|
||||
elem.stopTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
|
||||
const realRunlevel = this.compuntedRunTime(list, index, runLevel);
|
||||
tempTime = tempTime || this.computedTimeByString('23:59:59') / 1000 + 1;
|
||||
elem.arriveTime = formatTime(tempTime);
|
||||
|
||||
elem.speedLevelTime = realRunlevel;
|
||||
elem.speedLevel = runLevelObj.label;
|
||||
if (index == list.length - 1 && String(this.endTbFront) == 'true') {
|
||||
const data = this.reentryData[list[index].stationCode] || {};
|
||||
elem.departureTime = formatTime(tempTime + elem.stopTime + data.tbFront || 0);
|
||||
} else {
|
||||
elem.departureTime = formatTime(tempTime + elem.stopTime);
|
||||
}
|
||||
|
||||
let fronTime = 0;
|
||||
if (index == 0 && String(this.editModel.startTbFront) == 'false') {
|
||||
const data = this.reentryData[elem.stationCode] || {};
|
||||
fronTime = data.tbTo || 0;
|
||||
} else if (index == list.length - 2 && String(this.editModel.endTbFront) == 'false') {
|
||||
const data = this.reentryData[list[index + 1].stationCode] || {};
|
||||
fronTime = data.tbTo || 0;
|
||||
} else if (index == list.length - 1 && String(this.editModel.endTbFront) == 'true') {
|
||||
const data = this.reentryData[list[index].stationCode] || {};
|
||||
fronTime = data.tbFront || 0;
|
||||
}
|
||||
const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
|
||||
const realRunlevel = this.compuntedRunTime(list, index, runLevel);
|
||||
|
||||
tempTime = tempTime + fronTime + elem.stopTime + elem.speedLevelTime;
|
||||
});
|
||||
elem.speedLevelTime = realRunlevel;
|
||||
elem.speedLevel = runLevelObj.label;
|
||||
|
||||
this.editModel.endTime = formatTime(tempTime - list[list.length - 1].stopTime);
|
||||
}
|
||||
let fronTime = 0;
|
||||
if (index == 0 && String(this.startTbFront) == 'false') {
|
||||
const data = this.reentryData[elem.stationCode] || {};
|
||||
fronTime = data.tbTo || 0;
|
||||
} else if (index == list.length - 2 && String(this.endTbFront) == 'false') {
|
||||
const data = this.reentryData[list[index + 1].stationCode] || {};
|
||||
fronTime = data.tbTo || 0;
|
||||
} else if (index == list.length - 1 && String(this.endTbFront) == 'true') {
|
||||
const data = this.reentryData[list[index].stationCode] || {};
|
||||
fronTime = data.tbFront || 0;
|
||||
}
|
||||
|
||||
tempTime = tempTime + fronTime + elem.stopTime + elem.speedLevelTime;
|
||||
});
|
||||
|
||||
this.editModel.endTime = formatTime(tempTime - list[list.length - 1].stopTime);
|
||||
// }
|
||||
},
|
||||
loadInitData(params) {
|
||||
const lineCode = this.$route.query.lineCode;
|
||||
@ -364,7 +319,11 @@ export default {
|
||||
const paramData = params.rowData;
|
||||
this.initRunlevel(paramData);
|
||||
this.editModel.arriveConfigList = paramData.arriveConfigList;
|
||||
this.editModel.routingCode = paramData.routingCode;
|
||||
if (paramData.routingCode) {
|
||||
this.editModel.routingCode = paramData.routingCode;
|
||||
} else {
|
||||
this.editModel.tripNumber = this.tripNumber;
|
||||
}
|
||||
this.editModel.startStationCode = paramData.startStationCode;
|
||||
this.editModel.endStationCode = paramData.endStationCode;
|
||||
this.editModel.startTime = paramData.startTime;
|
||||
@ -372,111 +331,89 @@ export default {
|
||||
this.editModel.endSectionCode = paramData.endSectionCode;
|
||||
this.editModel.startSectionCode = paramData.startSectionCode;
|
||||
this.editModel.id = paramData.id;
|
||||
this.editModel.startTbFront = paramData.startTbFront;
|
||||
this.editModel.endTbFront = paramData.endTbFront;
|
||||
this.routingList = [];
|
||||
this.routingList.push({
|
||||
code:paramData.routingCode,
|
||||
startStationCode:paramData.startStationCode,
|
||||
endStationCode:paramData.endStationCode,
|
||||
endSectionCode:paramData.endSectionCode,
|
||||
startSectionCode:paramData.startSectionCode,
|
||||
startTbFront:paramData.startTbFront,
|
||||
endTbFront:paramData.endTbFront
|
||||
});
|
||||
this.startTbFront = paramData.startTbFront;
|
||||
this.endTbFront = paramData.endTbFront;
|
||||
this.computedDetailList();
|
||||
} else {
|
||||
const model = {
|
||||
planId: this.$route.query.planId || this.loadRunPlanId,
|
||||
SDTNumber: `${this.serviceNumber}${this.tripNumber}`
|
||||
};
|
||||
this.routingList = [];
|
||||
getRoutingBySDTNumber(model).then(resp => { // 根据车次号查询交路
|
||||
const editData = this.$store.state.runPlan.editData[this.serviceNumber];
|
||||
if (editData) {
|
||||
const trainInfo = editData.trainMap[this.tripNumber];
|
||||
const lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
|
||||
this.routingList.push({
|
||||
code:resp.data.code,
|
||||
startStationCode:resp.data.startStationCode,
|
||||
endStationCode:resp.data.endStationCode,
|
||||
endSectionCode:resp.data.endSectionCode,
|
||||
startSectionCode:resp.data.startSectionCode,
|
||||
startTbFront:resp.data.startTbFront,
|
||||
endTbFront:resp.data.endTbFront
|
||||
});
|
||||
|
||||
this.editModel = {
|
||||
tripNumber: this.tripNumber,
|
||||
startTime: formatTime(trainInfo.stationTimeList[0].secondTime + 7200),
|
||||
endTime: formatTime(trainInfo.stationTimeList[lastIndex].secondTime + 7200),
|
||||
routingCode : resp.data.id,
|
||||
arriveConfigList: [],
|
||||
startTbFront: resp.data.startTbFront,
|
||||
endTbFront: resp.data.endTbFront
|
||||
const editData = this.$store.state.runPlan.editData[this.serviceNumber];
|
||||
if (editData) {
|
||||
const trainInfo = editData.trainMap[this.tripNumber];
|
||||
const lastIndex = trainInfo.stationTimeList.length - 1;
|
||||
this.editModel = {
|
||||
tripNumber: this.tripNumber,
|
||||
startTime: formatTime(trainInfo.startSecondTime + 7200),
|
||||
endTime: formatTime(trainInfo.endSecondTime + 7200),
|
||||
arriveConfigList: [],
|
||||
startStationCode:trainInfo.stationTimeList[0].stationCode,
|
||||
endStationCode:trainInfo.stationTimeList[lastIndex].stationCode,
|
||||
startSectionCode:trainInfo.startSectionCode,
|
||||
endSectionCode:trainInfo.endSectionCode
|
||||
};
|
||||
if (trainInfo.startSectionCode != trainInfo.stationTimeList[0].sectionCode) {
|
||||
this.startTbFront = false;
|
||||
// this.editModel.startTime = formatTime(trainInfo.startSecondTime + 7200);
|
||||
const newModel = {
|
||||
sectionCode:trainInfo.startSectionCode,
|
||||
stationCode:trainInfo.stationTimeList[0].stationCode,
|
||||
// // speedLevel:'默认',
|
||||
departureTime: formatTime(trainInfo.startSecondTime + 7200),
|
||||
arriveTime: formatTime(trainInfo.startSecondTime + 7200),
|
||||
stopTime:0
|
||||
};
|
||||
|
||||
if (resp.data.startTbFront == false) {
|
||||
this.editModel.startTime = formatTime(trainInfo.startSecondTime + 7200);
|
||||
const newModel = {
|
||||
sectionCode:resp.data.parkSectionCodeList[0].sectionCode,
|
||||
stationCode:resp.data.startStationCode,
|
||||
// // speedLevel:'默认',
|
||||
departureTime: formatTime(trainInfo.startSecondTime + 7200),
|
||||
arriveTime: formatTime(trainInfo.startSecondTime + 7200),
|
||||
stopTime:0
|
||||
};
|
||||
this.editModel.arriveConfigList.push(newModel);
|
||||
}
|
||||
|
||||
const newstationTimeList = [];
|
||||
let current = {};
|
||||
|
||||
trainInfo.stationTimeList.forEach((stationTime, index)=>{
|
||||
if (index % 2 == 0) {
|
||||
current = {};
|
||||
current.stationCode = stationTime.stationCode;
|
||||
current.arriveTime = stationTime.secondTime;
|
||||
} else {
|
||||
current.departureTime = stationTime.secondTime;
|
||||
newstationTimeList.push(current);
|
||||
}
|
||||
});
|
||||
|
||||
newstationTimeList.forEach((newstationTime, index)=>{
|
||||
if (resp.data.startTbFront == false) {
|
||||
index += 1;
|
||||
}
|
||||
const newModel = {
|
||||
sectionCode:resp.data.parkSectionCodeList[index].sectionCode,
|
||||
stationCode:newstationTime.stationCode,
|
||||
arriveTime: formatTime(newstationTime.arriveTime + 7200),
|
||||
departureTime: formatTime(newstationTime.departureTime + 7200),
|
||||
stopTime:newstationTime.departureTime - newstationTime.arriveTime
|
||||
};
|
||||
this.editModel.arriveConfigList.push(newModel);
|
||||
});
|
||||
|
||||
if (resp.data.endTbFront == false) {
|
||||
this.editModel.endTime = formatTime(trainInfo.endSecondTime + 7200);
|
||||
const length = resp.data.parkSectionCodeList.length - 1;
|
||||
const newModel = {
|
||||
sectionCode:resp.data.parkSectionCodeList[length].sectionCode,
|
||||
stationCode:resp.data.endStationCode,
|
||||
// // speedLevel:'默认',
|
||||
departureTime: formatTime(trainInfo.endSecondTime + 7200),
|
||||
arriveTime: formatTime(trainInfo.endSecondTime + 7200),
|
||||
stopTime:0
|
||||
};
|
||||
this.editModel.arriveConfigList.push(newModel);
|
||||
}
|
||||
|
||||
this.initRunlevel(this.editModel);
|
||||
this.dialogShow = true;
|
||||
this.computedDetailList();
|
||||
this.editModel.arriveConfigList.push(newModel);
|
||||
}
|
||||
});
|
||||
|
||||
const newstationTimeList = [];
|
||||
let current = {};
|
||||
|
||||
trainInfo.stationTimeList.forEach((stationTime, index)=>{
|
||||
if (index % 2 == 0) {
|
||||
current = {};
|
||||
current.stationCode = stationTime.stationCode;
|
||||
current.sectionCode = stationTime.sectionCode;
|
||||
current.arriveTime = stationTime.secondTime;
|
||||
} else {
|
||||
current.departureTime = stationTime.secondTime;
|
||||
newstationTimeList.push(current);
|
||||
}
|
||||
});
|
||||
|
||||
newstationTimeList.forEach((newstationTime, index)=>{
|
||||
if (trainInfo.startSectionCode != trainInfo.stationTimeList[0].sectionCode) {
|
||||
index += 1;
|
||||
}
|
||||
const newModel = {
|
||||
sectionCode:newstationTime.sectionCode,
|
||||
stationCode:newstationTime.stationCode,
|
||||
arriveTime: formatTime(newstationTime.arriveTime + 7200),
|
||||
departureTime: formatTime(newstationTime.departureTime + 7200),
|
||||
stopTime:newstationTime.departureTime - newstationTime.arriveTime
|
||||
};
|
||||
this.editModel.arriveConfigList.push(newModel);
|
||||
});
|
||||
|
||||
if (trainInfo.endSectionCode != trainInfo.stationTimeList[lastIndex].sectionCode) {
|
||||
this.endTbFront = false;
|
||||
this.editModel.endTime = formatTime(trainInfo.endSecondTime + 7200);
|
||||
const newModel = {
|
||||
sectionCode:trainInfo.endSectionCode,
|
||||
stationCode:trainInfo.stationTimeList[lastIndex].stationCode,
|
||||
// // speedLevel:'默认',
|
||||
departureTime: formatTime(trainInfo.endSecondTime + 7200),
|
||||
arriveTime: formatTime(trainInfo.endSecondTime + 7200),
|
||||
stopTime:0
|
||||
};
|
||||
this.editModel.arriveConfigList.push(newModel);
|
||||
} else {
|
||||
if (trainInfo.reentry) {
|
||||
this.endTbFront = true;
|
||||
}
|
||||
}
|
||||
|
||||
this.initRunlevel(this.editModel);
|
||||
this.dialogShow = true;
|
||||
this.computedDetailList();
|
||||
}
|
||||
}
|
||||
},
|
||||
initRunlevel(paramData) {
|
||||
@ -520,7 +457,7 @@ export default {
|
||||
buildModel() {
|
||||
return {
|
||||
planId: this.$route.query.planId || this.loadRunPlanId,
|
||||
routingCode: this.editModel.routingCode,
|
||||
// routingCode: this.editModel.routingCode,
|
||||
tripNumber: this.tripNumber,
|
||||
startTime:this.editModel.arriveConfigList[0].arriveTime,
|
||||
endTime: this.editModel.arriveConfigList[this.editModel.arriveConfigList.length - 1].departureTime,
|
||||
|
@ -12,15 +12,16 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('publish.questionNumbers')" prop="number">
|
||||
<el-input
|
||||
<el-input-number
|
||||
v-model="form.number"
|
||||
placeholder=""
|
||||
:precision="0"
|
||||
:min="0"
|
||||
style="width: calc(100% - 280px); float: left; margin-right: 10px;"
|
||||
/>
|
||||
<span style="width: 190px; float: left;">{{ $t('publish.allNumberTipOne') }} {{ topicNum }} {{ $t('publish.allNumberTipTwo') }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('publish.scorePerQuestion')" prop="mark">
|
||||
<el-input-number v-model="form.mark" :precision="0" style="width:200px" />
|
||||
<el-input-number v-model="form.mark" :precision="0" :min="0" style="width:200px" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -76,14 +77,9 @@ export default {
|
||||
var mark = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error(this.$t('publish.inputScorePerQuestion')));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (!Number(value)) {
|
||||
callback(new Error(this.$t('publish.inputNumericType')));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, 100);
|
||||
};
|
||||
return {
|
||||
title: this.$t('publish.addRules'),
|
||||
@ -115,9 +111,9 @@ export default {
|
||||
methods: {
|
||||
show(detail) {
|
||||
this.dialogShow = true;
|
||||
if (detail) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.resetFields();
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.resetFields();
|
||||
if (detail) {
|
||||
this.title = this.$t('publish.modifyRules');
|
||||
this.editOk = true;
|
||||
this.changeCourse(detail.trainingType);
|
||||
@ -128,38 +124,24 @@ export default {
|
||||
mark: detail.point
|
||||
};
|
||||
this.changeOperation(detail.operateType);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.title = this.$t('publish.addRules');
|
||||
}
|
||||
});
|
||||
},
|
||||
handleOk() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.editOk) {
|
||||
// 修改
|
||||
this.$emit('editRuleList', this.form);
|
||||
setTimeout(() => {
|
||||
this.handleCancel();
|
||||
}, 300);
|
||||
} else {
|
||||
// 新增
|
||||
this.$emit('addRuleList', this.form);
|
||||
setTimeout(() => {
|
||||
this.handleCancel();
|
||||
}, 300);
|
||||
}
|
||||
this.topicNum = 0;
|
||||
} else {
|
||||
this.dialogShow = true;
|
||||
return false;
|
||||
this.$emit( this.editOk ? 'editRuleList' : 'addRuleList', this.form);
|
||||
this.handleCancel();
|
||||
}
|
||||
});
|
||||
},
|
||||
handleCancel() {
|
||||
this.$refs['form'].resetFields();
|
||||
this.dialogShow = false;
|
||||
this.editOk = false;
|
||||
this.topicNum = 0;
|
||||
this.operationTypeList = [];
|
||||
this.dialogShow = false;
|
||||
},
|
||||
changeCourse(val) {
|
||||
this.operationTypeList = this.operationTypeMap[val];
|
||||
|
@ -18,10 +18,10 @@
|
||||
<el-input-number v-model="examData.duration" placeholder="请输入" style="float: left; width: calc(100% - 80px);" :disabled="isEdit" :min="1" />
|
||||
<span style="width:80px; display: block;float: left; text-align: center;"> {{ $t('publish.durationMinutes') }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="开放时间要求" prop="havaDate">
|
||||
<el-switch v-model="havaDate" />
|
||||
<el-form-item label="开放时间要求" prop="haveDate">
|
||||
<el-switch v-model="haveDate" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="havaDate" :label="$t('publish.testDate')">
|
||||
<el-form-item v-if="haveDate" :label="$t('publish.testDate')">
|
||||
<el-col :span="11">
|
||||
<el-form-item prop="startDate">
|
||||
<el-date-picker
|
||||
@ -109,7 +109,7 @@ export default {
|
||||
return time.getTime() < new Date(new Date().toLocaleDateString()).getTime();
|
||||
}
|
||||
},
|
||||
havaDate: false,
|
||||
haveDate: false,
|
||||
mapList: [],
|
||||
prdList: [{ label: 'ATS现地工作站', value: '01' }, { label: 'ATS行调工作站', value: '02' }],
|
||||
trial: '1',
|
||||
|
@ -90,12 +90,18 @@ export default {
|
||||
passMark: res.data.passingPoint
|
||||
};
|
||||
this.ruleList = res.data.examDefinitionRulesVOList;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.exam.haveDate = !!this.examData.startDate;
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
regulation() {
|
||||
this.display = 1;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.exam.haveDate = !!this.examData.startDate;
|
||||
});
|
||||
},
|
||||
async createQuickly() {
|
||||
const resp = await getExamLessonDetail(this.$route.params.ruleId);
|
||||
|
@ -24,8 +24,7 @@ export default {
|
||||
formModel: {
|
||||
name: '',
|
||||
id: '',
|
||||
code: '',
|
||||
projectCode: ''
|
||||
projectCodes: []
|
||||
},
|
||||
update: false
|
||||
};
|
||||
@ -36,8 +35,7 @@ export default {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'name', label: '名称', type: 'text' },
|
||||
{ prop: 'code', label: '单位编号', type: 'text', disabled: this.update },
|
||||
{ prop: 'projectCode', label: '关联项目', type: 'select', options: this.projectListNew}
|
||||
{ prop: 'projectCodes', label: '关联项目', type: 'select', multiple:true, options: this.projectListNew}
|
||||
]
|
||||
};
|
||||
return form;
|
||||
@ -48,10 +46,7 @@ export default {
|
||||
{ required: true, message: '请输入单位名称', trigger: 'blur' },
|
||||
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: '请输入单位编号', trigger: 'blur' }
|
||||
],
|
||||
projectCode: [
|
||||
projectCodes: [
|
||||
{ required: true, message: '请选择关联项目', trigger: 'change'}
|
||||
]
|
||||
};
|
||||
@ -64,16 +59,18 @@ export default {
|
||||
methods: {
|
||||
doShow(data) {
|
||||
this.dialogVisible = true;
|
||||
this.update = false;
|
||||
if (data) {
|
||||
this.update = true;
|
||||
this.formModel = {
|
||||
id: data.id,
|
||||
code: data.code,
|
||||
name: data.name,
|
||||
projectCode: data.projectCode
|
||||
};
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.dataform.resetForm();
|
||||
this.update = false;
|
||||
if (data) {
|
||||
this.update = true;
|
||||
this.formModel = {
|
||||
id: data.id,
|
||||
name: data.name,
|
||||
projectCodes: data.projectCodes
|
||||
};
|
||||
}
|
||||
});
|
||||
},
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
@ -81,10 +78,8 @@ export default {
|
||||
this.formModel = {
|
||||
name: '',
|
||||
id: '',
|
||||
code: '',
|
||||
projectCode: ''
|
||||
};
|
||||
this.$refs.dataform.resetFields();
|
||||
},
|
||||
doSave() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
|
@ -29,7 +29,7 @@ export default {
|
||||
queryObject: {
|
||||
}
|
||||
},
|
||||
projectMap: {},
|
||||
// projectMap: {},
|
||||
projectListNew: [],
|
||||
queryList: {
|
||||
query: getCompanyListPaging,
|
||||
@ -37,7 +37,7 @@ export default {
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '单位名称',
|
||||
title: '组织名称',
|
||||
prop: 'name'
|
||||
},
|
||||
// {
|
||||
@ -48,15 +48,11 @@ export default {
|
||||
// title: '单位地址',
|
||||
// prop: 'address'
|
||||
// },
|
||||
{
|
||||
title: '单位编号',
|
||||
prop: 'code'
|
||||
},
|
||||
{
|
||||
title: '关联项目',
|
||||
prop: 'projectCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.projectMap[row.projectCode]; },
|
||||
prop: 'projectCodes',
|
||||
type: 'tagMore',
|
||||
columnValue: (row) => { return this.$convertField(row.projectCodes, this.projectListNew, ['value', 'label'], true); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
// {
|
||||
@ -78,6 +74,10 @@ export default {
|
||||
{
|
||||
name: '生成二维码',
|
||||
handleClick: this.handleGenerateQrCode
|
||||
},
|
||||
{
|
||||
name: '组织结构',
|
||||
handleClick: this.handleOrgDetail
|
||||
}
|
||||
// {
|
||||
// name: '删除',
|
||||
@ -97,7 +97,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
ProjectList.forEach(elem => {
|
||||
this.projectMap[elem.value.toUpperCase()] = elem.label;
|
||||
// this.projectMap[elem.value.toUpperCase()] = elem.label;
|
||||
this.projectListNew.push({value: elem.value.toUpperCase(), label: elem.label});
|
||||
});
|
||||
},
|
||||
@ -122,6 +122,9 @@ export default {
|
||||
handlerBack() {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
handleOrgDetail(index, row) {
|
||||
this.$router.push({ path: `/system/companyManage/orgDetail`, query: { orgId: row.id } });
|
||||
},
|
||||
handleGenerateQrCode(index, row) {
|
||||
let state = 2;
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
|
170
src/views/system/companyManage/orgDetail.vue
Normal file
170
src/views/system/companyManage/orgDetail.vue
Normal file
@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-button type="text" style="position: fixed;right: 20px;top: 70px;" @click="back">返回</el-button>
|
||||
<el-card style="width: 80%;margin: 20px auto 10px;padding: 10px 10px 20px;">
|
||||
<div slot="header">
|
||||
<el-input
|
||||
v-model="filterText"
|
||||
size="small"
|
||||
style="width: 500px;"
|
||||
placeholder="输入关键字进行过滤"
|
||||
/>
|
||||
</div>
|
||||
<el-tree
|
||||
ref="tree"
|
||||
style="width: 500px;margin: 20px 10px 0;height: calc(100vh - 250px);overflow-y: scroll;"
|
||||
:data="treeData"
|
||||
:default-expanded-keys="defaultExpandedKeys"
|
||||
node-key="keyId"
|
||||
:props="defaultProps"
|
||||
:auto-expand-parent="false"
|
||||
:filter-node-method="filterNode"
|
||||
@node-expand="nodeExpand"
|
||||
@node-collapse="nodeCollapse"
|
||||
>
|
||||
<span slot-scope="{ node, data }" class="custom-tree-node">
|
||||
<span>
|
||||
<span>{{ node.data.name }}</span>
|
||||
<span style="font-size: 14px;margin-left: 10px;color: #B0B0B5;">{{ getRoleName(node.data.orgRole) }}</span>
|
||||
</span>
|
||||
<span v-if="node.data.type === 'USER'">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="() => remove(node,data)"
|
||||
>
|
||||
移出
|
||||
</el-button>
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getOrgTreeById, deleteDepartUserRelation } from '@/api/company';
|
||||
import localStore from 'storejs';
|
||||
export default {
|
||||
name: 'OrgDetail',
|
||||
data() {
|
||||
return {
|
||||
filterText: '',
|
||||
treeData: [],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'data'
|
||||
},
|
||||
expandedKeys: [],
|
||||
defaultExpandedKeys: []
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initData();
|
||||
},
|
||||
beforeDestroy() {
|
||||
localStore.set('orgDetail-treeKey-' + this.$route.query.orgId, this.expandedKeys);
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
getOrgTreeById(this.$route.query.orgId).then(resp => {
|
||||
this.treeData = [];
|
||||
this.treeData[0] = { ...(resp.data.data || {}), keyId: (resp.data.data || {}).id, type: resp.data.type, children: resp.data.children || [] };
|
||||
const temKey1 = (resp.data.data || {}).id;
|
||||
this.treeData[0].children.forEach( (item, index1) => {
|
||||
const tem1 = { ...(item.data || {}), keyId: temKey1 + item.type + (item.data.id || item.data.userId), type: item.type, children: item.children || [] };
|
||||
const temKey2 = temKey1 + item.type + (item.data.id || item.data.userId);
|
||||
this.treeData[0].children[index1] = tem1;
|
||||
tem1.children.forEach((elem, index2) => {
|
||||
const tem2 = { ...(elem.data || {}), keyId: temKey2 + elem.type + elem.data.userId, type: elem.type };
|
||||
this.treeData[0].children[index1].children[index2] = tem2;
|
||||
});
|
||||
});
|
||||
const defaultNode = localStore.get('orgDetail-treeKey-' + this.$route.query.orgId);
|
||||
if (defaultNode && defaultNode.length) {
|
||||
this.defaultExpandedKeys = [...defaultNode];
|
||||
this.expandedKeys = [...defaultNode];
|
||||
} else {
|
||||
this.defaultExpandedKeys = [temKey1];
|
||||
this.expandedKeys = [temKey1];
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$message.error('获取组织结构失败:' + error.message);
|
||||
});
|
||||
},
|
||||
getRoleName(role) {
|
||||
if (role === 'Teacher') {
|
||||
return '-- 教师';
|
||||
} else if (role === 'Admin') {
|
||||
return '-- 管理员';
|
||||
} else if (role === 'Student') {
|
||||
return '-- 学生';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
filterNode(value, data, node) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1 || this.checkParent(value, node);
|
||||
},
|
||||
checkParent(value, node) {
|
||||
if (node.parent) {
|
||||
return (node.parent.data && node.parent.data.name && node.parent.data.name.indexOf(value) !== -1) || this.checkParent(value, node.parent);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
nodeExpand(obj, node, ele) {
|
||||
this.expandedKeys.push(obj.keyId);
|
||||
},
|
||||
nodeCollapse(obj, node, ele) {
|
||||
const index = this.expandedKeys.indexOf(obj.keyId);
|
||||
if (index !== -1) {
|
||||
this.expandedKeys.splice(index, 1);
|
||||
}
|
||||
},
|
||||
back() {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
remove(node, data) {
|
||||
const _that = this;
|
||||
this.$confirm(`是否确认将${data.name}移出组织?`, this.$t('tip.hint'), {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteDepartUserRelation({ departmentId: node.parent.data.id, userId: data.userId, orgRole: data.orgRole }).then(response => {
|
||||
const parent = node.parent;
|
||||
const children = parent.data.children || parent.data;
|
||||
const index = children.findIndex(d => d.keyId === data.keyId);
|
||||
children.splice(index, 1);
|
||||
}).catch(() => {
|
||||
_that.$message.error('移出组织失败!');
|
||||
});
|
||||
}).catch(() => {
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/deep/.el-tree-node__label{
|
||||
font-size: 16px;
|
||||
}
|
||||
/deep/.el-tree-node__content{
|
||||
height: 30px;
|
||||
}
|
||||
.custom-tree-node{
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-right: 8px;
|
||||
}
|
||||
</style>
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="绑定单位管理员" :visible.sync="dialogVisible" width="30%" :before-close="doClose" center :close-on-click-modal="false">
|
||||
<el-dialog v-dialogDrag title="绑定组织管理员" :visible.sync="dialogVisible" width="30%" :before-close="doClose" center :close-on-click-modal="false">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doCreate">{{ $t('global.confirm') }}</el-button>
|
||||
@ -36,7 +36,7 @@ export default {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ prop: 'name', label: '名称', type: 'text', disabled:true, rightWidth:true },
|
||||
{ prop: 'companyId', label: '单位', type: 'select', options: this.companyList}
|
||||
{ prop: 'companyId', label: '组织', type: 'select', options: this.companyList}
|
||||
]
|
||||
};
|
||||
return form;
|
||||
@ -44,7 +44,7 @@ export default {
|
||||
rules() {
|
||||
const crules = {
|
||||
companyId: [
|
||||
{ required: true, message: '请选择单位', trigger: 'change' }
|
||||
{ required: true, message: '请选择组织', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
@ -55,6 +55,7 @@ export default {
|
||||
this.dialogVisible = true;
|
||||
this.formModel.name = row.name;
|
||||
this.formModel.userId = row.id;
|
||||
this.formModel.companyId = row.companyId;
|
||||
},
|
||||
doClose() {
|
||||
this.dialogVisible = false;
|
||||
@ -72,7 +73,7 @@ export default {
|
||||
this.doClose();
|
||||
this.$emit('create');
|
||||
}).catch((error) => {
|
||||
this.$message.error('绑定单位管理员失败: ' + error.message);
|
||||
this.$message.error('绑定组织管理员失败: ' + error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,25 @@ export default {
|
||||
config: {
|
||||
data: this.$ConstSelect.roleList
|
||||
}
|
||||
},
|
||||
nickname: {
|
||||
type: 'text',
|
||||
label: '昵称'
|
||||
},
|
||||
mobile: {
|
||||
type: 'text',
|
||||
label: '手机号'
|
||||
},
|
||||
email: {
|
||||
type: 'text',
|
||||
label: '邮箱'
|
||||
},
|
||||
companyId: {
|
||||
type: 'select',
|
||||
label: '组织',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +88,7 @@ export default {
|
||||
prop: 'email'
|
||||
},
|
||||
{
|
||||
title: '单位',
|
||||
title: '组织',
|
||||
prop: 'companyId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.getCompanyName(row.companyId); },
|
||||
@ -92,7 +111,7 @@ export default {
|
||||
handleClick: this.handleUserEdit
|
||||
},
|
||||
{
|
||||
name: '绑定单位管理员',
|
||||
name: '绑定组织管理员',
|
||||
handleClick: this.handleBind
|
||||
}
|
||||
]
|
||||
@ -100,7 +119,7 @@ export default {
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建本地用户', btnCode: 'employee_auto', handler: this.createLocalUsers },
|
||||
{ text: '单位管理', btnCode: 'company_manage', handler: this.companyManage }
|
||||
{ text: '组织管理', btnCode: 'company_manage', handler: this.companyManage }
|
||||
]
|
||||
},
|
||||
currentModel: {}
|
||||
@ -115,6 +134,7 @@ export default {
|
||||
this.companyMap[item.id] = item.name;
|
||||
this.companyList.push({label: item.name, value: parseInt(item.id)});
|
||||
});
|
||||
this.queryForm.queryObject.companyId.config.data = this.companyList;
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
|
@ -1,234 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="创建课程"
|
||||
:visible.sync="dialogVisible"
|
||||
width="1400px"
|
||||
:before-close="handleClose"
|
||||
:center="true"
|
||||
>
|
||||
<div class="joylink-card forms">
|
||||
<div style="height: 100%; padding-top: 40px; overflow-y: auto;">
|
||||
<el-form ref="form" :model="courseModel" :rules="rules" label-width="135px">
|
||||
<el-form-item :label="this.$t('lesson.courseName')+this.$t('global.colon')" prop="name">
|
||||
<el-input v-model="courseModel.name" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('lesson.mapName')+this.$t('global.colon')" prop="mapId">
|
||||
<el-select v-model="courseModel.mapId" :placeholder="$t('rules.pleaseSelect')" :disabled="true">
|
||||
<el-option
|
||||
v-for="(item,index) in mapIdList"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('lesson.prdType')+this.$t('global.colon')" prop="prdType">
|
||||
<el-select v-model="courseModel.prdType" :placeholder="$t('rules.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="(item,index) in prdTypeList"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('lesson.courseDescription')+this.$t('global.colon')" prop="remarks">
|
||||
<el-input
|
||||
v-model="courseModel.remarks"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 6, maxRows: 6}"
|
||||
:placeholder="this.$t('rules.pleaseEnterContent')"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="draft">
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="create">{{ $t('global.create') }}</el-button>
|
||||
<el-button type="primary" @click="handleClose">{{ $t('global.back') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createLesson } from '@/api/jmap/lessondraft';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
export default {
|
||||
name: 'CourseEdit',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
display: 1,
|
||||
mapIdList: [],
|
||||
courseModel: {
|
||||
id: '',
|
||||
prdType: '',
|
||||
product: [],
|
||||
mapId: '',
|
||||
name: '',
|
||||
remarks: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
prdTypeList() {
|
||||
const productTypeList = [
|
||||
{ enlabel: 'ATS local workstation', label: 'ATS现地工作站', value: '01'},
|
||||
{ enlabel: 'ATS Traffic dispatching workstation', label: 'ATS行调工作站', value: '02'}
|
||||
];
|
||||
return Cookies.get('user_lang') == 'en'
|
||||
? productTypeList.map(elem => { return { value: elem.value, label: elem.enlabel }; })
|
||||
: productTypeList.map(elem => { return { value: elem.value, label: elem.label }; });
|
||||
},
|
||||
rules() {
|
||||
const baseRules = {
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.enterCourseName'), trigger: 'change' }
|
||||
],
|
||||
mapId: [
|
||||
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
|
||||
],
|
||||
prdType: [
|
||||
{ required: true, message: this.$t('rules.productTypeInput'), trigger: 'change' }
|
||||
],
|
||||
remarks: [
|
||||
{ required: true, message: this.$t('rules.enterCourseDescription'), trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return baseRules;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
this.courseModel.id = '';
|
||||
this.$refs.form && this.$refs.form.resetFields();
|
||||
},
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
showContextMenu(e, obj, node, vueElem) {
|
||||
if (obj && obj.type === 'Lesson' || obj.type === 'Chapter') {
|
||||
e.preventDefault();
|
||||
this.point = {
|
||||
x: e.clientX,
|
||||
y: e.clientY
|
||||
};
|
||||
this.node = node;
|
||||
const menu = DeviceMenu.Lesson;
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||
}
|
||||
},
|
||||
clickEvent(obj, node, ele) {},
|
||||
doShow() {
|
||||
this.mapIdList = [];
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
this.dialogVisible = true;
|
||||
this.courseModel.mapId = this.$route.query.mapId;
|
||||
this.courseModel.prdType = this.$route.query.prdType;
|
||||
});
|
||||
},
|
||||
create() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
const model = {
|
||||
prdType: this.courseModel.prdType,
|
||||
name: this.courseModel.name,
|
||||
mapId: this.courseModel.mapId,
|
||||
remarks: this.courseModel.remarks
|
||||
};
|
||||
createLesson(model).then(response => {
|
||||
this.$emit('refresh');
|
||||
this.$message.success(this.$t('tip.createSuccess'));
|
||||
this.handleClose();
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.creatingFailed'));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.card-box {
|
||||
padding-top: 20px;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.forms {
|
||||
width: 800px;
|
||||
margin: 0 auto;
|
||||
margin-top: 10px;
|
||||
height: calc(100% - 150px);
|
||||
|
||||
/deep/ {
|
||||
.el-select {
|
||||
float: left;
|
||||
width: calc(600px);
|
||||
}
|
||||
|
||||
.el-textarea {
|
||||
float: left;
|
||||
width: calc(600px);
|
||||
}
|
||||
|
||||
.el-form-item__content>.el-input {
|
||||
float: left;
|
||||
width: calc(600px);
|
||||
}
|
||||
|
||||
.el-input-number {
|
||||
float: left;
|
||||
width: calc(250px);
|
||||
}
|
||||
}
|
||||
}
|
||||
.joylink-card{
|
||||
height: 500px;
|
||||
overflow-y: auto;
|
||||
|
||||
.title_box{
|
||||
height: 47px;
|
||||
line-height: 47px;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #EBEEF5;
|
||||
}
|
||||
.content_box{
|
||||
height: calc(100% - 57px);
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.tree_box{
|
||||
position: relative;
|
||||
left: 24px;
|
||||
top: 10px;
|
||||
width: 400px;
|
||||
height: 100%;
|
||||
.tree_content_box{
|
||||
border: 2px dashed #B0C4DE;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.draft {
|
||||
width: 300px;
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
}
|
||||
</style>
|
@ -1,524 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-loading="loading"
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
width="1400px"
|
||||
:before-close="handleClose"
|
||||
:center="true"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="joylink-card">
|
||||
<div class="title_box">
|
||||
<b>{{ $t('lesson.courseName') + ': '+ lessonName }}</b>
|
||||
</div>
|
||||
<div class="content_box">
|
||||
<div class="tree_box">
|
||||
<div class="tree_content_box">
|
||||
<p>{{ this.$t('lesson.courseTree') }}</p>
|
||||
<div style="height: calc(100% - 89px); overflow-y: auto;">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
style="width: 370px"
|
||||
:data="treeList"
|
||||
node-key="id"
|
||||
:props="defaultProps"
|
||||
default-expand-all
|
||||
highlight-current
|
||||
:span="22"
|
||||
:filter-node-method="filterNode"
|
||||
:default-expanded-keys="expandList"
|
||||
@node-contextmenu="showContextMenu"
|
||||
@node-click="clickEvent"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<div style="height: 100%; overflow-y: auto;">
|
||||
<el-form v-if="editType === 'editLesson'" ref="form" :model="courseModel" :rules="courseRules" label-width="135px">
|
||||
<el-form-item :label="this.$t('lesson.courseName')+this.$t('global.colon')" prop="name">
|
||||
<el-input v-model="courseModel.name" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('lesson.mapName')+this.$t('global.colon')" prop="mapId">
|
||||
<el-select v-model="courseModel.mapId" :placeholder="$t('rules.pleaseSelect')" :disabled="true">
|
||||
<el-option
|
||||
v-for="(item,index) in mapIdList"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('lesson.prdType')+this.$t('global.colon')" prop="prdType">
|
||||
<el-select v-model="courseModel.prdType" :placeholder="$t('rules.pleaseSelect')" :disabled="true">
|
||||
<el-option
|
||||
v-for="(item,index) in prdTypeList"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('lesson.courseDescription')+this.$t('global.colon')" prop="remarks">
|
||||
<el-input
|
||||
v-model="courseModel.remarks"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 6, maxRows: 6}"
|
||||
:placeholder="this.$t('rules.pleaseEnterContent')"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form v-if="editType === 'updateChapter' || editType === 'createChapter'" ref="formChapter" :model="chapterModel" :rules="chapterRules" label-width="135px">
|
||||
<el-form-item :label="this.$t('lesson.parentChapter')" prop="parentName">
|
||||
<el-input v-model="chapterModel.parentName" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('lesson.chapterName')" prop="name">
|
||||
<el-input v-model="chapterModel.name" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('lesson.chapterInstructions')" prop="remarks">
|
||||
<el-input
|
||||
v-model="chapterModel.remarks"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2, maxRows: 2}"
|
||||
:placeholder="this.$t('rules.pleaseEnterContent')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('lesson.associatedTraining')" prop="trainings">
|
||||
<el-table
|
||||
ref="singleTable"
|
||||
:data="chapterModel.trainings"
|
||||
border
|
||||
highlight-current-row
|
||||
:height="237"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column property="trainingName" :label="this.$t('lesson.trainingName')" />
|
||||
<el-table-column property="trial" :label="this.$t('global.isTry')" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="scope.row.trial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" :label="this.$t('global.operate')" width="70">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click.native.prevent="deleteRow(scope.$index, chapterModel.trainings)"
|
||||
>{{ $t('global.remove') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button type="primary" style="margin-top: 20px" @click="pushTrain">{{ $t('lesson.addTraining') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="draft">
|
||||
<el-button-group>
|
||||
<template v-if="editType === 'createChapter'">
|
||||
<el-button type="primary" @click="create">{{ $t('global.create') }}</el-button>
|
||||
<el-button type="primary" @click="handleClose">关 闭</el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button type="primary" @click="update">{{ $t('global.update') }}</el-button>
|
||||
<el-button type="primary" @click="handleClose">关 闭</el-button>
|
||||
</template>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<operate-menu ref="menu" :point="point" :node="node" @refresh="refresh" @changeRouter="changeRouter" />
|
||||
<train-list
|
||||
ref="pathRoute"
|
||||
:trainings="chapterModel.trainings"
|
||||
:detail="detail"
|
||||
:map-id-list="mapIdList"
|
||||
:line-code="lineCode"
|
||||
@routeSelected="routeSelected"
|
||||
/>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createLessonChapter, updateLessonChapter, updateLesson, getLessonDetail, getLessonChapterDetail } from '@/api/jmap/lessondraft';
|
||||
import { getLessonTree, deleteLessonChapter } from '@/api/jmap/lessondraft';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import OperateMenu from './operateMenu';
|
||||
import Cookies from 'js-cookie';
|
||||
import TrainList from './trainingList';
|
||||
|
||||
export default {
|
||||
name: 'CourseEdit',
|
||||
components: {
|
||||
OperateMenu,
|
||||
TrainList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
display: 1,
|
||||
mapIdList: [],
|
||||
lineCode: '',
|
||||
courseModel: {
|
||||
id: '',
|
||||
prdType: '',
|
||||
product: [],
|
||||
mapId: '',
|
||||
name: '',
|
||||
remarks: ''
|
||||
},
|
||||
chapterModel: {
|
||||
trainingId: '',
|
||||
lessonId: '',
|
||||
name: '',
|
||||
remarks: '',
|
||||
trainings: [],
|
||||
parentId: null,
|
||||
parentName: ''
|
||||
},
|
||||
treeList: [],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
detail: {
|
||||
mapId: '',
|
||||
prdType: ''
|
||||
},
|
||||
expandList: [],
|
||||
lessonName: '',
|
||||
lessonId: '',
|
||||
node: {},
|
||||
point: {},
|
||||
title: '编辑课程',
|
||||
editType: 'editLesson',
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
prdTypeList() {
|
||||
const productTypeList = [
|
||||
{ enlabel: 'ATS local workstation', label: 'ATS现地工作站', value: '01'},
|
||||
{ enlabel: 'ATS Traffic dispatching workstation', label: 'ATS行调工作站', value: '02'}
|
||||
];
|
||||
return Cookies.get('user_lang') == 'en'
|
||||
? productTypeList.map(elem => { return { value: elem.value, label: elem.enlabel }; })
|
||||
: productTypeList.map(elem => { return { value: elem.value, label: elem.label }; });
|
||||
},
|
||||
courseRules() {
|
||||
const baseRules = {
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.enterCourseName'), trigger: 'change' }
|
||||
],
|
||||
mapId: [
|
||||
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
|
||||
],
|
||||
prdType: [
|
||||
{ required: true, message: this.$t('rules.productTypeInput'), trigger: 'change' }
|
||||
],
|
||||
remarks: [
|
||||
{ required: true, message: this.$t('rules.enterCourseDescription'), trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return baseRules;
|
||||
},
|
||||
chapterRules() {
|
||||
const baseRules = {
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.enterChapterName'), trigger: 'change' }
|
||||
],
|
||||
remarks: [
|
||||
{ required: true, message: this.$t('rules.enterChapterInstructions'), trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return baseRules;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.mapIdList = [];
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
this.mapIdList && this.mapIdList.forEach(item =>{
|
||||
if (item.id === this.$route.query.mapId) {
|
||||
this.lineCode = item.lineCode;
|
||||
}
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$message.error('获取发布地图信息失败!');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
this.courseModel.id = '';
|
||||
this.$refs.form && this.$refs.form.resetFields();
|
||||
this.$refs.formChapter && this.$refs.formChapter.resetFields();
|
||||
this.$emit('refresh');
|
||||
},
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
showContextMenu(e, obj, node) {
|
||||
if (obj && obj.type === 'Lesson' || obj.type === 'Chapter') {
|
||||
e.preventDefault();
|
||||
this.point = {
|
||||
x: e.clientX,
|
||||
y: e.clientY
|
||||
};
|
||||
this.node = node;
|
||||
const menu = DeviceMenu.Lesson;
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||
}
|
||||
},
|
||||
clickEvent(obj, node, ele) {},
|
||||
doShow(data) {
|
||||
this.editType = 'editLesson';
|
||||
getLessonTree(data.id).then(resp => {
|
||||
if (resp.data && resp.data[0]) {
|
||||
this.lessonName = resp.data[0].name;
|
||||
this.lessonId = resp.data[0].id;
|
||||
this.treeList = resp.data;
|
||||
this.dialogVisible = true;
|
||||
this.courseModel.mapId = this.$route.query.mapId;
|
||||
this.courseModel.prdType = this.$route.query.prdType;
|
||||
this.courseModel.id = data.id;
|
||||
this.courseModel.name = data.name;
|
||||
this.courseModel.remarks = data.remarks;
|
||||
}
|
||||
});
|
||||
},
|
||||
create() {
|
||||
this.$refs.formChapter.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
createLessonChapter(this.chapterModel).then(response => {
|
||||
this.refresh();
|
||||
this.$message.success(this.$t('tip.createSuccess'));
|
||||
this.loading = false;
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('error.refreshFailed'));
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
update() {
|
||||
if (this.editType === 'editLesson') {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
updateLesson(this.courseModel).then(response => {
|
||||
this.refresh();
|
||||
this.$message.success(this.$t('tip.updateSuccessfully'));
|
||||
this.loading = false;
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.updateFailed'));
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$refs.formChapter.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
updateLessonChapter(this.chapterModel).then(response => {
|
||||
this.refresh();
|
||||
this.$message.success(this.$t('tip.updateSuccessfully'));
|
||||
this.loading = false;
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.refreshFailed'));
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
refresh() {
|
||||
this.editType = 'editLesson';
|
||||
getLessonDetail({id: this.lessonId}).then(response => {
|
||||
const data = response.data;
|
||||
this.courseModel = {
|
||||
id: data.id,
|
||||
mapId: this.$route.query.mapId,
|
||||
prdType: data.prdType,
|
||||
name: data.name,
|
||||
remarks: data.remarks
|
||||
};
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.obtainCourseInformationFailed'));
|
||||
});
|
||||
getLessonTree(this.lessonId).then(resp => {
|
||||
if (resp.data && resp.data[0]) {
|
||||
this.lessonName = resp.data[0].name;
|
||||
this.lessonId = resp.data[0].id;
|
||||
this.treeList = resp.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteChapter(node) {
|
||||
const _that = this;
|
||||
this.$confirm('是否确认删除章节《' + node.data.name + '》 ' + ' ?', this.$t('tip.hint'), {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteLessonChapter(node.data.id).then(response => {
|
||||
_that.refresh();
|
||||
_that.$message.success(this.$t('map.successfullyDelete'));
|
||||
}).catch(error => {
|
||||
_that.$message.error(this.$t('map.failDelete') + error.message);
|
||||
});
|
||||
}).catch(() => {});
|
||||
},
|
||||
pushTrain() {
|
||||
if (this.$refs && this.$refs.pathRoute) {
|
||||
this.$refs.pathRoute.doShow();
|
||||
}
|
||||
},
|
||||
routeSelected(data) {
|
||||
data.forEach((elem, index) => {
|
||||
this.chapterModel.trainings.push({trainingName: elem.name, trial: false, trainingId: elem.id});
|
||||
});
|
||||
},
|
||||
getChapter(data, isEdit) {
|
||||
getLessonChapterDetail(data).then(response => {
|
||||
this.setChapterModel(response.data, isEdit);
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.obtainChapterDataFailed'));
|
||||
});
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
rows.splice(index, 1);
|
||||
},
|
||||
setChapterModel(data, isEdit) {
|
||||
if (!isEdit) {
|
||||
this.chapterModel.lessonId = this.lessonId;
|
||||
this.chapterModel.trainings = [];
|
||||
this.chapterModel.lessonName = this.lessonName;
|
||||
this.chapterModel.name = '';
|
||||
this.chapterModel.remarks = '';
|
||||
this.chapterModel.trainingId = '';
|
||||
this.chapterModel.parentName = data.type === 'Lesson' ? '' : data.name;
|
||||
this.chapterModel.parentId = data.type === 'Lesson' ? '' : data.id;
|
||||
} else {
|
||||
this.chapterModel = data;
|
||||
this.chapterModel.lessonName = this.lessonName;
|
||||
this.chapterModel.lessonId = this.lessonId;
|
||||
}
|
||||
},
|
||||
changeRouter(params) {
|
||||
switch (params.event) {
|
||||
case '01':
|
||||
this.editType = 'editLesson';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.clearValidate();
|
||||
});
|
||||
break;
|
||||
case '02':
|
||||
this.editType = 'createChapter';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.formChapter.resetFields();
|
||||
this.setChapterModel(params.node.data, false);
|
||||
});
|
||||
break;
|
||||
case '03':
|
||||
this.editType = 'updateChapter';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.formChapter.clearValidate();
|
||||
this.getChapter(params.node.data, true);
|
||||
});
|
||||
break;
|
||||
case '04':
|
||||
this.editType = 'createChapter';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.formChapter.resetFields();
|
||||
this.getChapter(params.node.data, false);
|
||||
});
|
||||
break;
|
||||
case '05':
|
||||
this.deleteChapter(params.node);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.card-box {
|
||||
padding-top: 20px;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.forms {
|
||||
width: 800px;
|
||||
margin: 0 auto;
|
||||
margin-top: 10px;
|
||||
height: calc(100% - 150px);
|
||||
|
||||
/deep/ {
|
||||
.el-select {
|
||||
float: left;
|
||||
width: calc(600px);
|
||||
}
|
||||
|
||||
.el-textarea {
|
||||
float: left;
|
||||
width: calc(600px);
|
||||
}
|
||||
|
||||
.el-form-item__content>.el-input {
|
||||
float: left;
|
||||
width: calc(600px);
|
||||
}
|
||||
|
||||
.el-input-number {
|
||||
float: left;
|
||||
width: calc(250px);
|
||||
}
|
||||
}
|
||||
}
|
||||
.joylink-card{
|
||||
height: 500px;
|
||||
overflow-y: auto;
|
||||
|
||||
.title_box{
|
||||
height: 47px;
|
||||
line-height: 47px;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #EBEEF5;
|
||||
}
|
||||
.content_box{
|
||||
height: calc(100% - 57px);
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.tree_box{
|
||||
position: relative;
|
||||
left: 24px;
|
||||
top: 10px;
|
||||
width: 400px;
|
||||
height: 100%;
|
||||
.tree_content_box{
|
||||
border: 2px dashed #B0C4DE;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.draft {
|
||||
width: 300px;
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
}
|
||||
</style>
|
@ -1,258 +0,0 @@
|
||||
<template>
|
||||
<div class="joylink-card">
|
||||
<div class="lesson-header">
|
||||
<div class="lesson-list">草稿{{ $t('lesson.courseList') }}</div>
|
||||
<div class="but-group">
|
||||
<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>
|
||||
<el-button size="mini" type="primary" @click="back">返回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<QueryListPage ref="queryListPage" :card-padding="50" :query-form="queryForm" :pager-config="pagerConfig" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;" />
|
||||
<publish-create ref="publishCreate" @refresh="refresh" />
|
||||
<publish-lesson ref="publishLesson" @refresh="refresh" />
|
||||
<lesson-detail ref="lessonDetail" />
|
||||
<draft-create ref="draftCreate" @refresh="refresh" />
|
||||
<draft-detail ref="draftDetail" @refresh="refresh" />
|
||||
<sort-tree ref="sortTree" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { releaseOrCancel } from '@/api/designPlatform';
|
||||
import { getLessonDrftList } from '@/api/jmap/lessondraft';
|
||||
import PublishCreate from '@/views/lesson/lessoncategory/edit/create/index';
|
||||
import draftCreate from './create';
|
||||
import sortTree from './sorttree';
|
||||
import PublishLesson from '@/views/lesson/lessoncategory/edit/lesson/publish';
|
||||
import { delLesson } from '@/api/jmap/lessondraft';
|
||||
import LessonDetail from '@/views/approval/detail';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import draftDetail from './draftDetail';
|
||||
|
||||
export default {
|
||||
name: 'LessonHome',
|
||||
components: {
|
||||
PublishCreate,
|
||||
PublishLesson,
|
||||
LessonDetail,
|
||||
draftCreate,
|
||||
sortTree,
|
||||
draftDetail
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
show: false
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('lesson.courseName'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('lesson.courseDescription'),
|
||||
prop: 'remarks'
|
||||
},
|
||||
{
|
||||
title: this.$t('global.status'),
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.status, ConstConfig.ConstSelect.releaseReview, ['value', 'label']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '400',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('lesson.courseDetails'),
|
||||
handleClick: this.goDetail,
|
||||
type: 'primary',
|
||||
showControl: (row) => {
|
||||
return row.status !== '1';
|
||||
}
|
||||
},
|
||||
{
|
||||
name: this.$t('lesson.contentSorting'),
|
||||
handleClick: this.treeSort,
|
||||
type: 'primary',
|
||||
showControl: (row) => {
|
||||
return row.status !== '1';
|
||||
}
|
||||
},
|
||||
{
|
||||
name: this.$t('global.release'),
|
||||
handleClick: this.publish,
|
||||
type: 'primary',
|
||||
showControl: (row) => {
|
||||
return row.status === '0' && this.hasRelease;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: this.$t('lesson.applicationForRelease'),
|
||||
handleClick: this.publish,
|
||||
type: 'primary',
|
||||
showControl: (row) => {
|
||||
return row.status === '0' && !this.hasRelease;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: this.$t('lesson.review'),
|
||||
handleClick: this.review,
|
||||
type: 'primary',
|
||||
showControl: (row) => {
|
||||
return row.status === '1';
|
||||
}
|
||||
},
|
||||
{
|
||||
name: this.$t('global.delete'),
|
||||
handleClick: this.deleteLesson,
|
||||
type: 'danger',
|
||||
showControl: (row) => {
|
||||
return row.status !== '1';
|
||||
}
|
||||
},
|
||||
{
|
||||
name: this.$t('lesson.withdraw'),
|
||||
handleClick: this.revertLesson,
|
||||
type: 'danger',
|
||||
showControl: (row) => {
|
||||
return row.status === '1';
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
mapId() {
|
||||
return this.$route.query.mapId;
|
||||
},
|
||||
isAdmin() {
|
||||
return this.$store.state.user.roles.includes('04') || this.$store.state.user.roles.includes('05');
|
||||
},
|
||||
hasRelease() {
|
||||
return this.$store.state.user.roles.includes('04') ||
|
||||
this.$store.state.user.roles.includes('05') || this.$store.state.user.roles.includes('03');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
this.refresh();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
queryFunction(params) {
|
||||
return getLessonDrftList(this.mapId, params);
|
||||
},
|
||||
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.$refs.queryListPage.refresh(true);
|
||||
},
|
||||
lessonCreate() {
|
||||
this.$refs.draftCreate.doShow();
|
||||
},
|
||||
lessonCreateByPublish() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.publishCreate.doShow();
|
||||
});
|
||||
},
|
||||
publish(index, row) {
|
||||
row.mapId = this.mapId;
|
||||
row.cityCode = this.$route.query.cityCode;
|
||||
this.$refs.publishLesson.doShow(row);
|
||||
},
|
||||
deleteLesson(index, row) {
|
||||
delLesson(row).then(response => {
|
||||
this.$message.success(this.$t('tip.successfullyDelete'));
|
||||
this.loading = true;
|
||||
this.refresh();
|
||||
this.loading = false;
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.failDelete'));
|
||||
});
|
||||
},
|
||||
treeSort(index, row) {
|
||||
this.$refs.sortTree.doShow(row);
|
||||
},
|
||||
revertLesson(index, 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.refresh();
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('tip.cancellationOfCoursePublicationApplicationFailed'));
|
||||
this.refresh();
|
||||
});
|
||||
});
|
||||
},
|
||||
review(index, row) {
|
||||
this.$refs.lessonDetail.show(row.id);
|
||||
},
|
||||
goDetail(index, row) {
|
||||
this.$refs.draftDetail.doShow(row);
|
||||
},
|
||||
back() {
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.joylink-card{
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
.lesson-header{
|
||||
display:inline-block;margin-top:40px;width: 90%;margin-left:5%;
|
||||
}
|
||||
.lesson-list{
|
||||
display:inline-block;padding:7px 0px
|
||||
}
|
||||
.but-group{
|
||||
float: right;
|
||||
margin-right:20px;
|
||||
}
|
||||
</style>
|
@ -4,7 +4,6 @@
|
||||
<div slot="header" class="lessonHeader">
|
||||
{{ $t('global.lessonSystem') }}
|
||||
</div>
|
||||
<el-button v-if="isAdmin && project !== 'cgy'" size="mini" type="primary" style="position: absolute;right: 10px;top: 10px;" @click="draftLessonManage">草稿课程管理</el-button>
|
||||
</el-card>
|
||||
<el-card v-loading="loading">
|
||||
<el-row style="padding: 10px;display: flex;align-items: center;justify-content: flex-end;">
|
||||
@ -137,10 +136,6 @@ export default {
|
||||
this.$messageBox(this.$t('error.updateFailed'));
|
||||
});
|
||||
},
|
||||
draftLessonManage() {
|
||||
const query = {mapId: this.mapId, prdType: this.prdType, cityCode: this.cityCode};
|
||||
this.$router.push({ path: `/trainingPlatform/draftTeach/${this.$route.params.subSystem}`, query: query });
|
||||
},
|
||||
changeInput(val) {
|
||||
localStore.set(this.$route.path, val);
|
||||
},
|
||||
|
@ -1,130 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
|
||||
export default {
|
||||
name: 'TrainingOperateMenu',
|
||||
components: {
|
||||
PopMenu
|
||||
},
|
||||
props: {
|
||||
point: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
node: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menuShow: false,
|
||||
menu: [],
|
||||
menuChapte: [
|
||||
{
|
||||
label: this.$t('lesson.updateChapter'),
|
||||
handler: this.updateChapter
|
||||
},
|
||||
{
|
||||
label: this.$t('lesson.createChapter'),
|
||||
handler: this.createChapterInChapter
|
||||
},
|
||||
{
|
||||
label: '删除章节',
|
||||
handler: this.deleteChapter
|
||||
}
|
||||
],
|
||||
menuLesson: [
|
||||
{
|
||||
label: this.$t('lesson.editCourse'),
|
||||
handler: this.editLesson
|
||||
},
|
||||
{
|
||||
label: this.$t('lesson.createChapter'),
|
||||
handler: this.createChapter
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
node: function (val, old) {
|
||||
if (val && val.data) {
|
||||
switch (val.data.type) {
|
||||
case 'Lesson':
|
||||
this.menu = this.menuLesson;
|
||||
break;
|
||||
case 'Chapter':
|
||||
this.menu = this.menuChapte;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Lesson)) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.closeEvent();
|
||||
},
|
||||
methods: {
|
||||
closeEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
doShow(point) {
|
||||
this.closeEvent();
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
this.menuShow = true;
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
this.menuShow = false;
|
||||
},
|
||||
updateChapter() {
|
||||
this.$emit('changeRouter', {event: '03', node: this.node});
|
||||
},
|
||||
deleteChapter() {
|
||||
this.$emit('changeRouter', {event: '05', node: this.node});
|
||||
},
|
||||
createChapter() {
|
||||
this.$emit('changeRouter', {event: '02', node: this.node});
|
||||
},
|
||||
editLesson() {
|
||||
this.$emit('changeRouter', {event: '01', node: this.node});
|
||||
},
|
||||
createChapterInChapter() {
|
||||
this.$emit('changeRouter', {event: '04', node: this.node});
|
||||
},
|
||||
refresh(filterSelect) {
|
||||
this.$emit('refresh', filterSelect);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
/deep/ {
|
||||
.menu-item{
|
||||
background: #f1ecec;
|
||||
.pop-menu {
|
||||
background: #5F9EA0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,143 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="实训排序"
|
||||
:visible.sync="dialogVisible"
|
||||
width="1000px"
|
||||
:before-close="handleClose"
|
||||
:center="true"
|
||||
>
|
||||
<el-card class="forms">
|
||||
<div style="height:100%;overflow-y:auto">
|
||||
<el-tree
|
||||
ref="lessonTree"
|
||||
:data="treeData"
|
||||
:props="defaultProps"
|
||||
draggable
|
||||
:allow-drop="allowDrop"
|
||||
default-expand-all
|
||||
:allow-drag="allowDrag"
|
||||
expand-on-click-node
|
||||
highlight-current
|
||||
style="margin:20px; min-height:300px;"
|
||||
@node-drag-end="handleDragEnd"
|
||||
>
|
||||
<span slot-scope="{ node }">
|
||||
<el-tooltip class="item" effect="dark" :content="node.label" placement="top" :open-delay="1000">
|
||||
<span v-if="node.data.type === 'lesson'" class="el-icon-tickets">{{ node.label }}</span>
|
||||
<span v-if="node.data.type === 'chapter'" class="el-icon-document">{{ node.label }}
|
||||
</span>
|
||||
<span v-else> {{ node.label }}</span>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getLessonTree, dragSortLessonChapter } from '@/api/jmap/lessondraft';
|
||||
|
||||
export default {
|
||||
name: 'SortTree',
|
||||
data() {
|
||||
return {
|
||||
display: 1,
|
||||
dialogVisible: false,
|
||||
treeData: [],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
doShow(data) {
|
||||
this.dialogVisible = true;
|
||||
getLessonTree(data.id).then(response => {
|
||||
this.treeData = response.data;
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.refreshFailed'));
|
||||
});
|
||||
},
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
allowDrop(draggingNode, dropNode, type) {
|
||||
if (draggingNode && draggingNode.data.type === 'Chapter') {
|
||||
return dropNode && (dropNode.data.type === 'Chapter');
|
||||
} else if (draggingNode && draggingNode.data.type === 'Training') {
|
||||
return dropNode && (dropNode.data.type === 'Training' && type !== 'inner' && draggingNode.parent == dropNode.parent );
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
allowDrag(draggingNode) {
|
||||
return draggingNode && (draggingNode.data.type === 'Chapter' || draggingNode.data.type === 'Training');
|
||||
},
|
||||
getLeesonId(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 lessonId = this.getLeesonId(dropNode);
|
||||
const model = {
|
||||
location: dropType,
|
||||
sourceId: draggingNode.data.id,
|
||||
sourceType: draggingNode.data.type,
|
||||
targetId: dropNode.data.id,
|
||||
targetType: dropNode.data.type,
|
||||
lessonId: lessonId,
|
||||
chapterId: dropNode.parent.data.id
|
||||
};
|
||||
dragSortLessonChapter(model).then(response => {
|
||||
this.$emit('refresh');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.el-tree-node.is-current>.el-tree-node__content {
|
||||
background-color: #e4e3e3 !important;
|
||||
}
|
||||
|
||||
.card-box {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.steps {
|
||||
width: 980px;
|
||||
margin: 0 auto;
|
||||
height: 100%;
|
||||
|
||||
/deep/ {
|
||||
.el-step__icon.is-icon {
|
||||
width: 95px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .el-card__body{
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.forms {
|
||||
width: 800px;
|
||||
margin: 0 auto;
|
||||
margin-top: 10px;
|
||||
height: calc(100% - 150px);
|
||||
}
|
||||
.draft {
|
||||
width: 300px;
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user