基础框架微调

This commit is contained in:
朱浩 2024-07-11 17:32:24 +08:00
parent 65ef2d6026
commit 240f4b24bd
5 changed files with 152 additions and 12 deletions

View File

@ -20,6 +20,7 @@
"dependencies": {
"@electron-toolkit/preload": "^3.0.1",
"@electron-toolkit/utils": "^3.0.0",
"@element-plus/icons-vue": "^2.3.1",
"crypto-js": "^4.2.0",
"electron-dl-manager": "^3.0.0",
"electron-updater": "^6.1.7",

View File

@ -1,18 +1,22 @@
<template>
<section class="app-main">
<transition mode="out-in" name="fade-transform">
<div v-show="$route != null" style="height: 100%">
<router-view v-slot="{ Component, route }">
<keep-alive>
<div style="height: 100%;"><router-view /></div>
<component :is="Component" v-if="route.meta.keepAlive" :key="route.name" />
</keep-alive>
<component :is="Component" v-if="!route.meta.keepAlive" :key="route.name" />
</router-view>
</div>
</transition>
</section>
</template>
<script setup>
</script>
<script setup></script>
<style lang="scss" scoped>
.app-main{
.app-main {
height: 100%;
}
</style>

View File

@ -18,13 +18,13 @@ export const constantRoutes = [
path: '/resource',
component: () => import('@/views/resource/index.vue'),
name: 'resource',
meta: {title: '资源'}
meta: {title: '资源',keepAlive:true}
},
{
path: '/prepare',
component: () => import('@/views/prepare/index.vue'),
name: 'prepare',
meta: {title: '备课'}
meta: {title: '备课',keepAlive:true}
},
{
path: '/teach',

View File

@ -1 +1,136 @@
<template> <div> <FileUpload :multiple="true" :upload-data="uploadData" ></FileUpload> </div> </template> <script> import FileUpload from '@/components/file-upload/index.vue' import { getSmarttalkPage } from '@/api/file' const { ipcRenderer } = window.electron || {} export default { name: 'Prepare', components: { FileUpload }, data() { return { fileUrl: "https://wzyzoss.eos-chongqing-3.cmecloud.cn/2024/7/10/117cdf208c6b4e58bf2b73369eaf3cb5.pptx", filePath: "C:/Users/zhuhao/Desktop/工作文档/0901高一【数学(人教A版)】集合的概念-PPT课件.pptx", uploadData: { textbookId: '123', levelFirstId: '123', levelSecondId: '123', fileSource: '平台', fileFlag: '课件' } } }, created() { ipcRenderer.removeAllListeners('copy-file-default-reply'); ipcRenderer.on('copy-file-default-reply', (e,param)=>{ this.callback(param) }) }, mounted() { // const destination = '0901高一【数学(人教A版)】集合的概念-PPT课件.pptx' setTimeout(()=>{ // ipcRenderer.send('open-path-app',this.filePath) // const source = 'D:\\edufile\\0901高一【数学(人教A版)】集合的概念-PPT课件.pptx' // ipcRenderer.send('copy-file-default',{ source, destination }) // ipcRenderer.send('download-file-default',this.fileUrl) },2000) getSmarttalkPage({nowPage:1,pageSize:2}).then(res=>{ console.log(res) }) }, methods: { callback({error, filePath}) { if (error) { console.error('An error occurred:', error) return } console.log('File copied to:', filePath) } } } </script> <style scoped lang="scss"></style>
<template>
<div class="page-resource flex">
<ChooseTextbook @node-click="nodeClick" />
<div class="page-right">
<div class="prepare-body-header">
<div>
<label style="font-size: 15px">共52个文件</label>&nbsp;
<el-popover placement="top-start" :width="250" trigger="hover">
<template #default>
<div>
<el-button type="success" size="small" :icon="Check" circle /> 2024-07-11 16:15
同步成功
</div>
</template>
<template #reference>
<el-button size="small" text
><el-icon><Refresh /></el-icon></el-button
>
</template>
</el-popover>
</div>
<div><el-button>上传资料</el-button><el-button type="primary"></el-button></div>
</div>
<div class="prepare-body-main">
<div class="prepare-body-main-item">
<div class="prepare-body-main-item-icon"></div>
<div class="prepare-body-main-item-info">
<div class="prepare-item-info-title">平面向量基本定理及坐标表示</div>
<div class="prepare-item-info-message">
<div>
<el-icon
style="background-color: green; border-radius: 20px; color: white; top: 3px"
><Check /></el-icon
>已同步
</div>
<div>1.6MB</div>
<div>2024-07-10</div>
<div>古诗词诵读 > 静女</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- <div>
<FileUpload :multiple="true" :upload-data="uploadData"></FileUpload>
</div>-->
</template>
<script setup>
import { Check } from '@element-plus/icons-vue'
</script>
<script>
import FileUpload from '@/components/file-upload/index.vue'
import ChooseTextbook from '@/components/choose-textbook/index.vue'
import ResoureList from '@/views/resource/container/resoure-list.vue'
import ResoureSearch from '@/views/resource/container/resoure-search.vue'
import { Refresh } from '@element-plus/icons-vue'
// import { getSmarttalkPage } from '@/api/file'
const { ipcRenderer } = window.electron || {}
export default {
name: 'Prepare',
components: { ResoureSearch, ResoureList, ChooseTextbook, FileUpload, Refresh },
data() {
return {
fileUrl:
'https://wzyzoss.eos-chongqing-3.cmecloud.cn/2024/7/10/117cdf208c6b4e58bf2b73369eaf3cb5.pptx',
filePath: 'C:/Users/zhuhao/Desktop/工作文档/0901高一【数学(人教A版)】集合的概念-PPT课件.pptx',
uploadData: {
textbookId: '123',
levelFirstId: '123',
levelSecondId: '123',
fileSource: '平台',
fileFlag: '课件'
}
}
},
created() {
ipcRenderer.removeAllListeners('copy-file-default-reply')
ipcRenderer.on('copy-file-default-reply', (e, param) => {
this.callback(param)
})
},
mounted() {
// const destination = '0901(A)-PPT.pptx'
// ipcRenderer.send('open-path-app',this.filePath)
// const source = 'D:\\edufile\\0901(A)-PPT.pptx'
// ipcRenderer.send('copy-file-default',{ source, destination })
// ipcRenderer.send('download-file-default',this.fileUrl)
// getSmarttalkPage({nowPage:1,pageSize:2}).then(res=>{
// console.log(res)
// })
},
methods: {
callback({ error, filePath }) {
if (error) {
console.error('An error occurred:', error)
return
}
console.log('File copied to:', filePath)
},
nodeClick(data) {
console.log(data)
}
}
}
</script>
<style scoped lang="scss">
.page-resource {
padding-top: 20px;
height: 100%;
.page-right {
flex: 1;
margin-left: 20px;
height: 100%;
background: #ffffff;
border-radius: 10px;
box-shadow: 0px 0px 20px 0px rgba(99, 99, 99, 0.06);
display: flex;
flex-direction: column;
.prepare-body-header {
height: 60px;
width: 100%;
display: flex;
align-items: center;
flex-wrap: wrap;
justify-content: space-between;
padding: 0 20px;
}
.prepare-body-main {
flex: 1;
width: 100%;
}
}
}
</style>