Compare commits

..

No commits in common. "1afaed082ac98e823079df458f1891ac24cff005" and "6a33ea8023574608044f16fc1af9c285f6e9708e" have entirely different histories.

7 changed files with 70 additions and 193 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "aix-win", "name": "aix-win",
"version": "1.2.2", "version": "1.2.0",
"description": "An Electron application with Vue", "description": "An Electron application with Vue",
"main": "./out/main/index.js", "main": "./out/main/index.js",
"author": "example.com", "author": "example.com",
@ -29,7 +29,6 @@
"@vue-office/excel": "^1.7.11", "@vue-office/excel": "^1.7.11",
"@vue-office/pdf": "^2.0.2", "@vue-office/pdf": "^2.0.2",
"@vueuse/core": "^10.11.0", "@vueuse/core": "^10.11.0",
"circular-json": "^0.5.9",
"cropperjs": "^1.6.2", "cropperjs": "^1.6.2",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
"echarts": "^5.5.1", "echarts": "^5.5.1",

View File

@ -53,7 +53,7 @@ function createLoginWindow() {
updateInit(loginWindow) updateInit(loginWindow)
} }
loginWindow.webContents.openDevTools() // loginWindow.webContents.openDevTools()
loginWindow.once('ready-to-show', () => { loginWindow.once('ready-to-show', () => {
loginWindow.show() loginWindow.show()
}) })

View File

@ -264,7 +264,7 @@ const transData = (data) => {
// //
const getSubject = async () => { const getSubject = async () => {
const { rows } = await listEvaluation({ itemkey: "version", edusubject, edustage, pageSize: 10000,orderby: 'orderidx asc', }) const { rows } = await listEvaluation({ itemkey: "version", edusubject, edustage, pageSize: 10000 })
// subjectList.value = rows.filter(item => item.edustage == edustage && item.edusubject == edusubject) // subjectList.value = rows.filter(item => item.edustage == edustage && item.edusubject == edusubject)
subjectList.value = rows subjectList.value = rows

View File

@ -4,7 +4,6 @@
const isNode = typeof require !== 'undefined' // 是否支持node函数 const isNode = typeof require !== 'undefined' // 是否支持node函数
const { ipcRenderer } = isNode?require('electron'):{} // app使用 const { ipcRenderer } = isNode?require('electron'):{} // app使用
import { sessionStore } from '@/utils/store' import { sessionStore } from '@/utils/store'
import CircularJSON from 'circular-json'
// import { diff } from 'jsondiffpatch' // import { diff } from 'jsondiffpatch'
// const Remote = isNode?require('@electron/remote'):{} // 远程模块 // const Remote = isNode?require('@electron/remote'):{} // 远程模块
@ -174,7 +173,6 @@ const findDifferences = (obj1, obj2) => {
for (const key in o1) { for (const key in o1) {
if (o1.hasOwnProperty(key)) { if (o1.hasOwnProperty(key)) {
const newPath = path ? `${path}.${key}` : key; const newPath = path ? `${path}.${key}` : key;
if(!o2) return
if (o2.hasOwnProperty(key)) { if (o2.hasOwnProperty(key)) {
const v1 = toJsonStr(o1[key]) const v1 = toJsonStr(o1[key])
const v2 = toJsonStr(o2[key]) const v2 = toJsonStr(o2[key])
@ -204,6 +202,6 @@ const findDifferences = (obj1, obj2) => {
return differences; return differences;
} }
// 对象克隆 // 对象克隆
const objClone = (obj) => JSON.parse(CircularJSON.stringify(obj)) const objClone = (obj) => JSON.parse(JSON.stringify(obj))
// 转换为json // 转换为json
const toJsonStr = (obj) => CircularJSON.stringify(obj) const toJsonStr = (obj) => JSON.stringify(obj)

View File

@ -88,9 +88,6 @@ export const getCurrentTime = (format)=> {
const day = now.getDate().toString().padStart(2, '0'); const day = now.getDate().toString().padStart(2, '0');
const hours = now.getHours().toString().padStart(2, '0'); const hours = now.getHours().toString().padStart(2, '0');
const minutes = now.getMinutes().toString().padStart(2, '0'); const minutes = now.getMinutes().toString().padStart(2, '0');
if(format == 'YYYY-MM-DD HH:mm'){
return `${year}-${month}-${day} ${hours}:${minutes}`;
}
if(format == 'YYYY-MM-DD'){ if(format == 'YYYY-MM-DD'){
return `${year}-${month}-${day}`; return `${year}-${month}-${day}`;
} }

View File

@ -2,7 +2,7 @@
<div class="class-reserv-item"> <div class="class-reserv-item">
<div class="class-reserv-item-body"> <div class="class-reserv-item-body">
<div class="class-reserv-item-title1"> <div class="class-reserv-item-title1">
<el-tag style="margin-left: 5px" :type="item.workclass?item.workclass:'info'"> {{ item.worktype }}</el-tag> <el-tag style="margin-left: 5px" :type="item.workclass"> {{ item.worktype }}</el-tag>
<label style="margin-left: 10px">{{ item.uniquekey }}</label> <label style="margin-left: 10px">{{ item.uniquekey }}</label>
</div> </div>

View File

@ -1,209 +1,92 @@
<template> <template>
<div class="desktop-work-item"> <div class="desktop-item">
<div class="item-title flex"> <div class="item-title flex">
<span>工作动态</span> <span>工作动态</span>
<el-radio-group v-model="type" @change="changeTab"> <el-radio-group v-model="type">
<el-radio-button label="全部" :value="-1" /> <el-radio-button label="全部" :value="-1" />
<el-radio-button label="备课" :value="1" disabled /> <el-radio-button label="备课" :value="1" />
<el-radio-button label="上课" :value="2" disabled /> <el-radio-button label="上课" :value="2" />
<el-radio-button label="作业" :value="3" /> <el-radio-button label="作业" :value="3" />
</el-radio-group> </el-radio-group>
</div> </div>
<div class="item-content" v-loading="loading"> <div class="item-content">
<el-scrollbar height="500px"> <ul>
<ul> <li class="flex class-item" v-for="item in classList" :key="item.id">
<!--上课--> <div class="class-left flex">
<template v-if="type == 2 || type == -1"> <div class="class-name flex">
<li class="flex class-item" v-for="item in classList" :key="item.id"> <span>{{ item.className }}</span>
<div class="class-left flex"> </div>
<div class="class-name flex"> <div class="class-time"> {{ item.classDay }}&nbsp;{{ item.startTime }} ~ {{ item.classDay }}&nbsp;{{ item.endTime }}</div>
<span class="name">{{ item.className }}</span> <div class="class-grade">
</div> <span v-for="(tag, index) in item.classItemList" :key="index" style="margin-left: 5px">
<div class="class-time"> {{ item.classDay }}&nbsp;{{ item.startTime }} ~ {{ item.classDay }}&nbsp;{{ {{ index === 0 ? tag.name : '、' + tag.name }}
item.endTime }}</div> </span>
<div class="class-grade"> </div>
<span v-for="(tag, index) in item.classItemList" :key="index" style="margin-left: 5px"> </div>
{{ index === 0 ? tag.name : '、' + tag.name }} <div class="class-right">
</span> <el-button type="primary" size="small">上课</el-button>
</div> </div>
</div> </li>
<div class="class-right"> </ul>
<el-button type="primary" size="small">上课</el-button>
</div>
</li>
</template>
<!--作业-->
<template v-if="type == 3 || type == -1">
<li class="flex class-item home-list" v-for="item in homeworkList" :key="item.id">
<div class="class-left flex">
<div class="class-name flex">
<span class="name">{{ item.uniquekey }}</span>
<el-tag class="tag" round :type="tagType(item.deaddate)" effect="dark" size="small">{{
getCurrentTime('YYYY-MM-DD HH:mm') > item.deaddate ? '已结束' : '进行中' }}</el-tag>
</div>
<div class="class-time">{{ item.classcaption }} | 截止时间{{ item.deaddate }} </div>
</div>
<div class="class-right">
<div><span class="num">{{ item.workdataresultcount }}</span> / {{ item.workdatacount }}</div>
<div>已交</div>
</div>
</li>
</template>
</ul>
</el-scrollbar>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import useUserStore from '@/store/modules/user'
import { getSelfReserv } from '@/api/classManage' import { getSelfReserv } from '@/api/classManage'
import { homeworklist } from '@/api/teaching/classwork'
import { getCurrentTime } from '@/utils/date'
const type = ref(-1) const type = ref(-1)
const user = useUserStore().user const classList = ref([])
const loading = ref(false)
const classList = ref([]) //
const homeworkList = ref([]) const getClass = () =>{
getSelfReserv().then((res) => {
let list = res.data || []
list.sort((a,b) => { if(a.status=='上课中') return -1; else return 0 })
classList.value = list.filter(item => item.status !== '已结束')
//
const getClass = async () => {
loading.value = true
try {
const res = await getSelfReserv()
let list = res.data || []
list.sort((a, b) => { if (a.status == '上课中') return -1; else return 0 })
classList.value = list.filter(item => item.status !== '已结束')
} finally {
loading.value = false
}
}
//
const getHomework = async () => {
loading.value = true
const { edustage, edusubject } = user
try {
const { rows } = await homeworklist({ edituserid: user.userId, edustage, edusubject, orderby: 'uniquekey DESC', pageSize: 500 })
homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey)
homeworkList.value.forEach((item) => {
item.workdatacount = JSON.parse('[' + item.classworkdatastudentids + ']').length
}) })
} finally {
loading.value = false
} }
}
const tagType = (time) => { onMounted(()=>{
return getCurrentTime('YYYY-MM-DD HH:mm') > time ? 'info' : 'warning' getClass()
} })
//
const changeTab = (val) =>{
switch(val){
case -1:
// getClass()
getHomework()
break;
case 1:
break;
case 2:
getClass()
break;
default:
getHomework()
}
}
onMounted(() => {
// getClass()
getHomework()
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.desktop-work-item { .desktop-item{
align-items: center; margin-bottom: 20px;
height: 100%;
.item-title {
height: 32px;
text-align: left;
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
align-items: center; align-items: center;
justify-content: space-between; .item-title{
} height: 32px;
text-align: left;
.item-content { font-size: 18px;
background-color: #fff; font-weight: bold;
border-radius: 5px;
padding: 10px 15px;
font-size: 13px;
height: calc(100% - 60px);
.class-item {
justify-content: space-between;
align-items: center;
background: #eff5fa;
border-radius: 5px;
margin-bottom: 10px; margin-bottom: 10px;
padding: 10px; align-items: center;
justify-content: space-between;
.class-left { }
flex-direction: column; .item-content{
align-items: flex-start; background-color: #fff;
width: 90%; border-radius: 5px;
padding: 10px 15px;
.class-name { font-size: 13px;
display: flex; .class-item{
align-items: center; justify-content: space-between;
align-items: center;
.name { background: #e2e4f4;
font-size: 14px; border-radius: 5px;
font-weight: bold; margin-bottom: 10px;
padding: 10px;
.class-left{
flex-direction: column;
align-items: flex-start;
.class-time{
font-size: 13px;
color: #bfbfbf;
} }
.tag {
margin-left: 5px;
border: none;
:deep(.el-tag__content) {
font-size: 12px;
}
}
}
.class-time {
font-size: 13px;
color: #a5a4a4;
padding-top: 3px;
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: left;
}
}
.class-right {
font-size: 12px;
color: #a5a4a4;
flex-shrink: 0;
font-size: 13px;
.num {
font-size: 14px;
color: #409EFF;
font-weight: bold;
} }
} }
} }
.class-grade {
padding-top: 3px
}
} }
}
</style> </style>