This commit is contained in:
joylink_cuiweidong 2021-01-11 15:40:15 +08:00
commit e1af8e878e
51 changed files with 892 additions and 1157 deletions

View File

@ -74,9 +74,9 @@ export function getPublishLessonListByMapId(params) {
});
}
/** 根据班级获取课程 */
export function getLessonByClassId(classId) {
export function getLessonByClassId(departId) {
return request({
url: `/api/lesson/class/${classId}`,
url: `/api/lesson/depart/${departId}`,
method: 'get'
});
}
@ -95,10 +95,10 @@ export function aKeyGeneratingLesson(data) {
data: data
});
}
/** 根据课程ID获取班级 */
/** 根据课程ID获取部门 */
export function getExamClassList(lessonId) {
return request({
url: `/api/lesson/${lessonId}/classes`,
url: `/api/lesson/${lessonId}/departs`,
method: 'get'
});
}

View File

@ -163,11 +163,11 @@ export function getProjectClassList(projectCode) {
}
// 导出学生成绩
export function exportStudentResults(projectCode, data) {
export function exportStudentResults(data) {
return request({
url: `/api/user/project/${projectCode}/export/student`,
url: `/api/user/scores`,
method: 'put',
data: data
data
});
}

View File

@ -9,13 +9,14 @@ import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
import { dataManager } from '@/jlmap3d/jl3dtrafficplan/sandbox/datamanager';
import StompClient from '@/utils/sock';
import store from '@/store/index';
// import { Loading } from 'element-ui';
import {Stats} from '@/jlmap3d/main/lib/stats.min.js';
export function Jl3dSandBoxTest(dom,skinCode,routegroup,token) {
export function Jl3dSandBoxTest(dom,textUi,skinCode,routegroup,token) {
let scope = this;
textUi.updataData("sss");
var camera, scene, renderer,controls, light;
camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 0.001, 50000 );
@ -43,9 +44,10 @@ export function Jl3dSandBoxTest(dom,skinCode,routegroup,token) {
let manager = new dataManager(scene);
let manager = new dataManager(scene,camera,routegroup);
manager.init(skinCode);
animate();
//循环渲染函数
function animate() {

View File

@ -7,23 +7,102 @@ import { sectionModel } from '@/jlmap3d/jl3dtrafficplan/sandbox/sectionmodel';
import { signalModel } from '@/jlmap3d/jl3dtrafficplan/sandbox/signalmodel';
import { stationModel } from '@/jlmap3d/jl3dtrafficplan/sandbox/stationmodel';
import { trainModel } from '@/jlmap3d/jl3dtrafficplan/sandbox/trainmodel';
import { ModelManager } from '@/jlmap3d/jl3dtrafficplan/sandbox/loader';
export function dataManager(scene) {
import {Materialload} from '@/jlmap3d/main/loaders/Materialload.js';
//数据整合
import { sandBoxConnect } from '@/jlmap3d/jl3dtrafficplan/sandbox/sandboxconnect';
import { textUi } from '@/jlmap3d/jl3dtrafficplan/sandbox/textUi';
export function dataManager(scene,camera,routegroup) {
let scope = this;
let section = new sectionModel();
let signal = new signalModel();
let station = new stationModel();
let train = new trainModel();
let section = new sectionModel(scene);
let signal = new signalModel(scene);
let station = new THREE.Group();
scene.add( station );
let train = new trainModel(scene);
this.topCurve = "";
this.downCurve = "";
console.log(routegroup);
this.nowConnect = '';
var detaildiv = document.createElement("div");
detaildiv.style.width = "128px";
detaildiv.id = "detail";
detaildiv.style.backgroundColor = "#ccc"
detaildiv.style.height = "256px";
detaildiv.style.border = "1px solid #f00";
detaildiv.style.position = "absolute";
detaildiv.style.top = "0px";
detaildiv.style.zIndex = 10;
detaildiv.style.display = "none";
document.body.appendChild(detaildiv);
let text = new textUi(scene);
text.init();
let modelmanager = new ModelManager();
Materialload(scope);
this.init = function(skinCode){
loadGeoJson().then(function(data){
//console.log(data);
modelmanager.loadpromise().then(function (data) {
console.log(data);
return loadGeoJson();
}).then(function(data){
console.log(data);
return loadMapData(skinCode);
}).then(function(data){
scope.nowConnect = new sandBoxConnect(scope,routegroup,section,signal,station,train);
document.addEventListener( 'mousemove', onDocumentMouseMove, false );
raycasterList.push(station);
raycasterList.push(train.trainGroup);
});
}
let raycaster = new THREE.Raycaster();
let mouse = new THREE.Vector2();
let line,intersects,intersect;
let raycasterList = [];
function onDocumentMouseMove( event ) {
event.preventDefault();
mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;
mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
raycaster.setFromCamera( mouse, camera );
for(let i=0;i<raycasterList.length;i++){
intersects = raycaster.intersectObjects( raycasterList[i].children );
if(intersects.length>0){
i = raycasterList.length;
}
}
// console.log(intersects);
if ( intersects.length > 0 ) {
intersect = intersects[ 0 ];
console.log(intersect.object.position);
console.log(text.textplane.position);
console.log(intersect.object.name);
console.log(intersect.object.groupNumber);
detaildiv.style.display = "";
detaildiv.style.left = event.clientX-64 + "px";
detaildiv.style.top = event.clientY-270 + "px";
} else {
detaildiv.style.display = "none";
}
}
function loadMapData(skinCode){
return new Promise(function(resolve, reject){
@ -35,7 +114,9 @@ export function dataManager(scene) {
getPublishMapDetail(skinCode).then(netdata => {
console.log(netdata);
section.init(netdata.sectionList,netdata.switchList);
section.init(netdata.data.sectionList,netdata.data.switchList,stationData);
signal.init(netdata.data.signalList,section.topData,section.downData,scope.topCurve,scope.downCurve,modelmanager.signal);
train.init(netdata.data.trainList);
resolve("loadMap");
});
});
@ -61,36 +142,41 @@ export function dataManager(scene) {
let stationListData = null;
let originX = 0;
let originY = 0;
let double = 1000;
let double = 10000;
//['成功了', 'success']
readTextFile(JL3D_LOCAL_STATIC+"/trafficplan/fuzhou1.json", function(text){
var data = JSON.parse(text);
console.log(data.data.busline_list[0]);
// console.log(data.data.busline_list[0]);
stationListData = data.data.busline_list[0];
let posx = stationListData.xs.split(",");
let posz = stationListData.ys.split(",");
posx.reverse();
posz.reverse();
originX = posx[0];
originY = posz[0];
let pointsTop = [];
let pointsDown = [];
for(let i=0;i<posx.length;i++){
pointsTop.push(new THREE.Vector3( (posx[i] -originX)*double, 4.9, -(posz[i]-originY)*double));
pointsDown.push(new THREE.Vector3( (posx[i] -originX+0.011)*double, 4.9, -(posz[i]-originY+0.001)*double));
if(posx[i]<=119.390592){
pointsTop.push(new THREE.Vector3( (posx[i] -originX)*double, 0, -(posz[i]-originY)*double));
pointsDown.push(new THREE.Vector3( (posx[i] -originX+0.001)*double, 0, -(posz[i]-originY+0.001)*double));
}
}
var curveTop = new THREE.CatmullRomCurve3(pointsTop );
curveTop.curveType = "chordal";
curveTop.tension = 0.15;
curveTop.closed = false;
scope.topCurve = curveTop;
var curveDown = new THREE.CatmullRomCurve3(pointsDown );
curveDown.curveType = "chordal";
curveDown.tension = 0.15;
curveDown.closed = false;
scope.downCurve = curveDown;
var extrudeSettingsTop = {
steps : pointsTop.length*2,
@ -110,34 +196,37 @@ export function dataManager(scene) {
var shapeTop = new THREE.Shape();
shapeTop.moveTo( 0,-0.2 );
shapeTop.lineTo( 0,0.2 );
shapeTop.moveTo( 0,-1 );
shapeTop.lineTo( 0,1 );
var shapeDown = new THREE.Shape();
shapeDown.moveTo( 0,-0.2 );
shapeDown.lineTo( 0,0.2 );
let materialSection = new THREE.MeshPhongMaterial( { color : 0x3366ff } );
shapeDown.moveTo( 0,-1 );
shapeDown.lineTo( 0,1 );
let materialSection1 = new THREE.MeshPhongMaterial( { color : 0x3366ff } );
let materialSection2 = new THREE.MeshPhongMaterial( { color : 0x336600 } );
var geometryTop = new THREE.ExtrudeBufferGeometry( shapeTop, extrudeSettingsTop );
var curveTop = new THREE.Mesh( geometryTop,materialSection) ;
scene.add(curveTop);
var curveTopMesh = new THREE.Mesh( geometryTop,materialSection1) ;
scene.add(curveTopMesh);
var geometryDown = new THREE.ExtrudeBufferGeometry( shapeDown, extrudeSettingsDown );
var curveDown = new THREE.Mesh( geometryDown,materialSection) ;
scene.add(curveDown);
var curveDownMesh = new THREE.Mesh( geometryDown,materialSection2) ;
scene.add(curveDownMesh);
for(let j=0;j<stationListData.stations.length;j++){
var geometry = new THREE.RingBufferGeometry( 0.5, 1, 16 );
var geometry = new THREE.RingBufferGeometry( 5, 10, 16 );
var material = new THREE.MeshBasicMaterial( { color: 0xff3333, side: THREE.DoubleSide } );
var cube = new THREE.Mesh( geometry, material );
let pos = stationListData.stations[j].xy_coords.split(";");
cube.position.set((pos[0] -originX+0.0005)*double,5,-(pos[1]-originY+0.0005)*double);
cube.name = stationListData.stations[j].name;
cube.position.set((pos[0] -originX+0.0005)*double,0.2,-(pos[1]-originY+0.0005)*double);
cube.rotation.x = Math.PI/2;
console.log(cube.position);
scene.add( cube );
// console.log(cube.position);
station.add(cube);
}
resolve("loadJson");

View File

@ -0,0 +1,70 @@
import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js';
import store from '@/store/index';
//模型管理器
let mode = "0";
export function ModelManager(){
let scope = this;
scope.signal = {
id: "1",
name: "信号机",
deviceType: "signal",
type: "signal",
url: "/MODEL/2020-07-10/13-42231.FBX",
mesh:''
};
scope.train = {
id: "2",
name: "列车",
deviceType: "train",
type: "train",
url: "/MODEL/2020-11-16/57-53841.FBX",
mesh:''
};
this.station = {
code:null,
screenDoorOpenStatus:"01",
animations:null,
mesh:null,
action:null
};
this.station = {
code:null,
screenDoorOpenStatus:"01",
animations:null,
mesh:null,
action:null
};
//读取模型
this.loadpromise = function (mixers){
let initlist = [];
initlist.push(fbxpromise(scope.signal));
initlist.push(fbxpromise(scope.train));
//promise按顺序加载
return new Promise(function(resolve, reject){
Promise.all(initlist).then((result) => {
// store.dispatch('app/animationsClose');
resolve("success"); //['成功了', 'success']
}).catch((error) => {
//console.log(error);
});
});
}
}
//fbx模型加载
function fbxpromise(asset){
return new Promise(function(resolve, reject){
var loader = new THREE.FBXLoader();
loader.load( BASE_ASSET_API+asset.url, function ( object ) {
asset.mesh = object;
resolve(asset.deviceType);
} );
});
}

View File

@ -1,3 +1,179 @@
export function sandBoxConnect() {
let scope = this;
import StompClient from '@/utils/sock';
import { getBaseUrl } from '@/utils/baseUrl'
import { getToken } from '@/utils/auth';
import store from '@/store/index';
// 定于仿真socket接口
export function sandBoxConnect(manager,routegroup,section,signal,station,train ) {
let scope = this;
this.teststomp = new StompClient();
let start = true;
let topic = '/user/queue/simulation/jl3d/'+routegroup;
let header = {'X-Token': getToken() };
let topswitch = false;
let downswitch = false;
socketon(topic);
function socketon(topic) {
try {
scope.teststomp.subscribe(topic, callback, header);
} catch (error) {
console.error('websocket订阅失败');
}
};
this.socketoff = function(topic) {
scope.teststomp.unsubscribe(topic);
};
// 仿真socket接口回调函数
function callback(Response) {
let data = JSON.parse(Response.body);
/** 站台客流当前人数信息 */
if(data.type == "STAND_PFI"){
let newStandData = data.body;
let count = 0;
for(let j=0;j<passerStation.stationlist.length;j++){
count = 0;
for(let i=0;i<newStandData.length;i++){
if(passerStation.stationlist[j].topstand == newStandData[i].standCode){
passerStation.stationlist[j].topspeed = newStandData[i].to;
passerStation.stationlist[j].toppassers = newStandData[i].num;
count++;
}
if(passerStation.stationlist[j].downstand == newStandData[i].standCode){
passerStation.stationlist[j].downspeed = newStandData[i].to;
passerStation.stationlist[j].downpassers = newStandData[i].num;
count++;
}
if(count == 2){
i = newStandData.length;
}
}
}
jl3d.updateNowStationData();
if(start){
start = false;
jl3d.initTrafficStart();
}
// jl3d.allStationData = data.body;
}
if(data.type == "TRAIN_PFI_BL"){
if(toptrain.nowcode == data.body.code && topswitch == true){
//根据上下车人数创建人
jl3d.updateNowLeaveData("top",data.body.out);
setTimeout(function(){
passerAi.passerout("top","start",data.body.in)
}, 5000);
}
if(downtrain.nowcode == data.body.code && downswitch == true){
//根据上下车人数创建人
jl3d.updateNowLeaveData("down",data.body.out);
setTimeout(function(){
passerAi.passerout("down","start",data.body.in);
}, 5000);
}
}
if(data.type == "DeviceCtrl_3D"){
if(data.body.type == "PSD"){
}
if(data.body.type == "TRAIN_DOOR"){
}
}
if(data.type == "TrainRun_3D"){
for(let i=0;i<data.body.length;i++){
//top
if(data.body[i].right == 1){
if(section.topSectionList[data.body[i].section]){
if(train.trainlist[data.body[i].code].dispose == false){
train.trainlist[data.body[i].code].dispose = true;
train.trainGroup.add(train.trainlist[data.body[i].code]);
}else{
let realprogress = section.topSectionList[data.body[i].section].leftProgress+(section.topSectionList[data.body[i].section].rightProgress - section.topSectionList[data.body[i].section].leftProgress)*data.body[i].offset;
train.trainlist[data.body[i].code].position.copy(manager.topCurve.getPoint(realprogress));
train.trainlist[data.body[i].code].up = new THREE.Vector3(1,0,0);
let tangent = manager.topCurve.getTangentAt(realprogress).normalize();
train.trainlist[data.body[i].code].axis.crossVectors(train.trainlist[data.body[i].code].up, tangent).normalize();
let radians = Math.acos(train.trainlist[data.body[i].code].up.dot(tangent));
train.trainlist[data.body[i].code].quaternion.setFromAxisAngle(train.trainlist[data.body[i].code].axis, radians);
// console.log("/////");
// console.log("offset:"+data.body[i].offset);
// console.log("left:"+section.topSectionList[data.body[i].section].leftProgress);
// console.log("right:"+section.topSectionList[data.body[i].section].rightProgress);
// console.log("real:"+realprogress);
}
}else{
train.trainlist[data.body[i].code].dispose = false;
train.trainGroup.remove(train.trainlist[data.body[i].code]);
}
}
//down
if(data.body[i].right == 0){
if(section.downSectionList[data.body[i].section]){
if(train.trainlist[data.body[i].code].dispose == false){
train.trainlist[data.body[i].code].dispose = true;
train.trainGroup.add(train.trainlist[data.body[i].code]);
}else{
let realprogress = section.downSectionList[data.body[i].section].leftProgress +(section.downSectionList[data.body[i].section].rightProgress - section.downSectionList[data.body[i].section].leftProgress)*data.body[i].offset;
train.trainlist[data.body[i].code].position.copy(manager.downCurve.getPoint(realprogress));
train.trainlist[data.body[i].code].up = new THREE.Vector3(-1,0,0);
let tangent = manager.downCurve.getTangentAt(realprogress).normalize();
train.trainlist[data.body[i].code].axis.crossVectors(train.trainlist[data.body[i].code].up, tangent).normalize();
let radians = Math.acos(train.trainlist[data.body[i].code].up.dot(tangent));
train.trainlist[data.body[i].code].quaternion.setFromAxisAngle(train.trainlist[data.body[i].code].axis, radians);
}
}else{
train.trainlist[data.body[i].code].dispose = false;
train.trainGroup.remove(train.trainlist[data.body[i].code]);
}
}
}
}
if(data.type == 'Device_Load_Destroy_3D'){
}
if(data.type == 'Simulation_Over') {
store.dispatch('LogOut').then(() => {
location.reload();
});
}
}
}

View File

@ -1,18 +1,27 @@
export function sectionModel() {
let scope = this;
this.sections={
datalist:[]
};
this.stopsection = [];
this.topData = [];
this.downData = [];
this.topSectionList = [];
this.downSectionList = [];
this.init = function(sectiondata,switchdata,stationdata){
this.init = function(sectiondata,switchdata){
for(let i=0;i<sectiondata.length;i++){
if(sectiondata[i].type == "01" || sectiondata[i].type == "03"){
//初始化区段对象数据
let newsection = new SectionModel(sectiondata[i]);
let newsection = {};
// console.log(sectiondata[i]);
newsection.name = sectiondata[i].name;
newsection.code = sectiondata[i].code;
newsection.index = i;
newsection.type = sectiondata[i].type;
newsection.lengthFact = sectiondata[i].lengthFact;
newsection.stationcode = sectiondata[i].stationCode;
newsection.rsection = sectiondata[i].rightSectionCode;
newsection.lsection = sectiondata[i].leftSectionCode;
@ -136,5 +145,85 @@ export function sectionModel() {
}
let topStartSection,topEndSection,
downStartSection,downEndSection;
for(let i=0;i<stationdata[0].stands.length;i++){
if(stationdata[0].stands[i].right == true){
topStartSection = stationdata[0].stands[i].section;
}
if(stationdata[0].stands[i].right == false){
downStartSection = stationdata[0].stands[i].section;
}
}
let endNum = stationdata.length-1;
for(let i=0;i<stationdata[endNum].stands.length;i++){
if(stationdata[0].stands[i].right == true){
topEndSection = stationdata[endNum].stands[i].section;
}
if(stationdata[0].stands[i].right == false){
downEndSection = stationdata[endNum].stands[i].section;
}
}
let topSections = [];
let topLengthFact = 0;
topLengthFact += scope.sections.datalist[topStartSection].lengthFact;
topSections.push(scope.sections.datalist[topStartSection]);
for(let i=0;i<1000;i++){
if(scope.sections.datalist[topStartSection].rsection != topEndSection){
topStartSection = [scope.sections.datalist[topStartSection].rsection];
topLengthFact += scope.sections.datalist[topStartSection].lengthFact;
topSections.push(scope.sections.datalist[topStartSection]);
}else{
topStartSection = [scope.sections.datalist[topStartSection].rsection];
topLengthFact += scope.sections.datalist[topStartSection].lengthFact;
topSections.push(scope.sections.datalist[topStartSection]);
i = 1000;
}
}
let downSections = [];
let downLengthFact = 0;
downLengthFact += scope.sections.datalist[downStartSection].lengthFact;
downSections.push(scope.sections.datalist[downStartSection]);
for(let i=0;i<1000;i++){
if(scope.sections.datalist[downStartSection].rsection != downEndSection){
downStartSection = [scope.sections.datalist[downStartSection].rsection];
downLengthFact += scope.sections.datalist[downStartSection].lengthFact;
downSections.push(scope.sections.datalist[downStartSection]);
}else{
downStartSection = [scope.sections.datalist[downStartSection].rsection];
downLengthFact += scope.sections.datalist[downStartSection].lengthFact;
downSections.push(scope.sections.datalist[downStartSection]);
i = 1000;
}
}
let nowLengthFact = 0;
for(let i=0;i<topSections.length;i++){
topSections[i].leftProgress = nowLengthFact/topLengthFact;
nowLengthFact += topSections[i].lengthFact;
topSections[i].rightProgress = nowLengthFact/topLengthFact;
scope.topSectionList[topSections[i].code] = topSections[i];
}
nowLengthFact = 0;
for(let i=0;i<downSections.length;i++){
downSections[i].leftProgress = nowLengthFact/downLengthFact;
nowLengthFact += downSections[i].lengthFact;
downSections[i].rightProgress = nowLengthFact/downLengthFact;
scope.downSectionList[downSections[i].code] = downSections[i];
}
scope.topData = topSections;
scope.downData = downSections;
console.log(topSections);
console.log(topLengthFact);
console.log(downSections);
console.log(downLengthFact);
}
}

View File

@ -1,3 +1,34 @@
export function signalModel() {
export function signalModel(scene) {
let scope = this;
this.init = function(signalData,topData,downData,topCurve,downCurve,originMesh){
console.log(originMesh);
for(let i=0;i<signalData.length;i++){
if(signalData[i].right == true){
for(let j=0;j<topData.length;j++){
if(signalData[i].sectionCode == topData[j].code){
let newsignal = originMesh.mesh.clone(true);
newsignal.position.copy(topCurve.getPoint(topData[j].rightProgress));
scene.add( newsignal );
j = topData.length;
}
}
}
if(signalData[i].right == false){
for(let j=0;j<downData.length;j++){
if(signalData[i].sectionCode == downData[j].code){
let newsignal = originMesh.mesh.clone(true);
newsignal.position.copy(downCurve.getPoint(downData[j].leftProgress));
scene.add( newsignal );
j = downData.length;
}
}
}
}
}
}

View File

@ -0,0 +1,70 @@
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
export function textUi(scene) {
let scope = this;
var stationcanvas = new Image();
stationcanvas.src = JL3D_LOCAL_STATIC+"/texture/msgtnew.png";
this.textplane = "";
let textmaterial,textt;
this.init = function(){
let textgeometry = new THREE.PlaneBufferGeometry( 65, 90, 1 );
textt = new THREE.CanvasTexture(getTextCanvas(""));
// let materialSection2 = new THREE.MeshPhongMaterial( { color : 0x336600 } );
textmaterial = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide,map:textt ,transparent: true} );
scope.textplane = new THREE.Mesh( textgeometry, textmaterial );
// scope.textplane.rotation.z = Math.PI/2;
scene.add(scope.textplane);
}
this.updateUi = function(textData){
textt = new THREE.CanvasTexture(getTextCanvas(""));
textmaterial = new THREE.MeshBasicMaterial( { side: THREE.DoubleSide,map:textt ,transparent: true} );
textplane = new THREE.Mesh( textgeometry, textmaterial );
textplane.name = stationdata[i].code;
newstationmesh.add(textplane);
textgeometry.dispose();
textmaterial.dispose();
textt.dispose();
}
function getTextCanvas(text){
let canvas = document.getElementById('canvastexture');
canvas.width = 128;
canvas.height = 256;
// canvas.style.width = width;
// canvas.style.height = height;
let ctx = canvas.getContext('2d');
//ctx.fillStyle = '#FFFFFF';
ctx.fillRect(0, 0,128,256);
ctx.fillStyle = '#FFFFFF';
// ctx.textAlign = 'center';
// ctx.textBaseline = 'middle';
ctx.clearRect(0,0,128,256);
ctx.drawImage(stationcanvas,0,0,128,256);
ctx.font = "10px";
if(text == ""){
}else{
ctx.fillText("车站: "+text.name, 15,25);
ctx.fillText("漫游", 18,48);
ctx.fillText("信息", 54,48);
ctx.fillText("备忘", 93,48);
ctx.fillText("车站序号: "+text.name, 10,115);
ctx.fillText("公里标记:",10 ,135);
ctx.fillText(text.kmPost,10 ,155);
}
let data = ctx.getImageData(0, 0,128,256);
return data;
}
}

View File

@ -1,3 +1,20 @@
export function trainModel() {
export function trainModel(scene) {
let scope = this;
this.trainGroup = new THREE.Group();
this.trainlist = [];
scene.add(scope.trainGroup);
this.init = function(trainData){
for(let i=0;i<trainData.length;i++){
var geometry = new THREE.BoxGeometry( 30, 10, 10 );
var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
var trainBox = new THREE.Mesh( geometry, material );
trainBox.code = trainData[i].code;
trainBox.groupNumber = trainData[i].groupNumber;
trainBox.dispose = false;
trainBox.up = new THREE.Vector3(1, 0, 0);
trainBox.axis = new THREE.Vector3();
scope.trainlist[trainData[i].groupNumber] = trainBox;
}
}
}

View File

@ -11,13 +11,15 @@ export function Materialload(jlmap3dedit,standTextureData){
settexture( jlmap3dedit.materiallist,"black",JL3D_LOCAL_STATIC+'/material/signal/5.jpg');
}
if(standTextureData.urls.length > 1){
for(let i=0,leni=standTextureData.urls.length;i<leni;i++){
setstationtexture(jlmap3dedit.stationtexture,standTextureData.urls[i].name,BASE_ASSET_API + standTextureData.urls[i].url);
if(standTextureData){
if(standTextureData.urls.length > 1){
for(let i=0,leni=standTextureData.urls.length;i<leni;i++){
setstationtexture(jlmap3dedit.stationtexture,standTextureData.urls[i].name,BASE_ASSET_API + standTextureData.urls[i].url);
}
}
}
}
function settexture(materiallist,name,textureurl){

View File

@ -224,9 +224,20 @@ export default {
},
methods: {
passWordCommit(data) {
const operate = {
operation: data.operateNext
};
let operate = {};
if (data.overNext) {
operate = {
over: true,
code: data.code,
operation: data.operation,
cmdType:this.cmdType,
param: data.param
};
} else {
operate = {
operation: data.operateNext
};
}
this.trainingOperation(operate);
},
checkCancel() {
@ -477,11 +488,10 @@ export default {
});
} else {
const operate = {
over: true,
code: deviceList[0].code,
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: this.cmdType,
param: {routeCode: route.code}
overNext: true,
param: {routeCode: route.code, signalCode: deviceList[0].code}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
@ -500,13 +510,13 @@ export default {
over: true,
code: deviceList[1].code,
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: this.cmdType,
overNext: true,
param: ''
};
let flag = false;
this.routeList.forEach(item => {
if (item.startSignalCode === deviceList[0].code && item.endSignalCode === deviceList[1].code) {
operate.param = {routeCode: item.code};
operate.param = {routeCode: item.code, signalCode: deviceList[0].code};
this.deviceList = [];
flag = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid, response }) => {}).catch((error) => {

View File

@ -51,6 +51,18 @@ export default {
data() {
return {
menu: [],
logicMenu: [
{
label: '设置限速',
handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
},
{
label: '取消限速',
handler: this.cancelSpeed,
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED
}
],
menuNormal: {
Local: [
{
@ -82,17 +94,6 @@ export default {
label: this.$t('menu.menuSection.sectionUnblock'),
handler: this.unlock,
cmdType: CMD.Section.CMD_SECTION_UNBLOCK
},
{
label: '设置限速',
handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
},
{
label: '取消限速',
handler: this.cancelSpeed,
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED
}
],
Center: [
@ -125,16 +126,6 @@ export default {
label: this.$t('menu.menuSection.sectionUnblock'),
handler: this.unlock,
cmdType: CMD.Section.CMD_SECTION_UNBLOCK
},
{
label: '设置限速',
handler: this.setSpeed,
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
},
{
label: '取消限速',
handler: this.cancelSpeed,
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED
}
]
},
@ -199,8 +190,14 @@ export default {
},
initMenu() {
//
if (this.selected.type != '04') {
if (this.selected.type == '01' || this.selected.type == '03') {
this.menu = MenuContextHandler.covert(this.menuNormal);
} else if (this.selected.type == '02') {
const logic = {
Local: [...this.menuNormal.Local, ...this.logicMenu],
Center: [...this.menuNormal.Center, ...this.logicMenu]
};
this.menu = MenuContextHandler.covert(logic);
} else {
this.menu = [];
}

View File

@ -53,36 +53,36 @@ export default {
menuNormal: {
Local: [],
Center: [
{
label: this.$t('menu.menuTrain.addTrainId'),
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: this.$t('menu.menuTrain.deleteTrainId'),
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
// {
// label: this.$t('menu.menuTrain.addTrainId'),
// handler: this.undeveloped,
// cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
// },
// {
// label: this.$t('menu.menuTrain.deleteTrainId'),
// handler: this.undeveloped,
// cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
// },
{
label: this.$t('menu.menuTrain.editTrainId'),
handler: this.editTrainId,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: this.$t('menu.menuTrain.editTrainNo'),
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: this.$t('menu.menuTrain.moveTrainId'),
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
{
label: this.$t('menu.menuTrain.switchTrainId'),
handler: this.undeveloped,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
}
// {
// label: this.$t('menu.menuTrain.editTrainNo'),
// handler: this.undeveloped,
// cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
// },
// {
// label: this.$t('menu.menuTrain.moveTrainId'),
// handler: this.undeveloped,
// cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
// },
// {
// label: this.$t('menu.menuTrain.switchTrainId'),
// handler: this.undeveloped,
// cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
// }
]
},
menuForce: [

View File

@ -57,7 +57,7 @@ export default {
this.$refs.userInfo.doShow();
},
handleOrganization() {
this.$router.push({ path: `/trainingPlatform/organization` });
this.$router.push({ path: `/info/organization` });
}
}
};

View File

@ -11,7 +11,7 @@ import App from './App';
import VueI18n from 'vue-i18n';
import store from './store/index';
import router from './router/index_APP_TARGET';
import router from './router/index';
import CancelMouseState from '@/mixin/CancelMouseState.js';
Vue.mixin(CancelMouseState);

View File

@ -1,6 +1,6 @@
import Vue from 'vue';
import store from '@/store/index';
import router from './router/index_APP_TARGET';
import router from './router/index';
import {loginInfo} from '@/scripts/ProjectConfig';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';

View File

@ -124,7 +124,6 @@ const UserRules = () => import('@/views/orderauthor/rules/index');
const UserRulesDetail = () => import('@/views/orderauthor/rules/detail');
const DeviceManage = () => import('@/views/system/deviceManage/index');
const StudentManage = () => import('@/views/studentManage');
const BankManage = () => import('@/views/competitionManage/bankList/index');
const Scene = () => import('@/views/drts/scene/index');
@ -429,6 +428,18 @@ export const publicAsyncRoute = [
path: '/messageBoard',
component: MessageBoard,
hidden: true
},
{
path: '/info',
component: Layout,
hidden: true,
children: [
{ // 单位组织管理
path: 'organization',
component: OrganizationManage,
hidden: true
}
]
}
];
// 城市轨道项目
@ -610,11 +621,6 @@ export const asyncRouter = [
hidden: true
}
]
},
{ // 单位组织管理
path: 'organization',
component: OrganizationManage,
hidden: true
}
]
},
@ -1081,26 +1087,6 @@ export const asyncRouter = [
/* merge 是否再路由处理中与asyncRouter进行合并 mergeIndex合并进入asyncRouter【mergeIndex】 慎重调整asyncRouter顺序 */
export const projectRoute = {
designgzb: [
{
path: '/design/student',
redirect: '/design/student/home',
component: Layout,
meta: {
i18n: 'router.studentManage',
roles: [admin, lessonCreater]
},
children: [
{
path: 'home',
component: StudentManage,
meta: {
i18n: 'router.studentManage',
icon: 'design',
hidden: true
}
}
]
},
{ // 系统管理
path: '/system',
component: Layout,

View File

@ -1,742 +0,0 @@
import Vue from 'vue';
import VueRouter from 'vue-router';
// import VueRouter from 'vue-router';
Vue.use(VueRouter);
/* Layout */
const Layout = () => import('@/layout');
// const Login = () => import('@/views/login/hydLogin');
const Login = () => import('@/views/login/index');
const Jlmap3dedit = () => import('@/views/jlmap3d/edit/jlmap3dedit');
const Jlmap3d = () => import('@/views/jlmap3d/drive/jl3ddrive');
const Jlmap3dSandbox = () => import('@/views/jlmap3d/simulation/jl3dsimulation');
const Jlmap3dModel = () => import('@/views/jlmap3d/device/jl3ddevice');
const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow');
const DisplayNew = () => import('@/views/newMap/displayNew/index');
const JointTrainingNew = () => import('@/views/newMap/jointTrainingNew/index');
const Errpr404 = () => import('@/views/error-page/404');
const Dictionary = () => import('@/views/system/dictionary/index');
const DictionaryDetail = () => import('@/views/system/dictionaryDetail/index');
const UserControl = () => import('@/views/system/userControl/index');
const UserTraining = () => import('@/views/system/userTraining/index');
const UserExam = () => import('@/views/system/userExam/index');
const UserSimulation = () => import('@/views/system/userSimulation/index');
const ExistingSimulation = () => import('@/views/system/existingSimulation/index');
const CacheControl = () => import('@/views/system/cacheControl/index');
const SystemGenerate = () => import('@/views/system/systemGenerate/index');
const News = () => import('@/views/system/news/index');
const CommandDictionary = () => import('@/views/system/commandDictionary/index');
const CommandDictionaryDetail = () => import('@/views/system/commandDictionary/edit');
const configLine = () => import('@/views/system/configLine/index');
const IscsSystem = () => import('@/views/iscs/iscsSystem/index');
const IscsConfig = () => import('@/views/iscs/iscsSystem/config/index');
const Taskmanage = () => import('@/views/lesson/taskmanage/list');
const TrainingRuleList = () => import('@/views/lesson/trainingRule/list');
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 LessonDetail = () => import('@/views/lesson/details');
const BigScreen = () => import('@/views/designPlatform/bigScreen');
const BigSplitScreen = () => import('@/views/designPlatform/bigSplitScreen');
const TestRunplan = () => import('@/views/designPlatform/testRunplan');
const ScriptmanageHome = () => import('@/views/scriptManage/home');
const IbpHome = () => import('@/views/ibp/home');
const IbpDraw = () => import('@/views/ibp/ibpDraw/index');
const TeachDetail = () => import('@/views/teach/detail/index');
const TeachHome = () => import('@/views/teach/index');
const Pay = () => import('@/views/components/pay/index');
const ExamHome = () => import('@/views/exam/index');
const ExamResult = () => import('@/views/exam/result');
const ExamDetail = () => import('@/views/exam/detail/examDetail');
const ExamCourseDetail = () => import('@/views/exam/detail/courseDetail');
const DemonstrationDetail = () => import('@/views/demonstration/detail/index');
const PlanMonitorEditTool = () => import('@/views/planMonitor/editTool/index');
const PlanMonitorNewEditTool = () => import('@/views/planMonitor/newEditTool/index');
const PlanMonitorDetail = () => import('@/views/planMonitor/detail');
const DesignPlatformHome = () => import('@/views/designPlatform/home');
const DesignPlatform = () => import('@/views/designPlatform/index');
const MapPreviewNew = () => import('@/views/designPlatform/mapPreviewNew');
const Package = () => import('@/views/package/index');
const PublishMap = () => import('@/views/publish/publishMap/index');
const PublishMapDetail = () => import('@/views/publish/publishMap/list'); // 发布历史
const PublishLesson = () => import('@/views/publish/publishLesson/index');
const RunPlanTemplate = () => import('@/views/publish/runPlanTemplate/index');
const RunPlanCommon = () => import('@/views/publish/runPlanCommon/index');
const RunPlanCommonDraft = () => import('@/views/publish/runPlanCommon/draft');
const RunPlanEveryDay = () => import('@/views/publish/runPlanEveryDay/index');
const RunplanView = () => import('@/views/publish/runPlanEveryDay/runPlanView');
const PublishExamRule = () => import('@/views/publish/examRule/index');
const PublishExamRuleDraft = () => import('@/views/publish/examRule/draft/index');
const TrainingPlatform = () => import('@/views/trainingPlatform/index');
const Commodity = () => import('@/views/orderauthor/commodity/index');
const OrderList = () => import('@/views/orderauthor/order/list');
const OrderDraft = () => import('@/views/orderauthor/order/draft');
const Author = () => import('@/views/orderauthor/author/index');
const Permission = () => import('@/views/orderauthor/permission/index');
const PermissionDetail = () => import('@/views/orderauthor/permission/detail');
const PermissionCreate = () => import('@/views/orderauthor/permission/create/index');
const UserRules = () => import('@/views/orderauthor/rules/index');
const UserRulesDetail = () => import('@/views/orderauthor/rules/detail');
const DeviceManage = () => import('@/views/system/deviceManage/index');
const Approval = () => import('@/views/approval/index');
// import { loginInfo } from '@/scripts/ProjectConfig';
// import { getSessionStorage } from '@/utils/auth';
/**
* Note: sub-menu only appear when route children.length >= 1
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
*
* hidden: true if set true, item will not show in the sidebar(default is false)
* alwaysShow: true if set true, will always show the root menu
* if not set alwaysShow, when item has more than one children route,
* it will becomes nested mode, otherwise not show the root menu
* redirect: noRedirect if set noRedirect will no redirect in the breadcrumb
* name:'router-name' the name is used by <keep-alive> (must set!!!)
* meta : {
roles: ['admin','editor'] control the page roles (you can set multiple roles)
title: 'title' the name show in sidebar and breadcrumb (recommend set)
icon: 'svg-name' the icon show in the sidebar
breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
}
*/
export const user = '01'; // 普通用户
export const mapCreater = '02'; // 地图创建权限
export const lessonCreater = '03'; // 课程创建权限
export const admin = '04'; // 管理员
export const superAdmin = '05'; // 超级管理员
export const projectTrain = '011'; // 城市轨道项目
export const projectXian = '012'; // 西安地铁项目
export const projectXty = '013'; // 西铁院
export const projectGzzb = '014'; // 贵州装备
export const projectJsxt = '015'; // 竞赛系统
export const projectJyd = '017'; // 竞业达
export const projectTky = '018'; // 铁科院
export const projectHeb = '019'; // 哈盈达
export const userTrainingPlatform = '016'; // 实训系统
// export const refereePlatform = '017'; // 裁判系统
/**
* constantRoutes
* a base page that does not have permission requirements
* all roles can be accessed
*/
export const constantRoutes = [
// 实训平台登录
{
path: '/login',
component: Login,
hidden: true
},
// 设计平台登录
{
path: '/design',
redirect: '/design/login',
hidden: true
},
{
path: '/design/login',
component: Login,
hidden: true
},
{
path: '/design/jlmap3d/edit',
component: Jlmap3dedit,
hidden: true
},
{
path: '/jlmap3d/sandbox',
component: Jlmap3dSandbox,
hidden: true
},
{
path: '/jlmap3d/devicemodel',
component: Jlmap3dModel,
hidden: true
},
{
path: '/jlmap3d/passengerflow',
component: Jlmap3dPassFlow,
hidden: true
},
{
path: '/404',
component: Errpr404,
hidden: true
},
{ path: '*', redirect: '/404', hidden: true }
];
// 公共路由不需要过滤 直接可以访问
export const publicAsyncRoute = [
{
path: '/displayNew/:mode',
component: DisplayNew,
hidden: true
},
{ // 剧本编辑 战场图
path: '/scriptDisplayNew/:mode',
component: DisplayNew,
hidden: true
},
{
path: '/jointTrainingNew',
component: JointTrainingNew,
hidden: true
},
{
path: '/displayBigScreen/:mapId',
component: BigScreen,
hidden: true
},
{ // 大屏切分
path: '/bigSplitScreen/:mapId',
component: BigSplitScreen,
hidden: true
},
{
path: '/jlmap3d',
component: Jlmap3d,
hidden: true
},
{ // 运行图编辑
path: '/plan/tool',
component: PlanMonitorEditTool,
hidden: true
},
{ // 哈尔滨运行图编辑
path: '/plan/newTool',
component: PlanMonitorNewEditTool,
hidden: true
},
{
path: '/displayIscs/system',
component: IscsSystem,
hidden: true,
children: [
{
path: 'config/:mode',
component: IscsConfig,
hidden: true
}
]
},
{
path: '/device/teachDetail',
component: TeachDetail,
hidden: true
},
{
path: '/device/course',
component: ExamCourseDetail,
hidden: true
},
{
path: '/device/examRule/manage',
component: PublishExamRule,
hidden: true
},
{
path: '/device/examRule/draft/:mode/:ruleId/:lessonId',
component: PublishExamRuleDraft,
hidden: true
},
{ // 试卷详情
path: '/device/exam/:examId',
component: ExamDetail,
hidden: true
},
{ // 考试结果
path: '/device/result/:userExamId',
component: ExamResult,
hidden: true
},
{
// 运行图测试(仿真,仅有按计划行车和初始化操作)
path: '/design/runPlan/testRunplan',
component: TestRunplan,
hidden: true
}
];
export const asyncRouter = [
{ // 公共地图
path: '/design',
component: Layout,
redirect: '/design/home',
meta: {
roles: [admin, user]
},
children: [
{
path: '',
redirect: '/design/home',
component: DesignPlatform,
meta: {
i18n: 'router.designhomePage',
icon: 'design'
},
children: [
{
path: 'home',
component: DesignPlatformHome,
meta: {
}
},
{ // 运行图设计
path: 'runPlan/detail/:mapId',
component: PlanMonitorDetail,
hidden: true
},
{ // 剧本
path: 'script/home/:mapId',
component: ScriptmanageHome,
meta: {
i18n: 'router.scriptManage'
},
hidden: true
},
{ // 课程列表
path: 'lesson/home/:mapId',
component: LessonHome,
hidden: true
},
{ // 操作定义
path: 'lesson/trainingRule',
component: TrainingRuleList,
hidden: true
},
{ // 操作定义步骤
path: 'lesson/trainingRule/detail',
hidden: true,
component: TrainingRuleEdit
},
{ // 任务管理
path: 'lesson/taskManage',
component: Taskmanage,
hidden: true
},
{ // 实训管理
path: 'lesson/trainingManage',
component: Trainingmanage,
hidden: true
},
{ // 创建课程
path: 'lesson/edit/:type',
component: LessonEdit,
hidden: true
},
{ // 课程详情
path: 'lesson/details',
component: LessonDetail,
hidden: true,
children: [
{
path: 'edit/:type',
component: LessonEdit,
hidden: true
}
]
},
{ // 新版地图预览
path: 'mapPreviewNew/:mapId',
component: MapPreviewNew,
hidden: true
},
{
path: 'bigScreen/:mapId',
component: BigScreen,
hidden: true
},
{ // ibp列表
path: 'ibp/home/:mapId',
component: IbpHome,
hidden: true
},
{
path: 'ibp/edit',
component: IbpDraw,
hidden: true
}
]
}
]
},
{ // 实训平台
path: '/trainingPlatform',
component: Layout,
hidden: true,
meta: {
roles: [admin, user, userTrainingPlatform]
},
children: [
{
path: '',
component: TrainingPlatform,
meta: {
},
children: [
{ // 仿真详情
path: 'detail/:subSystem',
component: DemonstrationDetail,
hidden: true
},
{ // 教学系统 课程列表
path: 'teachHome/:subSystem',
component: TeachHome,
hidden: true
},
{ // 课程详情
path: 'teach/:subSystem',
component: TeachDetail,
hidden: true
},
{ // 试卷列表
path: 'course/:subSystem',
component: ExamCourseDetail,
hidden: true
},
{ // 考试系统 课程列表
path: 'examHome/:subSystem',
component: ExamHome,
hidden: true
},
{ // 试卷详情
path: 'exam/:examId',
component: ExamDetail,
hidden: true
},
{ // 试卷列表
path: 'examRule/manage',
component: PublishExamRule,
hidden: true
},
{ // 创建试卷
path: 'examRule/draft/:mode/:ruleId/:lessonId',
component: PublishExamRuleDraft,
hidden: true
},
{ // 购买
path: 'pay/:lessonId',
component: Pay,
hidden: true
},
{ // 考试结果
path: 'result/:userExamId',
component: ExamResult,
hidden: true
},
{ // 线路权限列表
path: 'permission/:mapId',
component: Package,
hidden: true
}
]
}
]
},
{ // 发布内容管理
path: '/publish',
component: Layout,
meta: {
i18n: 'router.pulishManage',
roles: [admin]
},
children: [
{ // 发布地图
path: 'map',
component: PublishMap,
meta: {
i18n: 'router.publishMapManage'
}
},
{ // 发布历史
path: 'map/detail',
hidden: true,
component: PublishMapDetail
},
{ // 发布课程
path: 'lesson',
component: PublishLesson,
meta: {
i18n: 'router.publishLessonManage'
}
},
{ // 模板运行图
path: 'runPlan/template',
component: RunPlanTemplate,
meta: {
i18n: 'router.runPlanTemplateManage'
}
},
{ // 加载运行图管理
path: 'runPlan/common',
component: RunPlanCommon,
meta: {
i18n: 'router.runPlanCommonManage'
}
},
{ // 新增加载运行图
path: 'runPlan/common/:mode',
component: RunPlanCommonDraft,
hidden: true
},
{ // 运行图预览
path: 'runPlan/view/:mode',
component: RunplanView,
hidden: true
},
{ // 每日运行图
path: 'runPlan/everyDay',
component: RunPlanEveryDay,
meta: {
i18n: 'router.runPlanEveryDayManage'
}
},
{ // 考试规则列表
path: 'examRule/manage',
component: PublishExamRule,
meta: {
i18n: 'router.examRuleManage'
}
},
{
path: 'examRule/draft/:mode/:ruleId/:lessonId',
component: PublishExamRuleDraft,
hidden: true
}
]
},
{ // 订单权限管理
path: '/orderauthor',
component: Layout,
meta: {
i18n: 'router.orderAuthorityManage',
roles: [admin]
},
children: [
{
path: 'author/manage',
component: Author,
meta: {
i18n: 'router.authorityManage'
}
},
{
path: 'commodity/manage',
component: Commodity,
meta: {
i18n: 'router.commodityManage'
}
},
{
path: 'order/manage',
component: OrderList,
meta: {
i18n: 'router.orderManage'
}
},
{
path: 'transfer/manage',
component: Permission,
meta: {
i18n: 'router.authorityTransferManage'
}
},
{
path: 'rules/manage',
component: UserRules,
meta: {
i18n: 'router.userRulesManage'
}
},
{
path: 'rules/manage/detail/:id',
hidden: true,
component: UserRulesDetail,
meta: {
i18n: 'router.userRulesManage'
}
},
{
path: 'order/draft/:mode/:orderId',
hidden: true,
component: OrderDraft,
meta: {
i18n: 'router.addOrder'
}
},
{
path: 'transfer/detail/:permissionId',
component: PermissionDetail,
hidden: true
},
{
path: 'transfer/create',
component: PermissionCreate,
hidden: true
}
]
},
{ // 系统管理
path: '/system',
component: Layout,
meta: {
i18n: 'router.systemManage',
roles: [admin]
},
children: [
{
path: 'dictionary',
component: Dictionary,
meta: {
i18n: 'router.dataDictionary'
}
},
{
path: 'dictionary/detail',
hidden: true,
component: DictionaryDetail,
meta: {
i18n: 'router.dataDictionaryDetails'
}
},
{
// 用户管理
path: 'userManage',
component: UserControl,
meta: {
i18n: 'router.userManage'
}
},
{
// 缓存管理
path: 'cache',
component: CacheControl,
meta: {
i18n: 'router.cacheManage'
}
},
{
path: 'userTrainingManage',
component: UserTraining,
meta: {
i18n: 'router.userTrainingManage'
}
},
{
path: 'userExamManage',
component: UserExam,
meta: {
i18n: 'router.userExamManage'
}
},
{
path: 'userSimulationManage',
component: UserSimulation,
meta: {
i18n: 'router.userSimulationManage'
}
},
{
path: 'existingSimulation',
component: ExistingSimulation,
meta: {
i18n: 'router.existingSimulation'
}
},
{
// 子系统生成
path: 'systemGenerate',
component: SystemGenerate,
meta: {
i18n: 'router.subsystemGeneration'
}
},
{ // 消息公告
path: 'news',
component: News,
meta: {
i18n: 'router.newsBulletin'
}
},
{ // 命令管理
path: 'commands',
component: CommandDictionary,
meta: {
i18n: 'router.commandDictionary'
}
},
{
path: 'commands/Detail',
hidden: true,
component: CommandDictionaryDetail
},
{ // 线路管理
path: 'configLine',
component: configLine,
meta: {
i18n: 'router.configLine'
}
},
{
path: 'deviceManage',
component: DeviceManage,
meta: {
i18n: 'router.deviceManage'
}
},
{// 发布申请
path: 'approval',
component: Approval,
meta: {
i18n: 'router.releaseApplication'
}
}
]
}
];
const createRouter = () => new VueRouter({
mode: 'history', // require service support
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
});
const router = createRouter();
// router.beforeEach((to, from, next) => {
// const project = getSessionStorage('project');
// document.title = loginInfo[project || 'login'].title;
// next();
// });
// 兼容 vue-router在3.1.0版本以上的路由跳转使用的是 promise 的方式
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err);
};
export default router;

View File

@ -505,3 +505,9 @@ export const ProjectList = [
{value: 'urtss', label: '陪标项目'},
{value: 'sdy', label: '苏电院'}
];
export const localPackageProject = {
localdesign: 'designheb',
locallogin: 'heb',
ntyldesign: 'designntyl',
ntyllogin: 'ntyl'
};

View File

@ -1,5 +1,5 @@
import { sendCommandNew } from '@/api/jmap/training';
import router from '@/router/index_APP_TARGET';
import router from '@/router/index';
import Command from './Command';
import Handler from './Handler';

View File

@ -1,5 +1,5 @@
import store from '@/store/index';
import router from '@/router/index_APP_TARGET';
import router from '@/router/index';
import CommandHandler from './CommandHandler.js';
import ValidateHandler from './ValidateHandler.js';
import { State2SimulationMap } from './Config.js';

View File

@ -1,4 +1,4 @@
import { publicAsyncRoute, asyncRouter, constantRoutes, user, projectTrain, projectXian, projectXty, projectGzzb, projectJsxt, projectJyd, projectTky, projectHeb, superAdmin, admin, userTrainingPlatform, JSXT, projectRoute, projectDrts, projectSdy } from '@/router/index_APP_TARGET';
import { publicAsyncRoute, asyncRouter, constantRoutes, user, projectTrain, projectXian, projectXty, projectGzzb, projectJsxt, projectJyd, projectTky, projectHeb, superAdmin, admin, userTrainingPlatform, JSXT, projectRoute, projectDrts, projectSdy } from '@/router/index';
import { loginInfo } from '@/scripts/ProjectConfig';
import { getSessionStorage } from '@/utils/auth';

View File

@ -2,11 +2,11 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://api.joylink.club/jlcloud';
BASE_API = 'https://test.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.119:9000'; // 张赛
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
BASE_API = 'http://192.168.8.140:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛

View File

@ -8,7 +8,7 @@ import { getBaseUrl } from '@/utils/baseUrl';
import { EventBus } from '@/scripts/event-bus';
import ConstConfig from '@/scripts/ConstConfig';
import Vue from 'vue';
import router from '../router/index_APP_TARGET';
import router from '../router/index';
const BASE_API = getBaseUrl();

View File

@ -22,7 +22,7 @@
<script>
import { listPublishMap, getMapListByProjectCode } from '@/api/jmap/map';
import { UrlConfig } from '@/scripts/ConstDic';
import { superAdmin, admin, lessonCreater } from '@/router/index_APP_TARGET';
import { superAdmin, admin, lessonCreater } from '@/router/index';
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
import FilterCity from '@/views/components/filterCity';
import localStore from 'storejs';

View File

@ -46,7 +46,7 @@
<div class="btn-buy">
<!-- <el-button v-if="!isLocal" :disabled="disabled" type="success" @click="buy">{{ $t('exam.buy') }}</el-button> -->
<el-button v-if="hasPermssion && !isLocal" :disabled="disabled" type="primary" @click="distribute">{{ $t('exam.distributePermission') }}</el-button>
<el-button v-if="hasPermssion && !$route.query.noPreLogout" :disabled="disabled" type="primary" @click="checkCourse">{{ $t('exam.viewCoursePapers') }}</el-button>
<el-button v-if="hasPermssion && !$route.query.noPreLogout && !courseModel.systemFault" :disabled="disabled" type="primary" @click="checkCourse">{{ $t('exam.viewCoursePapers') }}</el-button>
<el-button v-if="!$route.query.noPreLogout" type="primary" :disabled="disabled" @click="backLessonList">{{ $t('exam.returnCourseList') }}</el-button>
<el-button v-if="$route.query.noPreLogout" type="primary" :disabled="disabled" @click="quit">退出</el-button>
</div>
@ -138,7 +138,8 @@ export default {
prdType: resp.data.prdType,
mapId: resp.data.mapId,
PermissionType: PermissionType.EXAM,
treeList: resp.data.examDefinitionList
treeList: resp.data.examDefinitionList,
systemFault: resp.data.systemFault
};
if (this.hasPermssion) {
this.valid = true;

View File

@ -34,7 +34,7 @@ import { getSubSystemDetail } from '@/api/trainingPlatform';
import { UrlConfig } from '@/scripts/ConstDic';
import { forceDeleteLesson } from '@/api/jmap/lesson';
import { getSessionStorage } from '@/utils/auth';
import { lessonCreater } from '@/router/index_APP_TARGET';
import { lessonCreater } from '@/router/index';
import localStore from 'storejs';
export default {

View File

@ -4,13 +4,13 @@
<div class="jl3dmap3dMaintainerSelect" :style="{'background-image': 'url('+localStatic+'/background/other.jpg)'}">
<div class="maintainerSelectButton selectButtonImg1"
:style="{'background-image': 'url('+localStatic+'/vrtest/maintainer.png)'}"
style="left:10%" @mouseenter="onMouseOverNormal"></div>
style="left:40%" @mouseenter="onMouseOverNormal"></div>
<div class="maintainerSelectButton selectButtonImg2"
:style="{'background-image': 'url('+localStatic+'/vrtest/zc.png)'}"
style="left:10%;" v-show="normalShow"@mouseleave="onMouseOutNormal" @click="initNormal"></div>
style="left:40%;" v-show="normalShow"@mouseleave="onMouseOutNormal" @click="initNormal"></div>
<div class="maintainerSelectButton selectButtonImg3"
<!-- <div class="maintainerSelectButton selectButtonImg3"
:style="{'background-image': 'url('+localStatic+'/vrtest/maintainervr.png)'}"
style="left:40%;" @mouseenter="onMouseOverVr"></div>
@ -24,7 +24,7 @@
<div class="maintainerSelectButton selectButtonImg6"
:style="{'background-image': 'url('+localStatic+'/vrtest/trvr.png)'}"
style="left:70%;" v-show="trainRescueShow" @mouseleave="onMouseOutRescue" @click="initTrainRescueVr"></div>
style="left:70%;" v-show="trainRescueShow" @mouseleave="onMouseOutRescue" @click="initTrainRescueVr"></div> -->
</div>

View File

@ -0,0 +1,54 @@
<template>
<div class="textui"
:style="{'background-image': 'url('+localStatic+'/texture/showmsg.png)'}">
</div>
</template>
<script>
import Vue from 'vue';
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
export default {
name: 'Jl3dTextUi',
components: {
},
data() {
return {
localStatic:JL3D_LOCAL_STATIC,
}
},
beforeDestroy() {
},
mounted() {
},
watch: {
},
methods: {
updataData: function (data) {
console.log(data);
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.textui{
position: absolute;
top:0;
left:0;
width:150px;
height:300px;
z-index: 11;
background-repeat:no-repeat;
background-size:100%;
// display:none;
}
</style>

View File

@ -1,6 +1,6 @@
<template>
<div id="jl3d" class="jl3ddraw">
<Jl3d-TextUi ref="jl3dtextui" ></Jl3d-TextUi>
<canvas id="canvastexture" ></canvas>
</div>
@ -10,11 +10,12 @@
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
import { Jl3dSandBoxTest } from '@/jlmap3d/jl3dtrafficplan/jl3dsandboxtest.js';
import Jl3dTextUi from '@/views/jlmap3d/trafficplan/component/textui';
export default {
name: 'jl3dsandboxtest',
components: {
Jl3dTextUi,
},
data() {
return {
@ -41,7 +42,7 @@
methods: {
initnewdata: function (group,header){
let dom = document.getElementById('jl3d');
this.jl3d = new Jl3dSandBoxTest(dom, this.$route.query.mapid, this.$route.query.group, this.$route.query.token);
this.jl3d = new Jl3dSandBoxTest(dom,this.$refs.jl3dtextui, this.$route.query.mapid, this.$route.query.group, this.$route.query.token);
}
}
}
@ -55,7 +56,7 @@
/* left: 0; */
width: 50%;
height: 50%;
z-index: 1500;
z-index: 9;
}
#canvastexture {

View File

@ -12,13 +12,13 @@
<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="isProject" label="课程所属班级:" prop="classIdList">
<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.id"
:label="item.name"
:value="item.id"
:key="item.departmentId"
:label="item.departmentName"
:value="item.departmentId"
/>
</el-select>
</el-form-item>
@ -33,9 +33,7 @@
<script>
import { adminPublishLesson, releaseOrCancel } from '@/api/designPlatform';
import { getSessionStorage } from '@/utils/auth';
import { getProjectClassList } from '@/api/management/user';
import { ProjectCode } from '@/scripts/ProjectConfig';
import { getCompanyDeptInfo } from '@/api/company';
export default {
name: 'LessonPublish',
data() {
@ -70,7 +68,7 @@ export default {
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
],
classIdList: [
{ required: !(this.$store.state.user.roles.includes('04') || this.$store.state.user.roles.includes('05')), message: '请选择课程归属班级', trigger: 'change' }
{ required: true, message: '请选择课程归属班级', trigger: 'change' }
]
};
},
@ -78,8 +76,8 @@ export default {
return this.$store.state.user.roles.includes('04') ||
this.$store.state.user.roles.includes('05') || this.$store.state.user.roles.includes('03');
},
isProject() {
return getSessionStorage('project').endsWith('gzb');
showClassSelect() {
return this.$store.state.user.companyId && this.$store.state.user.companyAdmin;
}
},
methods: {
@ -87,15 +85,14 @@ export default {
this.editModel = {
id: model.id,
name: model.name,
mapId: this.$route.params.mapId,
mapId: this.$route.query.mapId || this.$route.params.mapId,
prdType: model.prdType,
cityCode: model.cityCode,
classIdList: []
};
this.dialogShow = true;
const project = getSessionStorage('project');
if (this.isProject) {
getProjectClassList(ProjectCode[project]).then(resp => {
if (this.showClassSelect) {
getCompanyDeptInfo(this.$store.state.user.companyId).then(resp => {
this.calssList = resp.data;
}).catch(() =>{
this.$message.error('获取班级数据失败!');

View File

@ -138,7 +138,7 @@ import bgPsdImg from '@/assets/bg_psd.png';
import HandRight from '@/assets/hand-o-right.png';
import wchat from '@/assets/wchat.png';
import { UrlConfig } from '@/scripts/ConstDic';
import { loginInfo, ProjectIcon, ProjectLoginStyleList, VersionBaseNoShow, MainBodyNoShow, NoQrcodeList} from '@/scripts/ProjectConfig';
import { loginInfo, ProjectIcon, ProjectLoginStyleList, VersionBaseNoShow, MainBodyNoShow, NoQrcodeList, localPackageProject} from '@/scripts/ProjectConfig';
import { removeToken, getToken } from '@/utils/auth';
import LangStorage from '@/utils/lang';
import FloatPart from './floatPart';
@ -206,14 +206,9 @@ export default {
project() {
const project = this.$route.query.project;
const split = this.$route.path.split('/')[1];
if (process.env.VUE_APP_PRO === 'local' && split == 'design') {
return split + 'heb';
} else if (process.env.VUE_APP_PRO === 'ntyl' && split == 'design') {
return split + 'ntyl';
} else if (process.env.VUE_APP_PRO === 'local' && split == 'login') {
return 'heb';
} else if (process.env.VUE_APP_PRO === 'ntyl' && split == 'login') {
return 'ntyl';
console.log(process.env.VUE_APP_PRO, localPackageProject);
if (process.env.VUE_APP_PRO) {
return localPackageProject[process.env.VUE_APP_PRO + split];
} else if (split == 'design') {
return project ? split + project : split;
} else if (split == 'login') {

View File

@ -94,7 +94,7 @@ import lick_icon from '@/assets/like.png';
import unlike_icon from '@/assets/unlike.png';
import reply_icon from '@/assets/reply.png';
import delete_icon from '@/assets/delete.png';
import { superAdmin } from '@/router/index_APP_TARGET';
import { superAdmin } from '@/router/index';
import { ProjectCode } from '@/scripts/ProjectConfig';
export default {
name: 'MessageBoard',

View File

@ -20,7 +20,7 @@ import MapPublish from './publish';
import MapPublish3d from './publish3d';
import { mapGetters } from 'vuex';
import { saveMap, getBuildMapExport } from '@/api/jmap/mapdraft';
import { superAdmin, admin } from '@/router/index_APP_TARGET';
import { superAdmin, admin } from '@/router/index';
export default {
name: 'MapOperateMenu',

View File

@ -8,7 +8,7 @@
</template>
<script>
import { admin } from '@/router/index_APP_TARGET';
import { admin } from '@/router/index';
import { listPackagePermission, restorePackagePermission, getPackageQrCode, setCommodityStatus } from '@/api/management/distribute';
import { UrlConfig } from '@/scripts/ConstDic';
import QrCode from '@/components/QrCode';

View File

@ -1,6 +1,6 @@
<template>
<div class="joylink-card">
<div style="margin-top: 20px;width: 90%; position: absolute; left: 5%; height: 100%;">
<div style="overflow: auto;" :style="{height:height+95 + 'px'}">
<div style="width: 90%; position: absolute; left: 5%; height: 100%;">
<el-row>
<el-col :span="20">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" size="mini" style="width: 100%;margin-top: 10px;">
@ -10,9 +10,9 @@
<el-select v-model="form.classId" placeholder="请选择" @change="getLessonByClassId">
<el-option
v-for="item in classList"
:key="item.id"
:label="item.name"
:value="item.id"
:key="item.departmentId"
:label="item.departmentName"
:value="item.departmentId"
/>
</el-select>
</el-form-item>
@ -105,20 +105,9 @@
</el-col>
<el-col :span="4">
<el-button type="primary" size="mini" @click="query">查询</el-button>
<el-button :loading="loadingStudentInfo" type="primary" class="uploadDemo" size="mini" style="margin-top: 10px;">
<input
id="importResults"
ref="files"
type="file"
class="file_box"
accept=".json, application/json, .csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
@change="importResults"
>
导入学生信息
</el-button>
<el-button type="primary" size="mini" style="margin-top: 10px;" @click="exportResults">成绩导出</el-button></el-col>
</el-row>
<div style="height: calc(100% - 270px);">
<div style="height: calc(100% - 160px);">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-table
:data="tableData"
@ -153,17 +142,22 @@
<script>
import { getLessonDrftList } from '@/api/jmap/lessondraft';
import XLSX from 'xlsx';
import { convertSheetToList } from '@/utils/runPlan';
import { importStudentResults, exportStudentResults } from '@/api/management/user';
import { exportStudentResults } from '@/api/management/user';
import { getSessionStorage } from '@/utils/auth';
import { ProjectCode } from '@/scripts/ProjectConfig';
import { getProjectClassList } from '@/api/management/user';
import { getLessonByClassId } from '@/api/jmap/lesson';
import { getExamList } from '@/api/management/exam';
export default {
name: 'StudentManage',
components: {
name: 'GradeExport',
props: {
classList: {
type: Array,
required: true
},
height: {
type: Number,
required: true
}
},
data() {
var validatePass = (rule, value, callback) => {
@ -191,7 +185,6 @@ export default {
return {
loading: false,
loadingStudentInfo: false,
classList: [],
localLessonList: [],
centerLessonList: [],
localExamPaperList: [],
@ -275,25 +268,11 @@ export default {
}
},
mounted() {
this.classList = [];
getProjectClassList(ProjectCode[this.project]).then(resp => {
this.classList = resp.data;
}).catch(() =>{
this.$message.error('获取班级数据失败!');
});
},
methods: {
queryFunction(params) {
return getLessonDrftList(this.$route.params.mapId, params);
},
importResults(e) {
const obj = this.$refs.files;
if (obj.files) {
const file = obj.files[0];
this.handleImportResults(file);
obj.value = '';
}
},
query() {
this.$refs.form.validate((valid) => {
if (valid) {
@ -316,7 +295,7 @@ export default {
classId: '',
localLessonId: ''
};
exportStudentResults(ProjectCode[this.project], params).then(resp => {
exportStudentResults(params).then(resp => {
this.tableData = [];
this.showLocal = false;
this.showCenter = false;
@ -413,74 +392,6 @@ export default {
this.$message.error('获取课程列表失败!');
});
}
},
handleImportResults(file) {
const studentData = { className: '', students:[] };
if (file) {
setTimeout(() => {
const that = this;
const reader = new FileReader();
if (reader) {
reader.onload = function (e) {
let wb;
const data = e.target.result;
if (that.rABS) {
wb = XLSX.read(btoa(that.fixdata(data)), { //
type: 'base64'
});
} else {
wb = XLSX.read(data, {
type: 'binary'
});
}
if (wb) {
try {
const students = [];
for (const index in wb.Sheets) {
const dataList = convertSheetToList(wb.Sheets[index], true);
if (dataList.length) {
const className = dataList[0][2].split(' ')[0].replace(/\s*/g, '').split('')[1];
studentData.className = className;
for ( let i = 5; i <= dataList[0].length; i++) {
if (dataList[2][i] && dataList[1][i]) {
students.push({studentID:dataList[2][i], name: dataList[1][i]});
}
}
}
studentData.students = students;
}
that.loadingStudentInfo = true;
importStudentResults(ProjectCode[that.project], studentData).then(resp => {
that.classList = [];
getProjectClassList(ProjectCode[that.project]).then(respon => {
that.classList = respon.data;
that.loadingStudentInfo = false;
}).catch(() =>{
that.$message.error('获取班级数据失败!');
that.loadingStudentInfo = false;
});
that.$message.success('学生信息导入成功!');
}).catch((error) => {
that.$message.error('学生信息导入失败:' + error.message);
that.loadingStudentInfo = false;
});
} catch (error) {
that.$message.warning(`解析成绩单失败:${error}`);
}
}
};
if (that.rABS) {
reader.readAsArrayBuffer(file);
} else {
reader.readAsBinaryString(file);
}
}
}, 200);
}
},
handelData() {
},
exportResults() {
if (!this.tableData || !this.tableData.length) {
@ -670,10 +581,6 @@ export default {
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.joylink-card{
height: 100%;
overflow: auto;
}
.file_box {
width: 100%;
height: 100%;

View File

@ -12,6 +12,7 @@
>
导入学生信息
</el-button>
<el-button type="text" @click="exportTemplate">学生信息导入模板</el-button>
<el-button type="text" @click="goBack">返回</el-button>
</div>
<el-tabs v-model="activeName" type="card">
@ -52,7 +53,7 @@
<el-table-column prop="departmentName" label="班级" />
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
<el-button type="text" @click="handleDelete(scope.$index, scope.row)">移出班级</el-button>
</template>
</el-table-column>
</el-table>
@ -68,6 +69,9 @@
/>
</div>
</el-tab-pane>
<el-tab-pane label="成绩导出" name="third">
<grade-export refs="gradeExport" :class-list="classList" :height="height" />
</el-tab-pane>
</el-tabs>
<el-dialog
title="修改部门名称"
@ -87,9 +91,13 @@
import { getCompanyDeptInfo, importCompanyMember, queryDeptInfoPaging, getAllDeptTree, deleteDepartUserRelation, updateDeptInfo } from '@/api/company';
import { convertSheetToList } from '@/utils/runPlan';
import XLSX from 'xlsx';
import GradeExport from './gradeExport';
export default {
name: 'Organization',
components:{
GradeExport
},
data() {
return {
activeName: 'second',
@ -244,17 +252,34 @@ export default {
studentData.depart = depart;
studentData.parentDepart = parentDepart;
for ( let i = 2; i <= dataList[0].length; i++) {
if (dataList[2][i] && dataList[1][i]) {
const serialNumber = dataList[0][i];
const studentId = dataList[1][i];
const name = dataList[2][i];
const reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g');
const studentIdJudge = !!studentId && !reg.test(studentId);
const serialNumberJudge = serialNumber == (i - 1);
console.log(studentIdJudge, serialNumberJudge);
if (studentIdJudge && serialNumberJudge && name) {
students.push({account:dataList[1][i], name: dataList[2][i]});
} else {
if (!serialNumber && !studentId && !name) {
break;
} else if (!name) {
throw new Error(`序号为:《${serialNumber}》,学号为:《${studentId}》的数据学生姓名为空!`);
} else if (!studentIdJudge) {
throw new Error(`序号为:《${serialNumber}》,学号为:《${studentId}》的数据学号格式不正确!`);
} else if (!serialNumberJudge) {
throw new Error(`序号为:《${serialNumber}》,学号为:《${studentId}》的数据序号顺序不正确!`);
}
}
}
}
studentData.companyUsers = students;
}
that.loadingStudentInfo = true;
console.log(that.companyId);
importCompanyMember(that.companyId, studentData).then(resp => {
that.$message.success('学生信息导入成功!');
that.loadingStudentInfo = false;
that.getCompanyDept();
that.getDeptTree();
}).catch((error) => {
@ -278,8 +303,21 @@ export default {
goBack() {
this.$router.go(-1);
},
queryFunction() {
exportTemplate() {
const wb = XLSX.utils.book_new();
const data1 = [{A: '', B: '年级一', C:'班级二'}];
const data2 = [{A: '序号', B: '学号', C:'姓名'}];
const data3 = [{A: '1', B: '00001', C:'张三'}];
const data4 = [{A: '2', B: '00002', C:'李四'}];
const data = [...data1, ...data2, ...data3, ...data4];
const ws = XLSX.utils.json_to_sheet(data, {skipHeader:true});
ws['!cols'] = [
{width: 15},
{width: 15},
{width: 15}
];
XLSX.utils.book_append_sheet(wb, ws, 'file');
XLSX.writeFile(wb, '学生信息模板' + '.xlsx');
},
handleNodeClick(e) {
}
@ -293,7 +331,7 @@ export default {
padding-right: 20px;
height: 40px;
z-index: 36;
width: 200px;
width: 320px;
text-align: center;
position: absolute;
right: 0;

View File

@ -7,7 +7,7 @@
<script>
import { listUserPermision } from '@/api/management/author';
import { superAdmin, admin } from '@/router/index_APP_TARGET';
import { superAdmin, admin } from '@/router/index';
import selectRole from './selectRole/list';
import LangStorage from '@/utils/lang';

View File

@ -76,7 +76,6 @@
<script>
import { getPublishLessonList, getExamClassList } from '@/api/jmap/lesson';
import { getExamLessonDetail, updateExamRules } from '@/api/management/exam';
import { getSessionStorage } from '@/utils/auth';
export default {
name: 'ExamFrom',
@ -176,7 +175,7 @@ export default {
return this.$route.params.mode == 'edit';
},
isClassShow() {
return getSessionStorage('project').startsWith('gzb');
return this.$store.state.user.companyId && this.$store.state.user.companyAdmin;
}
},
watch: {

View File

@ -1,17 +1,18 @@
<template>
<div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center>
<div style="text-align: center;">
<span>生成地图:</span>
<el-select v-model="mapId" placeholder="请选择" size="small">
<el-option
v-for="item in mapList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</div>
<el-form ref="form" :model="form" label-width="100px" :rules="rules">
<el-form-item label="生成地图:" prop="mapId">
<el-select v-model="form.mapId" placeholder="请选择" size="small">
<el-option
v-for="item in mapList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" :loading="loading" @click="doCreate">{{ loading? '生成中':$t('global.confirm') }}</el-button>
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
@ -34,8 +35,13 @@ export default {
return {
dialogVisible: false,
title: '一键生成课程和试卷',
mapId: '',
loading: false
form: {mapId: ''},
loading: false,
rules: {
mapId: [
{ required: true, message: '请选择生成地图', trigger: 'change' }
]
}
};
},
methods: {
@ -43,16 +49,20 @@ export default {
this.dialogVisible = true;
},
doCreate() {
this.loading = true;
aKeyGeneratingLesson([this.mapId]).then(resp => {
this.$message.success('生成课程、试卷成功!');
this.loading = false;
this.dialogVisible = false;
this.$emit('reloadTable');
}).catch(() => {
this.$message.error('生成课程、试卷失败!');
this.dialogVisible = false;
this.loading = false;
this.$refs['form'].validate((valid) => {
if (valid) {
this.loading = true;
aKeyGeneratingLesson([this.mapId]).then(resp => {
this.$message.success('生成课程、试卷成功!');
this.loading = false;
this.dialogVisible = false;
this.$emit('reloadTable');
}).catch(() => {
this.$message.error('生成课程、试卷失败!');
this.dialogVisible = false;
this.loading = false;
});
}
});
},
doClose() {

View File

@ -35,7 +35,7 @@ import CopyMap from './copy';
import LocalMap from './localMap';
import ExportMap from './exportMap';
import MapSort from './mapSort';
import { superAdmin } from '@/router/index_APP_TARGET';
import { superAdmin } from '@/router/index';
import { ProjectList } from '@/scripts/ProjectConfig';
import { getPermissionQuickly } from '@/api/management/author';

View File

@ -6,7 +6,7 @@
</template>
<script>
import { superAdmin } from '@/router/index_APP_TARGET';
import { superAdmin } from '@/router/index';
import { getRunPlanLoadList, listAllTempLateRunPlan, deleteDailyRunPlanLoad, postDailyRunPlanLoadGenerate, postSchedulingCommonGenerate } from '@/api/runplan';
import { UrlConfig } from '@/scripts/ConstDic';
import CopyMap from './copyMap';

View File

@ -5,7 +5,7 @@
</template>
<script>
import { superAdmin } from '@/router/index_APP_TARGET';
import { superAdmin } from '@/router/index';
import { getPublishMapListOnline } from '@/api/jmap/map';
import { runPlanEveryDayList, deleteRunPlanEveryDay } from '@/api/runplan';
import { UrlConfig } from '@/scripts/ConstDic';

View File

@ -6,7 +6,7 @@
</template>
<script>
import { superAdmin } from '@/router/index_APP_TARGET';
import { superAdmin } from '@/router/index';
import { getPublishMapListOnline } from '@/api/jmap/map';
import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay, postRunPlanTemplate } from '@/api/runplan';
import { UrlConfig } from '@/scripts/ConstDic';

View File

@ -19,7 +19,7 @@
import Cookies from 'js-cookie';
import ConstConfig from '@/scripts/ConstConfig';
import { UrlConfig } from '@/scripts/ConstDic';
import { admin, superAdmin} from '@/router/index_APP_TARGET';
import { admin, superAdmin} from '@/router/index';
import {retractScript, publishScript, updateScript, deleteScript, getScriptPageList, createScript, getScriptExport} from '@/api/script';
import { launchFullscreen } from '@/utils/screen';
import { scriptDraftRecordNotifyNew, scriptRecordNotifyNew } from '@/api/simulation';

View File

@ -121,11 +121,11 @@
<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>
<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>
<el-button type="primary" @click="handleClose"></el-button>
</template>
</el-button-group>
</div>
@ -258,6 +258,7 @@ export default {
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;

View File

@ -18,9 +18,9 @@
<el-table-column :label="this.$t('global.operate')">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="goLesson(scope.row)">{{ $t('teach.enterTheCourse') }}</el-button>
<el-button v-if="(isLessonCreator && userId === scope.row.creatorId) || isAdmin" size="mini" type="primary" @click="handleEdit(scope.row)">编辑</el-button>
<el-button v-if="(isLessonCreator && userId === scope.row.creatorId) || isAdmin" size="mini" type="warning" @click="handleSoldOut(scope.row)">下架</el-button>
<el-button v-if="(isLessonCreator && userId === scope.row.creatorId) || isAdmin" size="mini" type="danger" @click="handleDelete(scope.row)">删除课程</el-button>
<el-button v-if="((isLessonCreator && userId === scope.row.creatorId) || isAdmin) && !scope.row.systemFault" size="mini" type="primary" @click="handleEdit(scope.row)">编辑</el-button>
<el-button v-if="((isLessonCreator && userId === scope.row.creatorId) || isAdmin) && !scope.row.systemFault" size="mini" type="warning" @click="handleSoldOut(scope.row)">下架</el-button>
<el-button v-if="((isLessonCreator && userId === scope.row.creatorId) || isAdmin) && !scope.row.systemFault" size="mini" type="danger" @click="handleDelete(scope.row)">删除课程</el-button>
</template>
</el-table-column>
</el-table>
@ -34,7 +34,7 @@ import { getSubSystemDetail } from '@/api/trainingPlatform';
import { UrlConfig } from '@/scripts/ConstDic';
import { forceDeleteLesson } from '@/api/jmap/lesson';
import { getSessionStorage } from '@/utils/auth';
import { lessonCreater, superAdmin, admin } from '@/router/index_APP_TARGET';
import { lessonCreater, superAdmin, admin } from '@/router/index';
import { putLessonOffLine, updatePublishLesson } from '@/api/jmap/lesson';
import UpdateOperate from '@/views/publish/publishLesson/draft.vue';
import localStore from 'storejs';
@ -129,7 +129,7 @@ export default {
});
},
draftLessonManage() {
const query = {mapId: this.mapId, prdType: this.prdType};
const query = {mapId: this.mapId, prdType: this.prdType, cityCode: this.$route.query.cityCode};
this.$router.push({ path: `/trainingPlatform/draftTeach/${this.$route.params.subSystem}`, query: query });
},
handleDelete(row) {

View File

@ -113,7 +113,7 @@ export default {
break;
case 'Lesson':
this.setLocalRoute(`${UrlConfig.trainingPlatform.teachHome}/${obj.id}`);
router = { path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}`};
router = { path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}?cityCode=${this.filterSelect}`};
this.toNextPage(isReplace, router);
break;
case 'Simulation':
@ -173,8 +173,9 @@ export default {
if (checkId) {
const checkIdDom = document.getElementById(checkId);
const mapTreeDom = document.getElementById('trainingMapTree');
mapTreeDom.scrollTop = checkIdDom.offsetTop;
if (checkIdDom && mapTreeDom) {
mapTreeDom.scrollTop = checkIdDom.offsetTop;
}
}
this.loading = false;
}, 200);

View File

@ -135,78 +135,6 @@
"name": "地铁1号线(三江口--象峰)",
"auto": "0",
"stations": [{
"status": "1",
"trans_flag": "0",
"code": "350104",
"navi_poiid": "",
"name": "三江口",
"station_num": "1",
"poiid1": "BS13160937",
"start_time": "0630",
"spell": "san jiang kou",
"time_desc_json": "",
"station_id": "350100020613041",
"navi_poiname": "",
"end_time": "2300",
"navi_poiside": "",
"xy_coords": "119.426122;25.978861",
"poiid2_xy": "119.426122;25.978861",
"poiid2": "BV11473936"
}, {
"status": "1",
"trans_flag": "0",
"code": "350104",
"navi_poiid": "",
"name": "下洋",
"station_num": "2",
"poiid1": "BS13161221",
"start_time": "0631",
"spell": "xia yang",
"time_desc_json": "",
"station_id": "350100020613042",
"navi_poiname": "",
"end_time": "2301",
"navi_poiside": "",
"xy_coords": "119.420776;25.984204",
"poiid2_xy": "119.420776;25.984204",
"poiid2": "BV10687392"
}, {
"status": "1",
"trans_flag": "0",
"code": "350104",
"navi_poiid": "",
"name": "梁厝",
"station_num": "3",
"poiid1": "BS11949917",
"start_time": "0633",
"spell": "liang cuo",
"time_desc_json": "",
"station_id": "350100020613043",
"navi_poiname": "",
"end_time": "2303",
"navi_poiside": "",
"xy_coords": "119.415109;25.994261",
"poiid2_xy": "119.415109;25.994261",
"poiid2": "BV10687393"
}, {
"status": "1",
"trans_flag": "0",
"code": "350104",
"navi_poiid": "",
"name": "安平",
"station_num": "4",
"poiid1": "BS13160935",
"start_time": "0636",
"spell": "an ping",
"time_desc_json": "",
"station_id": "350100020613044",
"navi_poiname": "",
"end_time": "2306",
"navi_poiside": "",
"xy_coords": "119.402224;25.992335",
"poiid2_xy": "119.402224;25.992335",
"poiid2": "BV11473935"
}, {
"status": "1",
"trans_flag": "0",
"code": "350104",
@ -4622,4 +4550,4 @@
"discount_flag": "0"
}]
}
}
}

View File

@ -65,12 +65,12 @@ module.exports = {
// },
// parallel: require('os').cpus().length > 1, // 是否为 Babel 或 TypeScript 使用 thread-loader。该选项在系统的 CPU 有多于一个内核时自动启用,仅作用于生产构建。
configureWebpack: config => {
const appTarget = process.env.VUE_APP_PRO == 'local' ? 'HEB' : 'Common'; // 其他环境变量 区分配置
config.plugins.push(new webpack.NormalModuleReplacementPlugin(/(.*)_APP_TARGET(\.*)/,
function (resourse) {
resourse.request = resourse.request.replace(/APP_TARGET/, `${appTarget}`);
})
);
// const appTarget = process.env.VUE_APP_PRO == 'local' ? 'HEB' : 'Common'; // 其他环境变量 区分配置
// config.plugins.push(new webpack.NormalModuleReplacementPlugin(/(.*)_APP_TARGET(\.*)/,
// function (resourse) {
// resourse.request = resourse.request.replace(/APP_TARGET/, `${appTarget}`);
// })
// );
if (process.env.NODE_ENV != 'development') {
config.mode = 'production';