Merge pull request 'lyc-dev' (#177) from lyc-dev into main

This commit is contained in:
lyc 2024-09-09 09:51:28 +08:00
commit 47f3202444
19 changed files with 603 additions and 35 deletions

View File

@ -28,16 +28,17 @@
"@vueuse/core": "^10.11.0", "@vueuse/core": "^10.11.0",
"cropperjs": "^1.6.2", "cropperjs": "^1.6.2",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
"echarts": "^5.5.1",
"electron-dl-manager": "^3.0.0", "electron-dl-manager": "^3.0.0",
"electron-log": "^5.1.7", "electron-log": "^5.1.7",
"electron-store": "8.0.0", "electron-store": "8.0.0",
"electron-updater": "^6.1.7", "electron-updater": "^6.1.7",
"element-plus": "^2.7.6", "element-plus": "^2.7.6",
"fabric": "^5.3.0", "fabric": "^5.3.0",
"im_electron_sdk": "^8.0.5904",
"js-cookie": "^3.0.5", "js-cookie": "^3.0.5",
"jsencrypt": "^3.3.2", "jsencrypt": "^3.3.2",
"jsondiffpatch": "0.6.0", "jsondiffpatch": "0.6.0",
"im_electron_sdk": "^8.0.5904",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"pdfjs-dist": "4.4.168", "pdfjs-dist": "4.4.168",
"pinia": "^2.1.7", "pinia": "^2.1.7",

View File

@ -1,9 +1,9 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 2794390 */ font-family: "iconfont"; /* Project id 2794390 */
src: url('iconfont.woff2?t=1724212790213') format('woff2'), src: url('iconfont.woff2?t=1725691484835') format('woff2'),
url('iconfont.woff?t=1724212790213') format('woff'), url('iconfont.woff?t=1725691484835') format('woff'),
url('iconfont.ttf?t=1724212790213') format('truetype'), url('iconfont.ttf?t=1725691484835') format('truetype'),
url('iconfont.svg?t=1724212790213#iconfont') format('svg'); url('iconfont.svg?t=1725691484835#iconfont') format('svg');
} }
.iconfont { .iconfont {
@ -14,6 +14,34 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-saoyisao:before {
content: "\e691";
}
.icon-jiaoxuezhiliangfenxi:before {
content: "\e690";
}
.icon-jiaoxuejihua:before {
content: "\e7e9";
}
.icon-tongji:before {
content: "\e68f";
}
.icon-pigai:before {
content: "\e68d";
}
.icon-jiaoxuefansi:before {
content: "\e6b2";
}
.icon-kaoshi:before {
content: "\e68a";
}
.icon-yiwen:before { .icon-yiwen:before {
content: "\e687"; content: "\e687";
} }

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,55 @@
"css_prefix_text": "icon-", "css_prefix_text": "icon-",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "12657402",
"name": "资源库",
"font_class": "saoyisao",
"unicode": "e691",
"unicode_decimal": 59025
},
{
"icon_id": "6513175",
"name": "教学质量分析",
"font_class": "jiaoxuezhiliangfenxi",
"unicode": "e690",
"unicode_decimal": 59024
},
{
"icon_id": "38447338",
"name": "教学计划",
"font_class": "jiaoxuejihua",
"unicode": "e7e9",
"unicode_decimal": 59369
},
{
"icon_id": "8455509",
"name": "统计",
"font_class": "tongji",
"unicode": "e68f",
"unicode_decimal": 59023
},
{
"icon_id": "5969226",
"name": "批改",
"font_class": "pigai",
"unicode": "e68d",
"unicode_decimal": 59021
},
{
"icon_id": "36295514",
"name": "教学反思",
"font_class": "jiaoxuefansi",
"unicode": "e6b2",
"unicode_decimal": 59058
},
{
"icon_id": "21088705",
"name": "考试",
"font_class": "kaoshi",
"unicode": "e68a",
"unicode_decimal": 59018
},
{ {
"icon_id": "20574719", "icon_id": "20574719",
"name": "疑问", "name": "疑问",

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 337 KiB

After

Width:  |  Height:  |  Size: 352 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -1,13 +1,13 @@
<template> <template>
<section class="app-main"> <section class="app-main">
<div class="app-main-left no-select"> <!-- <div class="app-main-left no-select">
<div v-for="(item, index) in title" :key="index" :class="item.active?'active':''" class="app-main-left-item" @click="active(index)"> <div v-for="(item, index) in title" :key="index" :class="item.active?'active':''" class="app-main-left-item" @click="active(index)">
<div class="app-main-left-item-icon"> <div class="app-main-left-item-icon">
<i :class="item.img"></i> <i :class="item.img"></i>
</div> </div>
<div class="app-main-left-item-text">{{item.name}}</div> <div class="app-main-left-item-text">{{item.name}}</div>
</div> </div>
</div> </div> -->
<transition mode="out-in" name="fade-transform"> <transition mode="out-in" name="fade-transform">
<div v-show="$route != null" style="height: 100%; flex: 1"> <div v-show="$route != null" style="height: 100%; flex: 1">
<router-view v-slot="{ Component, route }"> <router-view v-slot="{ Component, route }">
@ -120,7 +120,7 @@ const active = (index) => {
}) })
} }
onMounted(()=>{ onMounted(()=>{
active(0) // active(0)
}) })
</script> </script>

View File

@ -1,10 +1,19 @@
<template> <template>
<div class="title-bar flex"> <div class="title-bar flex">
<div class="left-section"> <div class="left-section">
<h3 class="title" @click="changeTab">AIX智慧课堂</h3> <div class="flex title-box">
<el-image style="width: 23px; height: 23px" :src="logoIco" />
<span class="title" @click="changeTab">AIX智慧课堂</span>
</div>
<div class="change-tab"> <div class="change-tab">
<ul class="flex"> <ul class="flex">
<li <li class="flex" :class="[activeId == menu.path ? 'active-li' : '', menu.disabled ? 'disabled' : '']"
v-for="menu in headerMenus" :key="menu.id" @click="clickMenu(menu)">
<i class="iconfont" :class="menu.icon"></i>
<span class="text">{{ menu.name }}</span>
</li>
<!-- <li
v-for="(item, index) in routeHeader.nowRouter" v-for="(item, index) in routeHeader.nowRouter"
:key="index" :key="index"
class="flex" class="flex"
@ -14,7 +23,7 @@
> >
<i :class="item.img"></i> <i :class="item.img"></i>
<span class="text">{{ item.name }}</span> <span class="text">{{ item.name }}</span>
</li> </li> -->
</ul> </ul>
</div> </div>
</div> </div>
@ -58,6 +67,8 @@ import useUserStore from '@/store/modules/user'
import routerStore from '@/store/modules/route' import routerStore from '@/store/modules/route'
import outLink from '@/utils/linkConfig' import outLink from '@/utils/linkConfig'
import logoIco from '@/assets/images/logo.png'
const routeHeader = routerStore() const routeHeader = routerStore()
const { ipcRenderer } = window.electron || {} const { ipcRenderer } = window.electron || {}
const userStore = useUserStore() const userStore = useUserStore()
@ -87,6 +98,41 @@ const handleOutLink = (path, type, name) => {
}) })
} }
} }
const activeId = ref('/home')
const headerMenus = [
{
name: '工作台',
id: 1,
icon: 'icon-gongzuotai',
path: '/home'
},
{
name: '研究室',
id: 2,
icon: 'icon-yanjiushi',
disabled: true
},
{
name: '资源库',
id: 3,
icon: 'icon-saoyisao',
path: '/resource'
},
{
name: '朋友圈',
id: 4,
icon: 'icon-pengyouquan1',
disabled: true
}
]
const clickMenu = ({ id, disabled, path }) =>{
if(disabled) return
activeId.value = id
router.push(path)
}
/*const menus = ref([ /*const menus = ref([
{ {
icon: 'icon-zhuye2 icon-homepage', icon: 'icon-zhuye2 icon-homepage',
@ -114,7 +160,8 @@ const handleOutLink = (path, type, name) => {
watch( watch(
() => router.currentRoute.value, () => router.currentRoute.value,
(newValue) => { (newValue) => {
currentRoute.value = newValue.path currentRoute.value = newValue
activeId.value = newValue.path
}, },
{ immediate: true } { immediate: true }
) )
@ -165,8 +212,6 @@ function setLayout() {
<style lang="scss" scoped> <style lang="scss" scoped>
.title-bar { .title-bar {
height: 80px; height: 80px;
background: #ebf0f9;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
-webkit-app-region: drag; -webkit-app-region: drag;
@ -174,27 +219,38 @@ function setLayout() {
.left-section { .left-section {
display: flex; display: flex;
align-items: center; align-items: flex-start;
flex-direction: column;
width: 50%; width: 50%;
.title-box{
padding-top: 8px;
box-sizing: border-box;
align-items: center;
padding-left: 20px;
.title {
color: #4b73df;
font-size: 13px;
padding: 0 5px;
}
}
.change-tab { .change-tab {
-webkit-app-region: no-drag; -webkit-app-region: no-drag;
margin-left: 20px; margin-left: 20px;
ul { ul {
li { li {
padding: 3px 13px;
cursor: pointer; cursor: pointer;
flex-direction: column; flex-direction: column;
border-radius: 8px; border-radius: 8px;
margin: 0 5px; margin: 0 10px;
.text { .text {
font-size: 13px; font-size: 13px;
font-weight: bold;
} }
.iconfont { .iconfont {
font-size: 22px; font-size: 26px;
} }
.icon-resource { .icon-resource {
@ -214,12 +270,17 @@ function setLayout() {
} }
&:hover { &:hover {
background: #d3e3fb; color: #409eff;
}
}
.disabled{
cursor: not-allowed;
color: #bfbfbf;
&:hover{
color: #bfbfbf;
} }
} }
.active-li { .active-li {
background: #d3e3fb;
color: #409eff; color: #409eff;
} }
} }
@ -229,11 +290,7 @@ function setLayout() {
-webkit-app-region: no-drag; -webkit-app-region: no-drag;
} }
.title {
color: #4b73df;
font-size: 18px;
padding: 0 20px;
}
} }
.right-section { .right-section {

View File

@ -4,20 +4,45 @@
<Header /> <Header />
</el-header> </el-header>
<el-main> <el-main>
<AppMain /> <template v-if="currentRoute.path != '/home'">
<el-page-header @back="goBack">
<template #content>
<span class="text-large mr-3"> {{ currentRoute.meta.title }} </span>
</template>
</el-page-header>
</template>
<AppMain :style="{ height: currentRoute.path == '/home' ? '100%' : 'calc(100% - 45px)'}" />
</el-main> </el-main>
<Uploader v-if="uploaderStore.uploadList && uploaderStore.uploadList.length > 0" /> <Uploader v-if="uploaderStore.uploadList && uploaderStore.uploadList.length > 0" />
</el-container> </el-container>
</template> </template>
<script setup> <script setup>
import { watch } from 'vue'
import { useRouter } from 'vue-router'
import Header from './components/Header.vue' import Header from './components/Header.vue'
import AppMain from './components/AppMain.vue' import AppMain from './components/AppMain.vue'
import Uploader from './components/Uploader.vue' import Uploader from './components/Uploader.vue'
import uploaderState from '@/store/modules/uploader' import uploaderState from '@/store/modules/uploader'
import { ref } from 'vue' import { ref } from 'vue'
const router = useRouter()
const currentRoute = ref('')
watch(
() => router.currentRoute.value,
(newValue) => {
currentRoute.value = newValue
},
{ immediate: true }
)
let uploaderStore = ref(uploaderState()) let uploaderStore = ref(uploaderState())
const goBack = () =>{
router.back()
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -32,6 +57,15 @@ let uploaderStore = ref(uploaderState())
height: 80px; height: 80px;
} }
.el-main { .el-main {
--el-main-padding: 0 20px 0 0; --el-main-padding: 0 20px 20px 20px;
box-sizing: border-box;
}
.el-page-header{
margin-top: 20px;
display: flex;
align-items: center;
.text-large{
font-size: 16px;
}
} }
</style> </style>

View File

@ -13,8 +13,14 @@ export const constantRoutes = [
{ {
path: '/', path: '/',
component: Layout, component: Layout,
redirect: '/homepage', redirect: '/home',
children: [ children: [
{
path: '/home',
component: () => import('@/views/desktop/index.vue'),
name: 'desktop',
meta: {title: '主页'}
},
{ {
path: '/homepage', path: '/homepage',
component: () => import('@/views/homePage/index.vue'), component: () => import('@/views/homePage/index.vue'),

View File

@ -2,7 +2,7 @@
* 工具类-窗口-状态管理 * 工具类-窗口-状态管理
*/ */
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { sessionStore } from '@/utils/tool' import { sessionStore } from '@/utils/store'
// 默认数据 // 默认数据
const defData = sessionStore.store || {} const defData = sessionStore.store || {}

View File

@ -0,0 +1,92 @@
<template>
<div class="desktop-item">
<div class="item-title flex">
<span>工作动态</span>
<el-radio-group v-model="type">
<el-radio-button label="全部" :value="-1" />
<el-radio-button label="备课" :value="1" />
<el-radio-button label="上课" :value="2" />
<el-radio-button label="作业" :value="3" />
</el-radio-group>
</div>
<div class="item-content">
<ul>
<li class="flex class-item" v-for="item in classList" :key="item.id">
<div class="class-left flex">
<div class="class-name flex">
<span>{{ item.className }}</span>
</div>
<div class="class-time"> {{ item.classDay }}&nbsp;{{ item.startTime }} ~ {{ item.classDay }}&nbsp;{{ item.endTime }}</div>
<div class="class-grade">
<span v-for="(tag, index) in item.classItemList" :key="index" style="margin-left: 5px">
{{ index === 0 ? tag.name : '、' + tag.name }}
</span>
</div>
</div>
<div class="class-right">
<el-button type="primary" size="small">上课</el-button>
</div>
</li>
</ul>
</div>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { getSelfReserv } from '@/api/classManage'
const type = ref(-1)
const classList = 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 !== '已结束')
})
}
onMounted(()=>{
getClass()
})
</script>
<style lang="scss" scoped>
.desktop-item{
margin-bottom: 20px;
align-items: center;
.item-title{
height: 32px;
text-align: left;
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
align-items: center;
justify-content: space-between;
}
.item-content{
background-color: #fff;
border-radius: 5px;
padding: 10px 15px;
font-size: 13px;
.class-item{
justify-content: space-between;
align-items: center;
background: #e2e4f4;
border-radius: 5px;
margin-bottom: 10px;
padding: 10px;
.class-left{
flex-direction: column;
align-items: flex-start;
.class-time{
font-size: 13px;
color: #bfbfbf;
}
}
}
}
}
</style>

View File

@ -0,0 +1,287 @@
<template>
<div class="page-desktop">
<el-row :gutter="20">
<el-col :span="17">
<el-row :gutter="20">
<el-col :span="12" v-for="item in menuList">
<div class="desktop-item">
<div class="item-title">{{ item.name }}</div>
<div class="item-content">
<ul class="flex con-ul">
<li v-for="menu in item.list" @click="clickMenu(menu)" class="flex item-menu" :class="menu.disabled ? 'menu-disabled' : ''">
<i class="iconfont" :class="menu.icon"></i>
<span>{{ menu.name }}</span>
</li>
</ul>
</div>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="desktop-item">
<div class="item-title flex">
<span>教学进度</span>
</div>
<div class="item-content">
<div ref="chartDom" class="chart-box"></div>
</div>
</div>
</el-col>
</el-row>
</el-col>
<el-col :span="7">
<!--工作动态-->
<workTrend/>
</el-col>
</el-row>
</div>
</template>
<script setup>
import { ref, onMounted, nextTick } from 'vue'
import { useRouter } from 'vue-router'
import workTrend from './container/work-trend.vue'
import outLink from '@/utils/linkConfig'
import * as echarts from 'echarts'
const router = useRouter()
const { ipcRenderer } = window.electron || {}
const type = ref(-1)
const chartDom = ref(null);
let chartInstance = null
const menuList = [{
name: '教学分析',
list: [
{
name: '课标分析',
icon: 'icon-kecheng',
isOuter: true,
path: '/teaching/chatwithstandard'
},
{
name: '教材分析',
icon: 'icon-jiaocaixuanze',
isOuter: true,
path: '/teaching/chatwithtextbook'
},
{
name: '考试分析',
icon: 'icon-kaoshi',
isOuter: true,
path: '/education/colentrance'
},
{
name: '学情分析',
icon: 'icon-xueqingfenxi',
disabled: true
},
{
name: '资源分析',
icon: 'icon-ziyuanfenxi',
disabled: true
}
]
},
{
name: '课程教学',
list: [
{
name: '教学设计',
icon: 'icon-jiaoxuesheji',
path: '/prepare'
},
{
name: '教学实施',
icon: 'icon-jiaoxuefenxi',
path: '/classReserv'
},
{
name: '教学反思',
icon: 'icon-jiaoxuefansi',
disabled: true
},
]
},
{
name: '作业管理',
list: [
{
name: '作业设计',
icon: 'icon-jiaoxuefansi',
disabled: true
},
{
name: '作业布置',
icon: 'icon-xiezuo1',
disabled: true
},
{
name: '作业批改',
icon: 'icon-pigai'
},
{
name: '作业统计',
icon: 'icon-tongji',
disabled: true
},
]
},
{
name: '教学管控',
list: [
{
name: '教学计划',
icon: 'icon-jiaoxuejihua',
disabled: true
},
{
name: '教学组织',
icon: 'icon-organization-framework-line',
disabled: true
},
{
name: '教学质量',
icon: 'icon-jiaoxuezhiliangfenxi',
disabled: true
},
{
name: '教学反馈',
icon: 'icon-fankui',
disabled: true
},
]
}
]
const clickMenu = ({isOuter, path, disabled}) =>{
if(disabled) return
//
if(isOuter){
let configObj = outLink().getBaseData()
let fullPath = configObj.fullPath + path
fullPath = fullPath.replaceAll('//', '/')
//
ipcRenderer.send('openWindow', {
key: path,
fullPath: fullPath,
cookieData: { ...configObj.data }
})
} else{
router.push(path)
}
}
onMounted(async ()=>{
// DOM
await nextTick()
chartInstance = echarts.init(chartDom.value)
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {},
grid: {
left: '3%',
right: '2%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'value',
// boundaryGap: [0, 0.01]
},
yAxis: {
type: 'category',
data: ['周一', '周二', '周三', '周四', '周五','周六','周日']
},
series: [
{
name: '一班',
type: 'bar',
data: [18, 24, 10, 13, 23, 15, 12]
},
{
name: '二班',
type: 'bar',
data: [25, 21, 14, 13, 20, 17,13]
},
{
name: '三班',
type: 'bar',
data: [15, 16, 16, 18, 20, 16, 10]
}
]
}
chartInstance.setOption(option);
})
</script>
<style lang="scss" scoped>
.page-desktop{
height: 100%;
padding-top: 20px;
.desktop-item{
margin-bottom: 20px;
.item-title{
height: 32px;
text-align: left;
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
align-items: center;
justify-content: space-between;
}
.item-content{
background-color: #fff;
border-radius: 5px;
padding: 10px 0;
.con-ul{
justify-content: space-around;
.item-menu{
cursor: pointer;
flex-direction: column;
font-size: 14px;
.iconfont{
font-size: 28px;
color: #707070;
}
&:hover{
color: #409EFF;
.iconfont{
color: #409EFF;
}
}
}
.menu-disabled{
cursor: not-allowed;
color: #bfbfbf;
.iconfont{
color: #bfbfbf;
}
&:hover{
color: #bfbfbf;
.iconfont{
color: #bfbfbf;
}
}
}
}
.chart-box{
height: 220px;
}
}
}
}
</style>

View File

@ -1,5 +1,5 @@
<template> <template>
<el-card style="overflow: auto; height: 100%"> <el-card style="overflow: auto; height: 100%;">
<div class="common-layout" style="overflow-y: auto"> <div class="common-layout" style="overflow-y: auto">
<el-container> <el-container>
<el-main style="--el-main-padding: 0"> <el-main style="--el-main-padding: 0">

View File

@ -544,7 +544,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.page-resource { .page-resource {
user-select: none; user-select: none;
padding-top: 20px; padding-top: 10px;
height: 100%; height: 100%;
.page-right { .page-right {

View File

@ -112,7 +112,7 @@ watch(() => sourceStore.query.fileSource,() => {
<style lang="scss" scoped> <style lang="scss" scoped>
.page-resource { .page-resource {
padding-top: 20px; padding-top: 10px;
height: 100%; height: 100%;
.page-right { .page-right {