This commit is contained in:
joylink_cuiweidong 2020-05-13 18:06:15 +08:00
commit 4631590df0
28 changed files with 1354 additions and 716 deletions

View File

@ -89,7 +89,7 @@ export function updateExamRules(data) {
/** 根据课程ID获取试卷 */
export function getExamParperList(lessonId) {
return request({
url: `/api/exam/${lessonId}/List`,
url: `/api/exam/${lessonId}/list`,
method: 'get'
});
}

View File

@ -187,7 +187,7 @@ export function generateOfflineUser(data) {
});
}
// 导入学生成绩
export function importnStudentResults(projectCode, data) {
export function importStudentResults(projectCode, data) {
return request({
url: `/api/user/project/${projectCode}/import/student`,
method: 'post',
@ -202,3 +202,20 @@ export function getProjectClassList(projectCode) {
method: 'get'
});
}
// 导出学生成绩
export function exportStudentResults(projectCode, data) {
return request({
url: `/api/user/project/${projectCode}/export/student`,
method: 'put',
data: data
});
}
// 生成绑定微信二维码
export function getWxQrCode(params) {
return request({
url: `/api/user/wmurl`,
method: 'get',
params: params
});
}

View File

@ -5,6 +5,8 @@ import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls';
import { ModelManager } from '@/jlmap3d/jl3ddevice/loader.js';
import { Signallightload } from '@/jlmap3d/jl3ddevice/component/signallight.js';
import { Moveanimate } from '@/jlmap3d/jl3ddevice/component/moveanimate.js';
import { Textconfig } from '@/jlmap3d/jl3ddevice/component/textconfig.js';
import StompClient from '@/utils/sock';
@ -19,6 +21,21 @@ export function Jl3ddevice(dom,group,token) {
Signallightload(this.signallights);
this.mixers = [];
this.showmodel = null;
//新数据交互
let helpbox,textplane;
let daochamodel;
//点击事件状态
this.raycasterstatus = false;
//动画状态
this.animastats = false;
//当前选中模型
this.nowobject = null;
//当前动画播放模型
this.animationmodel = null;
this.devicetext = new Textconfig();
this.windowstatus = '0';
//初始化webgl渲染
this.renderer = new THREE.WebGLRenderer({ antialias: true });
@ -70,6 +87,10 @@ export function Jl3ddevice(dom,group,token) {
this.controls.update();
this.selectmodel = null;
let moveanima = new Moveanimate(scope);
document.addEventListener( "mousedown", onselect, false );
let teststomp = new StompClient();
let topic = '/user/topic/simulation/assistant/'+group;
// let topic = '/user/queue/simulation/jl3d/'+group;
@ -83,7 +104,6 @@ export function Jl3ddevice(dom,group,token) {
function callback(Response) {
let data = JSON.parse(Response.body);
console.log(data);
if(scope.nowcode != data.body.code){
scope.nowcode = data.body.code;
scope.selectmodel(data);
@ -97,11 +117,18 @@ export function Jl3ddevice(dom,group,token) {
scope.camera.updateProjectionMatrix();
scope.renderer.setSize(scope.dom.offsetWidth, scope.dom.offsetHeight);
}
this.domresize = function(){
scope.camera.aspect = scope.dom.offsetWidth / scope.dom.offsetHeight;
scope.camera.updateProjectionMatrix();
scope.renderer.setSize(scope.dom.offsetWidth, scope.dom.offsetHeight);
}
this.anime = null;
this.modelmanager = new ModelManager();
this.modelmanager.loadpromise(Staticmodel, scope.mixers).then(function (data) {
moveanima.initlistnew(scope.modelmanager.switchmodel.mesh);
daochamodel = scope.modelmanager.switchmodel.mesh.getObjectByName("DAOCHA");
animate();
})
@ -113,6 +140,7 @@ export function Jl3ddevice(dom,group,token) {
scope.controls.update();
//scope.camera.lookAt(plane);
//
moveanima.animateupdate();
let delta = clock.getDelta();
if (scope.mixers) {
for (let i = 0; i < scope.mixers.length; i++) {
@ -139,7 +167,17 @@ export function Jl3ddevice(dom,group,token) {
scope.showmodel = scope.modelmanager.switchmodel.mesh;
scope.scene.add(scope.showmodel);
scope.devicetext.initdevicetext(scope.modelmanager.switchmodel.mesh);
scope.nowobject = scope.modelmanager.switchmodel.mesh;
updatemenulist(scope.devicetext.devicelist);
scope.raycasterstatus = true;
}else{
scope.raycasterstatus = false;
scope.nowobject = "";
updatemenulist();
}
if (data.body._type == "Signal") {
scope.modelmanager.signalmodel.code = data.body.code;
@ -155,15 +193,25 @@ export function Jl3ddevice(dom,group,token) {
scope.showmodel = scope.modelmanager.standmodel.mesh;
scope.scene.add(scope.showmodel);
}
scope.showmodel.code = data.body.code;
if(scope.showmodel){
scope.resetmodel();
scope.showmodel.code = data.code;
initstatus(data);
}
}
} else {
if (data.body._type == "Switch") {
scope.modelmanager.switchmodel.locateType = data.body.locateType;
scope.modelmanager.switchmodel.code = data.body.code;
scope.showmodel = scope.modelmanager.switchmodel.mesh;
scope.scene.add(scope.showmodel);
scope.devicetext.initdevicetext(scope.modelmanager.switchmodel.mesh);
scope.nowobject = scope.modelmanager.switchmodel.mesh;
updatemenulist(scope.devicetext.devicelist);
scope.raycasterstatus = true;
if (data.body.locateType == "01") {
scope.modelmanager.switchmodel.locateType = "01";
scope.modelmanager.switchmodel.action.reset();
@ -180,6 +228,10 @@ export function Jl3ddevice(dom,group,token) {
}
}else{
scope.raycasterstatus = false;
scope.nowobject = "";
updatemenulist();
}
if (data.body._type == "Signal") {
scope.modelmanager.signalmodel.code = data.body.code;
@ -442,4 +494,235 @@ export function Jl3ddevice(dom,group,token) {
}
}
//设备分解、归位动画按钮
this.disperdevice1 = function(){
if(scope.nowobject.animacode){
if(moveanima.status == true){
if(scope.animastats == false){
scope.animastats = true;
moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode+"on"],true)
} else if(scope.animastats == true){
scope.animastats = false;
moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode+"off"],true);
}
}
}
};
this.disperdevice2 = function(){
if(scope.nowobject.animacode){
if(moveanima.status == true){
if(scope.animastats == false){
scope.animastats = true;
moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode+"chaijie"],true);
} else if(scope.animastats == true){
scope.animastats = false;
moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode+"fuwei"],true);
}
}
}
};
this.resetmodel = function(){
if(scope.nowobject.animacode){
scope.animastats = false;
moveanima.setplaylist(moveanima.animatelist[scope.nowobject.animacode+"fuwei"],true);
}
};
this.animationmsgshowon = function(nowobject){
scope.animationmodel = nowobject;
if(helpbox){
scope.animationmodel.helpbox = null;
scope.scene.remove( helpbox );
helpbox = undefined;
}
settext(scope.animationmodel,scope.animationmodel.position);
// console.log(scope.animationmodel);
helpbox = new THREE.BoxHelper( scope.animationmodel, 0xff0000 );
moveanima.updatehelpbox(helpbox,textplane);
// settext(intersects[0].object,intersects[0].point);
// getdevicemsg(intersects[0].object.name);
scope.scene.add( helpbox );
getdevicemsg(nowobject.name);
}
this.animationmsgshowoff = function(nowobject){
if(helpbox){
scope.animationmodel.helpbox = null;
scope.scene.remove( helpbox );
helpbox = undefined;
}
if(textplane){
scope.scene.remove(textplane);
textplane.geometry.dispose();
textplane.material.dispose();
}
scope.animationmodel = null;
}
this.updateselect = function(updata){
// console.log(updata);
if(helpbox){
scope.scene.remove( helpbox );
helpbox = null;
}
helpbox = new THREE.BoxHelper( updata.mesh, 0xff0000 );
// console.log(updata.mesh);
let point = {
x:updata.mesh.matrixWorld.elements[12],
y:updata.mesh.matrixWorld.elements[13],
z:updata.mesh.matrixWorld.elements[14]
};
settext(updata.mesh,point)
getdevicemsg(updata.mesh.name);
scope.scene.add( helpbox );
}
function getdevicemsg(selectname){
// console.log(selectname);
for(let i=0,leni=scope.devicetext.devicelist.length;i<leni;i++){
if(selectname == scope.devicetext.devicelist[i].name){
updatemsg(scope.devicetext.devicelist[i].text,scope.devicetext.devicelist[i].msg);
i=leni;
}
}
}
this.updatewindowstatus = function(nowwindowstatus){
scope.windowstatus == nowwindowstatus;
}
function onselect(event){
if(event.button == '0'){
if(scope.raycasterstatus){
//定义光线
let raycaster = new THREE.Raycaster();
//定义平面鼠标点击坐标
let mouse = new THREE.Vector2();
let getBoundingClientRect = scope.dom.getBoundingClientRect()
if(scope.windowstatus == '0'){
mouse.x = ( (event.clientX - getBoundingClientRect .left) /scope.dom.offsetWidth) * 2-1;
mouse.y = -( (event.clientY - getBoundingClientRect .top) / scope.dom.offsetHeight) * 2 + 1;
}else{
mouse.x = (event.clientX / scope.dom.offsetWidth) * 2 - 1;
mouse.y = -(event.clientY / scope.dom.offsetHeight) * 2 + 1;
}
raycaster.setFromCamera( mouse, scope.camera );
let intersects = raycaster.intersectObjects( scope.modelmanager.switchmodel.mesh.children,true);
if(helpbox){
scope.scene.remove( helpbox );
helpbox = null;
}
if(textplane){
scope.scene.remove(textplane);
textplane.geometry.dispose();
textplane.material.dispose();
}
if(intersects[0]){
if(intersects[0].object.raycastoff){
helpbox = new THREE.BoxHelper( intersects[0].object.parent, 0xff0000 );
settext(intersects[0].object.parent,intersects[0].point);
getdevicemsg(intersects[0].object.parent.name);
}else{
helpbox = new THREE.BoxHelper( intersects[0].object, 0xff0000 );
settext(intersects[0].object,intersects[0].point);
getdevicemsg(intersects[0].object.name);
}
scope.scene.add( helpbox );
}
}
}
}
function settext(intersects,point){
if(intersects.text){
let textgeometry = new THREE.PlaneBufferGeometry( 18, 12, 1 );
let textt = new THREE.CanvasTexture(getTextCanvas(intersects.text));
let textmaterial = new THREE.MeshBasicMaterial( {
side: THREE.DoubleSide,
map:textt ,transparent: true,
alphaTest:0.1
} );
if(textplane){
scope.scene.remove(textplane);
textplane.geometry.dispose();
textplane.material.dispose();
}
textplane= new THREE.Mesh( textgeometry, textmaterial );
// textplane.name = data[i].code;
textplane.position.x = point.x;
textplane.position.y = point.y+6;
textplane.position.z = point.z;
// console.log(textplane.position);
// textplane.tcode = data[i].code;
textplane.rotation.y = -Math.PI/2;
textplane.lookAt(scope.camera.position);
// scope.textlist.push(textplane);
// newmesh.children[0].add(textplane);
scope.scene.add(textplane);
textgeometry.dispose();
textmaterial.dispose();
textt.dispose();
}
}
var beauty = new Image();
beauty.src = "../../static/texture/guide.png";
//canvas文字贴图方法
//PS:待提炼 增强功能
function getTextCanvas(text){
var canvas = document.getElementById('canvastexture');
canvas.width = 256;
canvas.height = 128;
var ctx = canvas.getContext('2d');
//var bg = canvas.createPattern(img, "no-repeat");
//ctx.fillStyle = bg;
ctx.fillRect(0, 0,256,128);
ctx.font = "20px Verdana";
ctx.fillStyle = '#FFFFFF';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.clearRect(0,0,256,128);
//console.log(text.groupNumber);
ctx.drawImage(beauty,0,0,256, 128);
ctx.fillText("设备部件:"+text, 90,30);
// ctx.fillText("车组人员:XXX", 40,20);
// ctx.fillText("速度:XXX.XXX", 40,30);
//ctx.fillText(text.trainModel.name, width/2,height*3/4);
let data = ctx.getImageData(0, 0,256, 128);
return data;
}
this.hideswitch = function (nowswitchstatus){
if(nowswitchstatus){
scope.modelmanager.switchmodel.mesh.add(daochamodel);
}else{
scope.modelmanager.switchmodel.mesh.remove(daochamodel);
}
}
}

View File

@ -66,9 +66,6 @@ function fbxpromise(asset,mixers,model){
mixers.push(mixer);
//model.action.play();
}
console.log(object);
resolve(asset.deviceType);
} );

View File

@ -54,7 +54,6 @@ class Jlmap {
this.$options = new Options(deepAssign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {}), (dataZoom) => { this.$mouseController.trigger(this.events.DataZoom, dataZoom); }); // 缩放
this.$painter = new Painter(this);
this.$painter.updateZrSize({width: this.$zr.getWidth(), height: this.$zr.getHeight()});
this.$painter.updateTransform(this.$options);
this.optionsHandler = this.setOptions.bind(this);
@ -157,9 +156,12 @@ class Jlmap {
}
}
setRecover(opts) {
this.$painter.updateTransform({ scaleRate: opts.scaleRate, offsetX: opts.offsetX, offsetY: opts.offsetY });
}
setUpdateScreen(opts) {
const num = opts.num;
const offsetY = (opts.height - 100) / num; // 高度差
this.setRecover({ scaleRate: 1, offsetX: 0, offsetY: 0 });
const arr = [];
const rectList = [];
let rect = '';
@ -173,13 +175,16 @@ class Jlmap {
}
}
}
const screenSplit = opts.list.length ? opts.list : Vue.prototype.$theme.loadPropConvert(store.state.map.map.skinVO.code).screenSplit;
const splitList = JSON.parse(JSON.stringify(screenSplit));
const num = screenSplit.length + 1;
const offsetY = (opts.height - 100) / num; // 高度差
const maxWidth = rect.width;
splitList.push(maxWidth);
const scaleWidth = Math.floor((((opts.width - 200) * num) / rect.width) * 100) / 100;
const scaleHeight = Math.floor(((opts.height - 100) / (rect.height * num)) * 100) / 100;
const scale = Math.min(scaleWidth, scaleHeight);
const splitList = Vue.prototype.$theme.loadPropConvert(store.state.map.map.skinVO.code).screenSplit;
const maxWidth = rect.width;
splitList.push(maxWidth);
for (let i = 0; i < splitList.length; i++) {
let offsetX = '';
if (i == 0) {
@ -533,6 +538,12 @@ class Jlmap {
case this.events.Keyboard:
this.$keyboardController.on(this.events.Keyboard, cb, context);
break;
case this.events.__Pan:
this.$mouseController.on(this.events.__Pan, this.optionsHandler);
break;
case this.events.__Zoom:
this.$mouseController.on(this.events.__Zoom, this.optionsHandler);
break;
}
}
}

View File

@ -202,10 +202,6 @@ class Painter {
this.screenFlag = true;
this.$transformHandleScreen.updateTransform(list, opts);
}
// trainScreen() {
// this.$transformHandleScreen.updateTransform(list, opts);
// }
/**
* 更新zrender尺寸
* @param {*} opt

View File

@ -209,4 +209,7 @@ export default class Automactic extends Group {
this.text.setStyle('textFill', color);
}
}
screenShow() {
this.hideMode();
}
}

View File

@ -71,4 +71,7 @@ export default class OutFrame extends Group {
this.isShowShape = false;
}
}
screenShow() {
this.box && this.box.hide();
}
}

View File

@ -147,10 +147,8 @@ class EMouse extends Group {
points.unshift(param);
} else {
const param = [ele.x + directx * this.triangle.getAbsSin(switchWidth), ele.y - directy * this.triangle.getAbsCos(switchWidth)];
points.unshift(param);
}
});
this.lineBorder = new Polygon({
zlevel: this.device.zlevel,

View File

@ -42,7 +42,7 @@ class StationStand extends Group {
create() {
const model = this.model;
const style = this.style;
const drict = 1;
// const drict = 1;
/** 列车站台*/
const standX = model.position.x - model.width / 2;

View File

@ -77,4 +77,7 @@ export default class Text2 extends Group {
this.isShowShape = false;
}
}
screenShow() {
this.text && this.text.hide();
}
}

View File

@ -227,7 +227,7 @@ export default {
};
if (this.operation == OperationEvent.Switch.unlock.menu.operation) {
operate.operation = OperationEvent.Switch.unlock.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK;
operate.cmdType = CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK_CHAIN;
} else if (this.operation == OperationEvent.Switch.unblock.menu.operation) {
operate.operation = OperationEvent.Switch.unblock.confirm2.operation;
operate.cmdType = CMD.Switch.CMD_SWITCH_UNBLOCK;

View File

@ -60,12 +60,12 @@ export default {
{
label: '道岔单锁',
handler: this.lock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK_CHAIN
},
{
label: '道岔单解',
handler: this.unlock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK_CHAIN
},
{
label: '道岔封锁',
@ -252,7 +252,7 @@ export default {
}
});
},
//
//
unlock() {
commitOperate(menuOperate.Switch.unlock, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{
if (valid) {

View File

@ -125,14 +125,16 @@ export const menuOperate = {
},
Switch:{
lock:{
// 道岔单锁
// 道岔单锁(联锁)
operation: OperationEvent.Switch.lock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
// cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK_CHAIN
},
unlock:{
// 道岔解锁
// 道岔解锁(联锁)
operation: OperationEvent.Switch.unlock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
// cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK_CHAIN
},
block:{
// 道岔封锁

View File

@ -1,7 +1,5 @@
import {createTransform, createBoundingRect} from './utils/parser';
import Vue from 'vue';
import store from '@/store/index_APP_TARGET';
class TransformHandle {
constructor(painter) {
@ -34,12 +32,12 @@ class TransformHandle {
if (this.checkVisible(view, rect)) {
view.transform = this.transform[i];
view.decomposeTransform(); // 修改 transform 后同步位置
const propConvert = Vue.prototype.$theme.loadPropConvert(store.state.map.map.skinVO.code);
if (propConvert.handleScreenProps && propConvert.handleScreenProps(view)) {
view.hide();
return;
if (view.screenShow) {
view.screenShow();
} else {
view.show();
}
view.show(); return;
return;
}
}
view.dirty(); // 更新
@ -53,12 +51,11 @@ class TransformHandle {
// 重新计算显示图形
revisibleAll() {
this.traverse(this.revisibleView, this);
this.traverse(this.transformView, this);
}
// 更新偏移量
updateTransform(list, rectList) {
// this.rect = { x: opts.x, y: opts.y, width: opts.width, height: opts.height };
this.rectList = rectList;
this.transform = [];
list.forEach(item => {

View File

@ -235,6 +235,24 @@
</div>
</div>
</div>
<div v-if="project.endsWith('gzb')" class="form_box">
<div class="title">绑定微信:</div>
<div class="content">
<el-button v-if="!binding&&!bindSuccess" type="primary" size="small" @click="generateQrCode">生成微信二位码</el-button>
<div v-if="binding && !bindSuccess" class="login-code-box" @click="generateQrCode">
<qrcode-vue
v-loading="loadingCode"
:value="loginUrl"
:class-name="qrcodeClassName"
:size="150"
:element-loading-text="this.$t('login.clickRefresh')"
element-loading-spinner="el-icon-refresh"
element-loading-background="rgba(255, 255, 255, 0.9)"
/>
</div>
<div v-if="bindSuccess"><span>绑定成功</span></div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doClose">{{ $t('global.close') }}</el-button>
</span>
@ -242,9 +260,9 @@
</template>
<script>
import md5 from "js-md5";
import { getInfo } from "@/api/login";
import { getToken } from "@/utils/auth"; // getDesignToken
import md5 from 'js-md5';
import { getInfo } from '@/api/login';
import { getToken } from '@/utils/auth'; // getDesignToken
import {
getUserinfoName,
getUserinfoNickname,
@ -252,29 +270,42 @@ import {
getUserinfoMobileCode,
getUserinfoEmailCode,
getUserinfoEmail,
getUserinfoPassword
} from "@/api/management/user";
import { setInterval, clearInterval } from "timers";
getUserinfoPassword,
getWxQrCode
} from '@/api/management/user';
import QrcodeVue from 'qrcode.vue';
import { LoginParams } from '@/utils/login';
import { setInterval, clearInterval } from 'timers';
import { checkLoginStatus } from '@/api/login';
import { getessionStorage } from '@/utils/auth';
export default {
components: { QrcodeVue },
data() {
return {
visible: false,
loginUrl: '',
loadingCode: false,
sessionId: '',
binding: false,
bindSuccess: false,
qrcodeClassName: 'login-qrcode',
checkTimeout: null,
userInfo: {
name: "",
nickname: "",
mobile: "",
email: "",
passWord: ""
name: '',
nickname: '',
mobile: '',
email: '',
passWord: ''
},
editInfo: {
name: "",
nickname: "",
mobile: "",
email: "",
passWord: ""
name: '',
nickname: '',
mobile: '',
email: '',
passWord: ''
},
nationCode: "86",
nationCode: '86',
nameShow: true,
nickNameShow: true,
mobileShow: true,
@ -283,6 +314,7 @@ export default {
mobileCode: null,
emailCode: null,
passWordCode: null,
checkLogin: null,
oldPassWord: null,
newPassWord1: null,
@ -295,17 +327,19 @@ export default {
mobileTime: null,
passWordTime: null,
countryList: [
{ name: this.$t("global.china"), value: "86" },
{ name: this.$t("global.australia"), value: "61" },
{ name: this.$t("global.england"), value: "44" },
{ name: this.$t("global.hongKong"), value: "852" },
{ name: this.$t("global.Japanese"), value: "81" },
{ name: this.$t("global.macao"), value: "853" },
{ name: this.$t("global.singapore"), value: "65" },
{ name: this.$t("global.taiwan"), value: "886" },
{ name: this.$t("global.america"), value: "1" }
{ name: this.$t('global.china'), value: '86' },
{ name: this.$t('global.australia'), value: '61' },
{ name: this.$t('global.england'), value: '44' },
{ name: this.$t('global.hongKong'), value: '852' },
{ name: this.$t('global.Japanese'), value: '81' },
{ name: this.$t('global.macao'), value: '853' },
{ name: this.$t('global.singapore'), value: '65' },
{ name: this.$t('global.taiwan'), value: '886' },
{ name: this.$t('global.america'), value: '1' }
],
nationCodeInit: "86" //
nationCodeInit: '86', //
loginClient: 'LianKeTang',
project:''
};
},
computed: {
@ -317,13 +351,16 @@ export default {
geTel(tel) {
const reg = /^(\d{3})\d{4}(\d{4})$/;
if (tel) {
return tel.replace(reg, "$1****$2");
return tel.replace(reg, '$1****$2');
} else {
return "";
return '';
}
},
doShow() {
this.visible = true;
this.binding = false;
this.bindSuccess = false;
this.project = getessionStorage('project');
// const token = getToken() || getDesignToken();
const token = getToken();
getInfo(token)
@ -334,20 +371,22 @@ export default {
nickname: user.nickname,
mobile: user.mobile,
email: user.email,
passWord: ""
passWord: ''
};
this.oldPassWord = user.password;
this.nationCode = user.nationCode ? user.nationCode : "86";
this.nationCode = user.nationCode ? user.nationCode : '86';
this.nationCodeInit = user.nationCode
? user.nationCode
: "86";
: '86';
})
.catch(error => {
console.log(error, "请求个人信息失败");
console.log(error, '请求个人信息失败');
});
},
doClose() {
this.visible = false;
this.binding = false;
this.bindSuccess = false;
},
switcherName() {
this.editInfo.name = this.userInfo.name;
@ -359,9 +398,9 @@ export default {
await getUserinfoName(this.info.id, this.editInfo.name);
this.userInfo.name = this.editInfo.name;
this.nameShow = !this.nameShow;
this.$store.commit("SET_NAME", this.editInfo.name);
this.$store.commit('SET_NAME', this.editInfo.name);
} catch (error) {
console.log(error, "错误");
console.log(error, '错误');
}
}
},
@ -379,9 +418,9 @@ export default {
);
this.userInfo.nickname = this.editInfo.nickname;
this.nickNameShow = !this.nickNameShow;
this.$store.commit("SET_NICKNAME", this.editInfo.nickname);
this.$store.commit('SET_NICKNAME', this.editInfo.nickname);
} catch (error) {
console.log(error, "错误");
console.log(error, '错误');
}
}
},
@ -404,7 +443,7 @@ export default {
this.mobileShow = !this.mobileShow;
this.mobileCode = null;
} catch (error) {
this.$message.info(this.$t("global.codeError"));
this.$message.info(this.$t('global.codeError'));
}
}
},
@ -431,7 +470,7 @@ export default {
}, 1000);
await getUserinfoMobileCode(param);
} catch (error) {
this.$message.info(this.$t("global.codeFaile"));
this.$message.info(this.$t('global.codeFaile'));
}
},
@ -451,7 +490,7 @@ export default {
this.emailShow = !this.emailShow;
this.emailCode = null;
} catch (error) {
this.$message.info(this.$t("global.codeError"));
this.$message.info(this.$t('global.codeError'));
}
}
},
@ -468,7 +507,7 @@ export default {
}, 1000);
await getUserinfoEmailCode(this.editInfo.email);
} catch (error) {
this.$message.info(this.$t("global.codeFaile"));
this.$message.info(this.$t('global.codeFaile'));
}
},
@ -477,7 +516,7 @@ export default {
},
async savePassWord() {
if (this.newPassWord1.length <= 5) {
this.$message.info(this.$t("global.passWordLength"));
this.$message.info(this.$t('global.passWordLength'));
} else {
this.uploadPassword();
}
@ -492,13 +531,59 @@ export default {
try {
await getUserinfoPassword(this.info.id, param);
this.passwordShow = !this.passwordShow;
this.newPassWord1 = "";
this.newPassWord1 = '';
this.passWordCode = null;
} catch (error) {
console.log(error, 11);
}
} else {
this.$message.info(this.$t("global.passWordSome"));
this.$message.info(this.$t('global.passWordSome'));
}
},
generateQrCode() {
getWxQrCode(LoginParams[this.loginClient]).then(response => {
this.sessionId = response.data.sessionId;
this.loginUrl = response.data.url;
this.binding = true;
this.clearTimer(this.checkTimeout);
this.checkTimeout = setTimeout(() => {
this.loadingCode = true;
this.loginUrl = '';
}, 3 * 60 * 1000);
this.checkLoginStatus();
});
},
checkLoginStatus() {
const self = this;
//
if (!this.binding) {
return;
}
//
//
this.clearTimer(this.checkLogin);
this.checkLogin = setTimeout(() => {
checkLoginStatus(self.sessionId).then(response => {
//
if (response.data.status == '2') {
self.clearTimer(self.checkLogin);
self.bindSuccess = true;
} else {
self.checkLoginStatus();
}
}).catch(error => {
if (error.data && error.data.status === '1') {
self.scanSuccess = true;
}
self.checkLoginStatus();
});
}, 3000);
},
clearTimer(timer) {
if (timer) {
clearTimeout(timer);
timer = null;
}
},
async sendPassWordCode() {
@ -525,11 +610,11 @@ export default {
}, 1000);
await getUserinfoMobileCode(param);
} catch (error) {
this.$message.info(this.$t("global.codeFaile"));
this.$message.info(this.$t('global.codeFaile'));
}
} else {
this.passwordShow = !this.passwordShow;
this.$message.info(this.$t("global.enterMobileNumber"));
this.$message.info(this.$t('global.enterMobileNumber'));
}
}
}

View File

@ -8,6 +8,10 @@ export default {
CMD_SWITCH_SINGLE_LOCK: {value:'Switch_Single_Lock', label: '单锁'},
/** 单解 */
CMD_SWITCH_SINGLE_UNLOCK: {value:'Switch_Single_Unlock', label: '单解'},
/** 单锁(联动) */
CMD_SWITCH_SINGLE_LOCK_CHAIN: {value:'Switch_Single_Lock_Chain', label: '单锁(联动)'},
/** 单解(联动) */
CMD_SWITCH_SINGLE_UNLOCK_CHAIN: {value:'Switch_Single_Unlock_Chain', label: '单解(联动)'},
/** 封锁 */
CMD_SWITCH_BLOCK: {value:'Switch_Block', label: '封锁'},
/** 解封 */

View File

@ -367,6 +367,13 @@ const map = {
return [];
}
},
bigScreenSplitConfig: (state) => {
if (state.map) {
return state.map.bigScreenSplitConfig || [];
} else {
return [];
}
},
indicatorLightList: (state) => {
if (state.map) {
return state.map.indicatorLightList || [];

View File

@ -2,11 +2,11 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -1,7 +1,8 @@
<template>
<div class="map-view">
<div v-show="maskOpen" class="mask" :style="{'width': maskWidth}" />
<jlmap-visual ref="jlmapVisual" />
<div class="display-draft">
<div v-show="disPlay" class="display-draft">
<el-button-group>
<el-button type="primary" @click="back">{{ $t('scriptRecord.scriptBack') }}</el-button>
</el-button-group>
@ -11,6 +12,7 @@
<script>
import JlmapVisual from '@/views/newMap/jlmapNew/index';
import { loadNewMapDataByGroup, loadMapDataById } from '@/utils/loaddata';
import { clearSimulation } from '@/api/simulation';
import { EventBus } from '@/scripts/event-bus';
import { mapGetters } from 'vuex';
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
@ -32,7 +34,10 @@ export default {
size: {
width: document.documentElement.clientWidth - 400,
height: document.documentElement.clientHeight - 80
}
},
maskOpen: false,
maskWidth: '100%',
disPlay: false
};
},
computed: {
@ -42,6 +47,9 @@ export default {
height() {
return this.$store.state.app.height - 50 - 30;
},
...mapGetters('map', [
'bigScreenSplitConfig'
]),
...mapGetters('config', [
'canvasId'
])
@ -63,7 +71,9 @@ export default {
this.$jlmap.off('zoom');
this.$jlmap.off('pan');
this.handleUpdateScreen();
if (this.$route.query.group) {
this.subscribe();
}
},
'$store.state.socket.equipmentStatus': function (val) {
if (val.length && this.$route.query.group) {
@ -77,47 +87,42 @@ export default {
async mounted() {
await this.setWindowSize();
await this.initLoadData();
this.disPlay = true;
if (this.$route.path.includes('design/bigScreen')) {
this.disPlay = false;
}
},
methods: {
async initLoadData() { //
if (this.$route.query.group) {
await loadNewMapDataByGroup(this.$route.query.group);
} else {
await loadMapDataById(this.$route.params.mapId);
this.loadMapDataById(this.$route.params.mapId);
}
},
// id
async loadMapDataById(mapId) {
try {
await this.$store.dispatch('training/changeMode', { mode: null });
loadMapDataById(mapId).then(()=>{
this.$store.dispatch('training/over');
this.$store.dispatch('training/setMapDefaultState');
this.$store.dispatch('map/clearJlmapTrainView');
});
} catch (error) {
this.$messageBox(`获取地图数据失败: ${error.message}`);
this.endViewLoading();
}
},
async statusMessage(list) {
await this.$store.dispatch('training/updateMapState', list);
await this.$store.dispatch('socket/setEquipmentStatus');
},
// id
async loadMapDataById(mapId) {
// try {
// await this.$store.dispatch('training/changeMode', { mode: null });
// loadMapDataById(mapId).then(()=>{
// this.$store.dispatch('training/over');
// this.$store.dispatch('training/setMapDefaultState');
// this.$store.dispatch('map/clearJlmapTrainView');
// });
// } catch (error) {
// this.$messageBox(`: ${error.message}`);
// this.endViewLoading();
// }
},
//
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
});
},
setWindowSize() {
this.$nextTick(() => {
if (this.widthLeft) {
const width = this.$store.state.app.width - (this.widthLeft || 450) - 2;
this.maskWidth = `calc(100% - ${this.widthLeft || 450}px)`;
const height = this.height;
this.$store.dispatch('config/resize', { width, height });
} else {
@ -125,27 +130,38 @@ export default {
const height = this.$store.state.app.height;
this.$store.dispatch('config/resize', { width, height });
}
this.handleUpdateScreen();
});
},
handleUpdateScreen() {
this.maskOpen = false;
if (this.bigScreenSplitConfig.length) {
if (this.widthLeft) {
const size = {
width: this.$store.state.app.width - (this.widthLeft || 450) - 2,
height: this.height,
num: this.$theme.loadPropConvert(this.$store.state.map.map.skinVO.code).screenLine
list: this.bigScreenSplitConfig.map(ele => ele.position)
};
this.$jlmap.setUpdateScreen(size);
} else {
const size = {
width: this.$store.state.app.width - 2,
height: this.$store.state.app.height,
num: this.$theme.loadPropConvert(this.$store.state.map.map.skinVO.code).screenLine
list: this.bigScreenSplitConfig.map(ele => ele.position)
};
this.$jlmap.setUpdateScreen(size);
}
this.$refs.jlmapVisual.handleStateLoaded();
} else {
this.maskOpen = true;
// this.$messageBox('线, ');
}
},
back() {
async back() {
if (this.$route.query.group) {
await clearSimulation(this.$route.query.group);
this.clearSubscribe();
}
this.$store.dispatch('training/over').then(() => {
EventBus.$emit('runPlanStop');
EventBus.$emit('chatSubscribeStop');
@ -169,11 +185,22 @@ export default {
.map-view {
float: left;
width: auto;
}
.mask{
opacity: 1;
background: #000;
position: absolute;
right: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 9;
}
.display-draft {
position: absolute;
float: right;
right: 15px;
bottom: 15px;
z-index: 19;
}
</style>

View File

@ -43,7 +43,7 @@
<!-- <Jl3d-Simulation v-show="simulationShow" ref="Jl3dSimulation" :panel-show="simulationShow" @showpanel="showpanel" /> -->
<Jl3d-Device v-if="deviceShow" ref="Jl3dDevice" :panel-show="deviceShow" @showdevice="showdevice" />
<Jl3d-Device v-if="deviceShow" ref="Jl3dDevice" :panel-show="deviceShow" @closedevice3dview="devicemodel" />
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
<scheduling v-if="isShowScheduling" ref="scheduling" :group="group" />

View File

@ -33,6 +33,7 @@
},
data() {
return {
datastatus:"",
jl3d: null,
psdlist:this.$store.state.map.map.psdList,
windowstatus:false,
@ -63,6 +64,7 @@
},
'$store.state.menuOperation.selectedCount': {
handler: function (newVal, oldVal) {
if(this.datastatus == "new"){
if (newVal != oldVal) {
if(this.$store.state.menuOperation.selected._type){
if(this.$store.state.menuOperation.selected._type == "StationStand"){
@ -77,11 +79,10 @@
this.jl3d.selectmodel(this.$store.state.menuOperation.selected);
}
}
// this.jl3d.selectmodel(this.$store.state.socket.device);
}
}
}
},
// '$store.state.socket.device': {
// deep: true,
@ -111,10 +112,14 @@
let header = this.$route.query.token;
// console.log(this.$store.state.menuOperation);
// console.log(this.$store.state.map.map.linkList);
// console.log(this.$store.state.map.map.linkList);
if(this.$store.state.map.map.linkList){
this.datastatus = "old";
this.initolddata(group,header);
}else{
this.datastatus = "new";
this.initnewdata(group,header);
}
// if (group) {
// this.init(group,header);

View File

@ -161,6 +161,12 @@ export default {
await this.loadInitData(json);
this.typeChoose(json);
},
mounted() {
this.interCheckGenerateStatus();
},
beforeDestroy() {
this.isLeaving = true;
},
methods: {
async loadInitData(queryData) {
this.mapIdList = [];
@ -196,6 +202,28 @@ export default {
this.reloadTable();
},
interCheckGenerateStatus() {
createAllTrainingList(this.$route.query.mapId, false).then((data)=>{
if (data.data) {
this.queryList.actions.pop();
this.queryList.actions.push({ text: this.$t('lesson.trainingGenerating'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:true });
} else {
this.queryList.actions.pop();
this.queryList.actions.push({ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:false });
}
setTimeout(() => {
if (!this.isLeaving) {
this.interCheckGenerateStatus(this.$route.query.mapId, false);
}
}, 15000);
}).catch(()=>{
setTimeout(() => {
if (!this.isLeaving) {
this.interCheckGenerateStatus(this.$route.query.mapId, false);
}
}, 15000);
});
},
async prdChoose(queryData) {
this.trainingTypeMap = {};
const mapId = this.$route.query.mapId;
@ -252,15 +280,26 @@ export default {
beforeClose: async (action, instance, done) => {
if (action === 'confirm') {
instance.confirmButtonLoading = true;
instance.confirmButtonText = '生成中...';
// instance.confirmButtonText = '...';
this.queryList.actions.pop();
this.queryList.actions.push({ text: this.$t('lesson.trainingGenerating'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:true });
try {
await createAllTrainingList(this.$route.query.mapId);
this.$message.success('生成实训成功');
const data = await createAllTrainingList(this.$route.query.mapId, true);
this.$message.success('实训生成中...');
instance.confirmButtonLoading = false;
if (!data.data) {
this.queryList.actions.pop();
this.queryList.actions.push({ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:false });
}
done();
} catch (error) {
instance.confirmButtonLoading = false;
this.$message.error(`生成实训失败: ${error.message}`);
this.queryList.actions.pop();
this.queryList.actions.push({ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging, disabled:false });
}
} else {
instance.confirmButtonLoading = false;
done();
}
}

View File

@ -116,7 +116,7 @@ export default {
components: { QrcodeVue, FloatPart },
data() {
const validateUsername = (rule, value, callback) => {
if (value.length < 5) {
if (value.length < 5 && !this.project.endsWith('gzb')) {
callback(new Error(this.$t('login.enterTheCorrectUserName')));
} else {
callback();

View File

@ -1,24 +1,19 @@
<template>
<div class="jlmap-canvas" :style="{ width: width+'px', height: height+'px' }">
<div v-show="maskOpen" class="mask" />
<div :id="canvasId" style="background: #000;" class="display_canvas" />
<progress-bar ref="progressBar" />
<div>
<jlmap-canvas @onOffset="onDataZoom" @onSelect="onSelected" @onMenu="onContextMenu" @mapViewLoaded="mapViewLoaded" />
</div>
</template>
<script>
import Vue from 'vue';
import Jlmap from '@/jmapNew/map';
import ProgressBar from '@/views/components/progressBar/index';
import JlmapCanvas from './cnavas';
import { mapGetters } from 'vuex';
import { TrainingMode } from '@/scripts/ConstDic';
import { EventBus } from '@/scripts/event-bus';
// import Theme from '@/jmapNew/theme/factory';
export default {
name: 'JlmapVisual',
components: {
ProgressBar
JlmapCanvas
},
data() {
return {
@ -36,11 +31,9 @@ export default {
'mode',
'offsetStationCode'
]),
canvasId() {
const canvasId = ['map', (Math.random().toFixed(5)) * 100000].join('_');
this.$store.dispatch('config/setCurrentCancasId', { id: canvasId });
return canvasId;
},
...mapGetters('config', [
'canvasId'
]),
width() {
return this.$store.state.app.width;
},
@ -61,51 +54,17 @@ export default {
}
},
watch: {
'$store.state.map.map': function (val, old) {
try {
if (val) {
this.setMap(val);
}
} catch (error) {
console.log('[ERROR] ', error);
this.mapViewLoaded(false);
}
},
'$store.state.training.rezoomCount': function (val, old) {
//
let code = this.$store.state.training.offsetStationCode;
if (code && code.includes('TurnedAround')) {
const buttonList = this.$store.state.map.map.cycleButtonList;
if (buttonList && buttonList.length > 0) {
buttonList.forEach(element => {
if (code == element.cycleCode) {
code = element.code;
}
});
}
}
},
$route() {
this.mapViewLoaded(true);
}
},
created() {
EventBus.$on('viewLoading', (loading) => {
this.mapViewLoaded(loading);
});
EventBus.$on('viewProgressAt', (percentage) => {
this.mapViewProgressAt(percentage);
});
EventBus.$on('refresh', () => {
this.refresh(this.$store.state.map.map);
});
},
mounted() {
this.initLoadPage();
// this.initLoadPage();
},
beforeDestroy() {
EventBus.$off('refresh');
EventBus.$off('viewLoading');
EventBus.$off('viewProgressAt');
this.$store.dispatch('map/mapClear');
if (this.$jlmap) {
@ -113,42 +72,17 @@ export default {
}
},
methods: {
// jlmap
initLoadPage() {
document.getElementById(this.canvasId).oncontextmenu = function (e) {
return false;
};
const mouseWheelFlag = true;
const prdType = this.$store.state.training.prdType;
// Vue.prototype.$theme = new Theme();
Vue.prototype.$jlmap = new Jlmap({
dom: document.getElementById(this.canvasId),
config: {
renderer: 'canvas',
width: this.width,
height: this.height
},
options: {
scaleRate: 1,
offsetX: 0,
offsetY: 0,
zoomOnMouseWheel: mouseWheelFlag
},
showConfig: {
prdType: prdType,
previewOrMapDraw: false,
showMode: '03'
},
methods: {
dataLoaded: this.handleDataLoaded,
viewLoaded: this.handleViewLoaded,
stateLoaded: this.handleStateLoaded
}
});
onDataZoom() {
},
onSelected() {
},
onContextMenu() {
},
mapViewLoaded() {
window.document.oncontextmenu = function () {
return false;
};
},
// jlmap
resetWidth(opt) {
@ -165,42 +99,11 @@ export default {
// }, 100);
// });
},
//
handleDataLoaded() {
this.$store.dispatch('map/mapDataLoaded');
},
//
handleViewLoaded() {
this.$store.dispatch('map/mapViewScreenLoaded');
if (!this.$store.state.training.prdType) {
this.mapViewLoaded(false);
}
},
//
handleStateLoaded() {
this.mapViewLoaded(false);
},
//
mapViewLoaded(loading) {
this.loading = loading;
if (loading) {
this.$refs.progressBar && this.$refs.progressBar.start();
} else {
this.$refs.progressBar && this.$refs.progressBar.end(true);
}
},
//
mapViewProgressAt(percentage) {
this.$nextTick(() => {
this.$refs.progressBar.progressAt(percentage);
});
},
//
setMap(map) {
this.$jlmap.setMap(map, this.$store.state.map.mapDevice, {routeData:this.$store.state.map.routeData, autoReentryData: this.$store.state.map.autoReentryData});
},
//
refresh(map) {
}
}
};

View File

@ -1,151 +0,0 @@
<template>
<el-dialog
title="大屏预览"
:visible.sync="dialogShow"
width="100%"
:before-close="doClose"
:close-on-click-modal="false"
:modal="false"
fullscreen
>
<div class="map-view">
<jlmap-visual ref="jlmapVisual" />
<div class="display-draft">
<el-button-group>
<el-button type="primary" @click="doClose">{{ $t('scriptRecord.scriptBack') }}</el-button>
</el-button-group>
</div>
</div>
</el-dialog>
</template>
<script>
import JlmapVisual from '@/views/newMap/jlmapNew/screen';
import { loadMapDataById } from '@/utils/loaddata';
import { EventBus } from '@/scripts/event-bus';
import { mapGetters } from 'vuex';
//
export default {
name: 'RunPlanView',
components: {
JlmapVisual
},
props: {
},
data() {
return {
dialogShow: false,
size: {
width: this.$store.state.app.width,
height: this.$store.state.app.height - 90
}
};
},
computed: {
mapId() {
return this.$route.params.mapId;
},
height() {
return this.$store.state.app.height - 50 - 30;
},
...mapGetters('config', [
'canvasId'
])
},
watch: {
'$store.state.map.mapDataLoadedScreenCount':function() {
this.$store.dispatch('map/setTrainWindowShow', false);
this.$jlmap.off('zoom');
this.$jlmap.off('pan');
this.handleUpdateScreen();
}
},
async beforeDestroy() {
await this.$store.dispatch('map/mapClear');
},
async mounted() {
// await this.setWindowSize();
},
methods: {
async doShow() {
try {
this.dialogShow = true;
const size = {
width: this.$store.state.app.width - 2,
height: this.$store.state.app.height
};
console.log(size, '------');
this.$refs.jlmapVisual && this.$refs.jlmapVisual.resetWidth(size);
await this.initLoadData();
} catch (e) {
console.error(e);
}
},
async doClose() {
this.$store.dispatch('training/over').then(() => {
EventBus.$emit('runPlanStop');
EventBus.$emit('chatSubscribeStop');
});
this.dialogShow = false;
},
async initLoadData() { //
if (this.$route.params.mapId) {
await loadMapDataById('34');
} else {
this.endViewLoading();
}
},
// id
async loadMapDataById(mapId) {
try {
await this.$store.dispatch('training/changeMode', { mode: null });
loadMapDataById(mapId).then(()=>{
this.$store.dispatch('training/over');
this.$store.dispatch('training/setMapDefaultState');
this.$store.dispatch('map/clearJlmapTrainView');
});
} catch (error) {
this.$messageBox(`获取地图数据失败: ${error.message}`);
this.endViewLoading();
}
},
//
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
});
},
handleUpdateScreen() {
const size = {
width: this.$store.state.app.width - 2,
height: this.$store.state.app.height,
num: this.$theme.loadPropConvert(this.$store.state.map.map.skinVO.code).screenLine
};
this.$jlmap.setUpdateScreen(size);
this.$refs.jlmapVisual.handleStateLoaded(); //
}
}
};
</script>
<style scoped rel="stylesheet/scss" lang="scss">
/deep/ {
.el-dialog__body {
padding: 0px !important;
background-color: floralwhite !important;
}
}
.map-view {
float: left;
width: 100%;
}
.display-draft {
position: absolute;
float: right;
right: 15px;
bottom: 15px;
}
</style>

View File

@ -9,7 +9,7 @@
</el-table-column>
<el-table-column label="换行位置">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.width }}</span>
<span style="margin-left: 10px">{{ scope.row.position }}</span>
</template>
</el-table-column>
<el-table-column label="操作">
@ -34,8 +34,8 @@
</div>
<div>
<el-form ref="hostileForm" :model="addModel" label-width="135px" size="mini" style="margin-top: 15px">
<el-form-item label="区段:" prop="section">
<el-select v-model="addModel.section" clearable :filterable="true">
<el-form-item label="区段:" prop="sectionCode">
<el-select v-model="addModel.sectionCode" clearable :filterable="true">
<el-option
v-for="item in sectionList"
:key="item.code"
@ -51,22 +51,21 @@
</el-form>
</div>
</el-card>
<div style="display: table; margin-left: 90px; margin-top: 12px; margin-bottom: 10px;">
<div style="display: table; margin-left: 90px; margin-top: 12px; margin-bottom: 20px;">
<el-button type="primary" @click="save">保存</el-button>
<!-- <el-button type="primary" @click="preview">预览</el-button> -->
<el-button v-if="isPreview" type="primary" @click="preview">预览</el-button>
<el-button v-if="!isPreview" type="primary" @click="recover">重置</el-button>
</div>
</el-scrollbar>
<preview-screen ref="previewScreen" />
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import PreviewScreen from './config/previewScreen';
import { saveMap } from '@/api/jmap/mapdraft';
export default {
components: {
PreviewScreen
},
props: {
selected: {
@ -80,16 +79,18 @@ export default {
return {
tableData: [],
addModel: {
section: ''
sectionCode: ''
},
field: '',
cardMode: 'generate',
index: ''
index: '',
isPreview: true
};
},
computed: {
...mapGetters('map', [
'sectionList'
'sectionList',
'bigScreenSplitConfig'
]),
cardTitle() {
if (this.cardMode === 'generate') {
@ -104,6 +105,11 @@ export default {
watch: {
selected: function (val, oldVal) {
this.deviceSelect(val);
},
bigScreenSplitConfig: function(val) {
if (val.length) {
this.handleList(val);
}
}
},
mounted() {
@ -115,11 +121,23 @@ export default {
this.$refs.make && this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'selectSection'.toUpperCase()) {
if (selected.type === '01' || selected.type === '03') {
this.addModel.section = selected.code;
this.addModel.sectionCode = selected.code;
this.field = '';
}
}
},
handleList(list) {
this.tableData = [];
list.forEach(item => {
const section = this.$store.getters['map/getDeviceByCode'](item.sectionCode);
const param = {
position: String(section.points[section.points.length - 1].x),
name: `${section.name}(${section.code})`,
sectionCode: section.code
};
this.tableData.push(param);
});
},
hover(field) {
this.field = field == this.field ? '' : field;
},
@ -129,7 +147,7 @@ export default {
this.cardMode = 'generate';
},
editModel(list, index) {
this.addModel.section = list[index].code;
this.addModel.sectionCode = list[index].sectionCode;
this.index = index;
this.cardMode = 'edit';
},
@ -139,14 +157,14 @@ export default {
},
updateOverlab() {
if (this.index || this.index == 0) {
if (!this.addModel.section) {
if (!this.addModel.sectionCode) {
this.$messageBox('请选择区段!');
} else {
const section = this.$store.getters['map/getDeviceByCode'](this.addModel.section);
const section = this.$store.getters['map/getDeviceByCode'](this.addModel.sectionCode);
const param = {
width: section.points[section.points.length - 1].x,
position: String(section.points[section.points.length - 1].x),
name: `${section.name}(${section.code})`,
code: section.code
sectionCode: section.code
};
this.tableData.splice(this.index, 1, param);
}
@ -155,25 +173,59 @@ export default {
}
},
save() {
console.log(this.tableData); //
if (this.tableData.length) {
const map = this.$store.state.map.map;
const param = {
bigScreenSplitConfig: this.tableData,
mapId: this.$route.params.mapId
};
saveMap(Object.assign(map, param)).then(response => {
this.$message.success('保存大屏分割位置成功');
}).catch(() => {
this.$messageBox('保存大屏分割位置失败');
});
}
},
preview() { //
this.$refs.previewScreen.doShow();
if (this.tableData.length) {
this.isPreview = false;
this.$jlmap && this.$jlmap.off('zoom');
this.$jlmap && this.$jlmap.off('pan');
const size = {
width: this.$jlmap.$zr.getWidth(),
height: this.$jlmap.$zr.getHeight(),
list: this.tableData.map(ele => ele.position)
};
this.$jlmap && this.$jlmap.setUpdateScreen(size);
} else {
this.$messageBox('请输入换行位置信息');
}
},
recover() { //
this.isPreview = true;
this.$jlmap && this.$jlmap.on('zoom');
this.$jlmap && this.$jlmap.on('pan');
const param = {
scaleRate: this.$store.state.map.dataZoom.scaleRate,
offsetX: this.$store.state.map.dataZoom.offsetX,
offsetY: this.$store.state.map.dataZoom.offsetY
};
this.$jlmap && this.$jlmap.setRecover(param);
},
clear() {
this.$refs.hostileForm.resetFields();
this.addModel.section = '';
this.addModel.sectionCode = '';
this.index = '';
},
generateOverlab() {
if (!this.addModel.section) {
if (!this.addModel.sectionCode) {
this.$messageBox('请选择区段!');
} else {
const section = this.$store.getters['map/getDeviceByCode'](this.addModel.section);
const section = this.$store.getters['map/getDeviceByCode'](this.addModel.sectionCode);
this.tableData.push({
width: section.points[section.points.length - 1].x,
position: String(section.points[section.points.length - 1].x),
name: `${section.name}(${section.code})`,
code: section.code
sectionCode: section.code
});
this.clear();
}

View File

@ -1,15 +1,15 @@
<template>
<div class="joylink-card">
<div style="margin-top: 20px;">
<div style="margin-top: 20px;width: 90%; position: absolute; left: 5%;">
<el-row>
<el-col :span="20">
<el-form ref="form" :model="form" label-width="80px" size="mini" style="width: 100%;margin-top: 10px;">
<el-form ref="form" :model="form" :rules="rules" label-width="100px" size="mini" style="width: 100%;margin-top: 10px;">
<el-row>
<el-col :span="6">
<el-form-item label="班级:">
<el-form-item label="班级:" prop="classId">
<el-select v-model="form.classId" placeholder="请选择" @change="getLessonByClassId">
<el-option
v-for="item in calssList"
v-for="item in classList"
:key="item.id"
:label="item.name"
:value="item.id"
@ -18,24 +18,26 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="考勤天数:">
<el-form-item label="考勤天数:" prop="attendanceDays">
<el-input-number v-model="form.attendanceDays" :min="1" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="开始日期:">
<el-form-item label="开始日期:" prop="termBeginDate">
<el-date-picker
v-model="form.termBeginDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="结束日期:">
<el-form-item label="结束日期:" prop="termEndDate">
<el-date-picker
v-model="form.termEndDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
/>
</el-form-item>
@ -43,10 +45,13 @@
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="产品类型:">
<el-select v-model="form.prdType" placeholder="请选择">
<el-form-item label="产品类型:"><span>行调</span></el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="课程:" prop="centerLessonId">
<el-select v-model="form.centerLessonId" placeholder="请选择" @change="centerLessonChange">
<el-option
v-for="item in calssList"
v-for="item in centerLessonList"
:key="item.id"
:label="item.name"
:value="item.id"
@ -55,10 +60,27 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="课程:">
<el-select v-model="form.lessonId" placeholder="请选择">
<el-form-item label="试卷:" prop="centerExamPaperId">
<el-select v-model="form.centerExamPaperId" placeholder="请选择">
<el-option
v-for="item in calssList"
v-for="item in centerExamPaperList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="产品类型:"><span>现地</span></el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="课程:" prop="localLessonId">
<el-select v-model="form.localLessonId" placeholder="请选择" @change="localLessonChange">
<el-option
v-for="item in localLessonList"
:key="item.id"
:label="item.name"
:value="item.id"
@ -67,10 +89,10 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="试:">
<el-select v-model="form.examPaperId" placeholder="请选择">
<el-form-item label=":" prop="localExamPaperId">
<el-select v-model="form.localExamPaperId" placeholder="请选择">
<el-option
v-for="item in calssList"
v-for="item in localExamPaperList"
:key="item.id"
:label="item.name"
:value="item.id"
@ -92,10 +114,34 @@
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>
<el-table
:data="tableData"
border
>
<el-table-column prop="index" label="序号" />
<el-table-column
prop="studentID"
label="学号"
/>
<el-table-column
prop="name"
label="姓名"
/>
<el-table-column label="考勤(10分)" prop="attendance" width="180" />
<el-table-column label="技能操作(30分)">
<el-table-column v-if="showLocal" :label="'ATS现地('+ lessonSocre +'分)'" prop="localLessonPassRate" />
<el-table-column v-if="showCenter" :label="'ATS行调('+ lessonSocre+'分)'" prop="centerLessonPassRate" />
</el-table-column>
<el-table-column label="考试成绩(60分)">
<el-table-column v-if="showLocal" :label="'ATS现地('+ examSocre+'分)'" prop="localExamSocreRadio" />
<el-table-column v-if="showCenter" :label="'ATS行调('+ examSocre+'分)'" prop="centerExamSocreRadio" />
</el-table-column>
<el-table-column label="期末成绩(100分)" prop="totolScore" />
</el-table>
</div>
</div>
</template>
@ -104,11 +150,12 @@
import { getLessonDrftList } from '@/api/jmap/lessondraft';
import XLSX from 'xlsx';
import { convertSheetToList } from '@/utils/runPlan';
import { importnStudentResults } from '@/api/management/user';
import { importStudentResults, 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',
@ -117,15 +164,41 @@ export default {
data() {
return {
loading: false,
calssList: [],
classList: [],
localLessonList: [],
centerLessonList: [],
localExamPaperList: [],
centerExamPaperList: [],
showLocal: false,
showCenter: false,
tableData: [],
props: { multiple: true, value: 'id', label: 'name' },
form: {
attendanceDays: 1,
classId: '',
termBeginDate: '',
termEndDate: '',
prdType: '',
lessonId: '',
examPaperId: ''
localLessonId: '',
centerLessonId: '',
localExamPaperId: '',
centerExamPaperId: ''
},
examDataList: [
{
id: '01',
name: '现地',
children: []
}, {
id: '02',
name: '行调',
children: []
}
],
rules: {
classId: [{ required: true, message: '请选择班级', trigger: 'change' }],
attendanceDays: [{required: true, message: '请输入考勤天数', trigger: 'blur'}],
termBeginDate: [{required: true, message: '请选择开始日期', trigger: 'change'}],
termEndDate: [{required: true, message: '请选择结束日期', trigger: 'change'}]
},
pagerConfig: {
pageSize: 'pageSize',
@ -141,17 +214,25 @@ export default {
columns: [
]
},
exportData: {
classId: '',
localLessonId: ''
}
};
},
computed: {
mapId() {
return this.$route.params.mapId;
},
hasRelease() {
return this.$store.state.user.roles.includes('04') ||
this.$store.state.user.roles.includes('05');
project() {
return getSessionStorage('project');
},
lessonSocre() {
return this.showLocal && this.showCenter ? 15 : 30;
},
examSocre() {
return this.showLocal && this.showCenter ? 30 : 60;
}
},
watch: {
@ -160,9 +241,8 @@ export default {
}
},
mounted() {
const project = getSessionStorage('project');
getProjectClassList(ProjectCode[project]).then(resp => {
this.calssList = resp.data;
getProjectClassList(ProjectCode[this.project]).then(resp => {
this.classList = resp.data;
}).catch(() =>{
this.$message.error('获取班级数据失败!');
});
@ -180,18 +260,118 @@ export default {
}
},
query() {
this.$refs.form.validate((valid) => {
if (valid) {
if ((this.form.localLessonId && this.form.localExamPaperId) || (this.form.centerLessonId && this.form.centerExamPaperId)) {
const prdParams = [];
if (this.form.localLessonId && this.form.localExamPaperId) {
prdParams.push({prdType: '01', lessonId: this.form.localLessonId, examPaperId: this.form.localExamPaperId});
}
if (this.form.centerLessonId && this.form.centerExamPaperId) {
prdParams.push({prdType: '02', lessonId: this.form.centerLessonId, examPaperId: this.form.centerExamPaperId});
}
const params = {
attendanceDays: this.form.attendanceDays,
classId:this.form.classId,
termBeginDate: this.form.termBeginDate,
termEndDate: this.form.termEndDate,
prdParams: prdParams
};
this.exportData = {
classId: '',
localLessonId: ''
};
exportStudentResults(ProjectCode[this.project], params).then(resp => {
this.tableData = [];
this.showLocal = false;
this.showCenter = false;
this.exportData = {
classId: params.classId
};
resp.data.forEach((item, index) => {
let localExamSocreRadio = -1;
let localLessonPassRate = -1;
let centerExamSocreRadio = -1;
let centerLessonPassRate = -1;
let totolScore = 0;
item.scores.forEach(elem => {
if (elem.prdType === '01') {
this.showLocal = true;
localExamSocreRadio = elem.examSocreRadio * 100 * 60 / 100 / item.scores.length;
localLessonPassRate = elem.lessonPassRate * 100 * 30 / 100 / item.scores.length;
totolScore += localExamSocreRadio;
totolScore += localLessonPassRate;
} else if (elem.prdType === '02') {
this.showCenter = true;
centerExamSocreRadio = elem.examSocreRadio * 100 * 60 / 100 / item.scores.length;
centerLessonPassRate = elem.lessonPassRate * 100 * 30 / 100 / item.scores.length;
totolScore += centerExamSocreRadio;
totolScore += centerLessonPassRate;
}
});
totolScore += item.attendance * 100 * 10 / 100;
this.tableData.push(
{
index: index + 1,
name: item.name,
studentID: item.studentID,
attendance: item.attendance * 100 * 10 / 100,
localExamSocreRadio:localExamSocreRadio,
localLessonPassRate: localLessonPassRate,
centerExamSocreRadio: centerExamSocreRadio,
centerLessonPassRate: centerLessonPassRate,
totolScore: totolScore
});
});
}).catch(() =>{
this.$message.error('获取学生考试成绩失败!');
});
} else {
this.$messageBox('您至少需选择一种产品类型下的课程与考试!');
}
}
});
},
getLessonByClassId(classId) {
getLessonByClassId(classId).then(resp => {
localLessonChange(lessonId) {
this.localExamPaperList = [];
if (lessonId) {
getExamList({lessonId:lessonId, pageSize:999, pageNum:1}).then(resp => {
this.localExamPaperList = resp.data.list;
}).catch(()=> {
this.$message.error('获取试卷列表失败!');
});
}
},
centerLessonChange(lessonId) {
this.centerExamPaperList = [];
if (lessonId) {
getExamList({lessonId:lessonId, pageSize:999, pageNum:1}).then(resp => {
this.centerExamPaperList = resp.data.list;
}).catch(()=> {
this.$message.error('获取试卷列表失败!');
});
}
},
getLessonByClassId(classId) {
this.lessonList = [];
if (classId) {
getLessonByClassId(classId).then(resp => {
this.lessonList = resp.data;
this.lessonList.forEach(item => {
if (item.prdType === '01') {
this.localExamPaperList.push(item);
} else if (item.prdType === '02') {
this.centerLessonList.push(item);
}
});
}).catch(()=> {
this.$message.error('获取课程列表失败!');
});
}
},
handleImportResults(file) {
const studentData = { className: '', students:[] };
const project = getSessionStorage('project');
if (file) {
setTimeout(() => {
const that = this;
@ -217,13 +397,13 @@ export default {
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[0][i] && dataList[1][i]) {
students.push({studentID:dataList[0][i], name: dataList[1][i]});
if (dataList[2][i] && dataList[1][i]) {
students.push({studentID:dataList[2][i], name: dataList[1][i]});
}
}
studentData.students = students;
}
importnStudentResults(ProjectCode[project], studentData).then(resp => {
importStudentResults(ProjectCode[that.project], studentData).then(resp => {
that.$message.success('学生成绩导入成功!');
}).catch(error => {
that.$message.error('学生成绩导入失败!');
@ -246,7 +426,184 @@ export default {
},
exportResults() {
if (!this.tableData || !this.tableData.length) {
this.$message.error('暂无导出数据!');
return;
}
let className = '';
this.classList.forEach(item => {
if (item.id === this.exportData.classId) {
className = item.name;
}
});
const wb = XLSX.utils.book_new();
let cellNum = 0;
let data = [{A:'贵 州 装 备 制 造 职 业 学 院'}, {A:'实 训 成 绩 登 记 表'}, {A:`班级:${className} 实训课程名称: 20XX 学年 第 学期 `}];
const data1 = [{A: '序号', B: '姓名', C:'学号', D:'考勤(10分)', E: '技能操作(30分)', F: '', G: '考试成绩(60分)', H: '', I: '期末成绩', J: '备注'}, {E: 'ATS现地(15分)', F: 'ATS行调(15分)', G: 'ATS现地(30分)', H: 'ATS行调(30分)'}];
const data2 = [{A: '序号', B: '姓名', C:'学号', D:'考勤(10分)', E: '技能操作(30分)', F: '考试成绩(60分)', G: '期末成绩', H: '备注'}, { E: 'ATS现地(30分)', F: 'ATS现地(60分)'}];
const data3 = [{A: '序号', B: '姓名', C:'学号', D:'考勤(10分)', E: '技能操作(30分)', F: '考试成绩(60分)', G: '期末成绩', H: '备注'}, {E: 'ATS行调(30分)', F: 'ATS行调(60分)'}];
if (this.showCenter && this.showLocal) {
data = [...data, ...data1];
cellNum = 9;
this.tableData.forEach(item => {
data.push({
A: item.index,
B: item.name,
C: item.studentID,
D: item.attendance,
E: item.localLessonPassRate,
F: item.centerLessonPassRate,
G: item.localExamSocreRadio,
H: item.centerExamSocreRadio,
I: item.totolScore,
J: ''
});
});
} else if (this.showCenter) {
data = [...data, ...data3];
cellNum = 7;
this.tableData.forEach(item => {
data.push({
A: item.index,
B: item.name,
C: item.studentID,
D: item.attendance,
E: item.centerLessonPassRate,
F: item.centerExamSocreRadio,
G: item.totolScore,
H: ''
});
});
} else if (this.showLocal) {
data = [...data, ...data2];
cellNum = 7;
this.tableData.forEach(item => {
data.push({
A: item.index,
B: item.name,
C: item.studentID,
D: item.attendance,
E: item.localLessonPassRate,
F: item.localExamSocreRadio,
G: item.totolScore,
H: ''
});
});
}
const ws = XLSX.utils.json_to_sheet(data, {skipHeader:true});
ws['A1'].s = { //
font: {
name: '宋体',
sz: 20,
color: {rgb: '#000000'},
bold: true,
italic: false,
underline: false
},
alignment: {
horizontal: 'center',
vertical: 'center'
}
};
ws['A2'].s = { //
font: {
name: '宋体',
sz: 16,
color: {rgb: '#000000'},
bold: true,
italic: false,
underline: false
},
alignment: {
horizontal: 'center',
vertical: 'center'
}
};
ws['A3'].s = { //
font: {
name: '宋体',
sz: 12,
color: {rgb: '#000000'},
bold: false,
italic: false,
underline: false
},
alignment: {
horizontal: 'center',
vertical: 'center'
}
};
ws['!merges'] = [
{
s: {c: 0, r: 0},
e: {c: cellNum, r: 0}
},
{
s: {c: 0, r: 1},
e: {c: cellNum, r: 1}
},
{
s: {c: 0, r: 2},
e: {c: cellNum, r: 2}
},
{
s: {c: 0, r: 3},
e: {c: 0, r: 4}
},
{
s: {c: 1, r: 3},
e: {c: 1, r: 4}
},
{
s: {c: 2, r: 3},
e: {c: 2, r: 4}
},
{
s: {c: 3, r: 3},
e: {c: 3, r: 4}
}
];
if (this.showCenter && this.showLocal) {
ws['!merges'].push({
s: {c: 4, r: 3},
e: {c: 5, r: 3}
});
ws['!merges'].push({
s: {c: 6, r: 3},
e: {c: 7, r: 3}
});
ws['!merges'].push({
s: {c: 8, r: 3},
e: {c: 8, r: 4}
});
ws['!merges'].push({
s: {c: 9, r: 3},
e: {c: 9, r: 4}
});
} else {
ws['!merges'].push({
s: {c: 6, r: 3},
e: {c: 6, r: 4}
});
ws['!merges'].push({
s: {c: 7, r: 3},
e: {c: 7, r: 4}
});
}
ws['!cols'] = [
{width: 10},
{width: 10},
{width: 10},
{width: 15},
{width: 15},
{width: 15},
{width: 15},
{width: 15},
{width: 15},
{width: 15}
];
XLSX.utils.book_append_sheet(wb, ws, 'file');
XLSX.writeFile(wb, '成绩单' + '.xlsx');
},
refresh() {
this.$refs.queryListPage.refresh(true);