Compare commits

...

8 Commits

7 changed files with 56 additions and 41 deletions

View File

@ -18,6 +18,14 @@ export function listClassworkdataByDeadDate(query) {
})
}
// 查询classworkdata详细
export function getClassworkdata(id) {
return request({
url: '/education/classworkdata/' + id,
method: 'get'
})
}
// 查询classworkdata列表 班级作业列表
export function listClassworkdata(query) {
return request({

View File

@ -10,12 +10,12 @@
<li class="flex" :class="[activeId == menu.path ? 'active-li' : '', menu.disabled ? 'disabled' : '']"
v-for="menu in headerMenus" :key="menu.id" @click="clickMenu(menu)">
<div class="icon-box">
<svg class="icon iconfont" aria-hidden="true">
<use :xlink:href="menu.icon"></use>
</svg>
</div>
<span class="text">{{ menu.name }}</span>
</li>
@ -80,8 +80,8 @@ import { updateUserInfo } from '@/api/system/user'
import logoIco from '@/assets/images/logo.png'
import { listEvaluation } from '@/api/classManage/index'
import { sessionStore } from '@/utils/store'
import Chat from '@/utils/chat' // im
if (!Chat.imChat) Chat.init()
// import Chat from '@/utils/chat' // im
// if (!Chat.imChat) Chat.init()
let homeTitle = ref(import.meta.env.VITE_APP_TITLE)
const { ipcRenderer } = window.electron || {}
@ -145,7 +145,7 @@ function handleCommand(command) {
break
case 'logout':
logout()
Chat?.logout() // im 退
// Chat?.logout() // im 退
break
default:
break
@ -161,7 +161,9 @@ function logout() {
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
.then(async () => {
const Chat = (await import('@/utils/chat')).default
if (!!Chat.imChat) Chat.logout()
userStore
.logOut()
.then(() => {
@ -172,8 +174,7 @@ function logout() {
// router.replace('/login')
ipcRenderer && ipcRenderer.send('openLoginWindow')
})
})
.catch(() => { })
}).catch(()=>{})
}
const emits = defineEmits(['setLayout'])
@ -183,10 +184,10 @@ function setLayout() {
//
const changeSubject = async (command) =>{
let sessionSubject = {
bookList: null,
curBook: null,
curNode: null,
defaultExpandedKeys: [],
bookList: null,
curBook: null,
curNode: null,
defaultExpandedKeys: [],
subjectTree: []
}
sessionStore.set( 'subject', sessionSubject)

View File

@ -20,9 +20,9 @@ export class Chat {
}
/**
* 初始化 获取IM签名
* @param {*} isInit : 是否初始化IM
* @param {*} isInit : 是否初始化IM
* @param {*} isLogin : 是否登录IM
* @param {*} callback: 监听消息回调函数
* @param {*} callback: 监听消息回调函数
* @returns Promise<ImChat>
*/
async init(isInit = true, isLogin = true, callback) {
@ -69,7 +69,6 @@ export class Chat {
async logout() {
if (!this.imChat) return
await this.imChat?.logout()
imChat = null
this.imChat = null
}
// 发群消息
@ -95,4 +94,4 @@ export class Chat {
}
}
export default new Chat()
export default new Chat()

View File

@ -32,6 +32,8 @@ function getColor(index) {
//
function initChart() {
const myChart = echarts.init(chartRef.value);
const total = dataList.value.reduce((acc, cur) => acc + cur.value, 0); //
const options = {
tooltip: {
trigger: 'axis',
@ -70,7 +72,11 @@ function initChart() {
label: {
show: true,
position: 'top',
formatter: '{c}人',
formatter: params => {
const value = dataList.value[params.dataIndex].value;
const percentage = ((value / total) * 100).toFixed(2); //
return `${percentage}%`; //
},
color: '#333',
fontSize: 12
}

View File

@ -460,12 +460,13 @@ import useUserStore from '@/store/modules/user'
import { ref, reactive } from 'vue'
// import { Plus } from '@element-plus/icons-vue'
import { ElMessageBox, ElMessage } from 'element-plus'
import { updateClassworkeval, updateClassworkdata } from '@/api/classTask'
import { updateClassworkeval, updateClassworkdata, getClassworkdata } from '@/api/classTask'
import { getTimeDate } from '@/utils/date'
import ReFilePreview from '@/components/refile-preview/index.vue'
import { quizStrToList } from '@/utils/comm';
const userStore = useUserStore()
const router = useRouter()
const route = useRoute()
@ -644,7 +645,7 @@ const selectScore = (score) => {
}
//
const acceptParams = (params) => {
const acceptParams = async (params) => {
console.log(params)
console.log(dialogProps, 'dialogProps')
//
@ -709,8 +710,9 @@ const acceptParams = (params) => {
if (params.studentObj.worktype == '常规作业') {
try {
// datacontent TODO
if (params.studentObj.datacontent != '') {
const teachWorkFileList = JSON.parse(params.studentObj.datacontent)
const res = await getClassworkdata(params.studentObj.id);
if(res.data.datacontent != ''){
const teachWorkFileList = JSON.parse(res.data.datacontent);
console.log(teachWorkFileList, '老师filelist-------------')
teachWorkFileList &&
teachWorkFileList.forEach((item) => {
@ -727,7 +729,6 @@ const acceptParams = (params) => {
teacherFeedContentList.value.push(teachWorkFileList)
}
dialogProps.value.studentObj.datacontent = dialogProps.value.studentObj.datacontent
} catch (error) {
console.error('Invalid JSON:', error)
}

View File

@ -418,15 +418,15 @@ const getStudentClassWorkDataDetail = (row) => {
wevalres.rows[w].score = wevalres.rows[w].score ? wevalres.rows[w].score : 0
// html
wevalres.rows[w].rightanswer =
wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null
? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '')
: wevalres.rows[w].rightanswer
// html
wevalres.rows[w].feedcontent =
wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null
? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '')
: wevalres.rows[w].feedcontent
// wevalres.rows[w].rightanswer =
// wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null
// ? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '')
// : wevalres.rows[w].rightanswer
// // html
// wevalres.rows[w].feedcontent =
// wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null
// ? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '')
// : wevalres.rows[w].feedcontent
if (classWorkAnalysis.row.worktype == '常规作业') {
wevalres.rows[w].feedcontent = JSON.parse(wevalres.rows[w].feedcontent)

View File

@ -410,15 +410,15 @@ const getStudentClassWorkDataDetail = (row) => {
wevalres.rows[w].score = wevalres.rows[w].score ? wevalres.rows[w].score : 0
// html
wevalres.rows[w].rightanswer =
wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null
? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '')
: wevalres.rows[w].rightanswer
// html
wevalres.rows[w].feedcontent =
wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null
? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '')
: wevalres.rows[w].feedcontent
// wevalres.rows[w].rightanswer =
// wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null
// ? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '')
// : wevalres.rows[w].rightanswer
// // html
// wevalres.rows[w].feedcontent =
// wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null
// ? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '')
// : wevalres.rows[w].feedcontent
if (classWorkAnalysis.row.worktype == '常规作业') {
wevalres.rows[w].feedcontent = JSON.parse(wevalres.rows[w].feedcontent)