Compare commits
No commits in common. "62a5339d040c2012f5515f338aa916feb336a351" and "241b0d3f2403bb3b7114d93d3417881e714db1bb" have entirely different histories.
62a5339d04
...
241b0d3f24
|
@ -31,17 +31,17 @@ function createLoginWindow() {
|
|||
preload: join(__dirname, '../preload/index.js'),
|
||||
sandbox: false,
|
||||
nodeIntegration: true,
|
||||
contextIsolation: false // 沙箱取消
|
||||
contextIsolation: false, // 沙箱取消
|
||||
}
|
||||
})
|
||||
loginWindow.type = 'login' // 唯一标识
|
||||
loginWindow.type = 'login' // 唯一标识
|
||||
// handleUpdate(loginWindow,ipcMain)
|
||||
// const loginURL = is.dev ? `http://localhost:5173/#/login` : `file://${__dirname}/index.html/#/login`
|
||||
// loginWindow.loadURL(loginURL)
|
||||
if (is.dev && process.env['ELECTRON_RENDERER_URL']) {
|
||||
loginWindow.loadURL('http://localhost:5173/#/login')
|
||||
} else {
|
||||
loginWindow.loadFile(join(__dirname, '../renderer/index.html'), { hash: 'login' })
|
||||
loginWindow.loadFile(join(__dirname, '../renderer/index.html'), {hash: 'login'})
|
||||
updateInit(loginWindow)
|
||||
}
|
||||
|
||||
|
@ -70,18 +70,17 @@ function createMainWindow() {
|
|||
preload: join(__dirname, '../preload/index.js'),
|
||||
sandbox: false,
|
||||
// nodeIntegration: true,
|
||||
nodeIntegration: true, // nodeApi调用
|
||||
contextIsolation: false // 沙箱取消
|
||||
nodeIntegration: true, // nodeApi调用
|
||||
contextIsolation: false, // 沙箱取消
|
||||
// webSecurity: false // 跨域关闭
|
||||
}
|
||||
})
|
||||
mainWindow.type = 'main' // 唯一标识
|
||||
mainWindow.type = 'main' // 唯一标识
|
||||
mainWindow.on('ready-to-show', () => {
|
||||
mainWindow.show()
|
||||
})
|
||||
mainWindow.on('closed', () => {
|
||||
setTimeout(() => {
|
||||
// 延迟销毁
|
||||
setTimeout(() => { // 延迟销毁
|
||||
mainWindow = null
|
||||
}, 1000)
|
||||
// app.quit() // 主窗口关闭-结束所有进程
|
||||
|
@ -93,7 +92,7 @@ function createMainWindow() {
|
|||
mainWindow.webContents.openDevTools()
|
||||
|
||||
if (is.dev && process.env['ELECTRON_RENDERER_URL']) {
|
||||
mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL'])
|
||||
mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL'] )
|
||||
} else {
|
||||
mainWindow.loadFile(join(__dirname, '../renderer/index.html'))
|
||||
}
|
||||
|
@ -103,6 +102,7 @@ function createMainWindow() {
|
|||
remote.enable(mainWindow.webContents)
|
||||
}
|
||||
|
||||
|
||||
// 作业窗口相关-开发中
|
||||
let linkWindow
|
||||
async function createLinkWin(data) {
|
||||
|
@ -120,17 +120,14 @@ async function createLinkWin(data) {
|
|||
contextIsolation: true
|
||||
}
|
||||
})
|
||||
linkWindow.type = 'link' // 唯一标识
|
||||
linkWindow.type = 'link' // 唯一标识
|
||||
let cookieDetails = { ...data.cookieData }
|
||||
await linkWindow.webContents.session.cookies
|
||||
.set(cookieDetails)
|
||||
.then(() => {
|
||||
console.log('Cookie is successful')
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Cookie is error', error)
|
||||
})
|
||||
data.fullPath = data.fullPath.replaceAll('//', '/')
|
||||
await linkWindow.webContents.session.cookies.set(cookieDetails).then(()=>{
|
||||
console.log('Cookie is successful');
|
||||
}).catch( error =>{
|
||||
console.error('Cookie is error', error);
|
||||
})
|
||||
|
||||
linkWindow.loadURL(data.fullPath)
|
||||
|
||||
linkWindow.once('ready-to-show', () => {
|
||||
|
@ -172,10 +169,9 @@ app.on('ready', () => {
|
|||
}
|
||||
if (mainWindow) {
|
||||
mainWindow.close() // 先发出这个关闭指令
|
||||
setTimeout(() => {
|
||||
//
|
||||
setTimeout(() => { //
|
||||
mainWindow.destroy()
|
||||
}, 200)
|
||||
}, 200);
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -203,19 +199,21 @@ app.on('ready', () => {
|
|||
createLinkWin(data)
|
||||
})
|
||||
// 新窗口创建-监听
|
||||
ipcMain.on('new-window', (e, data) => {
|
||||
ipcMain.on('new-window', (e,data) => {
|
||||
const { id, type } = data
|
||||
const win = BrowserWindow.fromId(id)
|
||||
win.type = type // 绑定独立标识
|
||||
remote.enable(win.webContents) // 开启远程服务
|
||||
})
|
||||
|
||||
|
||||
// 打开-登录窗口
|
||||
createLoginWindow()
|
||||
|
||||
app.on('activate', function () {
|
||||
if (BrowserWindow.getAllWindows().length === 0) createLoginWindow()
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
// Quit when all windows are closed, except on macOS. There, it's common
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
http-equiv="Content-Security-Policy"
|
||||
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:"
|
||||
/> -->
|
||||
<meta http-equiv="Content-Security-Policy" content="connect-src *; default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src * 'self' data: blob:" />
|
||||
<meta http-equiv="Content-Security-Policy" content="connect-src *; default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src * 'self' data: blob:" />
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -55,8 +55,6 @@
|
|||
|
||||
<script setup>
|
||||
import { ref, reactive, toRaw, onMounted, nextTick, watch } from 'vue'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { listEvaluation } from '@/api/subject'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
|
@ -68,8 +66,6 @@ const props = defineProps({
|
|||
default: '移动至'
|
||||
}
|
||||
})
|
||||
const userStore = useUserStore()
|
||||
const { edustage, edusubject, userId } = userStore.user
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const bookVisible = ref(false)
|
||||
|
@ -110,26 +106,10 @@ watch(() => props.modelValue, (newVal) => {
|
|||
})
|
||||
|
||||
|
||||
const getSubjectContent = async () => {
|
||||
const getSubjectContent = () => {
|
||||
|
||||
const params = {
|
||||
edusubject,
|
||||
edustage,
|
||||
entpcourseedituserid: userId,
|
||||
pageSize: 500
|
||||
}
|
||||
|
||||
let data;
|
||||
if (localStorage.getItem('evaluationList')) {
|
||||
evaluationList.value = JSON.parse(localStorage.getItem('evaluationList'))
|
||||
data = evaluationList.value
|
||||
}
|
||||
else {
|
||||
const { rows } = await listEvaluation(params)
|
||||
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
||||
evaluationList.value = rows
|
||||
data = rows
|
||||
}
|
||||
evaluationList.value = JSON.parse(localStorage.getItem('evaluationList'))
|
||||
let data = evaluationList.value
|
||||
|
||||
//获取教材版本
|
||||
getSubject()
|
||||
|
@ -141,18 +121,8 @@ const getSubjectContent = async () => {
|
|||
getTreeData()
|
||||
}
|
||||
|
||||
const getSubject = async () => {
|
||||
const getSubject = () => {
|
||||
subjectList.value = JSON.parse(localStorage.getItem('subjectList'))
|
||||
|
||||
if (localStorage.getItem('subjectList')) {
|
||||
subjectList.value = JSON.parse(localStorage.getItem('subjectList'))
|
||||
}
|
||||
else {
|
||||
const { rows } = await listEvaluation({ itemkey: "version", pageSize: 500 })
|
||||
subjectList.value = rows.filter(item => item.edustage == edustage && item.edusubject == edusubject && isHaveUnit(item.id))
|
||||
localStorage.setItem('subjectList', JSON.stringify(subjectList.value))
|
||||
}
|
||||
|
||||
// 默认第一个
|
||||
curBookName.value = subjectList.value[0].itemtitle
|
||||
curBookId.value = subjectList.value[0].id
|
||||
|
@ -327,8 +297,7 @@ onMounted(() => {
|
|||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #000;
|
||||
|
||||
.icon-close {
|
||||
.icon-close{
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
<template>
|
||||
<section class="app-main">
|
||||
<div class="app-main-left no-select">
|
||||
<div v-for="(item, index) in title" :key="index" :class="item.active?'active':''" class="app-main-left-item" @click="active(index)">
|
||||
<div class="app-main-left-item-icon">
|
||||
<i :class="item.img"></i>
|
||||
</div>
|
||||
<div class="app-main-left-item-text">{{item.name}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<transition mode="out-in" name="fade-transform">
|
||||
<div v-show="$route != null" style="height: 100%; flex: 1">
|
||||
<div v-show="$route != null" style="height: 100%">
|
||||
<router-view v-slot="{ Component, route }">
|
||||
<keep-alive>
|
||||
<component :is="Component" v-if="route.meta.keepAlive" :key="route.name" />
|
||||
|
@ -21,170 +13,10 @@
|
|||
</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import routerStore from '@/store/modules/route'
|
||||
const router = useRouter()
|
||||
const title = reactive([
|
||||
{
|
||||
name: '教学工作台',
|
||||
img: 'iconfont icon-gongzuotai',
|
||||
id: 1,
|
||||
child: [
|
||||
{
|
||||
name: '课程教学',
|
||||
img: 'iconfont icon-PPT',
|
||||
type: 'hash',
|
||||
url: '/prepare',
|
||||
child1: []
|
||||
},
|
||||
{
|
||||
name: '作业管理',
|
||||
img: 'iconfont icon-36zuoyepingtai',
|
||||
url: '/teaching/classtaskassign?titleName=作业布置',
|
||||
child1: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '教学研究室',
|
||||
img: 'iconfont icon-yanjiushi',
|
||||
id: 2,
|
||||
child: [
|
||||
{
|
||||
name: '资源研究',
|
||||
url: '/resource',
|
||||
type: 'hash',
|
||||
img: 'iconfont icon-business-report',
|
||||
child1: []
|
||||
},
|
||||
{
|
||||
name: '课标分析',
|
||||
url: '/teaching/chatwithstandard',
|
||||
img: 'iconfont icon-kecheng',
|
||||
child1: []
|
||||
},
|
||||
{
|
||||
name: '教材分析',
|
||||
url: '/teaching/chatwithtextbook',
|
||||
img: 'iconfont icon-yanjiushi',
|
||||
child1: []
|
||||
},
|
||||
{
|
||||
name: '高考研究',
|
||||
url: '/education/colentrance',
|
||||
img: 'iconfont icon-icon_kaoshifenxi',
|
||||
child1: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '教学资源库',
|
||||
img: 'iconfont icon-zhuanyeziyuanku',
|
||||
id: 3,
|
||||
child: [
|
||||
{
|
||||
name: '教学素材',
|
||||
img: 'iconfont icon-sucai',
|
||||
url: '/teaching/materialbank',
|
||||
child1: []
|
||||
},
|
||||
{
|
||||
name: '课程资源',
|
||||
img: 'iconfont icon-kechengziyuan',
|
||||
url: '/teaching/coursewareresource',
|
||||
child1: []
|
||||
},
|
||||
{
|
||||
name: '习题资源',
|
||||
img: 'iconfont icon-iconku-zhuanqu-',
|
||||
url: '/teaching/quesbank',
|
||||
child1: []
|
||||
}
|
||||
]
|
||||
}
|
||||
])
|
||||
const active = (index) => {
|
||||
const route = routerStore()
|
||||
title.forEach((item, i) => {
|
||||
if (i === index) {
|
||||
item.active = true
|
||||
route.setNowRouter(item.child)
|
||||
if (item.id !== 3) {
|
||||
router.push(item.child[0].url)
|
||||
}
|
||||
} else {
|
||||
item.active = false
|
||||
}
|
||||
})
|
||||
}
|
||||
onMounted(()=>{
|
||||
active(0)
|
||||
})
|
||||
|
||||
</script>
|
||||
<script setup></script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.no-select {
|
||||
-webkit-user-select: none; /* Safari */
|
||||
-moz-user-select: none; /* Firefox */
|
||||
-ms-user-select: none; /* IE10+ */
|
||||
user-select: none; /* Standard syntax */
|
||||
}
|
||||
.app-main {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
.app-main-left {
|
||||
width: 80px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
.app-main-left-item {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 65px;
|
||||
height: 65px;
|
||||
padding-top: 10px;
|
||||
margin: 10px 0;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
background: #839ce0;
|
||||
border-radius: 10px;
|
||||
.app-main-left-item-icon {
|
||||
background: #fff;
|
||||
color: #758fd3;
|
||||
}
|
||||
}
|
||||
&.active {
|
||||
background: #839ce0;
|
||||
border-radius: 10px;
|
||||
.app-main-left-item-icon {
|
||||
background: #fff;
|
||||
color: #758fd3;
|
||||
}
|
||||
}
|
||||
.app-main-left-item-text {
|
||||
font-size: 12px;
|
||||
}
|
||||
.app-main-left-item-icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 10px;
|
||||
background: #7c97e1;
|
||||
color: #fff;
|
||||
i {
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -4,15 +4,9 @@
|
|||
<h3 class="title" @click="changeTab">AIX智慧课堂</h3>
|
||||
<div class="change-tab">
|
||||
<ul class="flex">
|
||||
<li
|
||||
v-for="(item, index) in routeHeader.nowRouter"
|
||||
:key="index"
|
||||
class="flex"
|
||||
:style="{'color' : item.color}"
|
||||
:class="currentRoute === item.url ? 'active-li' : ''"
|
||||
@click="handleOutLink(item.url,item.type)"
|
||||
>
|
||||
<i :class="item.img"></i>
|
||||
<li v-for="item in menus" :key="item.path" class="flex"
|
||||
:class="currentRoute == item.path ? 'active-li' : ''" @click="changePage(item.path)">
|
||||
<i class="iconfont" :class="item.icon"></i>
|
||||
<span class="text">{{ item.name }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -20,17 +14,13 @@
|
|||
</div>
|
||||
|
||||
<div class="right-section flex">
|
||||
<WindowTools />
|
||||
<WindowTools/>
|
||||
<div class="user flex">
|
||||
<div class="avatar-container">
|
||||
<el-dropdown
|
||||
class="right-menu-item hover-effect"
|
||||
trigger="click"
|
||||
@command="handleCommand"
|
||||
>
|
||||
<el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
|
||||
<div class="avatar-wrapper">
|
||||
<img :src="userStore.user.avatar" class="user-avatar" style="float: left" />
|
||||
<div style="margin-top: 18px; font-size: 0.8em">{{ userStore.user.nickName }}</div>
|
||||
<img :src="userStore.user.avatar" class="user-avatar" style="float: left;" />
|
||||
<div style="margin-top: 18px; font-size: 0.8em;"> {{ userStore.user.nickName }}</div>
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
|
@ -54,31 +44,13 @@ import { useRouter } from 'vue-router'
|
|||
import { ElMessageBox } from 'element-plus'
|
||||
import WindowTools from '@/components/window-tools/index.vue'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import routerStore from '@/store/modules/route'
|
||||
import outLink from '@/utils/linkConfig'
|
||||
const routeHeader = routerStore()
|
||||
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
const userStore = useUserStore()
|
||||
const router = useRouter()
|
||||
const currentRoute = ref('')
|
||||
|
||||
const handleOutLink = (path, type) => {
|
||||
if (!path) return
|
||||
if (type === 'hash') {
|
||||
router.push(path)
|
||||
} else {
|
||||
// key 对应的 linkConfig.js 外部链接配置
|
||||
let configObj = outLink().getBaseData()
|
||||
let fullPath = configObj.fullPath + path
|
||||
fullPath = fullPath.replaceAll('//', '/')
|
||||
// 通知主进程
|
||||
ipcRenderer.send('openWindow', {
|
||||
fullPath: fullPath,
|
||||
cookieData: { ...configObj.data }
|
||||
})
|
||||
}
|
||||
}
|
||||
/*const menus = ref([
|
||||
const menus = ref([
|
||||
{
|
||||
icon: 'icon-zhuye2 icon-homepage',
|
||||
name: '主页',
|
||||
|
@ -94,12 +66,12 @@ const handleOutLink = (path, type) => {
|
|||
name: '备课',
|
||||
path: '/prepare'
|
||||
},
|
||||
{
|
||||
/*{
|
||||
icon: 'icon-jiangke1 icon-teach',
|
||||
name: '授课',
|
||||
path: '/teach'
|
||||
}
|
||||
])*/
|
||||
}*/
|
||||
])
|
||||
|
||||
// 监听当前路由
|
||||
watch(
|
||||
|
@ -110,19 +82,20 @@ watch(
|
|||
{ immediate: true }
|
||||
)
|
||||
|
||||
|
||||
const changePage = (url) => {
|
||||
router.push(url)
|
||||
}
|
||||
function handleCommand(command) {
|
||||
switch (command) {
|
||||
case 'setLayout':
|
||||
setLayout()
|
||||
break
|
||||
case 'logout':
|
||||
logout()
|
||||
break
|
||||
case "setLayout":
|
||||
setLayout();
|
||||
break;
|
||||
case "logout":
|
||||
logout();
|
||||
break;
|
||||
default:
|
||||
break
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -131,25 +104,20 @@ function logout() {
|
|||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
userStore
|
||||
.logOut()
|
||||
.then(() => {
|
||||
// router.replace('/login')
|
||||
ipcRenderer && ipcRenderer.send('openLoginWindow')
|
||||
})
|
||||
.catch(() => {
|
||||
// router.replace('/login')
|
||||
ipcRenderer && ipcRenderer.send('openLoginWindow')
|
||||
})
|
||||
}).then(() => {
|
||||
userStore.logOut().then(() => {
|
||||
// router.replace('/login')
|
||||
ipcRenderer && ipcRenderer.send('openLoginWindow')
|
||||
}).catch(()=>{
|
||||
// router.replace('/login')
|
||||
ipcRenderer && ipcRenderer.send('openLoginWindow')
|
||||
})
|
||||
.catch(() => {})
|
||||
}).catch(() => { });
|
||||
}
|
||||
|
||||
const emits = defineEmits(['setLayout'])
|
||||
function setLayout() {
|
||||
emits('setLayout')
|
||||
emits('setLayout');
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -192,7 +160,7 @@ function setLayout() {
|
|||
color: #f99b53;
|
||||
}
|
||||
|
||||
.icon-homepage {
|
||||
.icon-homepage{
|
||||
color: #0a84ff;
|
||||
}
|
||||
|
||||
|
@ -211,7 +179,7 @@ function setLayout() {
|
|||
|
||||
.active-li {
|
||||
background: #d3e3fb;
|
||||
color: #409eff;
|
||||
color: #409EFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -235,6 +203,7 @@ function setLayout() {
|
|||
padding-bottom: 5px;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
.user {
|
||||
.user-info {
|
||||
padding-right: 5px;
|
||||
|
|
|
@ -32,6 +32,6 @@ let uploaderStore = ref(uploaderState())
|
|||
height: 80px;
|
||||
}
|
||||
.el-main {
|
||||
--el-main-padding: 0 20px 0 0;
|
||||
--el-main-padding: 0 20px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
import { defineStore } from 'pinia'
|
||||
|
||||
const routerStore = defineStore('router', {
|
||||
state: () => ({
|
||||
nowRouter: []
|
||||
}),
|
||||
actions: {
|
||||
setNowRouter(payload) {
|
||||
this.nowRouter = payload
|
||||
}
|
||||
},
|
||||
mutations: {},
|
||||
persist: true
|
||||
})
|
||||
export default routerStore
|
|
@ -1,105 +1,101 @@
|
|||
import { defineStore } from 'pinia'
|
||||
import { defineStore } from "pinia"
|
||||
import { login, logout, getInfo } from '@/api/login'
|
||||
import { getToken, setToken, removeToken } from '@/utils/auth'
|
||||
import defAva from '@/assets/images/user.png'
|
||||
|
||||
const useUserStore = defineStore('user', {
|
||||
state: () => ({
|
||||
token: getToken(),
|
||||
id: '',
|
||||
name: '',
|
||||
avatar: '',
|
||||
roles: [],
|
||||
permissions: [],
|
||||
user: {}
|
||||
}),
|
||||
actions: {
|
||||
// 登录
|
||||
login(userInfo) {
|
||||
const username = userInfo.username.trim()
|
||||
const password = userInfo.password
|
||||
const code = userInfo.code
|
||||
const uuid = userInfo.uuid
|
||||
return new Promise((resolve, reject) => {
|
||||
login(username, password, code, uuid)
|
||||
.then((res) => {
|
||||
const useUserStore = defineStore(
|
||||
'user',
|
||||
{
|
||||
state: () => ({
|
||||
token: getToken(),
|
||||
id: '',
|
||||
name: '',
|
||||
avatar: '',
|
||||
roles: [],
|
||||
permissions: [],
|
||||
user: {}
|
||||
}),
|
||||
actions: {
|
||||
// 登录
|
||||
login(userInfo) {
|
||||
const username = userInfo.username.trim()
|
||||
const password = userInfo.password
|
||||
const code = userInfo.code
|
||||
const uuid = userInfo.uuid
|
||||
return new Promise((resolve, reject) => {
|
||||
login(username, password, code, uuid).then(res => {
|
||||
setToken(res.token)
|
||||
this.token = res.token
|
||||
resolve(res)
|
||||
})
|
||||
.catch((error) => {
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取用户信息
|
||||
getInfo() {
|
||||
return new Promise((resolve, reject) => {
|
||||
getInfo()
|
||||
.then((res) => {
|
||||
})
|
||||
},
|
||||
// 获取用户信息
|
||||
getInfo() {
|
||||
return new Promise((resolve, reject) => {
|
||||
getInfo().then(res => {
|
||||
res.user.avatar = import.meta.env.VITE_APP_BASE_API + res.user.avatar
|
||||
const user = res.user
|
||||
this.user = user
|
||||
const avatar = user.avatar == '' || user.avatar == null ? defAva : user.avatar
|
||||
this.user = user
|
||||
const avatar = (user.avatar == "" || user.avatar == null) ? defAva : user.avatar;
|
||||
|
||||
if (res.roles && res.roles.length > 0) {
|
||||
// 验证返回的roles是否是一个非空数组
|
||||
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||
this.roles = res.roles
|
||||
this.permissions = res.permissions
|
||||
} else {
|
||||
this.roles = ['ROLE_DEFAULT']
|
||||
}
|
||||
|
||||
|
||||
this.id = user.userId
|
||||
this.userName = user.userName
|
||||
this.nickName = user.nickName
|
||||
this.avatar = avatar
|
||||
this.userType = user.userType
|
||||
this.deptId = user.deptId
|
||||
this.deptName = user.deptName
|
||||
this.deptLogo = user.deptLogo
|
||||
this.deptSlogan = user.deptSlogan
|
||||
this.activeDeptId = user.activeDeptId
|
||||
this.activeDeptName = user.activeDeptName
|
||||
this.parentDeptId = user.parentDeptId
|
||||
this.parentDeptName = user.parentDeptName
|
||||
this.edusubject = user.edusubject
|
||||
this.edudegree = user.edudegree
|
||||
this.edustage = user.edustage
|
||||
this.userType = user.userType
|
||||
this.studentId = user.studentId
|
||||
this.timUserId = user.timuserid
|
||||
this.plainpwd = user.plainpwd
|
||||
this.nickName = user.nickName;
|
||||
this.avatar = avatar;
|
||||
this.userType = user.userType;
|
||||
this.deptId = user.deptId;
|
||||
this.deptName = user.deptName;
|
||||
this.deptLogo = user.deptLogo;
|
||||
this.deptSlogan = user.deptSlogan;
|
||||
this.activeDeptId = user.activeDeptId;
|
||||
this.activeDeptName = user.activeDeptName;
|
||||
this.parentDeptId = user.parentDeptId;
|
||||
this.parentDeptName = user.parentDeptName;
|
||||
this.edusubject = user.edusubject;
|
||||
this.edudegree = user.edudegree;
|
||||
this.edustage = user.edustage;
|
||||
this.userType = user.userType;
|
||||
this.studentId = user.studentId;
|
||||
this.timUserId = user.timuserid;
|
||||
this.plainpwd = user.plainpwd;
|
||||
|
||||
this.roles = res.roles
|
||||
this.roles = res.roles;
|
||||
|
||||
resolve(res)
|
||||
})
|
||||
.catch((error) => {
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 退出系统
|
||||
logOut() {
|
||||
return new Promise((resolve, reject) => {
|
||||
logout(this.token)
|
||||
.then(() => {
|
||||
})
|
||||
},
|
||||
// 退出系统
|
||||
logOut() {
|
||||
return new Promise((resolve, reject) => {
|
||||
logout(this.token).then(() => {
|
||||
this.token = ''
|
||||
this.roles = []
|
||||
this.permissions = []
|
||||
localStorage.clear()
|
||||
removeToken()
|
||||
resolve()
|
||||
})
|
||||
.catch((error) => {
|
||||
}).catch(error => {
|
||||
removeToken() // zdg: 网络异常时,清除前端退出进入登录页
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
persist: true
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
persist: true
|
||||
})
|
||||
|
||||
export default useUserStore
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
|
||||
import useUserStore from '@/store/modules/user'
|
||||
const baseConfig = () => {
|
||||
const userStore = useUserStore()
|
||||
return {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const baseConfig = {
|
||||
// Electron 设置cookie
|
||||
url: import.meta.env.VITE_APP_BUILD_BASE_PATH,
|
||||
// url: 'https://file.ysaix.com:7868',
|
||||
|
@ -11,48 +12,52 @@ const baseConfig = () => {
|
|||
value: userStore.token,
|
||||
// 域名
|
||||
domain: import.meta.env.VITE_APP_DOMAIN
|
||||
}
|
||||
}
|
||||
|
||||
export default () => {
|
||||
// 作业布置
|
||||
const homeWork = {
|
||||
data: { ...baseConfig},
|
||||
// 完整路径
|
||||
fullPath: `${baseConfig.url}/teaching/classtaskassign?titleName=%E4%BD%9C%E4%B8%9A%E5%B8%83%E7%BD%AE`
|
||||
}
|
||||
|
||||
// 作业反馈
|
||||
const feedback = {
|
||||
data: { ...baseConfig},
|
||||
// 完整路径
|
||||
fullPath: `${baseConfig.url}/teaching/classtaskassign?titleName=作业反馈`
|
||||
}
|
||||
|
||||
// 高考研读
|
||||
const gk = {
|
||||
data: { ...baseConfig},
|
||||
fullPath: `${baseConfig.url}/education/colentrance`
|
||||
}
|
||||
|
||||
// 课标研读
|
||||
const standard = {
|
||||
data: { ...baseConfig},
|
||||
fullPath: `${baseConfig.url}/teaching/chatwithstandard`
|
||||
}
|
||||
|
||||
// 教学大模型
|
||||
const aiModel = {
|
||||
data: { ...baseConfig},
|
||||
fullPath: `${baseConfig.url}/platofai`
|
||||
}
|
||||
|
||||
const getBaseData = () => {
|
||||
return {
|
||||
// 作业布置
|
||||
homeWork: {
|
||||
data: { ...baseConfig() },
|
||||
// 完整路径
|
||||
fullPath: `${baseConfig().url}/teaching/classtaskassign?titleName=%E4%BD%9C%E4%B8%9A%E5%B8%83%E7%BD%AE`
|
||||
},
|
||||
|
||||
// 作业反馈
|
||||
feedback: {
|
||||
data: { ...baseConfig() },
|
||||
// 完整路径
|
||||
fullPath: `${baseConfig().url}/teaching/classtaskassign?titleName=作业反馈`
|
||||
},
|
||||
|
||||
// 高考研读
|
||||
gk: {
|
||||
data: { ...baseConfig() },
|
||||
fullPath: `${baseConfig().url}/education/colentrance`
|
||||
},
|
||||
|
||||
// 课标研读
|
||||
standard: {
|
||||
data: { ...baseConfig() },
|
||||
fullPath: `${baseConfig().url}/teaching/chatwithstandard`
|
||||
},
|
||||
|
||||
// 教学大模型
|
||||
aiModel: {
|
||||
data: { ...baseConfig() },
|
||||
fullPath: `${baseConfig().url}/platofai`
|
||||
},
|
||||
|
||||
getBaseData: () => {
|
||||
return {
|
||||
data: { ...baseConfig() },
|
||||
fullPath: `${baseConfig().url}`
|
||||
}
|
||||
}
|
||||
data: { ...baseConfig},
|
||||
fullPath: `${baseConfig.url}`
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
homeWork,
|
||||
feedback,
|
||||
gk,
|
||||
standard,
|
||||
aiModel,
|
||||
getBaseData
|
||||
}
|
||||
|
|
|
@ -34,6 +34,9 @@
|
|||
<div
|
||||
v-if="item.levelFirstName"
|
||||
style="
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
"
|
||||
|
@ -64,7 +67,7 @@
|
|||
<div class="item-popover" @click="closePopver(index)">
|
||||
<template v-if="item.uniquekey">
|
||||
<div class="item-popover-item">
|
||||
<el-button text @click="setHomeWork(item, index)">
|
||||
<el-button text @click="editTalk(item, index)">
|
||||
<i class="iconfont icon-bianji"></i>
|
||||
<span>布置</span>
|
||||
</el-button>
|
||||
|
@ -142,10 +145,10 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
emits: { 'on-move': null, 'on-delete': null, 'on-set': null },
|
||||
emits: { 'on-move': null, 'on-delete': null },
|
||||
data() {
|
||||
return {
|
||||
listenList: [],
|
||||
listenList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -227,10 +230,6 @@ export default {
|
|||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
//布置
|
||||
setHomeWork(item){
|
||||
this.$emit('on-set', item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,215 +0,0 @@
|
|||
<template>
|
||||
<el-dialog v-model="dialogVisible" center top="10vh" width="600px" :show-close="false"
|
||||
style="border-radius: 10px; padding: 10px 15px;">
|
||||
|
||||
<template #header>
|
||||
<div class="homerwork-header flex">
|
||||
<span>布置作业</span>
|
||||
<i class="iconfont icon-guanbi" @click="cloneDialog"></i>
|
||||
</div>
|
||||
</template>
|
||||
<div>
|
||||
<el-form :model="form" label-width="80px">
|
||||
<el-form-item label="班级">
|
||||
<el-tree ref="treeRef" :data="treeData" :props="defaultProps" :load="getLoad" node-key="id"
|
||||
@check="handleCheckChange" lazy show-checkbox />
|
||||
</el-form-item>
|
||||
<el-form-item label="选中学生">
|
||||
<el-scrollbar max-height="200px">
|
||||
<el-tag v-for="(tag, index) in studentList" :key="tag.studentid" closable type="primary"
|
||||
@close="delStudent(index)">
|
||||
{{ tag.name }}
|
||||
</el-tag>
|
||||
</el-scrollbar>
|
||||
</el-form-item>
|
||||
<el-form-item label="完成要求">
|
||||
<el-radio-group v-model="form.feedtype">
|
||||
<el-radio value="必做" size="large">必做</el-radio>
|
||||
<el-radio value="选做" size="large">选做</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="截至时间">
|
||||
<el-date-picker v-model="endTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="请选择截至时间"
|
||||
@change="changeTime" />
|
||||
</el-form-item>
|
||||
<el-form-item label="推荐用时">
|
||||
<el-input-number v-model="form.timelength" :min="1" :max="500" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cloneDialog">取消</el-button>
|
||||
<el-button type="primary" @click="dialogVisible = false">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listClassmain, listClassgroup } from '@/api/classManage/index'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { uniqBy, cloneDeep } from 'lodash'
|
||||
export default {
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label',
|
||||
isLeaf: 'leaf',
|
||||
},
|
||||
treeData: [],
|
||||
// 用户信息
|
||||
userInfo: null,
|
||||
// 班级列表
|
||||
gradeList: [],
|
||||
curGradeId: '',
|
||||
// 小组列表
|
||||
groupList: [],
|
||||
// 选中的学生
|
||||
studentList: [],
|
||||
// 表单
|
||||
form: {
|
||||
feedtype: '必做',
|
||||
endTime: '',
|
||||
timelength: 1
|
||||
},
|
||||
endTime: ''
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
//截至时间默认值
|
||||
this.endTime = this.getCurrentDate() + ' ' + '10:00:00'
|
||||
this.userInfo = useUserStore().user
|
||||
this.getGradeList()
|
||||
},
|
||||
methods: {
|
||||
// 获取班级列表
|
||||
getGradeList() {
|
||||
listClassmain({ classuserid: this.userInfo.userId, pageSize: 100, status: 'open' }).then(res => {
|
||||
let list = res.rows
|
||||
list.forEach(item => {
|
||||
item.label = item.caption
|
||||
item.level = 0
|
||||
item.children = []
|
||||
item.classstudentlist = JSON.parse("[" + item.classstudentlist + "]")
|
||||
})
|
||||
console.log(list)
|
||||
this.gradeList = list
|
||||
this.treeData = list
|
||||
})
|
||||
},
|
||||
getLoad(node, resolve) {
|
||||
console.log(node.level)
|
||||
if (node.level == 0) return resolve([])
|
||||
if (node.level == 1) {
|
||||
listClassgroup({ classid: node.key, orderby: 'orderidx', pageSize: 100 }).then(res => {
|
||||
console.log(res)
|
||||
if (res.rows.length > 0) {
|
||||
let ary = []
|
||||
res.rows.forEach(item => {
|
||||
if (item.parentid === 0) {
|
||||
let studentGroup = JSON.parse("[" + item.studentlist + "]")
|
||||
studentGroup.forEach(el => {
|
||||
el.label = el.name
|
||||
el.leaf = true
|
||||
el.level = 2,
|
||||
el.id = el.studentid
|
||||
})
|
||||
ary.push({
|
||||
label: item.groupname,
|
||||
...item,
|
||||
level: 1,
|
||||
children: studentGroup
|
||||
})
|
||||
}
|
||||
})
|
||||
// console.log(ary)
|
||||
resolve(ary)
|
||||
}
|
||||
else {
|
||||
resolve([])
|
||||
}
|
||||
})
|
||||
}
|
||||
if (node.level == 2) {
|
||||
resolve(node.data.children)
|
||||
}
|
||||
|
||||
},
|
||||
handleCheckChange(data, checked) {
|
||||
this.studentList = []
|
||||
// 选中节点集合
|
||||
let checkNodes = checked.checkedNodes
|
||||
let ary = []
|
||||
checkNodes.forEach(item => {
|
||||
if (item.level == 0) {
|
||||
ary = [...ary, ...(item.classstudentlist)]
|
||||
}
|
||||
if (item.level == 1) {
|
||||
ary = [...ary, ...(item.children)]
|
||||
}
|
||||
if (item.level == 2) {
|
||||
ary = [...ary, item]
|
||||
}
|
||||
})
|
||||
this.studentList = uniqBy(ary, 'studentid')
|
||||
},
|
||||
// 删除学生
|
||||
delStudent(index) {
|
||||
this.studentList.splice(index, 1)
|
||||
},
|
||||
// 关闭弹窗
|
||||
cloneDialog() {
|
||||
this.$emit('on-close')
|
||||
},
|
||||
//
|
||||
changeTime(value) {
|
||||
console.log(value, 100)
|
||||
},
|
||||
// 获取当前年月日
|
||||
getCurrentDate() {
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = now.getMonth() + 1; // 月份是从0开始的,所以需要+1
|
||||
const day = now.getDate()
|
||||
return `${year}-${month.length == 2 ? month : '0' + month}-${day.length == 2 ? day : '0' + day}`;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
modelValue(val) {
|
||||
this.dialogVisible = val
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.homerwork-header {
|
||||
justify-content: space-between;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
|
||||
.icon-guanbi {
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.el-tag {
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
|
@ -13,23 +13,17 @@
|
|||
<el-button class="btn" @click="handleOutLink('aiModel')">教学大模型</el-button>
|
||||
</div>
|
||||
<el-button type="primary" class="to-class-btn" @click="openLesson">
|
||||
<i class="iconfont icon-lingdang"></i>上课</el-button
|
||||
>
|
||||
<i class="iconfont icon-lingdang"></i>上课</el-button>
|
||||
<div class="top-zoom-style"></div>
|
||||
</div>
|
||||
<div class="prepare-body-header">
|
||||
|
||||
<div>
|
||||
<label style="font-size: 15px">共{{ currentFileList.length }}个文件</label>
|
||||
<el-popover placement="top-start" :width="250" trigger="hover">
|
||||
<template #default>
|
||||
<div>
|
||||
<el-button
|
||||
v-if="lastAsyncAllTime"
|
||||
type="success"
|
||||
size="small"
|
||||
:icon="Check"
|
||||
circle
|
||||
/>
|
||||
<el-button v-if="lastAsyncAllTime" type="success" size="small" :icon="Check" circle />
|
||||
{{ lastAsyncAllTime ? toTimeText(lastAsyncAllTime) + '同步成功' : '' }}
|
||||
</div>
|
||||
</template>
|
||||
|
@ -47,42 +41,23 @@
|
|||
<el-button @click="handleOutLink('feedback')">作业反馈</el-button>
|
||||
<el-button @click="handleOutLink('homeWork')">布置作业</el-button>
|
||||
<el-button @click="isDialogOpen = true">上传资料</el-button>
|
||||
<el-button type="primary" style="margin-left: 10px" @click="createFile"
|
||||
>新建课件</el-button
|
||||
>
|
||||
<el-button type="primary" style="margin-left: 10px" @click="createFile">新建课件</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-checkbox-group
|
||||
v-model="checkFileList"
|
||||
class="prepare-body-main"
|
||||
:style="{ 'margin-bottom': checkFileList.length > 0 ? '40px' : '0' }"
|
||||
>
|
||||
<file-list-item
|
||||
v-for="(item, index) in currentFileList"
|
||||
:key="index"
|
||||
:item="item"
|
||||
:index="index"
|
||||
@on-move="onMoveSingleFile"
|
||||
@on-delete="deleteTalk"
|
||||
@on-set="openSet"
|
||||
>
|
||||
<el-checkbox-group v-model="checkFileList" class="prepare-body-main"
|
||||
:style="{ 'margin-bottom': checkFileList.length > 0 ? '40px' : '0' }">
|
||||
<file-list-item v-for="(item, index) in currentFileList" :key="index" :item="item" :index="index"
|
||||
@on-move="onMoveSingleFile" @on-delete="deleteTalk">
|
||||
<el-checkbox label="" :value="item" />
|
||||
</file-list-item>
|
||||
</el-checkbox-group>
|
||||
<file-oper-batch
|
||||
v-show="checkFileList.length > 0"
|
||||
<file-oper-batch v-show="checkFileList.length > 0"
|
||||
:indeterminate="checkFileList.length > 0 && checkFileList.length < currentFileList.length"
|
||||
:choose="checkFileList"
|
||||
:check-all="isCheckAll"
|
||||
@click-delete="clickDelete"
|
||||
@click-move="clickMove"
|
||||
@cancel="checkFileList = []"
|
||||
@click-choose="clickChoose"
|
||||
></file-oper-batch>
|
||||
:choose="checkFileList" :check-all="isCheckAll" @click-delete="clickDelete" @click-move="clickMove"
|
||||
@cancel="checkFileList = []" @click-choose="clickChoose"></file-oper-batch>
|
||||
</div>
|
||||
<MoveFile v-model="isMoveDialogOpen" @on-submit="chooseMoveCata" />
|
||||
<uploadDialog v-model="isDialogOpen" @submit-file="submitFile" />
|
||||
<SetHomework v-model="setDialog" @on-close="closeHomework" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
|
@ -102,7 +77,6 @@ import { toTimeText } from '@/utils/date'
|
|||
import { ElMessage } from 'element-plus'
|
||||
import { parseCataByNode, creatPPT, asyncLocalFile } from '@/utils/talkFile'
|
||||
import FileOperBatch from '@/views/prepare/container/file-oper-batch.vue'
|
||||
import SetHomework from './container/set-homework.vue'
|
||||
import outLink from '@/utils/linkConfig'
|
||||
import { createWindow } from '@/utils/tool'
|
||||
import { uniqBy, cloneDeep } from 'lodash'
|
||||
|
@ -111,15 +85,7 @@ const { ipcRenderer } = window.electron || {}
|
|||
|
||||
export default {
|
||||
name: 'Prepare',
|
||||
components: {
|
||||
ChooseTextbook,
|
||||
Refresh,
|
||||
uploadDialog,
|
||||
FileListItem,
|
||||
FileOperBatch,
|
||||
MoveFile,
|
||||
SetHomework
|
||||
},
|
||||
components: { ChooseTextbook, Refresh, uploadDialog, FileListItem, FileOperBatch, MoveFile },
|
||||
data() {
|
||||
return {
|
||||
moveFile: [],
|
||||
|
@ -145,9 +111,7 @@ export default {
|
|||
// 用户信息
|
||||
userStore: '',
|
||||
entpcourseid: '',
|
||||
timerId: null,
|
||||
// 布置作业弹窗
|
||||
setDialog: false
|
||||
timerId: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -157,13 +121,6 @@ export default {
|
|||
)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route(to) {
|
||||
if (to.path != '/prepare' && this.timerId) {
|
||||
clearInterval(this.timerId)
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.userStore = useUserStore().user
|
||||
ipcRenderer.removeAllListeners('copy-file-default-reply')
|
||||
|
@ -171,8 +128,10 @@ export default {
|
|||
this.callback(param)
|
||||
})
|
||||
this.lastAsyncAllTime = localStorage.getItem('lastAsyncAllTime')
|
||||
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
mounted() {},
|
||||
activated() {
|
||||
if (this.uploadData.textbookId !== null) {
|
||||
this.asyncAllFile()
|
||||
|
@ -324,20 +283,16 @@ export default {
|
|||
this.createTimer()
|
||||
}
|
||||
// key 对应的 linkConfig.js 外部链接配置
|
||||
let configObj = outLink()[key]
|
||||
let configObj = outLink[key]
|
||||
// 通知主进程
|
||||
ipcRenderer.send('openWindow', {
|
||||
fullPath: configObj.fullPath,
|
||||
cookieData: { ...configObj.data }
|
||||
cookieData: { ...(configObj.data) }
|
||||
})
|
||||
},
|
||||
// 根据教材章节单元ID 查询作业列表所需ID
|
||||
getChapterId() {
|
||||
return listEntpcourse({
|
||||
evalid: this.uploadData.levelSecondId,
|
||||
edituserid: this.userStore.userId,
|
||||
pageSize: 500
|
||||
})
|
||||
return listEntpcourse({ evalid: this.uploadData.levelSecondId, edituserid: this.userStore.userId, pageSize: 500 })
|
||||
},
|
||||
//
|
||||
createTimer() {
|
||||
|
@ -347,22 +302,20 @@ export default {
|
|||
},
|
||||
// 查询作业列表
|
||||
getHomeWorkList() {
|
||||
homeworklist({
|
||||
entpcourseid: this.entpcourseid,
|
||||
edituserid: this.userStore.userId,
|
||||
pageSize: 100
|
||||
}).then((res) => {
|
||||
homeworklist({ entpcourseid: this.entpcourseid, edituserid: this.userStore.userId, pageSize: 100 }).then(res => {
|
||||
|
||||
//以下代码 参照AIx web端 作业布置
|
||||
let list = []
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
res.rows[i].taskconfig = []
|
||||
|
||||
res.rows[i].taskconfig = [];
|
||||
|
||||
// 找child
|
||||
for (var j = 0; j < res.rows.length; j++) {
|
||||
if (res.rows[j].parentid == res.rows[i].id) {
|
||||
var ss = []
|
||||
var ss = [];
|
||||
if (res.rows[j].classworkdatastudentids != null) {
|
||||
ss = JSON.parse('[' + res.rows[j].classworkdatastudentids + ']')
|
||||
ss = JSON.parse('[' + res.rows[j].classworkdatastudentids + ']');
|
||||
}
|
||||
var js = {
|
||||
id: res.rows[j].id,
|
||||
|
@ -385,7 +338,7 @@ export default {
|
|||
weights: res.rows[j].weights,
|
||||
feedtype: res.rows[j].feedtype
|
||||
}
|
||||
res.rows[i].taskconfig.push(js)
|
||||
res.rows[i].taskconfig.push(js);
|
||||
}
|
||||
}
|
||||
res.rows[i].fileShowName = res.rows[i].uniquekey
|
||||
|
@ -393,16 +346,15 @@ export default {
|
|||
// 注意slideid>0的,这一些作业是添加到PPT页面的,所以在作业管理中不能出现
|
||||
// 2024-05-15,酉阳,jackyshen
|
||||
if (res.rows[i].classid == 0 && res.rows[i].slideid == 0) {
|
||||
list.push(res.rows[i])
|
||||
list.push(res.rows[i]);
|
||||
}
|
||||
|
||||
|
||||
// 如果是习题训练任务,则检查一共有多少道
|
||||
if (res.rows[i].entpcourseworklist != '') {
|
||||
res.rows[i].entpcourseworklistarray = JSON.parse(
|
||||
'[' + res.rows[i].entpcourseworklist + ']'
|
||||
)
|
||||
res.rows[i].entpcourseworklistarray = JSON.parse('[' + res.rows[i].entpcourseworklist + ']');
|
||||
} else {
|
||||
res.rows[i].entpcourseworklistarray = []
|
||||
res.rows[i].entpcourseworklistarray = [];
|
||||
}
|
||||
}
|
||||
// 去重
|
||||
|
@ -411,13 +363,6 @@ export default {
|
|||
this.currentFileList = cloneDeep(ary)
|
||||
})
|
||||
},
|
||||
// 打开布置作业窗口
|
||||
openSet() {
|
||||
this.setDialog = true
|
||||
},
|
||||
closeHomework() {
|
||||
this.setDialog = false
|
||||
},
|
||||
// 打开PDF-课件
|
||||
navtoPdf() {
|
||||
createWindow('open-PDF', { url: '/classBegins/index' })
|
||||
|
@ -426,6 +371,13 @@ export default {
|
|||
openLesson() {
|
||||
createWindow('tool-sphere', { url: '/tool/sphere' })
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route(to) {
|
||||
if (to.path != '/prepare' && this.timerId) {
|
||||
clearInterval(this.timerId)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -515,7 +467,7 @@ export default {
|
|||
border-color: #ffffff;
|
||||
|
||||
&:hover {
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
background: rgba(255, 255, 255, 0.3)
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
|
@ -552,6 +504,7 @@ export default {
|
|||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
padding: 0 20px;
|
||||
|
||||
}
|
||||
|
||||
.prepare-body-main {
|
||||
|
|
Loading…
Reference in New Issue