fanzhen 1003
This commit is contained in:
2
.browserslistrc
Normal file
2
.browserslistrc
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
> 1%
|
||||||
|
last 2 versions
|
||||||
5
.editorconfig
Normal file
5
.editorconfig
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[*.{js,jsx,ts,tsx,vue}]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
15
.env.development
Normal file
15
.env.development
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
# just a flag
|
||||||
|
ENV = 'development'
|
||||||
|
|
||||||
|
# base api
|
||||||
|
VUE_APP_BASE_API = '/api/'
|
||||||
|
|
||||||
|
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
|
||||||
|
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
|
||||||
|
# It only does one thing by converting all import() to require().
|
||||||
|
# This configuration can significantly increase the speed of hot updates,
|
||||||
|
# when you have a large number of pages.
|
||||||
|
# Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
|
||||||
|
|
||||||
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
5
.env.production
Normal file
5
.env.production
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# just a flag
|
||||||
|
ENV = 'production'
|
||||||
|
|
||||||
|
# base api
|
||||||
|
VUE_APP_BASE_API = 'http://wechatticket.ecooth.com//api/'
|
||||||
27
.eslintrc.js
Normal file
27
.eslintrc.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
env: {
|
||||||
|
node: true
|
||||||
|
},
|
||||||
|
'extends': [
|
||||||
|
'plugin:vue/essential',
|
||||||
|
'@vue/standard'
|
||||||
|
],
|
||||||
|
rules: {
|
||||||
|
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||||
|
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
|
||||||
|
},
|
||||||
|
parserOptions: {
|
||||||
|
parser: 'babel-eslint'
|
||||||
|
},
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: [
|
||||||
|
'**/__tests__/*.{j,t}s?(x)'
|
||||||
|
],
|
||||||
|
env: {
|
||||||
|
jest: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
21
.gitignore
vendored
Normal file
21
.gitignore
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/dist
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
|
||||||
|
# Log files
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
55
README.md
55
README.md
@@ -1,37 +1,34 @@
|
|||||||
# datawebsite
|
# datawebsite
|
||||||
|
|
||||||
#### 介绍
|
## Project setup
|
||||||
数据网项目,pc网站,主要运用数据预算与统计。
|
```
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
#### 软件架构
|
### Compiles and hot-reloads for development
|
||||||
软件架构说明
|
```
|
||||||
|
npm run serve
|
||||||
|
```
|
||||||
|
|
||||||
|
### Compiles and minifies for production
|
||||||
|
```
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
#### 安装教程
|
### Run your tests
|
||||||
|
```
|
||||||
|
npm run test
|
||||||
|
```
|
||||||
|
|
||||||
1. xxxx
|
### Lints and fixes files
|
||||||
2. xxxx
|
```
|
||||||
3. xxxx
|
npm run lint
|
||||||
|
```
|
||||||
|
|
||||||
#### 使用说明
|
### Run your unit tests
|
||||||
|
```
|
||||||
|
npm run test:unit
|
||||||
|
```
|
||||||
|
|
||||||
1. xxxx
|
### Customize configuration
|
||||||
2. xxxx
|
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### 参与贡献
|
|
||||||
|
|
||||||
1. Fork 本仓库
|
|
||||||
2. 新建 Feat_xxx 分支
|
|
||||||
3. 提交代码
|
|
||||||
4. 新建 Pull Request
|
|
||||||
|
|
||||||
|
|
||||||
#### 码云特技
|
|
||||||
|
|
||||||
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
|
||||||
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
|
|
||||||
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
|
|
||||||
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
|
|
||||||
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
|
||||||
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
|
||||||
|
|||||||
5
babel.config.js
Normal file
5
babel.config.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
module.exports = {
|
||||||
|
presets: [
|
||||||
|
'@vue/app'
|
||||||
|
]
|
||||||
|
}
|
||||||
30
jest.config.js
Normal file
30
jest.config.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
module.exports = {
|
||||||
|
moduleFileExtensions: [
|
||||||
|
'js',
|
||||||
|
'jsx',
|
||||||
|
'json',
|
||||||
|
'vue'
|
||||||
|
],
|
||||||
|
transform: {
|
||||||
|
'^.+\\.vue$': 'vue-jest',
|
||||||
|
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
|
||||||
|
'^.+\\.jsx?$': 'babel-jest'
|
||||||
|
},
|
||||||
|
transformIgnorePatterns: [
|
||||||
|
'/node_modules/'
|
||||||
|
],
|
||||||
|
moduleNameMapper: {
|
||||||
|
'^@/(.*)$': '<rootDir>/src/$1'
|
||||||
|
},
|
||||||
|
snapshotSerializers: [
|
||||||
|
'jest-serializer-vue'
|
||||||
|
],
|
||||||
|
testMatch: [
|
||||||
|
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
|
||||||
|
],
|
||||||
|
testURL: 'http://localhost/',
|
||||||
|
watchPlugins: [
|
||||||
|
'jest-watch-typeahead/filename',
|
||||||
|
'jest-watch-typeahead/testname'
|
||||||
|
]
|
||||||
|
}
|
||||||
15559
package-lock.json
generated
Normal file
15559
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
34
package.json
Normal file
34
package.json
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"name": "datawebsite",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"serve": "vue-cli-service serve",
|
||||||
|
"build": "vue-cli-service build",
|
||||||
|
"lint": "vue-cli-service lint",
|
||||||
|
"test:unit": "vue-cli-service test:unit"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"axios": "^0.19.0",
|
||||||
|
"core-js": "^2.6.5",
|
||||||
|
"vue": "^2.6.10",
|
||||||
|
"vue-router": "^3.0.3",
|
||||||
|
"vuex": "^3.0.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@vue/cli-plugin-babel": "^3.11.0",
|
||||||
|
"@vue/cli-plugin-eslint": "^3.11.0",
|
||||||
|
"@vue/cli-plugin-unit-jest": "^3.11.0",
|
||||||
|
"@vue/cli-service": "^3.11.0",
|
||||||
|
"@vue/eslint-config-standard": "^4.0.0",
|
||||||
|
"@vue/test-utils": "1.0.0-beta.29",
|
||||||
|
"babel-core": "7.0.0-bridge.0",
|
||||||
|
"babel-eslint": "^10.0.1",
|
||||||
|
"babel-jest": "^23.6.0",
|
||||||
|
"eslint": "^5.16.0",
|
||||||
|
"eslint-plugin-vue": "^5.0.0",
|
||||||
|
"node-sass": "^4.9.0",
|
||||||
|
"sass-loader": "^7.1.0",
|
||||||
|
"vue-template-compiler": "^2.6.10"
|
||||||
|
}
|
||||||
|
}
|
||||||
5
postcss.config.js
Normal file
5
postcss.config.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
module.exports = {
|
||||||
|
plugins: {
|
||||||
|
autoprefixer: {}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
public/favicon.ico
Normal file
BIN
public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
17
public/index.html
Normal file
17
public/index.html
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
|
<title>datawebsite</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
<strong>We're sorry but datawebsite doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||||
|
</noscript>
|
||||||
|
<div id="app"></div>
|
||||||
|
<!-- built files will be auto injected -->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
8
src/App.vue
Normal file
8
src/App.vue
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<template>
|
||||||
|
<div id="app">
|
||||||
|
<router-view/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
</style>
|
||||||
BIN
src/assets/logo.png
Normal file
BIN
src/assets/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
31
src/main.js
Normal file
31
src/main.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import App from './App.vue'
|
||||||
|
import router from './router'
|
||||||
|
import store from './store'
|
||||||
|
import axios from 'axios'
|
||||||
|
// axios请求配置
|
||||||
|
var root = process.env.VUE_APP_BASE_API
|
||||||
|
// console.log(root)
|
||||||
|
|
||||||
|
// 请求拦截器
|
||||||
|
axios.interceptors.request.use(config => {
|
||||||
|
// --请求之前重新拼装url--
|
||||||
|
config.url = root + config.url
|
||||||
|
// --默认请求参数--
|
||||||
|
// config.data = {
|
||||||
|
// ...config.data,
|
||||||
|
// openid
|
||||||
|
// };
|
||||||
|
// config.headers = {
|
||||||
|
// 'Authorization': 'hjiujkolololjhgg12569jhjhF'
|
||||||
|
// }
|
||||||
|
return config
|
||||||
|
})
|
||||||
|
Vue.config.productionTip = false
|
||||||
|
|
||||||
|
Vue.prototype.$axios = axios
|
||||||
|
new Vue({
|
||||||
|
router,
|
||||||
|
store,
|
||||||
|
render: h => h(App)
|
||||||
|
}).$mount('#app')
|
||||||
17
src/router.js
Normal file
17
src/router.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import Router from 'vue-router'
|
||||||
|
import Index from '@/views/index/Index.vue'
|
||||||
|
|
||||||
|
Vue.use(Router)
|
||||||
|
|
||||||
|
export default new Router({
|
||||||
|
mode: 'history',
|
||||||
|
base: process.env.BASE_URL,
|
||||||
|
routes: [
|
||||||
|
{
|
||||||
|
path: '/',
|
||||||
|
name: 'index',
|
||||||
|
component: Index
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
16
src/store.js
Normal file
16
src/store.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import Vuex from 'vuex'
|
||||||
|
|
||||||
|
Vue.use(Vuex)
|
||||||
|
|
||||||
|
export default new Vuex.Store({
|
||||||
|
state: {
|
||||||
|
|
||||||
|
},
|
||||||
|
mutations: {
|
||||||
|
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
16
src/views/index/Index.vue
Normal file
16
src/views/index/Index.vue
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<template>
|
||||||
|
<div>这是首页</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
</style>
|
||||||
5
tests/unit/.eslintrc.js
Normal file
5
tests/unit/.eslintrc.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
module.exports = {
|
||||||
|
env: {
|
||||||
|
jest: true
|
||||||
|
}
|
||||||
|
}
|
||||||
12
tests/unit/example.spec.js
Normal file
12
tests/unit/example.spec.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { shallowMount } from '@vue/test-utils'
|
||||||
|
import HelloWorld from '@/components/HelloWorld.vue'
|
||||||
|
|
||||||
|
describe('HelloWorld.vue', () => {
|
||||||
|
it('renders props.msg when passed', () => {
|
||||||
|
const msg = 'new message'
|
||||||
|
const wrapper = shallowMount(HelloWorld, {
|
||||||
|
propsData: { msg }
|
||||||
|
})
|
||||||
|
expect(wrapper.text()).toMatch(msg)
|
||||||
|
})
|
||||||
|
})
|
||||||
98
vue.config.js
Normal file
98
vue.config.js
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
// vue.config.js
|
||||||
|
module.exports = {
|
||||||
|
// 部署应用包时的基本 URL
|
||||||
|
publicPath: './',
|
||||||
|
// 当运行 vue-cli-service build 时生成的生产环境构建文件的目录
|
||||||
|
outputDir: 'dist',
|
||||||
|
// 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录
|
||||||
|
assetsDir: 'static',
|
||||||
|
// 指定生成的 index.html 的输出路径 (相对于 outputDir)。也可以是一个绝对路径
|
||||||
|
indexPath: 'index.html',
|
||||||
|
// 默认情况下,生成的静态资源在它们的文件名中包含了 hash 以便更好的控制缓存。然而,这也要求 index 的 HTML 是被 Vue CLI 自动生成的。如果你无法使用 Vue CLI 生成的 index HTML,你可以通过将这个选项设为 false 来关闭文件名哈希。
|
||||||
|
// filenameHashing: true,
|
||||||
|
// 在 multi-page 模式下构建应用。每个“page”应该有一个对应的 JavaScript 入口文件。其值应该是一个对象,对象的 key 是入口的名字,value 是:一个指定了 entry, template, filename, title 和 chunks 的对象 (除了 entry 之外都是可选的);或一个指定其 entry 的字符串。
|
||||||
|
// pages: {
|
||||||
|
// index: {
|
||||||
|
// // page 的入口
|
||||||
|
// entry: 'src/index/main.js',
|
||||||
|
// // 模板来源
|
||||||
|
// template: 'public/index.html',
|
||||||
|
// // 在 dist/index.html 的输出
|
||||||
|
// filename: 'index.html',
|
||||||
|
// // 当使用 title 选项时,
|
||||||
|
// // template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
|
||||||
|
// title: 'Index Page',
|
||||||
|
// // 在这个页面中包含的块,默认情况下会包含
|
||||||
|
// // 提取出来的通用 chunk 和 vendor chunk。
|
||||||
|
// chunks: ['chunk-vendors', 'chunk-common', 'index']
|
||||||
|
// },
|
||||||
|
// // 当使用只有入口的字符串格式时,
|
||||||
|
// // 模板会被推导为 `public/subpage.html`
|
||||||
|
// // 并且如果找不到的话,就回退到 `public/index.html`。
|
||||||
|
// // 输出文件名会被推导为 `subpage.html`。
|
||||||
|
// subpage: 'src/subpage/main.js'
|
||||||
|
// },
|
||||||
|
// 是否在开发环境下通过 eslint-loader 在每次保存时 lint 代码。这个值会在 @vue/cli-plugin-eslint 被安装之后生效
|
||||||
|
// lintOnSave: process.env.NODE_ENV === 'development',
|
||||||
|
// 是否使用包含运行时编译器的 Vue 构建版本。
|
||||||
|
// runtimeCompiler: false,
|
||||||
|
// 默认情况下 babel-loader 会忽略所有 node_modules 中的文件。如果你想要通过 Babel 显式转译一个依赖,可以在这个选项中列出来。
|
||||||
|
// transpileDependencies: [],
|
||||||
|
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
|
||||||
|
// productionSourceMap: false,
|
||||||
|
// 设置生成的 HTML 中 <link rel="stylesheet"> 和 <script> 标签的 crossorigin 属性。需要注意的是该选项仅影响由 html-webpack-plugin 在构建时注入的标签 - 直接写在模版 (public/index.html) 中的标签不受影响。
|
||||||
|
// crossorigin: undefined,
|
||||||
|
// 在生成的 HTML 中的 <link rel="stylesheet"> 和 <script> 标签上启用 Subresource Integrity (SRI)。如果你构建后的文件是部署在 CDN 上的,启用该选项可以提供额外的安全性。需要注意的是该选项仅影响由 html-webpack-plugin 在构建时注入的标签 - 直接写在模版 (public/index.html) 中的标签不受影响。
|
||||||
|
// integrity: false,
|
||||||
|
// 如果你的前端应用和后端 API 服务器没有运行在同一个主机上,你需要在开发环境下将 API 请求代理到 API 服务器。这个问题可以通过 vue.config.js 中的 devServer.proxy 选项来配置
|
||||||
|
devServer: {
|
||||||
|
open: false, // 运行项目是否自动开启浏览器
|
||||||
|
host: 'localhost', // 真机测试 0.0.0.0
|
||||||
|
port: '8080',
|
||||||
|
https: false,
|
||||||
|
hotOnly: false, // 是否开启热更新
|
||||||
|
proxy: {
|
||||||
|
// 配置跨域
|
||||||
|
'/api/': {
|
||||||
|
target: 'http://wechatticket.ecooth.com/api',
|
||||||
|
ws: false, // 允许重写
|
||||||
|
changeOrigin: true, // 允许跨域
|
||||||
|
pathRewrite: {
|
||||||
|
'^/api': ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 如果这个值是一个对象,则会通过 webpack-merge 合并到最终的配置中。
|
||||||
|
// configureWebpack: config => {
|
||||||
|
// if (process.env.NODE_ENV === 'production') {
|
||||||
|
// // 为生产环境修改配置...请求前缀
|
||||||
|
// process.env.API_ROOT = 'https://shop.sunhuixin.top/index.php?s=/api/'
|
||||||
|
// } else {
|
||||||
|
// // 为开发环境修改配置...请求前缀
|
||||||
|
// process.env.API_ROOT = 'https://shop.fanzhen.top/index.php?s=/api/'
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// 静态资源文件超出250kb
|
||||||
|
// webpack配置
|
||||||
|
configureWebpack: {
|
||||||
|
// 关闭 webpack 的性能提示
|
||||||
|
// performance: {
|
||||||
|
// hints: false
|
||||||
|
// },
|
||||||
|
// 或者
|
||||||
|
// 警告 webpack 的性能提示
|
||||||
|
performance: {
|
||||||
|
hints: 'warning',
|
||||||
|
// 入口起点的最大体积
|
||||||
|
maxEntrypointSize: 500000000,
|
||||||
|
// 生成文件的最大体积
|
||||||
|
maxAssetSize: 300000000,
|
||||||
|
// 只给出 js 文件的性能提示
|
||||||
|
assetFilter: function (assetFilename) {
|
||||||
|
return assetFilename.endsWith('.js')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user