Browse Source

更新readme

littlegreen 1 year ago
parent
commit
243aac018b

+ 17 - 0
README.md

@@ -0,0 +1,17 @@
+#实训
+## 实训流程
+- sheet1:实训流程表,包括整个实训过程的流程
+- sheet2:角色介绍表,小组分组后进行角色分配
+- sheet3:交付内容表,实训过程中要交付的东西,包括交付的文件内容、名称、要求等
+## 实训模板
+- 第一组:一个参考的文件结构模板
+- 会议记录模板
+- 周报模板
+- 操作手册模板
+- 需求规格说明书模板
+- 组员信息表模板
+- 贡献评价表模板
+## 实训内容
+- vue
+- axios
+- 前后端分离项目

+ 0 - 132
实训内容/实训-Vue.md

@@ -1,132 +0,0 @@
-## Vue2版
-
-Vue2官网:https://v2.cn.vuejs.org/v2/guide/
-
-### 1. 创建vue项目
-
-#### 全局安装
-
-```powershell
-npm install -g @vue/cli
-```
-
-#### 安装后查看是否安装成功
-
-```
-vue -V
-```
-
-![image-20240402143500429](D:\work\公司\实训\实训计划\实训-Vue\image-20240402143500429.png)
-
-#### 创建Vue项目
-
-```powershell
-vue create project-name
-```
-
-![image-20240402143807384](D:\work\公司\实训\实训计划\实训-Vue\image-20240402143807384.png)
-
-![image-20240402144106303](D:\work\公司\实训\实训计划\实训-Vue\image-20240402144106303.png)
-
-![image-20240402144156264](D:\work\公司\实训\实训计划\实训-Vue\image-20240402144156264.png)
-
-#### 创建完成
-
-![image-20240402144406688](D:\work\公司\实训\实训计划\实训-Vue\image-20240402144406688.png)
-
-### 2. 运行
-
-```powershell
-cd project-name
-npm run serve
-```
-
-![image-20240402144507047](D:\work\公司\实训\实训计划\实训-Vue\image-20240402144507047.png)
-
-![image-20240402144535517](D:\work\公司\实训\实训计划\实训-Vue\image-20240402144535517.png)
-
-### 3. element-ui
-
-官网:https://element.eleme.cn/#/zh-CN/component/installation
-
-#### 安装
-
-```powershell
-npm i element-ui -S
-```
-
-#### 引入:全局引入
-
-```js
-//main.js
-import ElementUI from "element-ui";
-import "element-ui/lib/theme-chalk/index.css";
-Vue.use(ElementUI);
-```
-
-#### 引入:按需引入方式1
-
-```js
-//main.js
-import "@/plugins/element";
-//@/plugins/element.js
-import Vue from "vue";
-import { Button, Loading,MessageBox } from "element-ui";
-Vue.use(Button);
-Vue.prototype.$loading = Loading.service;
-Vue.prototype.$msgbox = MessageBox;
-```
-
-#### 引入:按需引入方式2
-
-```js
-//babel.config.js
-module.exports = {
-  presets: [
-    "@vue/cli-plugin-babel/preset",
-    ["@babel/preset-env", { modules: false }],
-  ],
-  plugins: [
-    [
-      "component",
-      {
-        libraryName: "element-ui",
-        styleLibraryName: "theme-chalk",
-      },
-    ],
-  ],
-};
-```
-```js
-//./components/element/index.js
-import { Button, Input, Radio, Table, Form } from "element-ui";
-const coms = [Button, Input, Radio, Table, Form];
-export default {
-  install(Vue, options) {
-    coms.map((c) => {
-      Vue.component(c.name, c);
-    });
-  },
-};
-```
-```js
-//main.js
-import element from "./components/element";
-Vue.use(element);
-```
-
-#### 使用
-
-```html
-//vue文件中
-<template>
-  <div id="app">
-    <el-button>默认按钮</el-button>
-    <el-button type="primary">主要按钮</el-button>
-  </div>
-</template>
-```
-
-![image-20240402145534211](D:\work\公司\实训\实训计划\实训-Vue\image-20240402145534211.png)
-
-

BIN
实训内容/实训-Vue/image-20240402143500429.png


BIN
实训内容/实训-Vue/image-20240402143807384.png


BIN
实训内容/实训-Vue/image-20240402144106303.png


BIN
实训内容/实训-Vue/image-20240402144156264.png


BIN
实训内容/实训-Vue/image-20240402144406688.png


BIN
实训内容/实训-Vue/image-20240402144507047.png


BIN
实训内容/实训-Vue/image-20240402144535517.png


BIN
实训内容/实训-Vue/image-20240402145534211.png


+ 0 - 168
实训内容/实训-axios.md

@@ -1,168 +0,0 @@
-### 请求后端
-
-#### axios
-
-文档:https://www.axios-http.cn/docs/intro
-
-#### 安装
-
-```powershell
-npm install axios
-```
-
-#### 请求
-
-```js
-import axios from "axios";
-axios.post('/user', {
-	firstName: 'Fred',
-	lastName: 'Flintstone'
-})
-.then(function (response) {
-	console.log(response);
-})
-.catch(function (error) {
-	console.log(error);
-});
-```
-
-#### 封装请求
-
-**utils/request.js**
-
-```js
-import axios from "axios";
-import { MessageBox, Message } from "element-ui";
-const request = axios.create({
-  baseURL: "/api", //请求的url
-  timeout: 10000, // 请求超时
-  withCredentials: false, //跨域请求是否需要携带 cookie
-});
-function getToken() {
-  //获取token, token可以放在store, 也可以放在sessionStorage或localStorage
-  const token = sessionStorage.getItem("token") || "";
-  return token;
-}
-
-request.interceptors.request.use(
-  function (config) {
-    // 在发送请求之前做些什么
-    // 请求接口统一添加token
-    config.headers["Authorization"] = "Bearer " + getToken();
-    return config;
-  },
-  function (error) {
-    // 对请求错误做些什么
-    return Promise.reject(error);
-  }
-);
-
-// 添加响应拦截器
-request.interceptors.response.use(
-  function (response) {
-    // 2xx 范围内的状态码都会触发该函数。
-    // 对响应数据做点什么
-    // 后端返回格式 定义:
-    // {
-    //   data,
-    //   message,
-    //   code
-    // }
-    const code = response.data.code;
-    const msg = response.data.message;
-    // 当状态码不等于200时,请求数据有问题
-    if (code === 401) {
-      // 比如设置401:登录过期
-      MessageBox.confirm(
-        "登录状态过期,您可以继续留在该界面,或重新登录",
-        "系统提示",
-        {
-          confirmButtonText: "重新登录",
-          cancelButtonText: "取消",
-          type: "warning",
-        }
-      ).then(() => {
-        //跳转至登录页面
-      });
-    } else if (code === 500) {
-      Message({ message: msg, type: "error" });
-      return Promise.reject(new Error(msg));
-    } else {
-      // 当状态码等于200时,说明成功
-      return response.data.data;
-    }
-  },
-  function (error) {
-    // 超出 2xx 范围的状态码都会触发该函数。
-    // 对响应错误做点什么
-    Message({ message: error, type: "error", duration: 5 * 1000 });
-    return Promise.reject(error);
-  }
-);
-
-export default request;
-```
-**api/user.js**
-
-```js
-import request from "@/utils/request";
-export function getUserInfo() {
-  return request({
-    url: "/getInfo",
-    method: "get",
-    params: {
-       id: "1111"
-    }
-  });
-}
-export function changePwd() {
-  return request({
-    url: "/changePwd",
-    method: "post",
-    data: {
-       id: "1111"
-    }
-  });
-}
-```
-**Vue页面**
-
-```js
-import { getUserInfo } from "@/api/user";
-export default {
-  data() {
-    return {
-      name: 11,
-    };
-  },
-  mounted() {
-    getUserInfo().then((res) => {
-      console.log(res);
-    });
-  },
-};
-```
-
-#### 跨域问题
-**vue.config.js**
-
-```js
-const { defineConfig } = require("@vue/cli-service");
-module.exports = defineConfig({
-  transpileDependencies: true,
-  devServer: {
-    port: 9091,
-    open: true,
-    proxy: {
-      "/api": {
-        target: `http://localhost:9090`,//实际请求的后端地址
-        changeOrigin: true,
-        pathRewrite: {
-          "/api": "",
-        },
-      },
-    },
-  },
-});
-```
-

BIN
实训内容/实训-前后端分离项目.pdf


+ 0 - 0
实训模板/第一组需求规格说明书模板.docx → 实训模板/需求规格说明书模板.docx