Skip to content

Commit

Permalink
构建(架构搭建): first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dangc9 committed Sep 1, 2023
0 parents commit 4e814b8
Show file tree
Hide file tree
Showing 387 changed files with 24,434 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# port
VITE_PORT =8848
VITE_SYS_NAME =心理测评系统后台管理

VITE_BASE_API = '/api'
VITE_ADMIN_API = '/admin-api'

9 changes: 9 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 本地环境
NODE_ENV = 'development'

# 本地环境接口地址

VITE_BASE_ENV = 'stage'
VITE_BASE_PATH = ''
VITE_BASE_PORT = '9012'
VITE_DG_PROJECT_SYSTEM = 'http://localhost:8091'
9 changes: 9 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 线上环境
NODE_ENV = "production"

# 线上环境接口地址
VITE_BASE_ENV = 'prod'
VITE_BASE_PATH = ''
VITE_BASE_PORT = '9015'
VITE_DG_PROJECT_SYSTEM = 'https://nk.cqdg.xyz:9086'

9 changes: 9 additions & 0 deletions .env.stage
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 测试环境
NODE_ENV = "test"


# 测试环境接口地址
VITE_BASE_ENV = 'stage'
VITE_BASE_PATH = ''
VITE_BASE_PORT = '9012'
VITE_DG_PROJECT_SYSTEM = 'http://222.179.96.190:8091'
15 changes: 15 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

*.sh
node_modules
*.md
*.woff
*.ttf
.vscode
.idea
dist
/public
/docs
.husky
.local
/bin
Dockerfile
25 changes: 25 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:vue/vue3-essential",
"plugin:@typescript-eslint/recommended",
'plugin:prettier/recommended'
],
"parser": "vue-eslint-parser",
"parserOptions": {
"ecmaVersion": "latest",
"parser": "@typescript-eslint/parser",
"sourceType": "module"
},
"plugins": [
"vue",
"@typescript-eslint"
],
"rules": {
}
}
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist-ssr
dist
*.local
package-lock.json

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/dist/*
.local
.output.js
/node_modules/**

**/*.svg
**/*.sh

/public/*
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## 简介
本项目是基于Vue3 + Vite + TS 的多页面大型MPA项目, 他目前提供了pc用户端模块和后台管理模块的开发编译和打包。
项目支持模块的扩展、支持单独模块运行和打包、也支持全部模块一起运行和打包。

## 技术栈
- [Vue](https://cn.vuejs.org/guide/introduction.html) 现代前端框架,使应用界面开发简单高效,提供流畅的用户体验。
- [Vite](https://cn.vitejs.dev/) 快速构建工具,为项目带来更快的开发速度和响应性能。
- [Typescript](https://github.com/microsoft/TypeScript) 静态类型的JavaScript超集,确保代码质量和可维护性,减少潜在错误。
- [Element-plus](https://element-plus.gitee.io/zh-CN/component/button.html) 基于Vue的精美UI组件库,提供漂亮、功能丰富的界面元素,加速开发进度,让项目外观更专业。
- [Tailwind CSS](https://www.tailwindcss.cn/docs/installation) 强大的CSS框架,提供丰富的可定制样式,快速构建独特的现代界面。
- [Pinia](https://pinia.vuejs.org/zh/introduction.html) 现代化的Vue状态管理库,简单易用,让应用状态管理更高效可靠。
- [Axios](https://github.com/axios/axios) 流行的HTTP客户端,使数据交互更简单,提供稳定的网络请求和响应处理。


## 开发运行

```bash
# 安装依赖
npm run install

# 本地开发 开启所有模块服务
npm run dev

# 本地开发 开启单个模块服务
npm run dev --page=admin

# 测试环境打包
npm run build:stage
# 单个模块打包
npm run build:stage --page=admin

# 生产环境打包
npm run build:prod
# 单个模块打包
npm run build:prod --page=admin

# 创建新模块
npm run new:page

```


81 changes: 81 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// 文档参考:https://cz-git.qbb.sh/zh/config/
// cz.config.js kk
/** @type {import('cz-git').CommitizenGitOptions} */
module.exports = {
ignores: [commit => commit.includes("init")],
extends: ["@commitlint/config-conventional"],
// alias: { fd: 'docs: fix typos' },
// messages: {
// type: 'Select the type of change that you\'re committing:',
// scope: 'Denote the SCOPE of this change (optional):',
// customScope: 'Denote the SCOPE of this chang e:',
// subject: 'Write a SHORT, IMPERATIVE tense description of the change:\n',
// body: 'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',
// breaking: 'List any BREAKING CHANGES (optional). Use "|" to break new line:\n',
// footerPrefixsSelect: 'Select the ISSUES type of changeList by this change (optional):',
// customFooterPrefixs: 'Input ISSUES prefix:',
// footer: 'List any ISSUES by this change. E.g.: #31, #34:\n',
// confirmCommit: 'Are you sure you want to proceed with the commit above?'
// },
prompt: {
// 中英文对照版
messages: {
type: '选择你要提交的类型 :',
scope: '选择一个提交范围(可选):',
customScope: '请输入自定义的提交范围 :',
subject: '填写简短精炼的变更描述 :\n',
body: '填写更加详细的变更描述(可选)。使用 "|" 换行 :\n',
breaking: '列举非兼容性重大的变更(可选)。使用 "|" 换行 :\n',
footerPrefixesSelect: '选择关联issue前缀(可选):',
customFooterPrefix: '输入自定义issue前缀 :',
footer: '列举关联issue (可选) 例如: #31, #I3244 :\n',
confirmCommit: '是否提交或修改commit ?'
},
types: [
{ value: '特性', name: '特性: 新增功能' },
{ value: '修复', name: '修复: 修复缺陷' },
{ value: '文档', name: '文档: 文档变更' },
{ value: '格式', name: '格式: 代码格式(不影响功能,例如空格、分号等格式修正)' },
{ value: '重构', name: '重构: 代码重构(不包括 bug 修复、功能新增)' },
{ value: '性能', name: '性能: 性能优化' },
{ value: '测试', name: '测试: 添加疏漏测试或已有测试改动' },
{ value: '构建', name: '构建: 构建流程、外部依赖变更(如升级 npm 包、修改 webpack 配置等)' },
{ value: '集成', name: '集成: 修改 CI 配置、脚本' },
{ value: '回退', name: '回退: 回滚 commit' },
{ value: '其他', name: '其他: 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)' },
],
// emptyScopesAlias: 'empty: 不填写',
// customScopesAlias: 'custom: 自定义',

useEmoji: true,
// emojiAlign: 'center',
themeColorCode: '',
scopes: [],
allowCustomScopes: true,
allowEmptyScopes: true,
customScopesAlign: 'bottom',
customScopesAlias: 'custom',
emptyScopesAlias: 'empty',
upperCaseSubject: false,
markBreakingChangeMode: false,
allowBreakingChanges: ['feat', 'fix'],
breaklineNumber: 100,
breaklineChar: '|',
skipQuestions: [],
issuePrefixs: [{ value: 'closed', name: 'closed: ISSUES has been processed' }],
customIssuePrefixsAlign: 'top',
emptyIssuePrefixsAlias: 'skip',
customIssuePrefixsAlias: 'custom',
allowCustomIssuePrefixs: true,
allowEmptyIssuePrefixs: true,
confirmColorize: true,
maxHeaderLength: Infinity,
maxSubjectLength: Infinity,
minSubjectLength: 0,
scopeOverrides: undefined,
defaultBody: '',
defaultIssues: '',
defaultScope: '',
defaultSubject: ''
}
}
127 changes: 127 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" href="/log.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>%VITE_SYS_NAME%</title>
</head>

<body>
<div id="app">
<style>
.first-loading-wrp {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 90vh;
min-height: 90vh;
}

.first-loading-wrp>h1 {
font-size: 30px;
font-weight: bolder;
}

.first-loading-wrp .loading-wrp {
display: flex;
align-items: center;
justify-content: center;
padding: 98px;
}

.dot {
position: relative;
box-sizing: border-box;
display: inline-block;
width: 64px;
height: 64px;
font-size: 64px;
transform: rotate(45deg);
animation: antRotate 1.2s infinite linear;
}

.dot i {
position: absolute;
display: block;
width: 28px;
height: 28px;
background-color: #1890ff;
border-radius: 100%;
opacity: 0.3;
transform: scale(0.75);
transform-origin: 50% 50%;
animation: antSpinMove 1s infinite linear alternate;
}

.dot i:nth-child(1) {
top: 0;
left: 0;
}

.dot i:nth-child(2) {
top: 0;
right: 0;
-webkit-animation-delay: 0.4s;
animation-delay: 0.4s;
}

.dot i:nth-child(3) {
right: 0;
bottom: 0;
-webkit-animation-delay: 0.8s;
animation-delay: 0.8s;
}

.dot i:nth-child(4) {
bottom: 0;
left: 0;
-webkit-animation-delay: 1.2s;
animation-delay: 1.2s;
}

@keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}

@-webkit-keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}

@keyframes antSpinMove {
to {
opacity: 1;
}
}

@-webkit-keyframes antSpinMove {
to {
opacity: 1;
}
}
</style>
<div>
<div class="first-loading-wrp">
<div class="loading-wrp">
<span class="dot dot-spin">
<i></i>
<i></i>
<i></i>
<i></i>
</span>
</div>
</div>
</div>
</div>
<script type="module" src="/src/main.ts"></script>
</body>

</html>
Loading

0 comments on commit 4e814b8

Please sign in to comment.