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列表 班级作业列表 // 查询classworkdata列表 班级作业列表
export function listClassworkdata(query) { export function listClassworkdata(query) {
return request({ return request({

View File

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

View File

@ -20,9 +20,9 @@ export class Chat {
} }
/** /**
* 初始化 获取IM签名 * 初始化 获取IM签名
* @param {*} isInit : 是否初始化IM * @param {*} isInit : 是否初始化IM
* @param {*} isLogin : 是否登录IM * @param {*} isLogin : 是否登录IM
* @param {*} callback: 监听消息回调函数 * @param {*} callback: 监听消息回调函数
* @returns Promise<ImChat> * @returns Promise<ImChat>
*/ */
async init(isInit = true, isLogin = true, callback) { async init(isInit = true, isLogin = true, callback) {
@ -69,7 +69,6 @@ export class Chat {
async logout() { async logout() {
if (!this.imChat) return if (!this.imChat) return
await this.imChat?.logout() await this.imChat?.logout()
imChat = null
this.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() { function initChart() {
const myChart = echarts.init(chartRef.value); const myChart = echarts.init(chartRef.value);
const total = dataList.value.reduce((acc, cur) => acc + cur.value, 0); //
const options = { const options = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
@ -70,7 +72,11 @@ function initChart() {
label: { label: {
show: true, show: true,
position: 'top', position: 'top',
formatter: '{c}人', formatter: params => {
const value = dataList.value[params.dataIndex].value;
const percentage = ((value / total) * 100).toFixed(2); //
return `${percentage}%`; //
},
color: '#333', color: '#333',
fontSize: 12 fontSize: 12
} }

View File

@ -460,12 +460,13 @@ import useUserStore from '@/store/modules/user'
import { ref, reactive } from 'vue' import { ref, reactive } from 'vue'
// import { Plus } from '@element-plus/icons-vue' // import { Plus } from '@element-plus/icons-vue'
import { ElMessageBox, ElMessage } from 'element-plus' 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 { getTimeDate } from '@/utils/date'
import ReFilePreview from '@/components/refile-preview/index.vue' import ReFilePreview from '@/components/refile-preview/index.vue'
import { quizStrToList } from '@/utils/comm'; import { quizStrToList } from '@/utils/comm';
const userStore = useUserStore() const userStore = useUserStore()
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
@ -644,7 +645,7 @@ const selectScore = (score) => {
} }
// //
const acceptParams = (params) => { const acceptParams = async (params) => {
console.log(params) console.log(params)
console.log(dialogProps, 'dialogProps') console.log(dialogProps, 'dialogProps')
// //
@ -709,8 +710,9 @@ const acceptParams = (params) => {
if (params.studentObj.worktype == '常规作业') { if (params.studentObj.worktype == '常规作业') {
try { try {
// datacontent TODO // datacontent TODO
if (params.studentObj.datacontent != '') { const res = await getClassworkdata(params.studentObj.id);
const teachWorkFileList = JSON.parse(params.studentObj.datacontent) if(res.data.datacontent != ''){
const teachWorkFileList = JSON.parse(res.data.datacontent);
console.log(teachWorkFileList, '老师filelist-------------') console.log(teachWorkFileList, '老师filelist-------------')
teachWorkFileList && teachWorkFileList &&
teachWorkFileList.forEach((item) => { teachWorkFileList.forEach((item) => {
@ -727,7 +729,6 @@ const acceptParams = (params) => {
teacherFeedContentList.value.push(teachWorkFileList) teacherFeedContentList.value.push(teachWorkFileList)
} }
dialogProps.value.studentObj.datacontent = dialogProps.value.studentObj.datacontent
} catch (error) { } catch (error) {
console.error('Invalid JSON:', 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 wevalres.rows[w].score = wevalres.rows[w].score ? wevalres.rows[w].score : 0
// html // html
wevalres.rows[w].rightanswer = // wevalres.rows[w].rightanswer =
wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null // wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null
? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '') // ? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '')
: wevalres.rows[w].rightanswer // : wevalres.rows[w].rightanswer
// html // // html
wevalres.rows[w].feedcontent = // wevalres.rows[w].feedcontent =
wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null // wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null
? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '') // ? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '')
: wevalres.rows[w].feedcontent // : wevalres.rows[w].feedcontent
if (classWorkAnalysis.row.worktype == '常规作业') { if (classWorkAnalysis.row.worktype == '常规作业') {
wevalres.rows[w].feedcontent = JSON.parse(wevalres.rows[w].feedcontent) 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 wevalres.rows[w].score = wevalres.rows[w].score ? wevalres.rows[w].score : 0
// html // html
wevalres.rows[w].rightanswer = // wevalres.rows[w].rightanswer =
wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null // wevalres.rows[w].rightanswer != '' && wevalres.rows[w].rightanswer != null
? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '') // ? wevalres.rows[w].rightanswer.replace(/<[^>]+>/g, '')
: wevalres.rows[w].rightanswer // : wevalres.rows[w].rightanswer
// html // // html
wevalres.rows[w].feedcontent = // wevalres.rows[w].feedcontent =
wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null // wevalres.rows[w].feedcontent != '' && wevalres.rows[w].feedcontent != null
? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '') // ? wevalres.rows[w].feedcontent.replace(/<[^>]+>/g, '')
: wevalres.rows[w].feedcontent // : wevalres.rows[w].feedcontent
if (classWorkAnalysis.row.worktype == '常规作业') { if (classWorkAnalysis.row.worktype == '常规作业') {
wevalres.rows[w].feedcontent = JSON.parse(wevalres.rows[w].feedcontent) wevalres.rows[w].feedcontent = JSON.parse(wevalres.rows[w].feedcontent)