工作台-edit

This commit is contained in:
lyc 2024-09-25 16:12:55 +08:00
parent 773d0c1957
commit eb78a80131
4 changed files with 77 additions and 61 deletions

View File

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

View File

@ -70,10 +70,8 @@ import { ArrowDown } from '@element-plus/icons-vue'
import WindowTools from '@/components/window-tools/index.vue' import WindowTools from '@/components/window-tools/index.vue'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import { updateUserInfo } from '@/api/system/user' import { updateUserInfo } from '@/api/system/user'
import outLink from '@/utils/linkConfig'
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 { clearBookInfo } from '@/utils/ruoyi'
import { sessionStore } from '@/utils/store' import { sessionStore } from '@/utils/store'
import { useToolState } from '@/store/modules/tool' import { useToolState } from '@/store/modules/tool'

View File

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

View File

@ -1,40 +1,40 @@
<template> <template>
<div class="page-desktop"> <div class="page-desktop">
<el-row :gutter="20"> <el-row :gutter="20" style="height: 100%;">
<el-col :span="17"> <el-col :span="17" class="desktop-left">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="item.span" v-for="item in menuList" :key="item.id"> <el-col :span="item.span" v-for="item in menuList" :key="item.id">
<div class="desktop-item"> <div class="desktop-item">
<div class="item-title">{{ item.name }}</div> <div class="item-title">{{ item.name }}</div>
<div class="item-content"> <div class="item-content">
<ul class="flex con-ul"> <ul class="flex con-ul">
<li v-for="menu in item.list" :key="menu.id" @click="clickMenu(menu)" class="flex item-menu" :class="menu.disabled ? 'menu-disabled' : ''"> <li v-for="menu in item.list" :key="menu.id" @click="clickMenu(menu)" class="flex item-menu" :class="menu.disabled ? 'menu-disabled' : ''">
<i class="iconfont" :class="menu.icon"></i> <i class="iconfont" :class="menu.icon"></i>
<span>{{ menu.name }}</span> <span>{{ menu.name }}</span>
</li> </li>
</ul> </ul>
</div>
</div> </div>
</div> </el-col>
</el-col> </el-row>
</el-row> <el-row style="height: 100%;">
<el-row> <el-col :span="24">
<el-col :span="24"> <div class="desktop-item-chart">
<div class="desktop-item"> <div class="item-title flex">
<div class="item-title flex"> <span>教学进度</span>
<span>教学进度</span> </div>
<div class="item-content">
<div ref="chartDom" class="chart-box"></div>
</div>
</div> </div>
<div class="item-content"> </el-col>
<div ref="chartDom" class="chart-box"></div> </el-row>
</div> </el-col>
</div> <el-col :span="7" style="flex: 1;">
</el-col> <!--工作动态-->
</el-row> <workTrend/>
</el-col> </el-col>
<el-col :span="7"> </el-row>
<!--工作动态-->
<workTrend/>
</el-col>
</el-row>
</div> </div>
</template> </template>
@ -42,11 +42,12 @@
<script setup> <script setup>
import { ref, onMounted, nextTick } from 'vue' import { ref, onMounted, nextTick } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import * as echarts from 'echarts'
import workTrend from './container/work-trend.vue' import workTrend from './container/work-trend.vue'
import outLink from '@/utils/linkConfig' import outLink from '@/utils/linkConfig'
import * as echarts from 'echarts'
import { useGetSubject } from '@/hooks/useGetSubject' import { useGetSubject } from '@/hooks/useGetSubject'
import { sessionStore } from '@/utils/store' import { sessionStore } from '@/utils/store'
import { debounce } from 'lodash'
const router = useRouter() const router = useRouter()
const { ipcRenderer } = window.electron || {} 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 ()=>{ onMounted(async ()=>{
await useGetSubject() await useGetSubject()
@ -250,7 +255,10 @@ onMounted(async ()=>{
.page-desktop{ .page-desktop{
height: 100%; height: 100%;
padding-top: 20px; padding-top: 20px;
.desktop-left{
display: flex;
flex-direction: column;
}
.desktop-item{ .desktop-item{
margin-bottom: 20px; margin-bottom: 20px;
.item-title{ .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> </style>