lyc-dev #271

Merged
lyc merged 2 commits from lyc-dev into main 2024-09-25 16:14:01 +08:00
4 changed files with 77 additions and 61 deletions

View File

@ -88,9 +88,10 @@ function createLoginWindow() {
//主窗口
function createMainWindow() {
mainWindow = new BrowserWindow({
width: 1200,
minWidth: 1350,
width: 1350,
minWidth: 1200,
height: 700,
minHeight: 700,
show: false,
frame: false, // 无边框
autoHideMenuBar: true,
@ -118,6 +119,11 @@ function createMainWindow() {
}, 1000)
// app.quit() // 主窗口关闭-结束所有进程
})
mainWindow.on('resize', () => {
const { width, height } = mainWindow.getBounds();
mainWindow.webContents.send('minWinResize', { width, height });
});
mainWindow.webContents.setWindowOpenHandler((details) => {
shell.openExternal(details.url)
return { action: 'deny' }
@ -129,6 +135,7 @@ function createMainWindow() {
} else {
mainWindow.loadFile(join(__dirname, '../renderer/index.html'))
}
// mainWindow.setAlwaysOnTop(true, "screen-saver") // 将窗口设置为顶层窗口
// mainWindow.setVisibleOnAllWorkspaces(true) // 如果窗口在所有工作区都可见
// 第三步: 开启remote服务

View File

@ -70,10 +70,8 @@ import { ArrowDown } from '@element-plus/icons-vue'
import WindowTools from '@/components/window-tools/index.vue'
import useUserStore from '@/store/modules/user'
import { updateUserInfo } from '@/api/system/user'
import outLink from '@/utils/linkConfig'
import logoIco from '@/assets/images/logo.png'
import { listEvaluation } from '@/api/classManage/index'
import { clearBookInfo } from '@/utils/ruoyi'
import { sessionStore } from '@/utils/store'
import { useToolState } from '@/store/modules/tool'

View File

@ -34,30 +34,15 @@
<script setup>
import { ref, onMounted } from 'vue'
import useUserStore from '@/store/modules/user'
import { getSelfReserv } from '@/api/classManage'
import { homeworklist } from '@/api/teaching/classwork'
import { getCurrentTime, getTomorrow } from '@/utils/date'
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
const type = ref(-1)
const user = useUserStore().user
const loading = ref(false)
const classList = ref([])
const homeworkList = ref([])
const itemDialogRef = ref(null)
//
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
@ -98,16 +83,16 @@ const tagType = (time) => {
onMounted(() => {
// getClass()
getHomework()
})
</script>
<style lang="scss" scoped>
.desktop-work-item {
align-items: center;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
.item-title {
height: 32px;
text-align: left;
@ -126,7 +111,7 @@ onMounted(() => {
border-radius: 5px;
padding: 10px 15px;
font-size: 13px;
height: calc(100% - 60px);
flex: 1;
.class-item {
justify-content: space-between;

View File

@ -1,7 +1,7 @@
<template>
<div class="page-desktop">
<el-row :gutter="20">
<el-col :span="17">
<el-row :gutter="20" style="height: 100%;">
<el-col :span="17" class="desktop-left">
<el-row :gutter="20">
<el-col :span="item.span" v-for="item in menuList" :key="item.id">
<div class="desktop-item">
@ -17,9 +17,9 @@
</div>
</el-col>
</el-row>
<el-row>
<el-row style="height: 100%;">
<el-col :span="24">
<div class="desktop-item">
<div class="desktop-item-chart">
<div class="item-title flex">
<span>教学进度</span>
</div>
@ -30,7 +30,7 @@
</el-col>
</el-row>
</el-col>
<el-col :span="7">
<el-col :span="7" style="flex: 1;">
<!--工作动态-->
<workTrend/>
</el-col>
@ -42,11 +42,12 @@
<script setup>
import { ref, onMounted, nextTick } from 'vue'
import { useRouter } from 'vue-router'
import * as echarts from 'echarts'
import workTrend from './container/work-trend.vue'
import outLink from '@/utils/linkConfig'
import * as echarts from 'echarts'
import { useGetSubject } from '@/hooks/useGetSubject'
import { sessionStore } from '@/utils/store'
import { debounce } from 'lodash'
const router = useRouter()
const { ipcRenderer } = window.electron || {}
@ -191,6 +192,10 @@ const clickMenu = ({isOuter, path, disabled, id}) =>{
}
}
ipcRenderer.on('minWinResize', debounce((e, data) =>{
chartInstance.resize()
}, 100))
onMounted(async ()=>{
await useGetSubject()
@ -250,7 +255,10 @@ onMounted(async ()=>{
.page-desktop{
height: 100%;
padding-top: 20px;
.desktop-left{
display: flex;
flex-direction: column;
}
.desktop-item{
margin-bottom: 20px;
.item-title{
@ -298,12 +306,30 @@ onMounted(async ()=>{
}
}
}
.chart-box{
height: 220px;
}
}
}
}
.desktop-item-chart{
height: 100%;
display: flex;
flex-direction: column;
.item-title{
height: 32px;
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
align-items: center;
}
.item-content{
background: #fff;
flex: 1;
.chart-box{
height: 100%;
}
}
}
</style>