├── .env.development ├── .env.production ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.js ├── jsconfig.json ├── package-lock.json ├── package.json ├── public ├── favicon.ico └── index.html ├── src ├── App.vue ├── assets │ ├── login-bg.jpg │ └── logo.png ├── components │ ├── CommonMenu.vue │ ├── RegisterDialog.vue │ └── SelectDialog.vue ├── main.js ├── router │ └── index.js ├── store │ └── index.js ├── utils │ └── request.js └── views │ ├── HomeView.vue │ ├── LoginView.vue │ ├── RecommendView.vue │ ├── SchoolDetailView.vue │ ├── SchoolView.vue │ ├── SpecialDetailView.vue │ └── SpecialView.vue └── vue.config.js /.env.development: -------------------------------------------------------------------------------- 1 | // development 开发环境 2 | NODE_ENV='development' 3 | // 下面的为接口地址。此处/api是我经过webpack设置跨域代理之后的地址 4 | VUE_APP_BASE_URL='/api' -------------------------------------------------------------------------------- /.env.production: -------------------------------------------------------------------------------- 1 | // production 生产环境 2 | NODE_ENV = 'production' 3 | // 下方链接为生产环境接口地址 4 | VUE_APP_BASE_URL='/api' -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Cabbage-xy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 高考志愿推荐系统,前端部分 2 | 3 | 高考志愿推荐系统,数据来自掌上高考 4 | 5 | ### 页面展示 6 | - 学校详情页 7 | 8 | ![image](https://user-images.githubusercontent.com/75256787/179710242-777361ee-b7a4-44a3-a961-858299dd8f10.png) 9 | 10 | - 学校查询页 11 | 12 | ![image](https://user-images.githubusercontent.com/75256787/179709872-0746f602-bb5a-4695-8611-6b6ce90c9ee5.png) 13 | 14 | - 志愿推荐页 15 | 16 | ![image](https://user-images.githubusercontent.com/75256787/179710098-3ddc14c0-201f-4370-90df-b2aed5161892.png) 17 | 18 | 19 | ## Project setup 20 | ``` 21 | npm install 22 | ``` 23 | 24 | ### 开发环境编译热加载 25 | ``` 26 | npm run serve 27 | ``` 28 | 29 | ### 打包 30 | ``` 31 | npm run build 32 | ``` 33 | 34 | ### Lints and fixes files 35 | ``` 36 | npm run lint 37 | ``` 38 | 39 | ### Customize configuration 40 | See [Configuration Reference](https://cli.vuejs.org/config/). 41 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "esnext", 5 | "baseUrl": "./", 6 | "moduleResolution": "node", 7 | "paths": { 8 | "@/*": [ 9 | "src/*" 10 | ] 11 | }, 12 | "lib": [ 13 | "esnext", 14 | "dom", 15 | "dom.iterable", 16 | "scripthost" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gaokao", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "@element-plus/icons-vue": "^2.0.6", 12 | "axios": "^0.27.2", 13 | "core-js": "^3.8.3", 14 | "echarts": "^5.3.3", 15 | "element-plus": "^2.2.9", 16 | "g": "^2.0.1", 17 | "serve": "^14.0.1", 18 | "vue": "^3.2.13", 19 | "vue-router": "^4.1.1", 20 | "vuex": "^4.0.2" 21 | }, 22 | "devDependencies": { 23 | "@babel/core": "^7.12.16", 24 | "@babel/eslint-parser": "^7.12.16", 25 | "@vue/cli-plugin-babel": "~5.0.0", 26 | "@vue/cli-plugin-eslint": "~5.0.0", 27 | "@vue/cli-service": "~5.0.0", 28 | "eslint": "^7.32.0", 29 | "eslint-plugin-vue": "^8.0.3" 30 | }, 31 | "eslintConfig": { 32 | "root": true, 33 | "env": { 34 | "node": true 35 | }, 36 | "extends": [ 37 | "plugin:vue/vue3-essential", 38 | "eslint:recommended" 39 | ], 40 | "parserOptions": { 41 | "parser": "@babel/eslint-parser" 42 | }, 43 | "rules": {} 44 | }, 45 | "browserslist": [ 46 | "> 1%", 47 | "last 2 versions", 48 | "not dead", 49 | "not ie 11" 50 | ] 51 | } 52 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cabbage-xy/gaokao/ff2b113b2bba2572694865b533eb81dd0ae70265/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 14 | 15 | 27 | -------------------------------------------------------------------------------- /src/assets/login-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cabbage-xy/gaokao/ff2b113b2bba2572694865b533eb81dd0ae70265/src/assets/login-bg.jpg -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cabbage-xy/gaokao/ff2b113b2bba2572694865b533eb81dd0ae70265/src/assets/logo.png -------------------------------------------------------------------------------- /src/components/CommonMenu.vue: -------------------------------------------------------------------------------- 1 | 40 | 89 | 90 | -------------------------------------------------------------------------------- /src/components/RegisterDialog.vue: -------------------------------------------------------------------------------- 1 | 47 | 48 | -------------------------------------------------------------------------------- /src/components/SelectDialog.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import {createApp} from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import store from './store' 5 | import ElementPlus from 'element-plus' 6 | import 'element-plus/dist/index.css' 7 | import * as ElementPlusIconsVue from '@element-plus/icons-vue' 8 | const app = createApp(App) 9 | for (const [key, component] of Object.entries(ElementPlusIconsVue)) { 10 | app.component(key, component) 11 | } 12 | app 13 | .use(store) 14 | .use(router) 15 | .use(ElementPlus) 16 | .mount('#app') -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import { 2 | createRouter, 3 | createWebHashHistory 4 | } from 'vue-router' 5 | 6 | // import store from '../store/index.js' 7 | 8 | const routes = [{ 9 | path: '/', 10 | redirect: '/login' 11 | }, 12 | { 13 | path: '/login', 14 | name: 'login', 15 | component: () => import('../views/LoginView.vue'), 16 | meta: { 17 | title: '登录|高考推荐数据库' 18 | } 19 | }, 20 | { 21 | path: '/home', 22 | component: () => import('../views/HomeView.vue'), 23 | children: [{ 24 | path: '', 25 | redirect: '/home/school' 26 | }, 27 | { 28 | path: 'school', 29 | name: 'school', 30 | component: () => import('../views/SchoolView.vue'), 31 | meta: { 32 | need2Login: 1, 33 | title: '学校查询|高考推荐数据库' 34 | } 35 | }, 36 | { 37 | path: 'special', 38 | name: 'special', 39 | component: () => import('../views/SpecialView.vue'), 40 | meta: { 41 | need2Login: 1, 42 | title: '专业查询|高考推荐数据库' 43 | } 44 | }, 45 | { 46 | path: 'recommend', 47 | name: 'recommend', 48 | component: () => import('../views/RecommendView.vue'), 49 | meta: { 50 | need2Login: 1, 51 | title: '报考推荐|高考推荐数据库' 52 | } 53 | }, 54 | ] 55 | }, 56 | { 57 | path: '/detail', 58 | name: 'detail', 59 | component: () => import('../views/SchoolDetailView.vue'), 60 | meta: { 61 | title: '学校详情|高考推荐数据库' 62 | } 63 | }, 64 | ] 65 | 66 | const router = createRouter({ 67 | history: createWebHashHistory(), 68 | //mode: 'history', 69 | routes 70 | }) 71 | 72 | 73 | router.beforeEach((to, from, next) => { //全局钩子函数 74 | to.meta.title && (document.title = to.meta.title); 75 | if (to.path === '/login') { 76 | next(); 77 | } else { 78 | if(localStorage.getItem('ms_username') === null){ 79 | alert("请登录!") 80 | next('/login'); 81 | }else{ 82 | // next('/login'); 83 | next(); 84 | } 85 | } 86 | }); 87 | 88 | export default router -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import { 2 | createStore 3 | } from 'vuex' 4 | 5 | export default createStore({ 6 | state: { 7 | showRegisterDialog: false, 8 | showSelectDialog: false, 9 | isLogin: '', 10 | }, 11 | getters: {}, 12 | mutations: { 13 | showRegisterDialog(state) { 14 | state.showRegisterDialog = true; 15 | }, 16 | closeRegisterDialog(state) { 17 | state.showRegisterDialog = false; 18 | }, 19 | showSelectDialog(state) { 20 | state.showSelectDialog = true; 21 | }, 22 | closeSelectDialog(state) { 23 | state.showSelectDialog = false; 24 | } 25 | }, 26 | actions: {}, 27 | modules: {} 28 | }) -------------------------------------------------------------------------------- /src/utils/request.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | 3 | const service = axios.create({ 4 | // process.env.NODE_ENV === 'development' 来判断是否开发环境 5 | // easy-mock服务挂了,暂时不使用了 6 | // baseURL: 'https://www.easy-mock.com/mock/592501a391470c0ac1fab128', 7 | // baseURL: '/api', 8 | baseURL: process.env.VUE_APP_BASE_URL, 9 | // baseURL: process.env.VUE_APP_URL, 10 | timeout: 5000 11 | }); 12 | 13 | //request 拦截器 14 | //自请求发送前进行处理 15 | service.interceptors.request.use( 16 | config => { 17 | config.headers['Content-Type'] = 'application/json;charset=utf-8'; 18 | return config; 19 | }, 20 | error => { 21 | console.log(error); 22 | return Promise.reject(); 23 | } 24 | ); 25 | 26 | //response 拦截器 27 | //在接口响应后统一处理 28 | service.interceptors.response.use( 29 | response => { 30 | let res = response.data; 31 | if (response.status === 200) { 32 | //如果返回的是文件 33 | if(response.config.responseType === 'blob') { 34 | return res; 35 | } 36 | //兼容返回的字符串数据 37 | if(typeof res === 'string') { 38 | res = res?JSON.parse(res) : res; 39 | } 40 | return res; 41 | } else { 42 | Promise.reject(); 43 | } 44 | }, 45 | error => { 46 | console.log(error); 47 | return Promise.reject(); 48 | } 49 | ); 50 | 51 | export default service; 52 | -------------------------------------------------------------------------------- /src/views/HomeView.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 35 | 36 | -------------------------------------------------------------------------------- /src/views/LoginView.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | 121 | 122 | -------------------------------------------------------------------------------- /src/views/RecommendView.vue: -------------------------------------------------------------------------------- 1 | 81 | 82 | 263 | 264 | 393 | -------------------------------------------------------------------------------- /src/views/SchoolDetailView.vue: -------------------------------------------------------------------------------- 1 | 90 | 862 | 863 | 1044 | -------------------------------------------------------------------------------- /src/views/SchoolView.vue: -------------------------------------------------------------------------------- 1 | 64 | 65 | 162 | 163 | 246 | -------------------------------------------------------------------------------- /src/views/SpecialDetailView.vue: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cabbage-xy/gaokao/ff2b113b2bba2572694865b533eb81dd0ae70265/src/views/SpecialDetailView.vue -------------------------------------------------------------------------------- /src/views/SpecialView.vue: -------------------------------------------------------------------------------- 1 | 46 | 47 | 272 | 273 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('@vue/cli-service') 2 | module.exports = defineConfig({ 3 | transpileDependencies: true, 4 | publicPath: './', 5 | outputDir: 'dist', // 输出文件目录 6 | assetsDir: 'static', 7 | devServer: { 8 | // port: 8080, // 设置端口号 9 | host: '127.0.0.1', // ip 本地 10 | historyApiFallback: true, 11 | allowedHosts: 'all', //是否关闭用于 DNS 重绑定的 HTTP 请求的 HOST 检查 12 | https: false, // https:{type:Boolean}配置前缀 13 | open: false, //配置自动启动浏览器 14 | proxy: { //目的是解决跨域,若测试环境不需要跨域,则不需要进行该配置 15 | '/api': { // 拦截以 /api 开头的url接口 16 | // target: 'http://gkzytbsxdez5050.vaiwan.com', //目标接口域名 17 | // target: 'http://127.0.0.1:4523/m1/1261128-0-default', 18 | // target: 'http://127.0.0.1:5000', 19 | target: 'http://47.103.139.192:5000', 20 | changeOrigin: true, //是否跨域 21 | ws: true, //如果要代理 websockets,配置这个参数 22 | secure: false, // 如果是https接口,需要配置这个参数 23 | // 标识替换 24 | // 原请求地址为 /api/getData 将'/api'替换''时, 25 | // 代理后的请求地址为: http://xxx.xxx.xxx/getData 26 | // 若替换为'/other',则代理后的请求地址为 http://xxx.xxx.xxx/other/getData 27 | pathRewrite: { // 标识替换 28 | '^/api': '/' //重写接口 后台接口指向不统一 所以指向所有/ 29 | // '^/api': '/api/mock' 30 | } 31 | } 32 | } 33 | }, 34 | chainWebpack: config => { 35 | // 移除 preload(预载) 插件 36 | config.plugins.delete('preload') 37 | // 移除 prefetch(预取) 插件 38 | config.plugins.delete('prefetch') 39 | } 40 | }) 41 | --------------------------------------------------------------------------------