PPT全方位辅助系统——项目记录4

本周我们继续学习前端的相关内容,并根据之前小组讨论后设计的项目前端页面进行前端页面和功能的进一步实现和完善。

接上周进度,我们本周主要进行了PPT生成功能对应页面的进一步实现和补充完善。主要包括:1)实现项目系统主界面的页面和PPT评价功能的页面;3)用页面跳转功能将所有的页面连接起来形成一个相对完整前端界面。

页面展示

核心代码:

<template>  
    <div class="web-page">  
      <div class="header" style="font-size: 40px;">  
        <h1>PPT评价</h1>  
      </div>  
      <div class="back">
        <router-link to="/" class="button">返回</router-link>
        <router-view></router-view>
      </div>


      <div class="import" style="font-size: 20px;">  
        <h1>导入PPT</h1>  
      </div> 

      <div>  
         <input type="file"  @change="handleFileUpload" />  
      </div>
      
        <button  @click="submitFile">提交</button>   
      
      
    </div>  
  </template>  
    
  <script>  
  
  window.location.href = '/Home.vue';
    
  export default {  
    data() {  
      return {  
        generateMethod: 'auto',  
        pptTopic: '',  
        showUpload: false, // 控制上传组件的显示与隐藏  
        selectedFile: null, // 存储选中的文件  
      };  
    },  
     methods: {  
    generatePPT() {  
      // 处理PPT生成逻辑  
      console.log('生成PPT', this.generateMethod, this.pptTopic);  

    },  
    handleFileUpload(event) {  
      this.selectedFile = event.target.files[0];  
    },  
    submitFile() {  
      if (!this.selectedFile) {  
        alert('请先选择一个文件');  
        return;  
      }  
      // 使用axios或其他HTTP库发送文件到后端  
      const formData = new FormData();  
      formData.append('file', this.selectedFile);  
      // 发送POST请求到后端API  
      axios.post('/api/upload', formData)  
        .then(response => {  
          // 处理上传成功后的逻辑  
          this.showUpload = false; // 上传成功后隐藏上传组件  
          alert('文件上传成功');  
          // ...  
        })  
        .catch(error => {  
          // 处理上传失败后的逻辑  
          alert('文件上传失败');  
          // ...  
        });  
    }, 
    
  },  



    

};  
  

  </script>  
    
  <style scoped>  
  .web-page {  
    display: flex;  
    flex-direction: column;  
    align-items: stretch;  
    justify-content: flex-start;  
    font-family: Arial, sans-serif;  
    margin: 0 auto;  
    padding: 20px;  
    max-width: 600px;  
  }  
    
  .header {  
    display: flex;  
    justify-content: center;  
    margin-bottom: 20px;
    position: absolute; /* 使用绝对定位 */  
    top: 50px; /* 距离顶部的位置 */  
    left: 100px; /* 距离左侧的位置 */  
  
  }  
    
  .header h1 {  
    margin: 0;  
  }

  .import {  
    display: flex;  
    justify-content: center;  
    margin-bottom: 20px;
    position: absolute; /* 使用绝对定位 */  
    top: 300px; /* 距离顶部的位置 */  
    left: 200px; /* 距离左侧的位置 */  
  
  }  
  
  .back{
    display: flex;  
    flex-direction: column; 
    position: absolute; /* 使用绝对定位 */  
    top: 50px; /* 距离顶部的位置 */  
    left: 50px; /* 距离左侧的位置 */  
  }

  

  /* 按钮样式 */
.btn-go {
  background-color: #42b983; /* 背景色 */
  color: white; /* 文字颜色 */
  padding: 10px 20px; /* 内边距 */
  border: none; /* 无边框 */
  border-radius: 5px; /* 圆角边框 */
  cursor: pointer; /* 鼠标样式为指针 */
  font-size: 16px; /* 字体大小 */
  transition: background-color 0.3s ease; /* 鼠标悬停过渡效果 */
}

.btn-go:hover {
  background-color: #369b6e; /* 鼠标悬停时的背景色 */
}

  button {  
    margin-top: 15px;  
    padding: 10px 20px;  
    border: none;  
    border-radius: 4px;  
    position: absolute; /* 使用绝对定位 */  
    top: 610px; /* 距离顶部的位置 */  
    left: 600px; /* 距离左侧的位置 */  
    background-color: #4CAF50;  
    color: white;  
    cursor: pointer;  
  }  
    
  button:hover {  
    background-color: #45a049;  
  }  
  </style>

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值