Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
ZhangJianFrontEnd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vue-project
ZhangJian
ZhangJianFrontEnd
Commits
8105105e
Commit
8105105e
authored
Jul 13, 2021
by
zsh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新框架配置
parent
07226a25
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
36 additions
and
100 deletions
+36
-100
README.md
README.md
+1
-1
build.prd.js
build/build.prd.js
+4
-2
vue-loader.config.js
build/vue-loader.config.js
+3
-1
webpack.base.conf.js
build/webpack.base.conf.js
+11
-9
webpack.dev.conf.js
build/webpack.dev.conf.js
+5
-4
webpack.prod.conf.js
build/webpack.prod.conf.js
+3
-2
config.js
config/config.js
+6
-6
constant.js
src/public/utils/constant.js
+0
-11
apis.js
src/request/apis.js
+1
-16
index.js
src/store/actions/index.js
+1
-11
index.js
src/store/mutations/index.js
+0
-26
index.js
src/store/state/index.js
+1
-11
No files found.
README.md
View file @
8105105e
##
徐汇教育局项目
##
Vue基础框架
```
```
npm install
npm install
...
...
build/build.prd.js
View file @
8105105e
// 此文件是项目打包服务,用来构建一个全量压缩包
// 命令: npm run build
/**
* @file 项目打包服务, 用来构建一个全量生产包
*/
'use strict'
'use strict'
const
ora
=
require
(
'ora'
)
const
ora
=
require
(
'ora'
)
...
...
build/vue-loader.config.js
View file @
8105105e
// Vue-loader配置
/**
* @file Vue-loader配置
*/
const
{
dev
=
{},
build
=
{}
}
=
require
(
'../config/config'
)
const
{
dev
=
{},
build
=
{}
}
=
require
(
'../config/config'
)
module
.
exports
=
(
isDev
)
=>
{
module
.
exports
=
(
isDev
)
=>
{
...
...
build/webpack.base.conf.js
View file @
8105105e
...
@@ -26,21 +26,22 @@ const defaultPlugins = [
...
@@ -26,21 +26,22 @@ const defaultPlugins = [
module
.
exports
=
{
module
.
exports
=
{
entry
:
path
.
resolve
(
__dirname
,
'../src/index.js'
),
entry
:
path
.
resolve
(
__dirname
,
'../src/index.js'
),
resolve
:
{
resolve
:
{
// 自动解析文件扩展名(补全文件后缀)(左 -> 右)
// 自动解析文件扩展名(补全文件后缀)(左 -> 右)
extensions
:
[
'.js'
,
'.vue'
,
'.json'
],
extensions
:
[
'.js'
,
'.vue'
,
'.json'
],
// 配置别名映射
// 配置别名映射
alias
:
{
alias
:
{
// 键后加上$,表示精准匹配
!
// 键后加上$,表示精准匹配
vue
$
:
'vue/dist/vue.esm.js'
,
vue
$
:
'vue/dist/vue.esm.js'
,
'@'
:
resolve
(
'src'
),
'@'
:
resolve
(
'src'
),
utils
:
resolve
(
'src/utils'
),
utils
:
resolve
(
'src/
public/utils/
utils'
),
components
:
resolve
(
'src/components'
),
components
:
resolve
(
'src/components'
),
public
:
resolve
(
'public'
)
public
:
resolve
(
'public'
)
}
}
},
},
module
:
{
module
:
{
// 处理模块的规则(可在此处使用不同的loader来处理模块)
rules
:
[
rules
:
[
{
{
test
:
/
\.(
vue|js|jsx
)
$/
,
test
:
/
\.(
vue|js|jsx
)
$/
,
...
@@ -57,7 +58,7 @@ module.exports = {
...
@@ -57,7 +58,7 @@ module.exports = {
test
:
/
\.
jsx$/
,
test
:
/
\.
jsx$/
,
loader
:
'babel-loader'
// 处理jsx文件
loader
:
'babel-loader'
// 处理jsx文件
},
},
// 使用babel-loader来处理src下所有js文件, 详细babel配置在.babelrc
, 用来转义ES6
// 使用babel-loader来处理src下所有js文件, 详细babel配置在.babelrc
{
{
test
:
/
\.
js$/
,
test
:
/
\.
js$/
,
use
:
{
use
:
{
...
@@ -66,8 +67,8 @@ module.exports = {
...
@@ -66,8 +67,8 @@ module.exports = {
include
:
resolve
(
'src'
)
include
:
resolve
(
'src'
)
},
},
// 使用url-loader(file-loader的一个再封装)对引入的图片进行编码,此处可将小于20480字节(20kb)的图片转为DataURL(base64),
// 使用url-loader(file-loader的一个再封装)对引入的图片进行编码,此处可将小于20480字节(20kb)的图片转为DataURL(base64),
// 大于limit字节的会调用file-loader进行处理
!
// 大于limit字节的会调用file-loader进行处理
// 图片一般发布后都是长缓存,故此处文件名加入hash做版本区分
!
// 图片一般发布后都是长缓存,故此处文件名加入hash做版本区分
{
{
test
:
/
\.(
jpg|png|gif|svg|jpeg|txt|exl
)
$/
,
test
:
/
\.(
jpg|png|gif|svg|jpeg|txt|exl
)
$/
,
use
:
[
use
:
[
...
@@ -82,14 +83,15 @@ module.exports = {
...
@@ -82,14 +83,15 @@ module.exports = {
]
]
},
},
{
{
//
当前loader需要处理的文件类型(后缀)
//
iconfont字体文件
test
:
/
\.(
eot|ttf|svg|woff|woff2
)(\?\S
*
)?
$/
,
// iconfont字体文件
test
:
/
\.(
eot|ttf|svg|woff|woff2
)(\?\S
*
)?
$/
,
// 处理test中的文件类型需要用到的loader类型(名称)
// 处理test中的文件类型需要用到的loader类型(名称)
use
:
{
use
:
{
loader
:
'file-loader'
// 处理静态资源类型
loader
:
'file-loader'
}
}
}
}
]
]
},
},
plugins
:
defaultPlugins
.
concat
([])
plugins
:
defaultPlugins
.
concat
([])
}
}
build/webpack.dev.conf.js
View file @
8105105e
...
@@ -10,12 +10,15 @@ const merge = require('webpack-merge')
...
@@ -10,12 +10,15 @@ const merge = require('webpack-merge')
const
HtmlWebpackPlugin
=
require
(
'html-webpack-plugin'
)
const
HtmlWebpackPlugin
=
require
(
'html-webpack-plugin'
)
const
FriendlyErrorsPlugin
=
require
(
'friendly-errors-webpack-plugin'
)
const
FriendlyErrorsPlugin
=
require
(
'friendly-errors-webpack-plugin'
)
const
notifier
=
require
(
'node-notifier'
)
const
notifier
=
require
(
'node-notifier'
)
const
devConf
=
merge
(
baseConf
,
{
const
devConf
=
merge
(
baseConf
,
{
output
:
{
output
:
{
filename
:
'[name].[hash:8].js'
,
filename
:
'[name].[hash:8].js'
,
publicPath
:
devConfig
.
publicPath
publicPath
:
devConfig
.
publicPath
},
},
devtool
:
devConfig
.
devtoolType
,
devtool
:
devConfig
.
devtoolType
,
devServer
:
{
devServer
:
{
// HMR控制台log等级
// HMR控制台log等级
clientLogLevel
:
'warning'
,
clientLogLevel
:
'warning'
,
...
@@ -43,10 +46,9 @@ const devConf = merge(baseConf, {
...
@@ -43,10 +46,9 @@ const devConf = merge(baseConf, {
// 终端输出的只有初始启动信息, webpack 的警告和错误是不输出到终端的
// 终端输出的只有初始启动信息, webpack 的警告和错误是不输出到终端的
quiet
:
false
quiet
:
false
},
},
module
:
{
module
:
{
// 处理模块的规则(可在此处使用不同的loader来处理模块)
rules
:
[
rules
:
[
// 使用vue-style-loader!css-loader!postcss-loader处理以css结尾的文件
{
{
test
:
/
\.
css$/
,
test
:
/
\.
css$/
,
use
:
[
use
:
[
...
@@ -65,7 +67,6 @@ const devConf = merge(baseConf, {
...
@@ -65,7 +67,6 @@ const devConf = merge(baseConf, {
}
}
]
]
},
},
// 使用vue-style-loader!css-loader!postcss-loader处理以less结尾的文件!
{
{
test
:
/
\.
less$/
,
test
:
/
\.
less$/
,
use
:
[
use
:
[
...
@@ -90,7 +91,6 @@ const devConf = merge(baseConf, {
...
@@ -90,7 +91,6 @@ const devConf = merge(baseConf, {
}
}
]
]
},
},
// 使用vue-style-loader!css-loader!postcss-loader处理以scss结尾的文件
{
{
test
:
/
\.
scss$/
,
test
:
/
\.
scss$/
,
use
:
[
use
:
[
...
@@ -121,6 +121,7 @@ const devConf = merge(baseConf, {
...
@@ -121,6 +121,7 @@ const devConf = merge(baseConf, {
}
}
]
]
},
},
plugins
:
[
plugins
:
[
// 开启HMR(热替换功能, 替换更新部分, 不重载页面)
// 开启HMR(热替换功能, 替换更新部分, 不重载页面)
new
webpack
.
HotModuleReplacementPlugin
(),
new
webpack
.
HotModuleReplacementPlugin
(),
...
...
build/webpack.prod.conf.js
View file @
8105105e
...
@@ -24,9 +24,10 @@ const prodConf = merge(baseConf, {
...
@@ -24,9 +24,10 @@ const prodConf = merge(baseConf, {
filename
:
assetsPath
(
'js/[name].[chunkhash:8].js'
),
filename
:
assetsPath
(
'js/[name].[chunkhash:8].js'
),
chunkFilename
:
assetsPath
(
'js/[name].[chunkhash:8].js'
)
chunkFilename
:
assetsPath
(
'js/[name].[chunkhash:8].js'
)
},
},
devtool
:
prodConfig
.
devtoolType
,
devtool
:
prodConfig
.
devtoolType
,
module
:
{
module
:
{
// 处理模块的规则(可在此处使用不同的loader来处理模块!)
rules
:
[
rules
:
[
{
{
test
:
/
\.
css$/
,
test
:
/
\.
css$/
,
...
@@ -51,8 +52,8 @@ const prodConf = merge(baseConf, {
...
@@ -51,8 +52,8 @@ const prodConf = merge(baseConf, {
}
}
]
]
},
},
plugins
:
[
plugins
:
[
// 每个chunk头部添加vue-cli-init!
new
webpack
.
BannerPlugin
(
'vue-cli-init'
),
new
webpack
.
BannerPlugin
(
'vue-cli-init'
),
// 压缩js
// 压缩js
...
...
config/config.js
View file @
8105105e
// 该文件主要用来配置构建开发环境和生产环境差异化的参数
/**
* @file 配置构建开发环境和生产环境差异化参数
*/
const
_path
=
require
(
'path'
)
const
_path
=
require
(
'path'
)
const
ExtractTextPlugin
=
require
(
'extract-text-webpack-plugin'
)
const
ExtractTextPlugin
=
require
(
'extract-text-webpack-plugin'
)
// vue-loader基本配置
// vue-loader基本配置
const
baseVueLoaderConf
=
{
const
baseVueLoaderConf
=
{
// 引入postcss插件
postcss
:
{
postcss
:
{
config
:
{
config
:
{
path
:
_path
.
resolve
(
'../'
)
path
:
_path
.
resolve
(
'../'
)
...
@@ -22,7 +23,6 @@ const baseVueLoaderConf = {
...
@@ -22,7 +23,6 @@ const baseVueLoaderConf = {
// vue-loader开发环境配置
// vue-loader开发环境配置
const
devVueLoaderConf
=
Object
.
assign
({},
baseVueLoaderConf
,
{
const
devVueLoaderConf
=
Object
.
assign
({},
baseVueLoaderConf
,
{
// loaders
loaders
:
{
loaders
:
{
css
:
[
'vue-style-loader'
,
'css-loader'
],
css
:
[
'vue-style-loader'
,
'css-loader'
],
less
:
[
'vue-style-loader'
,
'css-loader'
,
'postcss-loader'
,
'less-loader'
]
less
:
[
'vue-style-loader'
,
'css-loader'
,
'postcss-loader'
,
'less-loader'
]
...
@@ -32,7 +32,6 @@ const devVueLoaderConf = Object.assign({}, baseVueLoaderConf, {
...
@@ -32,7 +32,6 @@ const devVueLoaderConf = Object.assign({}, baseVueLoaderConf, {
// vue-loader生产环境配置
// vue-loader生产环境配置
const
buildVueLoaderConf
=
Object
.
assign
({},
baseVueLoaderConf
,
{
const
buildVueLoaderConf
=
Object
.
assign
({},
baseVueLoaderConf
,
{
// loaders
loaders
:
ExtractTextPlugin
.
extract
({
loaders
:
ExtractTextPlugin
.
extract
({
use
:
[
'css-loader'
,
'postcss-loader'
,
'less-loader'
],
use
:
[
'css-loader'
,
'postcss-loader'
,
'less-loader'
],
fallback
:
'vue-style-loader'
fallback
:
'vue-style-loader'
...
@@ -48,9 +47,10 @@ module.exports = {
...
@@ -48,9 +47,10 @@ module.exports = {
vueloaderConf
:
devVueLoaderConf
,
vueloaderConf
:
devVueLoaderConf
,
host
:
'127.0.0.1'
,
host
:
'127.0.0.1'
,
port
:
'8081'
,
port
:
'8081'
,
// 开发环境跨域配置
proxyTable
:
{
proxyTable
:
{
'/apis'
:
{
'/apis'
:
{
target
:
'http://192.168.0.121:8881'
,
// 接口域名
target
:
'http://192.168.0.121:8881'
,
pathRewrite
:
{
pathRewrite
:
{
'^/apis'
:
'/'
'^/apis'
:
'/'
},
},
...
@@ -63,7 +63,7 @@ module.exports = {
...
@@ -63,7 +63,7 @@ module.exports = {
publicPath
:
'../../'
,
publicPath
:
'../../'
,
devtoolType
:
'#cheap-module-source-map'
,
devtoolType
:
'#cheap-module-source-map'
,
vueloaderConf
:
buildVueLoaderConf
,
vueloaderConf
:
buildVueLoaderConf
,
host
:
''
,
// 接口请求域名
host
:
''
,
staticPath
:
'static'
staticPath
:
'static'
}
}
}
}
src/public/utils/constant.js
deleted
100644 → 0
View file @
07226a25
// 新增弹框的title需要在此增加
const
bulletTitle
=
{
managementAnalysis
:
'教育发展课题管理分析'
,
teacherDevelop
:
'教师专业发展专项活动情况'
,
TeachersPersonal
:
'教师个人专业能力发展情况'
,
TeachActive
:
'教研活动开展情况'
,
schoolQuality
:
'学校办学质量分析'
}
export
default
{
bulletTitle
}
src/request/apis.js
View file @
8105105e
...
@@ -2,19 +2,4 @@
...
@@ -2,19 +2,4 @@
* @file request/apis 所有接口url
* @file request/apis 所有接口url
*/
*/
export
default
{
export
default
{}
index
:
'/api1'
,
// 徐汇区教师队伍整体发展情况分析
indexJYFZDetail
:
'/api1JYFZDetail'
,
// 教育发展课题管理分析弹窗
indexTeacherHonerDetail
:
'/api1teacherHonerDetail'
,
// 教师专业发展专项活动情况
indexMapModal
:
'/api1MapPanel'
,
// 地图定位点弹窗详情
childGardon
:
'/api2'
,
// 区域整体办学质量检测分析(幼儿园)
childGardonDetail
:
'/api2detail'
,
// 学校办学质量分析(幼儿园)
childPrimaryMiddleSchool
:
'/api3'
,
// 区域整体办学质量检测分析(小学、中学)
childMapModal
:
'/api2MapPanel'
,
// (幼儿园)地图定位点弹窗详情
middleMapModal
:
'/api3MapPanel'
,
// (小学、中学)地图定位点弹窗详情
childPrimaryMiddleSchoolDetail
:
'/api3detail'
,
// 学校办学质量分析(小学、中学)
cultivate
:
'/api4'
,
// 教师队伍专业能力培养分析
cultivateSearch
:
'/api4searchTeacher'
,
// 教师队伍专业能力培养分析 - 搜索
cultivateDetail
:
'/api4teacherAbilityDetail'
,
// 教师个人专业能力发展情况
teacherActivity
:
'/api4jiaoYanDetail'
// 教研活动开展情况
}
src/store/actions/index.js
View file @
8105105e
...
@@ -2,14 +2,4 @@
...
@@ -2,14 +2,4 @@
* @file actions/index Vuex-actions
* @file actions/index Vuex-actions
*/
*/
export
default
{
export
default
{}
actionOpenBullet
:
({
commit
},
data
)
=>
{
return
commit
(
'openBullet'
,
data
)
},
actionCloseBullet
:
({
commit
})
=>
{
return
commit
(
'closeBullet'
)
},
actionTeacherAbility
:
({
commit
},
payload
)
=>
{
commit
(
'setTeacherAbility'
,
payload
)
}
}
src/store/mutations/index.js
View file @
8105105e
...
@@ -2,33 +2,7 @@
...
@@ -2,33 +2,7 @@
/**
/**
* @file mutations/index Vuex-mutations
* @file mutations/index Vuex-mutations
*/
*/
import
allTitle
from
'../../public/utils/constant'
export
default
{
export
default
{
openBullet
:
(
state
,
data
)
=>
{
// 打开弹框
state
.
showBullet
=
true
// 关闭其他所有插槽
for
(
let
key
in
state
.
bulletConTent
)
{
state
.
bulletConTent
[
key
]
=
false
}
// 变更弹框的title
state
.
bulletTitle
=
allTitle
.
bulletTitle
[
data
.
type
]
// 打开对应弹框的插槽
state
.
bulletConTent
[
data
.
type
]
=
true
// 根据data和type进行特殊处理
if
(
data
.
type
===
'schoolQuality'
&&
data
.
schoolKey
)
{
// 学校办学质量分析
state
.
schoolKey
=
data
.
schoolKey
}
},
closeBullet
:
(
state
)
=>
{
// 直接关闭弹框
state
.
showBullet
=
false
},
// 教师个人能力发展情况
setTeacherAbility
(
state
,
payload
)
{
state
.
teacherAbility
=
payload
.
key
||
''
}
}
}
src/store/state/index.js
View file @
8105105e
...
@@ -4,15 +4,5 @@
...
@@ -4,15 +4,5 @@
*/
*/
export
default
{
export
default
{
showBullet
:
false
,
// 是否展示弹框(外部的大框)
bulletTitle
:
'教研活动开展情况'
,
// 弹框名字
bulletConTent
:
{
managementAnalysis
:
false
,
// 教育发展课题管理分析
teacherDevelop
:
false
,
// 教师专业发展专项活动情况
schoolQuality
:
false
,
// 学校办学质量分析
TeachActive
:
false
,
// 教研活动开展情况
TeachersPersonal
:
false
// 教师个人专业能力发展情况
},
schoolKey
:
''
,
// 学校办学质量分析的key(用于请求弹框内数据)
teacherAbility
:
''
// 教师个人能力发展情况
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment