Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform-ui
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform-ui
Commits
d0cb77f7
Commit
d0cb77f7
authored
May 13, 2019
by
youjj
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
3df4fdab
dde2a3c2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
166 additions
and
5 deletions
+166
-5
webpack.sit.conf.js
build/webpack.sit.conf.js
+123
-0
sit.env.js
config/sit.env.js
+1
-1
index.js
src/api/admin/group/index.js
+11
-0
index.vue
src/views/admin/user/index.vue
+31
-4
No files found.
build/webpack.sit.conf.js
0 → 100644
View file @
d0cb77f7
var
path
=
require
(
'path'
)
var
utils
=
require
(
'./utils'
)
var
webpack
=
require
(
'webpack'
)
var
config
=
require
(
'../config'
)
var
merge
=
require
(
'webpack-merge'
)
var
baseWebpackConfig
=
require
(
'./webpack.base.conf'
)
var
CopyWebpackPlugin
=
require
(
'copy-webpack-plugin'
)
var
HtmlWebpackPlugin
=
require
(
'html-webpack-plugin'
)
var
ExtractTextPlugin
=
require
(
'extract-text-webpack-plugin'
)
var
OptimizeCSSPlugin
=
require
(
'optimize-css-assets-webpack-plugin'
)
var
env
=
process
.
env
.
NODE_ENV
===
'sit'
?
config
.
build
.
sitEnv
:
config
.
build
.
prodEnv
;
// config.assetsPublicPath = (env.assetsPublicPath === undefined) ? config.assetsPublicPath : env.assetsPublicPath;
function
resolveApp
(
relativePath
)
{
return
path
.
resolve
(
relativePath
);
}
var
webpackConfig
=
merge
(
baseWebpackConfig
,
{
module
:
{
rules
:
utils
.
styleLoaders
({
sourceMap
:
config
.
build
.
productionSourceMap
,
extract
:
true
})
},
devtool
:
config
.
build
.
productionSourceMap
?
'#source-map'
:
false
,
output
:
{
path
:
config
.
build
.
assetsRoot
,
filename
:
utils
.
assetsPath
(
'js/[name].[chunkhash].js'
),
chunkFilename
:
utils
.
assetsPath
(
'js/[id].[chunkhash].js'
),
publicPath
:
config
.
build
.
assetsPublicPath
},
plugins
:
[
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new
webpack
.
DefinePlugin
({
'process.env'
:
env
}),
new
webpack
.
optimize
.
UglifyJsPlugin
({
compress
:
{
warnings
:
false
},
sourceMap
:
true
}),
// extract css into its own file
new
ExtractTextPlugin
({
filename
:
utils
.
assetsPath
(
'css/[name].[contenthash].css'
)
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new
OptimizeCSSPlugin
(),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new
HtmlWebpackPlugin
({
filename
:
'index.html'
,
template
:
'index.html'
,
inject
:
true
,
favicon
:
resolveApp
(
'favicon.ico'
),
minify
:
{
removeComments
:
true
,
collapseWhitespace
:
true
,
removeRedundantAttributes
:
true
,
useShortDoctype
:
true
,
removeEmptyAttributes
:
true
,
removeStyleLinkTypeAttributes
:
true
,
keepClosingSlash
:
true
,
minifyJS
:
true
,
minifyCSS
:
true
,
minifyURLs
:
true
},
path
:
config
.
build
.
assetsPublicPath
+
config
.
build
.
assetsSubDirectory
,
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode
:
'dependency'
}),
// cache Module Identifiers
new
webpack
.
HashedModuleIdsPlugin
(),
// split vendor js into its own file
new
webpack
.
optimize
.
CommonsChunkPlugin
({
name
:
'vendor'
,
minChunks
:
function
(
module
,
count
)
{
// any required modules inside node_modules are extracted to vendor
return
(
module
.
resource
&&
/
\.
js$/
.
test
(
module
.
resource
)
&&
module
.
resource
.
indexOf
(
path
.
join
(
__dirname
,
'../node_modules'
)
)
===
0
)
}
}),
// split echarts into its own file
new
webpack
.
optimize
.
CommonsChunkPlugin
({
async
:
'echarts'
,
minChunks
(
module
)
{
var
context
=
module
.
context
;
return
context
&&
(
context
.
indexOf
(
'echarts'
)
>=
0
||
context
.
indexOf
(
'zrender'
)
>=
0
);
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new
webpack
.
optimize
.
CommonsChunkPlugin
({
name
:
'manifest'
,
chunks
:
[
'vendor'
]
}),
// copy custom static assets
new
CopyWebpackPlugin
([{
from
:
path
.
resolve
(
__dirname
,
'../static'
),
to
:
config
.
build
.
assetsSubDirectory
,
ignore
:
[
'.*'
]
}]),
new
webpack
.
ProvidePlugin
({
$
:
'jquery'
,
'jQuery'
:
'jquery'
})
]
})
if
(
config
.
build
.
bundleAnalyzerReport
)
{
var
BundleAnalyzerPlugin
=
require
(
'webpack-bundle-analyzer'
).
BundleAnalyzerPlugin
webpackConfig
.
plugins
.
push
(
new
BundleAnalyzerPlugin
())
}
module
.
exports
=
webpackConfig
config/sit.env.js
View file @
d0cb77f7
module
.
exports
=
{
NODE_ENV
:
'"production"'
,
BASE_API
:
'"https://
api-si
t"'
,
BASE_API
:
'"https://
xxfcim.upyuns.com/cloudtes
t"'
,
APP_ORIGIN
:
'"https://wallstreetcn.com"'
};
src/api/admin/group/index.js
View file @
d0cb77f7
...
...
@@ -112,4 +112,15 @@ export function getCurrentGroups() {
});
}
/**
*
* @param id
*/
export
function
getUserGroups
(
id
)
{
return
fetch
({
url
:
'/api/admin/user/'
+
id
+
'/group'
,
method
:
'get'
});
}
src/views/admin/user/index.vue
View file @
d0cb77f7
...
...
@@ -76,9 +76,7 @@
</el-form-item>
<el-form-item
label=
"数据权限"
prop=
"dataState"
>
<el-checkbox-group
v-model=
"form.dataLimit"
>
<el-checkbox
label=
"1"
>
所属分公司
</el-checkbox>
<el-checkbox
label=
"2"
>
所属片区
</el-checkbox>
<el-checkbox
label=
"3"
>
所有数据
</el-checkbox>
<el-checkbox
v-for=
"item in dataOptions"
:label=
"item.id"
>
{{item.val}}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item
label=
"描述"
>
...
...
@@ -115,7 +113,7 @@ import {
import
{
fetchTree
,
get
Current
Groups
get
User
Groups
}
from
'api/admin/group/index'
;
export
default
{
...
...
@@ -201,6 +199,7 @@ export default {
},
sexOptions
:
[
'男'
,
'女'
],
zoneOptions
:
[
'男'
,
'女'
],
dataOptions
:
[{
id
:
"1"
,
val
:
"所属分公司"
},
{
id
:
"2"
,
val
:
"所属片区"
},
{
id
:
"3"
,
val
:
"所有数据"
}],
statusOptions
:
[{
id
:
1
,
val
:
'开启'
},
{
id
:
2
,
val
:
'禁用'
}],
dialogFormVisible
:
false
,
dialogStatus
:
''
,
...
...
@@ -282,9 +281,37 @@ export default {
this
.
dialogFormVisible
=
true
;
},
handleUpdate
(
row
)
{
this
.
resetTemp
();
getObj
(
row
.
id
)
.
then
(
response
=>
{
this
.
form
=
response
.
data
;
let
dataLimit
=
new
Array
();
if
(
response
.
data
.
dataCompany
!=
undefined
&&
response
.
data
.
dataCompany
!=
''
)
{
let
companys
=
response
.
data
.
dataCompany
.
split
(
","
);
if
(
companys
.
includes
(
response
.
data
.
companyId
+
""
))
{
dataLimit
.
push
(
"1"
);
}
}
if
(
response
.
data
.
dataZone
!=
undefined
&&
response
.
data
.
dataZone
!=
''
)
{
let
zones
=
response
.
data
.
dataZone
.
split
(
","
);
if
(
zones
.
includes
(
response
.
data
.
zoneId
+
""
))
{
dataLimit
.
push
(
"2"
);
}
}
if
(
response
.
data
.
dataAll
!=
undefined
&&
response
.
data
.
dataAll
==
1
)
{
dataLimit
.
push
(
"3"
);
}
this
.
$set
(
this
.
form
,
"dataLimit"
,
dataLimit
);
getUserGroups
(
response
.
data
.
id
).
then
(
result
=>
{
this
.
myGroups
=
result
.
data
;
let
mems
=
[];
for
(
let
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
mems
.
push
(
result
.
data
[
i
].
id
);
}
this
.
form
.
members
=
mems
;
});
this
.
dialogFormVisible
=
true
;
this
.
dialogStatus
=
'update'
;
});
...
...
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