Compare commits
No commits in common. "0fe264054cff4cd19854c28cca949e22e03970c3" and "3c2dbb722a9f5b0ad08305f55d6b1887a2320555" have entirely different histories.
0fe264054c
...
3c2dbb722a
|
@ -146,7 +146,7 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
|
|||
//使用默认应用打开本地文件
|
||||
ipcMain.on('open-path-app', (e, destination) => {
|
||||
let path = appRootFilePath + destination
|
||||
shell.openPath(path).catch((error) => {
|
||||
shell.openExternal(path).catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
})
|
||||
|
|
|
@ -28,7 +28,6 @@ function createLoginWindow() {
|
|||
icon: join(__dirname, '../../resources/logo2.ico'),
|
||||
...(process.platform === 'linux' ? { icon } : {}),
|
||||
webPreferences: {
|
||||
defaultEncoding: 'utf-8',
|
||||
preload: join(__dirname, '../preload/index.js'),
|
||||
sandbox: false,
|
||||
nodeIntegration: true,
|
||||
|
@ -68,7 +67,6 @@ function createMainWindow() {
|
|||
icon: join(__dirname, '../../resources/logo2.ico'),
|
||||
...(process.platform === 'linux' ? { icon } : {}),
|
||||
webPreferences: {
|
||||
defaultEncoding: 'utf-8',
|
||||
preload: join(__dirname, '../preload/index.js'),
|
||||
sandbox: false,
|
||||
// nodeIntegration: true,
|
||||
|
@ -117,7 +115,6 @@ async function createLinkWin(data) {
|
|||
autoHideMenuBar: true,
|
||||
...(process.platform === 'linux' ? { icon } : {}),
|
||||
webPreferences: {
|
||||
defaultEncoding: 'utf-8',
|
||||
sandbox: false,
|
||||
nodeIntegration: true,
|
||||
worldSafeExecuteJavaScript: true,
|
||||
|
@ -146,8 +143,6 @@ async function createLinkWin(data) {
|
|||
|
||||
// 初始化完成
|
||||
app.on('ready', () => {
|
||||
process.env.LANG = 'en_US.UTF-8'
|
||||
process.env['ELECTRON_DISABLE_SANDBOX'] = true;
|
||||
// 设置应用程序用户模型标识符
|
||||
electronApp.setAppUserModelId('com.electron')
|
||||
|
||||
|
|
|
@ -50,9 +50,3 @@ export function updateUserInfo(data) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
export function getUserInfo(userId) {
|
||||
return request({
|
||||
url: '/system/user/' + userId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ import { onMounted, ref, nextTick, toRaw, reactive } from 'vue';
|
|||
import useUserStore from '@/store/modules/user'
|
||||
import { listEvaluation } from '@/api/subject'
|
||||
|
||||
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
||||
const BaseUrl = 'https://prev.ysaix.com:7868/'
|
||||
// 定义要发送的emit事件
|
||||
const emit = defineEmits(['nodeClick', 'changeBook'])
|
||||
// store
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-dialog v-model="model" append-to-body :show-close="false" width="500"
|
||||
<el-dialog v-model="dialogVisible" append-to-body :show-close="false" width="500"
|
||||
top="25vh"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
|
@ -34,14 +34,12 @@
|
|||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { listEvaluation } from '@/api/subject'
|
||||
import { updateUserInfo } from '@/api/system/user'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const { userId, userName } = userStore.user
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
|
||||
const props = defineProps({
|
||||
loginData: {
|
||||
|
@ -50,11 +48,17 @@ const props = defineProps({
|
|||
return {}
|
||||
}
|
||||
},
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
})
|
||||
|
||||
const model = defineModel();
|
||||
const subjectLoading = ref(false)
|
||||
// 默认学段 前端写死 参照web AIx
|
||||
|
||||
// 定义要发送的emit事件
|
||||
const emit = defineEmits(['update:modelValue', 'onSuccess'])
|
||||
|
||||
const gradeList = ref([
|
||||
{
|
||||
label: '高中',
|
||||
|
@ -81,6 +85,7 @@ gradeVal.value = gradeList.value[0].value
|
|||
//学科列表数据
|
||||
const subjectList = ref([])
|
||||
const allSubject = ref([])
|
||||
const dialogVisible = ref(false)
|
||||
|
||||
//切换年级
|
||||
const changeGrade = ()=>{
|
||||
|
@ -93,8 +98,8 @@ const changeGrade = ()=>{
|
|||
// 默认选中第一个学科
|
||||
subjectVal.value = subjectList.value[0].itemtitle
|
||||
}
|
||||
|
||||
// 获取学科数据
|
||||
|
||||
const getSubject = async ()=>{
|
||||
const { rows } = await listEvaluation({ itemkey: "subject", pageSize: 500 })
|
||||
// 所有学科
|
||||
|
@ -114,6 +119,7 @@ const editUserInfo = async () =>{
|
|||
edustage: gradeVal.value,
|
||||
edusubject: subjectVal.value
|
||||
}
|
||||
|
||||
// 修改之后需要重新登录 查询用户信息,否则不登录 查询的用户信息是未修改之前的
|
||||
// 接口如此,我也不知道为啥要这样
|
||||
subjectLoading.value = true
|
||||
|
@ -122,15 +128,14 @@ const editUserInfo = async () =>{
|
|||
await updateUserInfo(data)
|
||||
await userStore.login(props.loginData)
|
||||
await userStore.getInfo()
|
||||
ElMessage.success('登录成功')
|
||||
model.value = false
|
||||
ipcRenderer && ipcRenderer.send('openMainWindow')
|
||||
} finally {
|
||||
subjectLoading.value = false
|
||||
}
|
||||
emit('onSuccess')
|
||||
}
|
||||
|
||||
watch(() => model.value, (newVal) => {
|
||||
watch(() => props.modelValue, (newVal) => {
|
||||
dialogVisible.value = newVal
|
||||
if(newVal){
|
||||
getSubject()
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ let chapterId = null
|
|||
export const useGetHomework = async (node) => {
|
||||
/**
|
||||
* node
|
||||
* 左侧选择章节的节点数据
|
||||
*/
|
||||
if (!node) return
|
||||
curNode = node
|
||||
|
@ -27,10 +26,7 @@ export const useGetHomework = async (node) => {
|
|||
chapterId = rows[0].id
|
||||
}
|
||||
|
||||
return new Promise(async (resolve) =>{
|
||||
const res = await getHomeWorkList()
|
||||
resolve({res,chapterId})
|
||||
})
|
||||
return await getHomeWorkList()
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ const useUserStore = defineStore('user', {
|
|||
return new Promise((resolve, reject) => {
|
||||
getInfo()
|
||||
.then((res) => {
|
||||
// res.user.avatar = import.meta.env.VITE_APP_BASE_API + res.user.avatar
|
||||
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
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
/>
|
||||
</el-dialog>
|
||||
<!--选择学科-->
|
||||
<SelectSubject v-model="isSubject" :login-data="loginForm" />
|
||||
<SelectSubject v-model="isSubject" :login-data="loginForm" @on-success="successEditSubject" />
|
||||
</template>
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
|
@ -121,6 +121,12 @@ const submitForm = async (formEl) => {
|
|||
})
|
||||
}
|
||||
|
||||
const successEditSubject = () => {
|
||||
isSubject.value = false
|
||||
ElMessage.success('登录成功')
|
||||
ipcRenderer && ipcRenderer.send('openMainWindow')
|
||||
}
|
||||
|
||||
const getCookie = async () => {
|
||||
const username = (await getCookieDetail('username'))[0]
|
||||
const password = (await getCookieDetail('password'))[0]
|
||||
|
|
|
@ -230,7 +230,6 @@ export default {
|
|||
}
|
||||
},
|
||||
openFileWin(items) {
|
||||
if (!items||!items.fileSuffix) return;
|
||||
getPrepareById(items.id).then((item) => {
|
||||
Object.assign(items, item)
|
||||
asyncLocalFile(items).then(() => {
|
||||
|
|
|
@ -263,15 +263,9 @@ export default {
|
|||
getCurrentDate() {
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
let month = now.getMonth() + 1; // 月份是从0开始的,所以需要+1
|
||||
let day = now.getDate()
|
||||
if(month < 10){
|
||||
month = '0' + month
|
||||
}
|
||||
if(day < 10){
|
||||
day = '0' + day
|
||||
}
|
||||
return `${year}-${month}-${day}`;
|
||||
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}`;
|
||||
},
|
||||
validateGrade(rule, value, callback) {
|
||||
if (this.studentList.length == 0) {
|
||||
|
|
|
@ -139,6 +139,7 @@ import { useToolState } from '@/store/modules/tool'
|
|||
import MoveFile from '@/components/move-file/index.vue'
|
||||
import FileListItem from '@/views/prepare/container/file-list-item.vue'
|
||||
import { getSmarttalkPage, moveSmarttalk } from '@/api/file'
|
||||
import { homeworklist, listEntpcourse } from '@/api/teaching/classwork'
|
||||
import { toTimeText } from '@/utils/date'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { parseCataByNode, creatPPT, asyncLocalFile } from '@/utils/talkFile'
|
||||
|
@ -147,9 +148,8 @@ import SetHomework from './container/set-homework.vue'
|
|||
import outLink from '@/utils/linkConfig'
|
||||
import { createWindow } from '@/utils/tool'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { delClasswork } from '@/api/teaching/classwork'
|
||||
import { delClasswork, addEntpcourse } from '@/api/teaching/classwork'
|
||||
import { getSelfReserv, startClass } from '@/api/classManage'
|
||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||
const toolStore = useToolState()
|
||||
const fs = require('fs')
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
|
@ -416,7 +416,6 @@ export default {
|
|||
this.curBookImg = data.textBook.curBookImg
|
||||
this.curBookPath = data.textBook.curBookPath
|
||||
this.checkFileList = []
|
||||
this.currentWorkList = []
|
||||
let cata = parseCataByNode(data.node)
|
||||
this.currentNode = data.node
|
||||
this.uploadData.levelFirstId = cata[0]
|
||||
|
@ -429,11 +428,44 @@ export default {
|
|||
this.initHomeWork()
|
||||
await this.asyncAllFile()
|
||||
},
|
||||
// 获取作业
|
||||
async initHomeWork() {
|
||||
const { res, chapterId } = await useGetHomework(this.currentNode)
|
||||
this.entpcourseid = chapterId
|
||||
this.currentWorkList = cloneDeep(res)
|
||||
|
||||
if (this.uploadData.levelSecondId) {
|
||||
// 获取作业列表所需ID 可能存在没有
|
||||
let { rows } = await this.getChapterId()
|
||||
if (rows.length > 0) {
|
||||
this.entpcourseid = rows[0].id
|
||||
} else {
|
||||
await this.createEntpcourse()
|
||||
let { rows } = await this.getChapterId()
|
||||
this.entpcourseid = rows[0].id
|
||||
}
|
||||
|
||||
// 查询作业
|
||||
this.getHomeWorkList()
|
||||
}
|
||||
},
|
||||
// 创建新的entpcourse
|
||||
createEntpcourse() {
|
||||
// 参照 web AIx 传入参数
|
||||
var cform = {}
|
||||
cform.entpid = this.userStore.deptId
|
||||
cform.level = 1
|
||||
cform.parentid = 0
|
||||
cform.dictid = 0
|
||||
cform.evalid = this.currentNode.id
|
||||
cform.evalparentid = 0
|
||||
cform.edusubject = this.currentNode.edusubject
|
||||
cform.edudegree = this.currentNode.edudegree
|
||||
cform.edustage = this.currentNode.edustage
|
||||
cform.coursetype = '课标学科'
|
||||
cform.coursetitle = this.currentNode.itemtitle
|
||||
cform.coursedesc = ''
|
||||
cform.status = ''
|
||||
cform.dflag = 0
|
||||
cform.edituserid = this.userStore.userId
|
||||
cform.createblankfile = 'yes'
|
||||
return addEntpcourse(cform)
|
||||
},
|
||||
openReserv() {
|
||||
this.$refs['reservDialog'].openDialog()
|
||||
|
@ -463,6 +495,79 @@ export default {
|
|||
cookieData: { ...configObj.data }
|
||||
})
|
||||
},
|
||||
// 根据教材章节单元ID 查询作业列表所需ID
|
||||
getChapterId() {
|
||||
return listEntpcourse({
|
||||
evalid: this.uploadData.levelSecondId,
|
||||
edituserid: this.userStore.userId,
|
||||
pageSize: 500
|
||||
})
|
||||
},
|
||||
|
||||
// 查询作业列表
|
||||
getHomeWorkList() {
|
||||
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 = []
|
||||
|
||||
// 找child
|
||||
for (var j = 0; j < res.rows.length; j++) {
|
||||
if (res.rows[j].parentid == res.rows[i].id) {
|
||||
var ss = []
|
||||
if (res.rows[j].classworkdatastudentids != null) {
|
||||
ss = JSON.parse('[' + res.rows[j].classworkdatastudentids + ']')
|
||||
}
|
||||
var js = {
|
||||
id: res.rows[j].id,
|
||||
classid: res.rows[j].classid,
|
||||
classcaption: res.rows[j].classcaption,
|
||||
parentid: 0,
|
||||
worktype: '',
|
||||
workkey: res.rows[j].workkey,
|
||||
worktag: '',
|
||||
entpcourseid: 0,
|
||||
evalid: 0,
|
||||
edusubject: '',
|
||||
edudegree: '',
|
||||
workdate: '',
|
||||
title: '',
|
||||
workcodes: '',
|
||||
studentlist: ss,
|
||||
deaddate: res.rows[j].deaddate,
|
||||
timelength: res.rows[j].timelength,
|
||||
weights: res.rows[j].weights,
|
||||
feedtype: res.rows[j].feedtype
|
||||
}
|
||||
res.rows[i].taskconfig.push(js)
|
||||
}
|
||||
}
|
||||
res.rows[i].fileShowName = res.rows[i].uniquekey
|
||||
|
||||
// 注意slideid>0的,这一些作业是添加到PPT页面的,所以在作业管理中不能出现
|
||||
// 2024-05-15,酉阳,jackyshen
|
||||
if (res.rows[i].classid == 0 && res.rows[i].slideid == 0) {
|
||||
list.push(res.rows[i])
|
||||
}
|
||||
|
||||
// 如果是习题训练任务,则检查一共有多少道
|
||||
if (res.rows[i].entpcourseworklist != '') {
|
||||
res.rows[i].entpcourseworklistarray = JSON.parse(
|
||||
'[' + res.rows[i].entpcourseworklist + ']'
|
||||
)
|
||||
} else {
|
||||
res.rows[i].entpcourseworklistarray = []
|
||||
}
|
||||
}
|
||||
// 深度克隆
|
||||
this.currentWorkList = cloneDeep(list)
|
||||
})
|
||||
},
|
||||
getWeekday1(date) {
|
||||
const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
|
||||
const weekday = new Date(date).getDay()
|
||||
|
@ -481,7 +586,7 @@ export default {
|
|||
ElMessage.success('操作成功')
|
||||
this.isLoading = false
|
||||
await this.asyncAllFile()
|
||||
this.initHomeWork()
|
||||
this.getHomeWorkList()
|
||||
})
|
||||
.catch(() => {
|
||||
this.isLoading = false
|
||||
|
|
|
@ -97,10 +97,10 @@ const state = reactive({
|
|||
postGroup: {}
|
||||
})
|
||||
|
||||
async function getUser() {
|
||||
function getUser() {
|
||||
getUserProfile().then((response) => {
|
||||
// response.data.avatar = import.meta.env.VITE_APP_BASE_API + response.data.avatar
|
||||
Object.assign(state.user,response.data)
|
||||
response.data.avatar = import.meta.env.VITE_APP_BASE_API + response.data.avatar
|
||||
state.user = response.data
|
||||
state.roleGroup = response.roleGroup
|
||||
state.postGroup = response.postGroup
|
||||
})
|
||||
|
|
|
@ -68,7 +68,7 @@ function uploadImg(data) {
|
|||
|
||||
/** 关闭窗口 */
|
||||
function closeDialog() {
|
||||
options.img = userStore.user.avatar
|
||||
// options.img = userStore.avatar
|
||||
options.visible = false
|
||||
}
|
||||
const cancle = () => {
|
||||
|
|
|
@ -73,6 +73,7 @@
|
|||
import { ref, onMounted, toRaw } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { homeworklist } from '@/api/teaching/classwork'
|
||||
import { getSmarttalkPage, getPrepareById } from '@/api/file'
|
||||
import SetHomework from '@/views/prepare/container/set-homework.vue'
|
||||
import FileImage from '@/components/file-image/index.vue'
|
||||
|
@ -117,7 +118,7 @@ const closeHomework = () => {
|
|||
|
||||
|
||||
const changeChapter = async (data)=>{
|
||||
const { res } = await useGetHomework(data)
|
||||
const res = await useGetHomework(data)
|
||||
dataList.value = res
|
||||
let cata = parseCataByNode(data)
|
||||
|
||||
|
@ -156,12 +157,70 @@ const getResource = () => {
|
|||
}
|
||||
|
||||
// 获取作业数据
|
||||
const getHomework = async () => {
|
||||
const data = toRaw(toolStore.curSubjectNode).data.node
|
||||
const getHomework = () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const { res } = await useGetHomework(data)
|
||||
dataList.value = res
|
||||
homeworklist({
|
||||
entpcourseid: entpcourseid.value,
|
||||
edituserid: usertore.userId,
|
||||
pageSize: 100
|
||||
}).then(res => {
|
||||
//以下代码 参照AIx web端 作业布置
|
||||
let list = []
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
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 = []
|
||||
if (res.rows[j].classworkdatastudentids != null) {
|
||||
ss = JSON.parse('[' + res.rows[j].classworkdatastudentids + ']')
|
||||
}
|
||||
var js = {
|
||||
id: res.rows[j].id,
|
||||
classid: res.rows[j].classid,
|
||||
classcaption: res.rows[j].classcaption,
|
||||
parentid: 0,
|
||||
worktype: '',
|
||||
workkey: res.rows[j].workkey,
|
||||
worktag: '',
|
||||
entpcourseid: 0,
|
||||
evalid: 0,
|
||||
edusubject: '',
|
||||
edudegree: '',
|
||||
workdate: '',
|
||||
title: '',
|
||||
workcodes: '',
|
||||
studentlist: ss,
|
||||
deaddate: res.rows[j].deaddate,
|
||||
timelength: res.rows[j].timelength,
|
||||
weights: res.rows[j].weights,
|
||||
feedtype: res.rows[j].feedtype
|
||||
}
|
||||
res.rows[i].taskconfig.push(js)
|
||||
}
|
||||
}
|
||||
res.rows[i].fileShowName = res.rows[i].uniquekey
|
||||
|
||||
// 注意slideid>0的,这一些作业是添加到PPT页面的,所以在作业管理中不能出现
|
||||
// 2024-05-15,酉阳,jackyshen
|
||||
if (res.rows[i].classid == 0 && res.rows[i].slideid == 0) {
|
||||
list.push(res.rows[i])
|
||||
}
|
||||
|
||||
// 如果是习题训练任务,则检查一共有多少道
|
||||
if (res.rows[i].entpcourseworklist != '') {
|
||||
res.rows[i].entpcourseworklistarray = JSON.parse(
|
||||
'[' + res.rows[i].entpcourseworklist + ']'
|
||||
)
|
||||
} else {
|
||||
res.rows[i].entpcourseworklistarray = []
|
||||
}
|
||||
}
|
||||
|
||||
dataList.value = list
|
||||
})
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
@ -186,10 +245,10 @@ function leave(el, done) {
|
|||
onMounted(() => {
|
||||
entpcourseid.value = route.query.entpcourseid
|
||||
lesson.value = route.query.label
|
||||
setTimeout(()=>{
|
||||
getHomework()
|
||||
setTimeout(()=>{
|
||||
getResource()
|
||||
},200)
|
||||
},1000)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue