Commit 4717a822 authored by 罗超's avatar 罗超

优化部分功能

parent 263a77a8
......@@ -25,6 +25,7 @@
"quasar": "^1.0.0",
"relation-graph": "^1.0.8",
"v-viewer": "^1.5.1",
"vue-aliplayer-v2": "^1.2.9",
"vue-i18n": "^8.0.0",
"vue-inline-svg": "^2.0.0"
},
......
......@@ -48,7 +48,7 @@ module.exports = function (ctx) {
build: {
vueRouterMode: 'hash', // available values: 'hash', 'history'
env: ctx.dev ? {
API: 'http://192.168.20.24:8300/api'
API: 'http://192.168.20.17:8017/api'
} : {
API: 'http://eduapi.oytour.com/api'
},
......
......@@ -52,6 +52,9 @@ const server = ws
mainClass.createWindow();
mainClass.mainWindow.webContents.on("dom-ready", () => {
mainClass.mainWindow.webContents.send("RELOAD_USER_INFO", teacher);
setTimeout(() => {
mainClass.mainWindow.webContents.send("UPDATE_STUDENT_CHECKIN", 3);
}, 6000);
});
} else {
popuClass.createWindow();
......@@ -72,9 +75,13 @@ const server = ws
server.connections.forEach(conn => {
conn.sendText("OPEN-CAMERA");
});
}else if(str.indexOf("CHECK_IN")!=-1){
} else if(str.indexOf("CHECK_IN")!=-1){
console.log("CHECK_IN",str)
let id=str.split('|')[1]
mainClass.mainWindow.webContents.send("UPDATE_STUDENT_CHECKIN", id);
} else if(str.indexOf("UPLOAD_VIDEO_RESULT")!=-1){
let vid=str.split(':')[1]
mainClass.mainWindow.webContents.send("NEW_CLASS_UP_VIDEO", vid);
}
});
//监听关闭
......@@ -230,13 +237,12 @@ ipc.on("OPEN_LOGIN_INIT", function(event) {
//popuClass.popuWindow = null;
});
ipc.on("EXIT_LOGIN_OPENPOPU", function(event) {
console.log()
if (popuClass.popuWindow != null && !popuClass.popuWindow.isDestroyed()) {
popuClass.popuWindow.reload();
popuClass.popuWindow.on("ready-to-show", () => {
popuClass.popuWindow.show();
popuClass.popuWindow.show()
popuClass.popuWindow.webContents.send("REFER_PAGE");
loginClass.loginWindow.destroy();
loginClass.loginWindow = null;
});
} else {
popuClass.createWindow();
loginClass.loginWindow.destroy();
......@@ -279,10 +285,12 @@ ipc.on("CHOSEN_DIRTORY_PATH", function(event) {
});
});
ipc.on("GO_TO_CLASS", function(event) {
mainClass.createTray()
mainClass.mainWindow.hide()
//散布即将上课消息,关闭人脸识别
server.connections.forEach(conn => {
conn.sendText("CLOSE-CAMERA-FORREADY");
});
// server.connections.forEach(conn => {
// conn.sendText("CLOSE-CAMERA-FORREADY");
// });
});
ipc.on("CLOSE_VIDEO", function(event,id) {
server.connections.forEach(conn => {
......@@ -295,10 +303,8 @@ ipc.on("CREATEORUPDATE_CONFIG_JSON", function(event, classroom_info) {
event.sender.send("NOTIFY_CONFIG_STATUS");
} else {
if (popuClass.popuWindow != null && !popuClass.popuWindow.isDestroyed()) {
popuClass.popuWindow.reload();
popuClass.popuWindow.on("ready-to-show", () => {
popuClass.popuWindow.show();
});
popuClass.popuWindow.show()
popuClass.popuWindow.webContents.send("REFER_PAGE");
} else {
if (
loginClass.loginWindow != null &&
......
import { app, BrowserWindow, nativeTheme } from "electron";
import { app, BrowserWindow, Tray } from "electron";
const path = require('path');
var mainClass = {};
mainClass.mainWindow = null;
mainClass.tray=null
mainClass.createWindow = function() {
mainClass.mainWindow = new BrowserWindow({
width: 850,
......@@ -23,7 +25,25 @@ mainClass.createWindow = function() {
mainClass.mainWindow.on("closed", () => {
mainClass.mainWindow = null;
if(mainClass.tray){
mainClass.tray.destroy();
mainClass.tray=null
}
});
mainClass.mainWindow.on("blur", () => {
if(mainClass.tray){
mainClass.mainWindow.hide()
}
});
};
mainClass.createTray=function(){
console.log(__statics)
mainClass.tray = new Tray(path.join(__statics, '/favicon.ico'));
mainClass.tray.setToolTip('甲鹤上课系统')
mainClass.tray.on('click', ()=>{ //我们这里模拟桌面程序点击通知区图标实现打开关闭应用的功能
mainClass.mainWindow.isVisible() ? mainClass.mainWindow.hide() : mainClass.mainWindow.show()
mainClass.mainWindow.isVisible() ? mainClass.mainWindow.setSkipTaskbar(false):mainClass.mainWindow.setSkipTaskbar(true);
})
}
export default mainClass;
......@@ -38,7 +38,21 @@ export function queryClassTime(data) {
export function queryStudent(data) {
return request({
url: '/Class/GetStudentByClassId',
url: '/Class/GetStudentCheckByClassId',
method: 'post',
data
})
}
export function queryVideoAuth(data) {
return request({
url: '/Video/GetVideoPlayAuth',
method: 'post',
data
})
}
export function setStudentCheckIn(data) {
return request({
url: '/class/AddClassCheckOne',
method: 'post',
data
})
......
......@@ -29,8 +29,8 @@
</div>
<div class="stu-box">
<div class="text-dark q-mb-md f14 text-center">{{x.GuestName}}</div>
<div class="text-primary ms-r f12 text-center" v-if="x.checkState==1">学员已签到</div>
<div class="text-negative ms-r f12 text-center" v-if="x.checkState==0">学员未签到</div>
<div class="text-primary ms-r f12 text-center" v-if="x.CheckStatus==0">学员已签到</div>
<div class="text-negative ms-r f12 text-center" v-if="x.CheckStatus==-1">学员未签到</div>
</div>
</div>
</div>
......@@ -47,6 +47,15 @@ export default {
components: {
//carmers
},
props:["checkIns"],
watch: {
checkIns:{
handler(val,oval){
this.initStudents()
},
deep:true
}
},
data() {
return {
room: null,
......@@ -65,7 +74,8 @@ export default {
width: '9px',
opacity: 0
},
students:[]
students:[],
checkInList:[]
}
},
mounted() {
......@@ -73,29 +83,24 @@ export default {
this.user = Lockr.get("loginUserInfo");
}
let that=this
this.$q.electron.ipcRenderer.on("UPDATE_STUDENT_CHECKIN",(e,r)=>{
that.students.forEach(x=>{
if(x.Id==r){
x.checkState=1
}
})
})
this.initStudents()
this.$q.electron.ipcRenderer.send("BEGIN_STUDENTS_CHECKIN",this.user.ClassInfo.ClassId);
},
methods: {
changeCheck(i){
this.students[i].checkState=this.students[i].checkState==0?1:0
},
initStudents(){
console.log("调用")
queryStudent({
ClassId:this.user.ClassInfo.ClassId
ClassId:this.user.ClassInfo.ClassId,
ClassTimeId:this.user.ClassInfo.ClassTimeId
}).then(res=>{
let temp=res["Data"]
temp.forEach(x => {
x.checkState=0
});
this.students=temp;
// let temp=res["Data"]
// temp.forEach(x => {
// x.checkState=this.checkInList.indexOf(x.Id)==-1?0:1
// });
this.students=res["Data"];
this.$forceUpdate();
})
}
},
......
......@@ -12,22 +12,24 @@
<q-img style="border-radius: 6px;" v-for="(item, i) in user.ClassInfo.SuiPaiList" :key="i" height="76px" width="100px" :src="item"></q-img>
</div>-->
<div class="pingfang-b" style="font-size:18px;margin-bottom:20px;">课程回顾</div>
<div v-if="shangeKeState!=-1" style="height:262px;border-radius:12px;font-size:20px;padding-top:111px;" class="bg-dark text-grey-2 text-center">{{shangeKeState==0?"上课后将启动自动录屏":"视频录制中,下课后可查看"}}</div>
<div v-if="videoPath!=''" style="height:262px;border-radius:12px;" class="bg-dark">
<q-video
<div class="pingfang-b" style="font-size:18px;margin-bottom:20px;">上课录像</div>
<div v-if="shangeKeState!=-1&&videoPath==''" style="height:262px;border-radius:12px;font-size:20px;padding-top:111px;" class="bg-dark text-grey-2 text-center">{{shangeKeState==0?"上课后将启动自动录屏":"视频录制中,下课后可查看"}}</div>
<div v-if="shangeKeState==2&&videoPath==''" style="height:262px;border-radius:12px;font-size:20px;padding-top:111px;" class="bg-dark text-grey-2 text-center">正在上传上课录像</div>
<div v-if="videoAuth" style="height:262px;border-radius:12px;" class="bg-dark">
<!--<q-video
:ratio="16/9"
:src="videoPath"
/>
/>-->
<vue-aliplayer-v2 ref="VueAliplayerV2" :options="options" />
</div>
<div class="pingfang-b" style="font-size:18px;margin-bottom:20px;margin-top:20px;">期间录像</div>
<!-- <div class="pingfang-b" style="font-size:18px;margin-bottom:20px;margin-top:20px;">期间录像</div>
<div v-if="shangeKeState!=-1" style="height:262px;border-radius:12px;font-size:20px;padding-top:111px;" class="bg-dark text-grey-2 text-center">{{shangeKeState==0?"上课后将启动自动录屏":"视频录制中,下课后可查看"}}</div>
<div v-if="videoPath!=''" style="height:262px;border-radius:12px;" class="bg-dark">
<q-video
:ratio="16/9"
:src="videoPath"
/>
</div>
</div>-->
</q-scroll-area>
</div>
<div style="width:248px;padding:20px;" class="bg-white full-height">
......@@ -97,10 +99,10 @@
<q-spinner-facebook />
</template>
</q-btn>
<q-btn @click="changeClassStatus" disable v-if="user.ClassInfo.ClassStatus==2" label="资料上传中" style="width:100%;" color="grey"></q-btn>
<div v-if="shangeKeState==2 && videoPath==''">你已完成授课,辛苦啦,后台正在上传视频,请勿关闭电视。</div>
<!-- <q-btn @click="changeClassStatus" disable label="资料上传中" style="width:100%;" color="grey"></q-btn> -->
<q-btn @click="changeClassStatus" v-if="user.ClassInfo.ClassStatus==1 && !classOver" label="正在上课" style="width:100%;" color="grey"></q-btn>
<q-btn @click="changeClassStatus" v-if="shangeKeState==1" label="下 课" style="width:100%;background:rgb(0,197,154);color:white;"></q-btn>
<q-btn @click="changeClassStatus" disable v-if="user.ClassInfo.ClassStatus==2" label="资料上传中" style="width:100%;" color="grey"></q-btn>
</div>
</div>
</div>
......@@ -113,13 +115,22 @@
<script>
import Lockr from 'lockr'
import VueAliplayerV2 from 'vue-aliplayer-v2';
import {queryVideoAuth} from '../api/room/class_room'
// import carmers from './camers'
export default {
components: {
//carmers
VueAliplayerV2
},
props:["vPath"],
data() {
return {
options: {
isLive: false, //切换为直播流的时候必填
autoplay:false,
height:"100%"
},
room: null,
user: null,
submitting: false,
......@@ -128,7 +139,9 @@ export default {
borderRadius: '5px',
backgroundColor: '#333',
width: '5px',
opacity: 0.4
opacity: 0.4,
preload:true,
},
barStyle: {
......@@ -145,7 +158,19 @@ export default {
currentSecond:0,
shangeKeState:0,
videoPath:"",
moniState:0
moniState:0,
videoAuth:null
}
},
watch: {
vPath:{
handler(newV,oldV){
if(newV && newV!=''){
this.videoPath=newV
this.initVideoAuth();
}
},
deep:true
}
},
mounted() {
......@@ -164,16 +189,24 @@ export default {
this.setClassDownStatus()
}, 1000);
this.$root.$on("update_suipai_img",r=>{
console.log("视频路径:"+r)
this.updatePic(r)
})
if(this.vPath && this.vPath!=''){
this.videoPath=this.vPath
this.initVideoAuth();
}
this.$q.electron.ipcRenderer.on("NEW_CLASS_UP_VIDEO",(e,r)=>{
this.videoPath=r;
})
},
methods: {
initVideoAuth(){
queryVideoAuth({strVid:this.videoPath}).then(r=>{
console.log(r.Data)
this.options.vid=this.videoPath
this.options.playauth=r.Data.PlayAuth
this.options.cover=r.Data.VideoMeta.CoverURL
this.options.encryptType=1
this.videoAuth=r.Data
})
},
moni(){
if(this.moniState==0){
this.$q.electron.ipcRenderer.send("GO_TO_CLASS")
......@@ -214,14 +247,33 @@ export default {
return Math.floor(Math.random() * (max - min + 1)) + min;
},
changeClassStatus() {
if(!this.submitting){
this.submitting=true
if(this.shangeKeState==0){
this.$q.dialog({
title: '上课提醒',
message: '开始上课后,系统将停止人脸识别签到,需要手动进行学员签到',
ok: "确认上课",
cancel: "取消",
seamless:true,
persistent: true
}).onOk(() => {
this.$root.$emit("play_music")
this.$q.electron.ipcRenderer.send("GO_TO_CLASS")
this.shangeKeState=1
}).onCancel(() => {
// console.log('>>>> Cancel')
}).onDismiss(() => {
// console.log('I am triggered on both OK and Cancel')
this.submitting=false
})
}else{
this.$root.$emit("play_music")
this.$q.electron.ipcRenderer.send("CLOSE_VIDEO",this.room.Id)
this.shangeKeState=-1
this.submitting=false
}
}
},
setClassDownStatus() {
......
......@@ -92,6 +92,9 @@ export default {
this.$q.electron.ipcRenderer.send("OPEN_CLASS_ROOM_INIT")
},
close(){
if(this.isValing){
this.$q.electron.ipcRenderer.send("CLOSE_VALIDATE_VIDEO")
}
this.$q.electron.ipcRenderer.send("EXIT_LOGIN_OPENPOPU")
},
gologin() {
......
......@@ -19,10 +19,10 @@
<div class="full-height col">
<q-tab-panels v-model="pannelName" animated class="full-height">
<q-tab-panel class="q-pa-none full-height" name="main">
<class-info v-if="!isReload"></class-info>
<class-info v-if="!isReload" :vPath="videoPath"></class-info>
</q-tab-panel>
<q-tab-panel class="q-pa-none full-height" name="sign">
<check-in></check-in>
<check-in ref="checkInBox" :checkIns="checkInList"></check-in>
</q-tab-panel>
</q-tab-panels>
</div>
......@@ -42,6 +42,7 @@ import classInfo from '../components/class_info'
import checkIn from '../components/check_in'
import { addAuth } from "../utils/auth";
import Lockr from 'lockr'
import {setStudentCheckIn} from '../api/room/class_room'
export default {
data() {
return {
......@@ -66,26 +67,73 @@ export default {
],
crtMenu: 0,
pannelName:"main",
isReload:false
isReload:false,
checkInList:[],
videoPath:""
}
},
components:{classInfo,checkIn},
mounted() {
this.$root.$on("play_music",this.playStart)
if (Lockr.get("Token")) {
let token = Lockr.get("Token");
addAuth(token);
}
created(){
this.$q.electron.ipcRenderer.on("RELOAD_USER_INFO",(event,userInfo)=>{
console.log("哈哈,我被命中了")
Lockr.set("loginUserInfo",userInfo)
let token = userInfo.Token;
addAuth(token);
this.isReload = true
this.$nextTick(function(){
this.isReload = false
})
});
this.$q.electron.ipcRenderer.on("UPDATE_STUDENT_CHECKIN",(e,r)=>{
console.log("哈哈,我被命中了",r)
this.setUserCheckIn(r)
})
this.$q.electron.ipcRenderer.on("NEW_CLASS_UP_VIDEO",(e,r)=>{
this.videoPath=r;
})
},
mounted() {
this.$root.$on("play_music",this.playStart)
if (Lockr.get("loginUserInfo")) {
let user = Lockr.get("loginUserInfo");
let token = user.Token;
addAuth(token);
this.$q.electron.ipcRenderer.send("BEGIN_STUDENTS_CHECKIN",user.ClassInfo.ClassId);
}
},
methods: {
setUserCheckIn(id){
if (Lockr.get("loginUserInfo")) {
let user = Lockr.get("loginUserInfo");
let room = Lockr.get("room_config");
let msg={
classId:user.ClassInfo.ClassId,
ClassDate:user.ClassInfo.ClassTime.split(' ')[0],
ClassRoomId:room.Id,
School_Id:user.School_Id,
TeacherId:user.Id,
OrderGuestId:id,
CheckStatus:0,
StudyNum:"90",
ClassTimeId:user.ClassInfo.ClassTimeId
};
console.log(this.$refs.checkInBox)
setStudentCheckIn(msg).then(r=>{
//d
//this.checkInList.push(r)
if(this.pannelName=="sign"){
this.$refs.checkInBox.initStudents()
}
});
}
},
signout(){
Lockr.rm("loginUserInfo")
this.$q.electron.ipcRenderer.send("USER_SIGNOUT");
......
......@@ -88,6 +88,10 @@ export default {
this.room = Lockr.get("room_config")
this.getClassTimeList()
}
let that=this
this.$q.electron.ipcRenderer.on("REFER_PAGE",(e)=>{
that.getClassTimeList()
})
//this.$q.electron.ipcRenderer.send("OPEN_LOCK_SCREEN")
},
methods: {
......
import axios from "axios";
import Lockr from "lockr"
import {
removeAuth
} from "../utils/auth";
......@@ -16,6 +17,7 @@ const service = axios.create({
timeout: 15000
});
// request拦截器
service.interceptors.request.use(
config => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment