Merge branch 'main' into zhuhao_dev
This commit is contained in:
commit
4b2f2aa73a
|
@ -13,6 +13,7 @@ const defaultData = {
|
||||||
showBoardAll: false, // 全屏画板-是否显示
|
showBoardAll: false, // 全屏画板-是否显示
|
||||||
isPdfWin: false, // pdf窗口是否打开
|
isPdfWin: false, // pdf窗口是否打开
|
||||||
isToolWin: false, // 工具窗口是否打开
|
isToolWin: false, // 工具窗口是否打开
|
||||||
|
isTaskWin: false, // 批改窗口是否打开
|
||||||
curSubjectNode: {
|
curSubjectNode: {
|
||||||
querySearch: {} // 查询资源所需参数
|
querySearch: {} // 查询资源所需参数
|
||||||
},
|
},
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 51 KiB |
|
@ -276,6 +276,7 @@ const cloneDialog = (formEl) => {
|
||||||
expandedKeys.value = []
|
expandedKeys.value = []
|
||||||
formEl.resetFields()
|
formEl.resetFields()
|
||||||
model.value = false
|
model.value = false
|
||||||
|
emit('on-close')
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
|
@ -80,9 +80,7 @@ import { updateUserInfo } from '@/api/system/user'
|
||||||
import logoIco from '@/assets/images/logo.png'
|
import logoIco from '@/assets/images/logo.png'
|
||||||
import { listEvaluation } from '@/api/classManage/index'
|
import { listEvaluation } from '@/api/classManage/index'
|
||||||
import { sessionStore } from '@/utils/store'
|
import { sessionStore } from '@/utils/store'
|
||||||
import { useToolState } from '@/store/modules/tool'
|
|
||||||
|
|
||||||
const toolState = useToolState();
|
|
||||||
let homeTitle = ref(import.meta.env.VITE_APP_TITLE)
|
let homeTitle = ref(import.meta.env.VITE_APP_TITLE)
|
||||||
const { ipcRenderer } = window.electron || {}
|
const { ipcRenderer } = window.electron || {}
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
@ -153,7 +151,8 @@ function handleCommand(command) {
|
||||||
|
|
||||||
function logout() {
|
function logout() {
|
||||||
const hasClass = sessionStore.has('activeClass.id')
|
const hasClass = sessionStore.has('activeClass.id')
|
||||||
if (hasClass || toolState.isToolWin) return ElMessage.warning('当前正在上课,请先结结束上课')
|
const hasTool = sessionStore.get('isToolWin')
|
||||||
|
if (hasClass || hasTool) return ElMessage.warning('当前正在上课,请先结束上课')
|
||||||
ElMessageBox.confirm('确认退出系统吗?', '提示', {
|
ElMessageBox.confirm('确认退出系统吗?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
|
|
|
@ -4,14 +4,7 @@
|
||||||
<Header />
|
<Header />
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main>
|
<el-main>
|
||||||
<template v-if="currentRoute.path != '/home'">
|
<AppMain />
|
||||||
<el-page-header @back="goBack">
|
|
||||||
<template #content>
|
|
||||||
<span class="text-large mr-3"> {{ currentRoute.meta.title }} </span>
|
|
||||||
</template>
|
|
||||||
</el-page-header>
|
|
||||||
</template>
|
|
||||||
<AppMain :style="{ height: currentRoute.path == '/home' ? '100%' : 'calc(100% - 45px)'}" />
|
|
||||||
</el-main>
|
</el-main>
|
||||||
<Uploader v-if="uploaderStore.uploadList && uploaderStore.uploadList.length > 0" />
|
<Uploader v-if="uploaderStore.uploadList && uploaderStore.uploadList.length > 0" />
|
||||||
<AiChart/>
|
<AiChart/>
|
||||||
|
@ -19,32 +12,16 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { watch } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import Header from './components/Header.vue'
|
import Header from './components/Header.vue'
|
||||||
import AppMain from './components/AppMain.vue'
|
import AppMain from './components/AppMain.vue'
|
||||||
import Uploader from './components/Uploader.vue'
|
import Uploader from './components/Uploader.vue'
|
||||||
import AiChart from '@/components/ai-chart/index.vue'
|
import AiChart from '@/components/ai-chart/index.vue'
|
||||||
import uploaderState from '@/store/modules/uploader'
|
import uploaderState from '@/store/modules/uploader'
|
||||||
import { ref } from 'vue'
|
|
||||||
|
|
||||||
const router = useRouter()
|
|
||||||
const currentRoute = ref('')
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => router.currentRoute.value,
|
|
||||||
(newValue) => {
|
|
||||||
currentRoute.value = newValue
|
|
||||||
},
|
|
||||||
{ immediate: true }
|
|
||||||
)
|
|
||||||
|
|
||||||
let uploaderStore = ref(uploaderState())
|
let uploaderStore = ref(uploaderState())
|
||||||
|
|
||||||
const goBack = () =>{
|
|
||||||
router.back()
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -10,6 +10,8 @@ import _ from 'lodash'
|
||||||
// import { diff } from 'jsondiffpatch'
|
// import { diff } from 'jsondiffpatch'
|
||||||
// const Remote = isNode?require('@electron/remote'):{} // 远程模块
|
// const Remote = isNode?require('@electron/remote'):{} // 远程模块
|
||||||
|
|
||||||
|
const exArrs = ['subject'] // 不需要同步key-排除
|
||||||
|
|
||||||
export function shareStorePlugin({store}) {
|
export function shareStorePlugin({store}) {
|
||||||
store.$subscribe((mutation, state) => { // 自动同步
|
store.$subscribe((mutation, state) => { // 自动同步
|
||||||
// mutation 变量包含了变化前后的状态
|
// mutation 变量包含了变化前后的状态
|
||||||
|
@ -54,6 +56,7 @@ function stateSync(storeName, key, value, state) {
|
||||||
// 同步数据-发送给主线程-单独($subscribe-监听使用)
|
// 同步数据-发送给主线程-单独($subscribe-监听使用)
|
||||||
function stateSyncWatch(storeName, newState) {
|
function stateSyncWatch(storeName, newState) {
|
||||||
const oldState = sessionStore.store // 旧数据
|
const oldState = sessionStore.store // 旧数据
|
||||||
|
exArrs.forEach(k => Object.keys(oldState).includes(k) && (delete oldState[k]))
|
||||||
const diffData = findDifferences(oldState, newState)
|
const diffData = findDifferences(oldState, newState)
|
||||||
if(!_.keys(diffData).length) return // 没有变化就终止执行
|
if(!_.keys(diffData).length) return // 没有变化就终止执行
|
||||||
// 数据处理: 找出差异
|
// 数据处理: 找出差异
|
||||||
|
@ -62,27 +65,23 @@ function stateSyncWatch(storeName, newState) {
|
||||||
let pinaValue = {} // store pina状态管理需要的数据格式
|
let pinaValue = {} // store pina状态管理需要的数据格式
|
||||||
// 数据转换处理
|
// 数据转换处理
|
||||||
for(const key in diffData) {
|
for(const key in diffData) {
|
||||||
const value = diffData[key] || null
|
const value = diffData[key]
|
||||||
const newValue = {} // 重新组装pinia需要的数据 {a:{b:1}} 这种
|
const newValue = {} // 重新组装pinia需要的数据 {a:{b:1}} 这种
|
||||||
const keyArr = key.split('.') || []
|
const keyArr = key.split('.') || []
|
||||||
keyArr.reduce((o,c,i)=>{o[c] = i === keyArr.length-1 ? value : {};return o[c]}, newValue)
|
keyArr.reduce((o,c,i)=>{o[c] = i === keyArr.length-1 ? value : {};return o[c]}, newValue)
|
||||||
// 合并数据 loadsh _.merge() 函数
|
// 合并数据 loadsh _.merge() 函数
|
||||||
_.merge(pinaValue, newValue)
|
_.merge(pinaValue, newValue)
|
||||||
}
|
}
|
||||||
|
const piniaArr = _.toPairs(pinaValue) // 对象转换为数组 {a:1} toPairs [['a',1]]
|
||||||
// 数据处理: electron-store
|
const setData = (key, value) => {
|
||||||
const [key, value] = _.toPairs(pinaValue)[0] // 对象转换为数组 {a:1} toPairs [['a',1]]
|
|
||||||
// 无数据就终止执行
|
// 无数据就终止执行
|
||||||
if (!key || !value) return
|
if (!key) return
|
||||||
|
|
||||||
// 更新本地数据-session
|
// 更新本地数据-session
|
||||||
// 直接获取当前最新值(整体更新),上面获取到value是差异值,并不能知道删除还是新增
|
// 直接获取当前最新值(整体更新),上面获取到value是差异值,并不能知道删除还是新增
|
||||||
const newValAll = _.get(newState, key)
|
const newValAll = _.get(newState, key)
|
||||||
const oldValAll = sessionStore.get(key)
|
const oldValAll = sessionStore.get(key)
|
||||||
|
|
||||||
// 没变化也终止执行
|
// 没变化也终止执行
|
||||||
if (_.isEqual(oldValAll, newValAll)) return
|
if (_.isEqual(oldValAll, newValAll)) return
|
||||||
|
|
||||||
// 更新本地数据-session
|
// 更新本地数据-session
|
||||||
sessionStore.set(key, newValAll)
|
sessionStore.set(key, newValAll)
|
||||||
|
|
||||||
|
@ -91,6 +90,11 @@ function stateSyncWatch(storeName, newState) {
|
||||||
// 通知主线程更新
|
// 通知主线程更新
|
||||||
ipcRenderer?.invoke('pinia-state-change', storeName, jsonStr)
|
ipcRenderer?.invoke('pinia-state-change', storeName, jsonStr)
|
||||||
// console.log('======',key, value, jsonStr )
|
// console.log('======',key, value, jsonStr )
|
||||||
|
}
|
||||||
|
// 数据处理: electron-store
|
||||||
|
for(let [key, value] of piniaArr) {
|
||||||
|
setData(key, value)
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('state-change-error', error)
|
console.log('state-change-error', error)
|
||||||
}
|
}
|
||||||
|
|
|
@ -377,6 +377,7 @@ const closeDialog = () => {
|
||||||
getStudentClassWorkDataPolling()
|
getStudentClassWorkDataPolling()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const openDialogTime = ref(null);//弹窗
|
||||||
/**
|
/**
|
||||||
* 开启新批改弹窗
|
* 开启新批改弹窗
|
||||||
* @param item 作业对象
|
* @param item 作业对象
|
||||||
|
@ -386,12 +387,15 @@ const onClickItem = (item) => {
|
||||||
clearInterval(pollingST.value)
|
clearInterval(pollingST.value)
|
||||||
// itemDialogRef.value.openDialog(item)
|
// itemDialogRef.value.openDialog(item)
|
||||||
|
|
||||||
// 新跳转子窗口链接
|
if(openDialogTime.value) return;
|
||||||
// 1、本地缓存item数据,2、打开子窗口 3、子窗口加载item数据
|
clearTimeout(openDialogTime.value)
|
||||||
// localStorage.setItem('teachClassWorkItem', JSON.stringify(item))
|
openDialogTime.value = setTimeout(() => {
|
||||||
sessionStore.set('teachClassWorkItem', item)
|
openDialogTime.value = null;
|
||||||
toolState.isTaskWin=true //设置打开批改窗口
|
toolState.isTaskWin=true; // 设置打开批改窗口
|
||||||
|
sessionStore.set('teachClassWorkItem', item); // 缓存点击的item
|
||||||
|
// 调用新窗口批改页面
|
||||||
createWindow('open-taskwin',{url:'/teachClassTask'})
|
createWindow('open-taskwin',{url:'/teachClassTask'})
|
||||||
|
}, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -67,14 +67,20 @@ const getHomework = async () => {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const openDialogTime = ref(null);//弹窗
|
||||||
// 批改作业
|
// 批改作业
|
||||||
const onClickItem = (item) => {
|
const onClickItem = (item) => {
|
||||||
console.log('开启弹窗')
|
console.log('开启弹窗')
|
||||||
// itemDialogRef.value.openDialog(item)
|
if(openDialogTime.value) return;
|
||||||
|
clearTimeout(openDialogTime.value)
|
||||||
|
openDialogTime.value = setTimeout(() => {
|
||||||
|
openDialogTime.value = null;
|
||||||
|
toolState.isTaskWin=true; // 设置打开批改窗口
|
||||||
|
sessionStore.set('teachClassWorkItem', item); // 缓存点击的item
|
||||||
// 调用新窗口批改页面
|
// 调用新窗口批改页面
|
||||||
sessionStore.set('teachClassWorkItem', item)
|
|
||||||
toolState.isTaskWin=true //设置打开批改窗口
|
|
||||||
createWindow('open-taskwin',{url:'/teachClassTask'})
|
createWindow('open-taskwin',{url:'/teachClassTask'})
|
||||||
|
}, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
const tagType = (time) => {
|
const tagType = (time) => {
|
||||||
|
|
|
@ -183,10 +183,10 @@ const clickMenu = ({isOuter, path, disabled, id}) =>{
|
||||||
// 头部 教材分析打开外部链接需要当前章节ID
|
// 头部 教材分析打开外部链接需要当前章节ID
|
||||||
const { id, rootid } = sessionStore.get('subject.curNode')
|
const { id, rootid } = sessionStore.get('subject.curNode')
|
||||||
if(fullPath.indexOf('?') == -1){
|
if(fullPath.indexOf('?') == -1){
|
||||||
fullPath += `?unitId=${id}&bookeId=${rootid}`
|
fullPath += `?unitId=${id}&bookId=${rootid}`
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
fullPath += `&unitId=${id}&bookeId=${rootid}`
|
fullPath += `&unitId=${id}&bookId=${rootid}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fullPath = fullPath.replaceAll('//', '/')
|
fullPath = fullPath.replaceAll('//', '/')
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="login-container">
|
<div class="login-container">
|
||||||
<div class="box-item desc">
|
<div class="box-item desc">
|
||||||
<div class="welcome">
|
<div class="welcome">
|
||||||
<p>欢迎登录 {{homeTitle}}</p>
|
<p>欢迎登录 {{ homeTitle }}</p>
|
||||||
</div>
|
</div>
|
||||||
<img class="welcome-img" :src="leftBg2" />
|
<img class="welcome-img" :src="leftBg2" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -14,22 +14,15 @@
|
||||||
<el-input v-model.trim="loginForm.username" placeholder="请输入用户名" />
|
<el-input v-model.trim="loginForm.username" placeholder="请输入用户名" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="password" style="margin-bottom: 15px">
|
<el-form-item prop="password" style="margin-bottom: 15px">
|
||||||
<el-input
|
<el-input v-model="loginForm.password" autocomplete="on" type="password" placeholder="请输入密码" />
|
||||||
v-model="loginForm.password"
|
|
||||||
autocomplete="on"
|
|
||||||
type="password"
|
|
||||||
placeholder="请输入密码"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div class="flex mb-5">
|
<div class="flex mb-5">
|
||||||
<el-checkbox v-model="loginForm.rememberMe" >记住密码</el-checkbox>
|
<el-checkbox v-model="loginForm.rememberMe">记住密码</el-checkbox>
|
||||||
<!-- <el-checkbox >阅读并同意《xxx》</el-checkbox> -->
|
<!-- <el-checkbox >阅读并同意《xxx》</el-checkbox> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button :loading="btnLoading" class="btn" type="primary" @click="submitForm(formRef)"
|
<el-button :loading="btnLoading" class="btn" type="primary" @click="submitForm(formRef)">登录</el-button>
|
||||||
>登录</el-button
|
|
||||||
>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div class="flex mb-4" style="display: flex;justify-content: center;color: #ccc;cursor: pointer;">
|
<div class="flex mb-4" style="display: flex;justify-content: center;color: #ccc;cursor: pointer;">
|
||||||
<a class="hover:text-sky-500" style="margin-right: 10px;" @click="RegisterModel(1)">注册账号</a>
|
<a class="hover:text-sky-500" style="margin-right: 10px;" @click="RegisterModel(1)">注册账号</a>
|
||||||
|
@ -39,21 +32,10 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog
|
<el-dialog v-model="showDownLoading" width="500" :show-close="false" :close-on-click-modal="false"
|
||||||
v-model="showDownLoading"
|
:close-on-press-escape="false" align-center>
|
||||||
width="500"
|
<el-progress :text-inside="true" :stroke-width="22" :percentage="downloadProp" :show-text="false"
|
||||||
:show-close="false"
|
status="success" />
|
||||||
:close-on-click-modal="false"
|
|
||||||
:close-on-press-escape="false"
|
|
||||||
align-center
|
|
||||||
>
|
|
||||||
<el-progress
|
|
||||||
:text-inside="true"
|
|
||||||
:stroke-width="22"
|
|
||||||
:percentage="downloadProp"
|
|
||||||
:show-text="false"
|
|
||||||
status="success"
|
|
||||||
/>
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!--选择学科-->
|
<!--选择学科-->
|
||||||
<SelectSubject v-model="isSubject" :login-data="loginForm" />
|
<SelectSubject v-model="isSubject" :login-data="loginForm" />
|
||||||
|
@ -69,6 +51,7 @@ import leftBg2 from '@/assets/images/login/left-bg2.png'
|
||||||
import WindowTools from '@/components/window-tools/index.vue'
|
import WindowTools from '@/components/window-tools/index.vue'
|
||||||
import SelectSubject from '@/components/select-subject/index.vue'
|
import SelectSubject from '@/components/select-subject/index.vue'
|
||||||
import Register from './components/Register.vue'
|
import Register from './components/Register.vue'
|
||||||
|
import { sessionStore } from '@/utils/store'
|
||||||
|
|
||||||
const { session } = require('@electron/remote')
|
const { session } = require('@electron/remote')
|
||||||
const downloadProp = ref(0)
|
const downloadProp = ref(0)
|
||||||
|
@ -99,7 +82,7 @@ ipcRenderer.on('update-app-progress', (e, prop) => {
|
||||||
showDownLoading.value = prop !== 100
|
showDownLoading.value = prop !== 100
|
||||||
})
|
})
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
const RegisterModel = type =>{
|
const RegisterModel = type => {
|
||||||
RegModel.value.OpenModel(type)
|
RegModel.value.OpenModel(type)
|
||||||
}
|
}
|
||||||
//登录
|
//登录
|
||||||
|
@ -168,6 +151,13 @@ const setCookie = (name, value) => {
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
localStorage.clear()
|
localStorage.clear()
|
||||||
|
sessionStore.set('subject', {
|
||||||
|
bookList: null,
|
||||||
|
curBook: null,
|
||||||
|
curNode: null,
|
||||||
|
defaultExpandedKeys: [],
|
||||||
|
subjectTree: []
|
||||||
|
})
|
||||||
getCookie()
|
getCookie()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@ -179,6 +169,7 @@ onMounted(() => {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
-webkit-app-region: drag;
|
-webkit-app-region: drag;
|
||||||
|
|
||||||
.box-item {
|
.box-item {
|
||||||
width: 444px;
|
width: 444px;
|
||||||
height: 520px;
|
height: 520px;
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
<div :title="value" v-if="!!value">
|
<div :title="value" v-if="!!value">
|
||||||
<vue-qr :text="value" :size="200" :margin="10" colorDark="green" colorLight="white" :logoSrc="getStaticUrl('/img/logo.png')" :logoScale="0.2" :dotScale="0.7"></vue-qr>
|
<vue-qr :text="value" :size="200" :margin="10" colorDark="green" colorLight="white" :logoSrc="getStaticUrl('/img/logo.png')" :logoScale="0.2" :dotScale="0.7"></vue-qr>
|
||||||
</div>
|
</div>
|
||||||
<!-- <el-button type="primary" :icon="Refresh" round title="刷新" @click="getQrUrl()" /> -->
|
<el-button type="primary" :icon="Refresh" round title="刷新" @click="getQrUrl()" />
|
||||||
<!-- <el-button type="warning" :loading="dt.loadingDel" @click="removeClasscourse()">删除记录</el-button>-->
|
<!-- <el-button type="warning" :loading="dt.loadingDel" @click="removeClasscourse()">删除记录</el-button>-->
|
||||||
</template>
|
</template>
|
||||||
<!-- 手机登录 -->
|
<!-- 手机登录 -->
|
||||||
|
@ -96,7 +96,7 @@ import * as Http_api from '@/api/apiService' // api接口
|
||||||
import useUserStore from "@/store/modules/user" // 状态管理:user
|
import useUserStore from "@/store/modules/user" // 状态管理:user
|
||||||
import CryptoJS from 'crypto-js'
|
import CryptoJS from 'crypto-js'
|
||||||
|
|
||||||
const baseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
let baseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const visible = ref(false) // 是否打开窗口
|
const visible = ref(false) // 是否打开窗口
|
||||||
const myClassActive = ref({}) // 我的课件:准备上课的APT课件
|
const myClassActive = ref({}) // 我的课件:准备上课的APT课件
|
||||||
|
@ -286,30 +286,30 @@ const getQrUrl = async() => {
|
||||||
const { userName, userId } = userStore.user
|
const { userName, userId } = userStore.user
|
||||||
if (!id||!userName) return
|
if (!id||!userName) return
|
||||||
// 原始方法(需要wx登录)
|
// 原始方法(需要wx登录)
|
||||||
const qrCodeUrl = `wxlogin?username=${userName}&nextaction=classteaching&id=${id}`
|
// const qrCodeUrl = `wxlogin?username=${userName}&nextaction=classteaching&id=${id}`
|
||||||
|
// teacherForm.form.qrUrl = baseUrl + qrCodeUrl
|
||||||
|
// baseUrl = 'https://localhost:7860'
|
||||||
|
// token跳转
|
||||||
|
let url = `teaching/classteachingonmobile?classcourseid=${id}` // 跳转移动端-上课
|
||||||
|
let qrCodeUrl = '' // 移动端-二维码地址
|
||||||
|
try {
|
||||||
|
// 走后端缓存url
|
||||||
|
const res = await Http_api.toLink.setLink('/' + url) // 设置链接-缓存
|
||||||
|
if (res.code == 200) {
|
||||||
|
const redisKey = res.data
|
||||||
|
const base64Key = CryptoJS.enc.Utf8.parse(redisKey).toString(CryptoJS.enc.Base64) // base64加密
|
||||||
|
const enStrUrl = encodeURIComponent(base64Key) // url转码
|
||||||
|
qrCodeUrl = `${url}&_server=${enStrUrl}`
|
||||||
|
teacherForm.form.qrUrl = baseUrl + qrCodeUrl
|
||||||
|
}
|
||||||
|
} catch (error) { // 异常, 直接加密token
|
||||||
|
const jsonStr = JSON.stringify({ url, token: userStore.token }) // json数据:{url, token}
|
||||||
|
const key = `Ax19i14Ga6qEDOkGTo` // AES加密-key
|
||||||
|
const enStr = CryptoJS.AES.encrypt(jsonStr, key).toString() // AES加密-数据
|
||||||
|
const enStrUrl = encodeURIComponent(enStr) // url转码
|
||||||
|
qrCodeUrl = `${url}&?_web=${enStrUrl}`
|
||||||
|
}
|
||||||
teacherForm.form.qrUrl = baseUrl + qrCodeUrl
|
teacherForm.form.qrUrl = baseUrl + qrCodeUrl
|
||||||
// // const baseUrl = 'https://localhost:7860'
|
|
||||||
// // token跳转
|
|
||||||
// const url = `/teaching/classteachingonmobile?classcourseid=${id}` // 跳转移动端-上课
|
|
||||||
// let qrCodeUrl = '' // 移动端-二维码地址
|
|
||||||
// try {
|
|
||||||
// // 走后端缓存url
|
|
||||||
// const res = await Http_api.toLink.setLink(url) // 设置链接-缓存
|
|
||||||
// if (res.code == 200) {
|
|
||||||
// const redisKey = res.data
|
|
||||||
// const base64Key = CryptoJS.enc.Utf8.parse(redisKey).toString(CryptoJS.enc.Base64) // base64加密
|
|
||||||
// const enStrUrl = encodeURIComponent(base64Key) // url转码
|
|
||||||
// qrCodeUrl = `?_server=${enStrUrl}`
|
|
||||||
// teacherForm.form.qrUrl = baseUrl + qrCodeUrl
|
|
||||||
// }
|
|
||||||
// } catch (error) { // 异常, 直接加密token
|
|
||||||
// const jsonStr = JSON.stringify({ url, token: userStore.token }) // json数据:{url, token}
|
|
||||||
// const key = `Ax19i14Ga6qEDOkGTo` // AES加密-key
|
|
||||||
// const enStr = CryptoJS.AES.encrypt(jsonStr, key).toString() // AES加密-数据
|
|
||||||
// const enStrUrl = encodeURIComponent(enStr) // url转码
|
|
||||||
// qrCodeUrl = `?_web=${enStrUrl}`
|
|
||||||
// }
|
|
||||||
// teacherForm.form.qrUrl = baseUrl + qrCodeUrl
|
|
||||||
}
|
}
|
||||||
// 定时器监听
|
// 定时器监听
|
||||||
|
|
||||||
|
|
|
@ -86,10 +86,16 @@
|
||||||
<span>布置</span>
|
<span>布置</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="item-popover-item">
|
||||||
|
<el-button text @click="reSetHomeWork(item, index)">
|
||||||
|
<i class="iconfont icon-bianji"></i>
|
||||||
|
<span>编辑</span>
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
<div class="item-popover-item">
|
<div class="item-popover-item">
|
||||||
<el-button text @click="deleteHomework(item)">
|
<el-button text @click="deleteHomework(item)">
|
||||||
<i class="iconfont icon-shanchu"></i>
|
<i class="iconfont icon-shanchu"></i>
|
||||||
<span>删除</span>
|
<span style="color: red;">删除</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -110,7 +116,7 @@
|
||||||
<div class="item-popover-item" v-if="userInfo.userId === Number(item.createUserId)">
|
<div class="item-popover-item" v-if="userInfo.userId === Number(item.createUserId)">
|
||||||
<el-button text @click="deleteTalk(item)">
|
<el-button text @click="deleteTalk(item)">
|
||||||
<i class="iconfont icon-shanchu"></i>
|
<i class="iconfont icon-shanchu"></i>
|
||||||
<span>删除</span>
|
<span style="color: red;">删除</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-popover-item">
|
<div class="item-popover-item">
|
||||||
|
@ -168,7 +174,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
emits: { 'on-move': null, 'on-delete': null, 'on-set': null, 'on-delhomework': null,'on-filearg': null },
|
emits: { 'on-move': null, 'on-delete': null, 'on-set': null, 'on-reSet': null, 'on-delhomework': null,'on-filearg': null },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
listenList: [],
|
listenList: [],
|
||||||
|
@ -275,6 +281,10 @@ export default {
|
||||||
setHomeWork(item) {
|
setHomeWork(item) {
|
||||||
this.$emit('on-set', item)
|
this.$emit('on-set', item)
|
||||||
},
|
},
|
||||||
|
// 编辑
|
||||||
|
reSetHomeWork(item) {
|
||||||
|
this.$emit('on-reSet', item)
|
||||||
|
},
|
||||||
// 删除作业
|
// 删除作业
|
||||||
deleteHomework(item){
|
deleteHomework(item){
|
||||||
this.$emit('on-delhomework', item)
|
this.$emit('on-delhomework', item)
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
<div class="item-popover-item">
|
<div class="item-popover-item">
|
||||||
<el-button text @click="deleteTalk(item)">
|
<el-button text @click="deleteTalk(item)">
|
||||||
<i class="iconfont icon-shanchu"></i>
|
<i class="iconfont icon-shanchu"></i>
|
||||||
<span>删除</span>
|
<span style="color: red;">删除</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -116,22 +116,20 @@
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="作业" name="作业">
|
<el-tab-pane label="作业" name="作业">
|
||||||
<!-- <div class="prepare-body-header">
|
<div class="prepare-body-header">
|
||||||
<div>
|
<div>
|
||||||
<label style="font-size: 15px">共{{ currentWorkList.length }}个作业</label>
|
<label style="font-size: 15px">共{{ currentWorkList.length }}个作业</label>
|
||||||
<el-button size="small" @click="handleOutLink('feedback')">作业反馈</el-button>
|
<el-button size="small" @click="handleOutLink('homeWork')">作业设计</el-button>
|
||||||
<el-button size="small" @click="handleOutLink('homeWork')">布置作业</el-button>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>-->
|
|
||||||
<div class="prepare-work-wrap">
|
<div class="prepare-work-wrap">
|
||||||
<file-list-item
|
<file-list-item
|
||||||
v-for="(item, index) in currentWorkList"
|
v-for="(item, index) in currentWorkList"
|
||||||
:key="index"
|
:key="index"
|
||||||
:item="item"
|
:item="item"
|
||||||
:index="index"
|
:index="index"
|
||||||
@on-move="onMoveSingleFile"
|
|
||||||
@on-delete="deleteTalk"
|
|
||||||
@on-set="openSet"
|
@on-set="openSet"
|
||||||
|
@on-reSet="openReSet"
|
||||||
@on-delhomework="delhomework"
|
@on-delhomework="delhomework"
|
||||||
>
|
>
|
||||||
</file-list-item>
|
</file-list-item>
|
||||||
|
@ -596,6 +594,7 @@ export default {
|
||||||
openReserv() {
|
openReserv() {
|
||||||
this.$refs['reservDialog'].openDialog()
|
this.$refs['reservDialog'].openDialog()
|
||||||
},
|
},
|
||||||
|
|
||||||
// 打开外部链接
|
// 打开外部链接
|
||||||
handleOutLink(key) {
|
handleOutLink(key) {
|
||||||
if (key == 'homeWork') {
|
if (key == 'homeWork') {
|
||||||
|
@ -609,12 +608,15 @@ export default {
|
||||||
let unitId = this.uploadData.levelSecondId
|
let unitId = this.uploadData.levelSecondId
|
||||||
? this.uploadData.levelSecondId
|
? this.uploadData.levelSecondId
|
||||||
: this.uploadData.levelFirstId
|
: this.uploadData.levelFirstId
|
||||||
if (key == 'gk') {
|
let bookId = this.uploadData.textbookId;
|
||||||
fullPath += `?unitId=${unitId}`
|
if(fullPath.indexOf('?') == -1){
|
||||||
} else {
|
fullPath += `?unitId=${unitId}&bookId=${bookId}&openDialog=newClassTask`
|
||||||
fullPath += `&unitId=${unitId}`
|
}
|
||||||
|
else{
|
||||||
|
fullPath += `&unitId=${unitId}&bookId=${bookId}&openDialog=newClassTask`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 通知主进程
|
// 通知主进程
|
||||||
ipcRenderer.send('openWindow', {
|
ipcRenderer.send('openWindow', {
|
||||||
key,
|
key,
|
||||||
|
@ -632,6 +634,27 @@ export default {
|
||||||
this.row = row
|
this.row = row
|
||||||
this.setDialog = true
|
this.setDialog = true
|
||||||
},
|
},
|
||||||
|
// 打开作业编辑窗口
|
||||||
|
openReSet(row) {
|
||||||
|
// 新窗口打开标识
|
||||||
|
this.isOpenHomework = true;
|
||||||
|
// key 对应的 linkConfig.js 外部链接配置
|
||||||
|
let configObj = outLink()['homeWork']
|
||||||
|
let fullPath = configObj.fullPath
|
||||||
|
|
||||||
|
let unitId = this.uploadData.levelSecondId
|
||||||
|
? this.uploadData.levelSecondId
|
||||||
|
: this.uploadData.levelFirstId
|
||||||
|
let bookId = this.uploadData.textbookId;
|
||||||
|
fullPath += `&unitId=${unitId}&bookId=${bookId}&courseWorkId=${row.id}`
|
||||||
|
|
||||||
|
// 通知主进程
|
||||||
|
ipcRenderer.send('openWindow', {
|
||||||
|
key: 'homeWork',
|
||||||
|
fullPath: fullPath,
|
||||||
|
cookieData: { ...configObj.data }
|
||||||
|
})
|
||||||
|
},
|
||||||
// 删除作业
|
// 删除作业
|
||||||
delhomework(item) {
|
delhomework(item) {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
|
@ -874,6 +897,7 @@ export default {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
.prepare-body-main {
|
.prepare-body-main {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
@click="delRow(item)"
|
@click="delRow(item)"
|
||||||
>
|
>
|
||||||
<i class="iconfont icon-shanchu"></i>
|
<i class="iconfont icon-shanchu"></i>
|
||||||
<span>删除</span>
|
<span style="color: red;">删除</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-popover-item" @click="downloadFile(item)">
|
<div class="item-popover-item" @click="downloadFile(item)">
|
||||||
<i class="iconfont icon-xiazai"></i>
|
<i class="iconfont icon-xiazai"></i>
|
||||||
|
|
|
@ -220,13 +220,13 @@ const sideChange = async o => {
|
||||||
await imChatRef.value?.imChatObj?.imChat?.sendMsgClosed() // 发送下课消息
|
await imChatRef.value?.imChatObj?.imChat?.sendMsgClosed() // 发送下课消息
|
||||||
// const elMsg = ElMessage.warning({duration:0,message:'正在下课...'})
|
// const elMsg = ElMessage.warning({duration:0,message:'正在下课...'})
|
||||||
const elMsg = ElLoading.service({lock: true, text: '正在下课...', background: 'rgba(0, 0, 0, 0.7)'})
|
const elMsg = ElLoading.service({lock: true, text: '正在下课...', background: 'rgba(0, 0, 0, 0.7)'})
|
||||||
// 延迟2秒后关闭窗口,如果马上解散群,会导致群组不存在
|
|
||||||
setTimeout(async() => {
|
|
||||||
// toolStore.isToolWin = false
|
// toolStore.isToolWin = false
|
||||||
toolStore.resetDef() // 重置状态
|
toolStore.resetDef() // 重置状态
|
||||||
|
await classManageApi.endClass(route.query.reservId)
|
||||||
|
// 延迟2秒后关闭窗口,如果马上解散群,会导致群组不存在
|
||||||
|
setTimeout(async() => {
|
||||||
await imChatRef.value?.deleteGroup() // 解散群
|
await imChatRef.value?.deleteGroup() // 解散群
|
||||||
await imChatRef.value?.logout() // 退出im
|
await imChatRef.value?.logout() // 退出im
|
||||||
await classManageApi.endClass(route.query.reservId)
|
|
||||||
elMsg.close()
|
elMsg.close()
|
||||||
ipcMsgSend('tool-sphere:close') // 关闭窗口
|
ipcMsgSend('tool-sphere:close') // 关闭窗口
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
Loading…
Reference in New Issue