cbdb-project / cbdb-online-query-app

http://47.111.230.182:8001/
13 stars 1 forks source link
cbdb frontend vue

🧑‍🎓 User Guide/用户指南

All Contributors

Quick Start in Local Server/在本地搭建服务器使用

📖Quick start in local server/在本地搭建服务器使用

Guide for users/用户手册

📖Guide for users/用户手册

API Document

📖API Document/API文档

🧑‍🔧 Contributor Guide/开发指南

⚠️ Important Notice/重要提示

❌ Do not modify the master branch directly! Committing directly to the master branch will not trigger automatic deployment of code for CI/CD.
⭕️ Please create a new branch first and develop on the new branch. When development is complete, initiate a Pull Request to merge that branch onto the master branch.

❌ 请勿直接修改主分支!直接向主分支提交(commit)将不会触发持续集成自动部署代码。
⭕️ 请先新建一个分支,并在新建的分支上进行开发。开发完成后,发起 Pull Request 将该分支合并到主分支上。

📚 Project Structure/项目结构

cbdb-online-query-app/
├── README.md
├── dataProcessing #Save codes and output of data processing. This directory is just for archive and has nothing to do with other parts.
│   ├── Office_type_tree.xlsx
│   ├── office.json
│   ├── officeData.json
│   └── position_json.py
└── src #Core source code of this project. 
    ├── cbdbweb #Backend
    ├── db.sqlite3
    ├── dockerfile
    ├── frontend # Frontend
    ├── manage.py #django dev-server entrance. See Backend > Running the server
    └── requirements.txt

📕 Backend/后端

Python Environment

3.6.x

Requirements/Python包依赖

Django ==3.0.8
djangorestframework ==3.11.0
mysqlclient ==2.0.1
gunicorn==20.0.4 Please install above packages before running the server.

📚 Structure/结构

cbdbweb/
├── __init__.py
├── asgi.py
├── settings.py
├── urls.py
└── wsgi.py

Running the Server locally/在本地运行服务器

⚠️ If you just want to change the code of frontend, running the Webpack Dev Server is strongly recommanded. See Quick start in local server/在本地搭建服务器使用

⚠️ 如果你只是想修改前端代码,强烈建议运行 Webpack 的开发服务器。参见Quick start in local server/在本地搭建服务器使用

Windows

cd src
py manage.py runserver

MacOS

cd src
python manage.py runserver

📕 Frontend/前端

📚 Structure/结构

frontend/
├── build #Settings for using webpack to bundle the project
│   ├── build.js
│   ├── check-versions.js
│   ├── logo.png
│   ├── utils.js
│   ├── vue-loader.conf.js
│   ├── webpack.base.conf.js
│   ├── webpack.dev.conf.js
│   └── webpack.prod.conf.js
├── config
│   ├── dev.env.js
│   ├── index.js
│   └── prod.env.js
├── index.html
├── package-lock.json
├── package.json
├── postcss.config.js
├── src #Vue Project
│   ├── App.vue
│   ├── assets #Save resources like images, etc. 
│   ├── components #Save Vue components
│   ├── main.js
│   ├── router #Vue router
│   └── store #Vuex
└── static

Useful Commands/实用指令

🛠 Quick Start in Dev Mode/在本地快速搭建开发服务器

# go to the directory of FE first
cd src/frontend

# install dependencies
npm install

# equivalent to: npm run dev
npm start

🔧 Formatting Code/格式化代码

# go to the directory of FE first
cd src/frontend

# install dependencies
npm install

# install vue client globally. If it has already installed, skip this step. 
npm install -g @vue/cli

# Formatting code
npm run lint

🔧 Other Commands/其他指令

#install dependencies
npm install

#server with hot reload at localhost:8080
npm run dev

#build for production with minification
npm run build

#build for production and view the bundle analyzer report
npm run build --report

For a detailed explain on how things work, check out the guide and docs for vue-loader.

Important Virables & Methods

目录

src/components/utility/select-entry.vue

组件简介

用于查询入仕途径,并将其传递到父组件中

Data
Methods
Watch

show 当变量 show:Bool 的值为 true 时,监听键鼠滚动。

src/components/utility/select-office.vue

WIP

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Łøçꝁë Tân

🎨 💻 📖 🤔

CasewardBen

💻 🔣

IceCodeNew

💻 🚇 🚧

zhangliyuan2013

💻

yuetieqi-meow

💻

This project follows the all-contributors specification. Contributions of any kind welcome!