初步实现

未实现:log,重启
main
LAPTOP-S9HJSOEB\昊天 2 years ago
parent 2baf5ed5aa
commit 19069d5fab

@ -0,0 +1,12 @@
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"]
}

@ -0,0 +1,9 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

14
.gitignore vendored

@ -0,0 +1,14 @@
.DS_Store
node_modules/
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln

@ -0,0 +1,10 @@
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<video controls
src="D://2b5c2178-cb21-4f03-8aa0-bb5307e45e95.mkv"></video>
</body>
</html>

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 lidonghui
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@ -0,0 +1,41 @@
'use strict'
require('./check-versions')()
process.env.NODE_ENV = 'production'
const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')
const spinner = ora('building for production...')
spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, (err, stats) => {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
chunks: false,
chunkModules: false
}) + '\n\n')
if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}
console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
})
})

@ -0,0 +1,54 @@
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')
function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
}
const versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
}
]
if (shell.which('npm')) {
versionRequirements.push({
name: 'npm',
currentVersion: exec('npm --version'),
versionRequirement: packageConfig.engines.npm
})
}
module.exports = function () {
const warnings = []
for (let i = 0; i < versionRequirements.length; i++) {
const mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
}
}
if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (let i = 0; i < warnings.length; i++) {
const warning = warnings[i]
console.log(' ' + warning)
}
console.log()
process.exit(1)
}
}

@ -0,0 +1,102 @@
'use strict'
const path = require('path')
const config = require('../config')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const packageConfig = require('../package.json')
exports.assetsPath = function(_path) {
const assetsSubDirectory = process.env.NODE_ENV === 'production' ?
config.build.assetsSubDirectory :
config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function(options) {
options = options || {}
const cssLoader = {
loader: 'css-loader',
options: {
sourceMap: options.sourceMap
}
}
const postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap
}
}
// generate loader string to be used with extract text plugin
function generateLoaders(loader, loaderOptions) {
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
publicPath: '../../',
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
}
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function(options) {
const output = []
const loaders = exports.cssLoaders(options)
for (const extension in loaders) {
const loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
}
exports.createNotifierCallback = () => {
const notifier = require('node-notifier')
return (severity, errors) => {
if (severity !== 'error') return
const error = errors[0]
const filename = error.file && error.file.split('!').pop()
notifier.notify({
title: packageConfig.name,
message: severity + ': ' + error.name,
subtitle: filename || '',
icon: path.join(__dirname, 'logo.png')
})
}
}

@ -0,0 +1,22 @@
'use strict'
const utils = require('./utils')
const config = require('../config')
const isProduction = process.env.NODE_ENV === 'production'
const sourceMapEnabled = isProduction
? config.build.productionSourceMap
: config.dev.cssSourceMap
module.exports = {
loaders: utils.cssLoaders({
sourceMap: sourceMapEnabled,
extract: isProduction
}),
cssSourceMap: sourceMapEnabled,
cacheBusting: config.dev.cacheBusting,
transformToRequire: {
video: ['src', 'poster'],
source: 'src',
img: 'src',
image: 'xlink:href'
}
}

@ -0,0 +1,82 @@
'use strict'
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
},
node: {
// prevent webpack from injecting useless setImmediate polyfill because Vue
// source contains it (although only uses it if it's native).
setImmediate: false,
// prevent webpack from injecting mocks to Node native modules
// that does not make sense for the client
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty'
}
}

@ -0,0 +1,91 @@
'use strict'
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const path = require('path')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
const portfinder = require('portfinder')
const HOST = process.env.HOST
const PORT = process.env.PORT && Number(process.env.PORT)
const devWebpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
},
// cheap-module-eval-source-map is faster for development
devtool: config.dev.devtool,
// these devServer options should be customized in /config/index.js
devServer: {
clientLogLevel: 'warning',
historyApiFallback: {
rewrites: [
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
],
},
hot: true,
contentBase: false, // since we use CopyWebpackPlugin.
compress: true,
host: HOST || config.dev.host,
port: PORT || config.dev.port,
open: config.dev.autoOpenBrowser,
overlay: config.dev.errorOverlay ? { warnings: false, errors: true } : false,
publicPath: config.dev.assetsPublicPath,
proxy: config.dev.proxyTable,
quiet: true, // necessary for FriendlyErrorsPlugin
watchOptions: {
poll: config.dev.poll,
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': require('../config/dev.env')
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true,
favicon: './favicon.ico'
}),
// copy custom static assets
new CopyWebpackPlugin([{
from: path.resolve(__dirname, '../static'),
to: config.dev.assetsSubDirectory,
ignore: ['.*']
}])
]
})
module.exports = new Promise((resolve, reject) => {
portfinder.basePort = process.env.PORT || config.dev.port
portfinder.getPort((err, port) => {
if (err) {
reject(err)
} else {
// publish the new Port, necessary for e2e tests
process.env.PORT = port
// add port to devServer config
devWebpackConfig.devServer.port = port
// Add FriendlyErrorsPlugin
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
compilationSuccessInfo: {
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
},
onErrors: config.dev.notifyOnErrors ?
utils.createNotifierCallback() : undefined
}))
resolve(devWebpackConfig)
}
})
})

@ -0,0 +1,145 @@
'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const env = require('../config/prod.env')
const webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true,
usePostCSS: true
})
},
devtool: config.build.productionSourceMap ? config.build.devtool : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new UglifyJsPlugin({
uglifyOptions: {
compress: {
warnings: false
}
},
sourceMap: config.build.productionSourceMap,
parallel: true
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css'),
// Setting the following option to `false` will not extract CSS from codesplit chunks.
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
allChunks: true,
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: config.build.productionSourceMap
? { safe: true, map: { inline: false } }
: { safe: true }
}),
// 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: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// keep module.id stable when vendor modules does not change
new webpack.HashedModuleIdsPlugin(),
// enable scope hoisting
new webpack.optimize.ModuleConcatenationPlugin(),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks (module) {
// 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
)
}
}),
// 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',
minChunks: Infinity
}),
// This instance extracts shared chunks from code splitted chunks and bundles them
// in a separate chunk, similar to the vendor chunk
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
new webpack.optimize.CommonsChunkPlugin({
name: 'app',
async: 'vendor-async',
children: true,
minChunks: 3
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
const CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.bundleAnalyzerReport) {
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig

@ -0,0 +1,7 @@
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
})

@ -0,0 +1,77 @@
'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/api': {
target: 'http://xxx.xxx.xxx.xxx:xxx', // 你请求的第三方接口
changeOrigin: true, // 在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题
pathRewrite: { // 路径重写,
'^/api': '/api' // 替换target中的请求地址也就是说以后你在请求http://api.jisuapi.com/XXXXX这个地址的时候直接写成/api即可。
}
}
},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 9008, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: true,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
/**
* Source Maps
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: 'cheap-module-eval-source-map',
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting: true,
cssSourceMap: true
},
build: {
// Template for index.html
index: path.resolve(__dirname, '../dist/index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: './',
/**
* Source Maps
*/
productionSourceMap: true,
// https://webpack.js.org/configuration/devtool/#production
devtool: '#source-map',
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
}
}

@ -0,0 +1,4 @@
'use strict'
module.exports = {
NODE_ENV: '"production"'
}

@ -0,0 +1,48 @@
{
"editor.tabSize": 2,
"files.associations": {
"*.vue": "vue"
},
"eslint.autoFixOnSave": true,
"eslint.options": {
"extensions": [
".js",
".vue"
]
},
"eslint.validate": [
"javascript",
"javascriptreact",
"vue",
"vue-html"
],
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/dist": true
},
"emmet.syntaxProfiles": {
"javascript": "jsx",
"vue": "html",
"vue-html": "html"
},
"git.confirmSync": false,
"window.zoomLevel": 0,
"vsicons.projectDetection.autoReload": true,
"typescript.check.tscVersion": false,
"editor.renderWhitespace": "boundary",
"editor.cursorBlinking": "smooth",
"workbench.colorTheme": "Solarized Light",
"workbench.iconTheme": "vscode-great-icons",
"editor.minimap.enabled": true,
"editor.minimap.renderCharacters": false,
"tslint.autoFixOnSave": true,
"editor.fontFamily": "'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
"beautify.tabSize": 2,
"window.title": "${dirty}${activeEditorMedium}${separator}${rootName}",
"typescript.extension.sortImports.maxNamedImportsInSingleLine": 5,
"typescript.extension.sortImports.omitSemicolon": true,
"editor.codeLens": true,
"editor.snippetSuggestions": "top",
"react-native-storybooks.port": 6006
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<!-- 页面增加icon图标 -->
<link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" rel="external nofollow" />
<title>后端管理平台</title>
</head>
<body>
<!-- built files will be auto injected -->
<div id="app"></div>
</body>
</html>

12158
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,69 @@
{
"name": "vue-ele-project",
"version": "1.0.0",
"description": "vue-ele-project",
"author": "lidonghui",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"serve": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js"
},
"dependencies": {
"echarts": "^4.2.0-rc.2",
"element-ui": "^2.3.2",
"http-proxy-middleware": "^0.18.0",
"js-md5": "^0.7.3",
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"axios": "^0.18.0",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}

@ -0,0 +1,12 @@
<!DOCTYPE html><html><head><meta charset=utf-8>
<meta name=viewport content="width=device-width,initial-scale=1">
<link rel="shortcut icon" type=image/x-icon href=./favicon.ico rel="external nofollow">
<title>后端管理平台</title><link href=./static/css/app.f7de60d9ec9c07c112d0b94c59208a0e.css rel=stylesheet>
</head>
<body>
<div id=app></div>
<script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script>
<script type=text/javascript src=./static/js/vendor.e37fbe972401a2962be8.js></script>
<script type=text/javascript src=./static/js/app.656e0752769862c0c376.js></script>
</body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 79 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,2 @@
!function(r){var n=window.webpackJsonp;window.webpackJsonp=function(e,u,c){for(var f,i,p,a=0,l=[];a<e.length;a++)i=e[a],o[i]&&l.push(o[i][0]),o[i]=0;for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(r[f]=u[f]);for(n&&n(e,u,c);l.length;)l.shift()();if(c)for(a=0;a<c.length;a++)p=t(t.s=c[a]);return p};var e={},o={2:0};function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=r,t.c=e,t.d=function(r,n,e){t.o(r,n)||Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:e})},t.n=function(r){var n=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(n,"a",n),n},t.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)},t.p="./",t.oe=function(r){throw console.error(r),r}}([]);
//# sourceMappingURL=manifest.3ad1d5771e9b13dbdad2.js.map

@ -0,0 +1 @@
{"version":3,"sources":["webpack:///webpack/bootstrap 2339051ff345deb5e9a9"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,KAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.3ad1d5771e9b13dbdad2.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 2339051ff345deb5e9a9"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,30 @@
<template>
<div id="app">
<router-view/>
</div>
</template>
<script>
export default {
name: "App"
};
</script>
<style>
html,
body {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 0px;
margin: 0px;
}
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
widows: 100%;
height: 100%;
}
</style>

@ -0,0 +1,58 @@
import axios from 'axios';
// 登录请求方法
const loginreq = (method, url, params) => {
return axios({
method: method,
url: url,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
data: params,
traditional: true,
transformRequest: [
function(data) {
let ret = ''
for (let it in data) {
ret +=
encodeURIComponent(it) +
'=' +
encodeURIComponent(data[it]) +
'&'
}
return ret
}
]
}).then(res => res.data);
};
// 通用公用方法
const req = (method, url, params) => {
return axios({
method: method,
url: 'http://localhost:9011'+url,
headers: {
'Access-Control-Allow-Origin':'*',
'Content-Type':'application/json;charset=UTF-8'
},
data: params,
traditional: true,
// transformRequest: [
// function(data) {
// let ret = ''
// for (let it in data) {
// ret +=
// encodeURIComponent(it) +
// '=' +
// encodeURIComponent(data[it]) +
// '&'
// }
// return ret
// }
// ]
}).then(res => res.data);
};
export {
loginreq,
req
}

@ -0,0 +1,32 @@
import axios from 'axios';
import { req } from './axiosFun';
/**
* 商品管理
**/
// 商品管理-获取商品管理列表
export const GoodsList = (params) => { return req("post", "/api/Goods/list", params) };
// 商品管理-保存商品管理
export const GoodsSave = (params) => { return req("post", "/api/Goods/save", params) };
// 商品管理-删除商品管理
export const GoodsDelete = (params) => { return axios.delete("/api/Goods/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
/**
* 机器信息管理
**/
// 机器信息管理-获取机器信息管理列表
export const MachineList = (params) => { return req("post", "/api/Machine/list", params) };
// 机器信息管理-保存机器信息管理
export const MachineSave = (params) => { return req("post", "/api/Machine/save", params) };
// 机器信息管理-删除机器信息管理
export const MachineDelete = (params) => { return axios.delete("/api/Machine/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
/**
* 货道信息管理
**/
// 货道信息管理-获取获取货道信息管理列表
export const MachineAisleList = (params) => { return req("post", "/api/MachineAisle/list", params) };
// 货道信息管理-删除货道信息管理
export const MachineAisleDelete = (params) => { return axios.delete("/api/MachineAisle/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
// 货道信息管理-保存货道信息管理
export const MachineAisleRsave = (params) => { return req("post", "/api/MachineAisle/save", params) };

@ -0,0 +1,32 @@
import axios from 'axios';
import { req } from './axiosFun';
/**
* 支付配置信息
**/
// 支付配置信息-获取支付配置信息列表
export const MachineConfigList = (params) => { return req("post", "/api/MachineConfig/list", params) };
// 支付配置信息-保存支付配置信息
export const MachineConfigSave = (params) => { return req("post", "/api/MachineConfig/save", params) };
// 支付配置信息-删除支付配置信息
export const MachineConfigDelete = (params) => { return axios.delete("/api/MachineConfig/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
/**
* 支付配置
**/
// 支付配置-获取支付配置列表
export const ConfigList = (params) => { return req("post", "/api/Config/list", params) };
// 支付配置-保存支付配置
export const ConfigSave = (params) => { return req("post", "/api/Config/save", params) };
// 支付配置-删除支付配置
export const ConfigDelete = (params) => { return axios.delete("/api/Config/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
/**
* 订单管理-交易订单
**/
// 交易订单-获取交易订单列表
export const OrderList = (params) => { return req("post", "/api/Order/list", params) };
// 交易订单-s删除交易订单
export const OrderDelete = (params) => { return axios.delete("/api/Order/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
// 交易订单-交易订单退款
export const OrderRefund = (params) => { return req("post", "/api/Order/refund", params) };

@ -0,0 +1,122 @@
import axios from 'axios';
import { loginreq, req } from './axiosFun';
// 登录接口
export const login = (params) => { return loginreq("post", "/api/login", params) };
// 获取用户菜单
export const menu = (params) => { return axios.get("/api/menu?&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
// 退出接口
export const loginout = () => { return axios.delete("/api/login?&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
/**
* 用户管理
**/
// 用户管理-获取用户列表
export const userList = (params) => { return req("post", "/api/User/list", params) };
// 用户管理-保存(添加编辑)
export const userSave = (params) => { return req("post", "/api/User/save", params) };
// 用户管理-删除用户
export const userDelete = (params) => { return req("post", "/pm2-api/app/delete" , params ) };
// 用户管理-重置密码
export const userPwd = (params) => { return req("post", "/api/User/pwd", params) };
// 用户管理-修改状态
export const userLock = (params) => { return axios.get("/api/User/lock?userId=" + params.userId + "&lock=" + params.lock + "&token=" + localStorage.getItem('logintoken')) };
// 用户管理-数据权限
export const UserDeptTree = (params) => { return axios.get("/api/UserDept/tree/" + params + "?token=" + localStorage.getItem('logintoken')) };
// 用户管理-数据权限保存
export const UserDeptSave = (params) => { return req("post", "/api/UserDept/save", params) };
// 用户管理-获取部门设置
export const UserDeptdeptTree = (params) => { return axios.get("/api/UserDept/deptTree/" + params + "?token=" + localStorage.getItem('logintoken')) };
// 用户管理-保存部门设置
export const UserChangeDept = (params) => { return req("post", "/api/User/change/dept", params) };
// 用户管理-用户下线
export const userExpireToken = (params) => { return req("get", "/api/User/expireToken/" + params, {}) };
// 用户管理-刷新缓存
export const userFlashCache = (params) => { return req("get", "/api/User/flashCache/" + params, {}) };
/**
* app管理
**/
// app管理-获取app列表
export const selectApp = (params) => { return req("post", "/pm2-api/app/select", params) };
// app管理-保存(添加编辑)
export const saveApp = (params) => { return req("post", "/pm2-api/app/installOrUpdateApp", params) };
// app管理-删除app
export const deleteApp = (params) => { return req("post", "/pm2-api/app/delete" , params ) };
// app管理-搜索
export const searchApp = (params) => { return req("post", "/pm2-api/app/search", params) };
/**
* 服务管理
**/
// 服务管理-启动服务
export const startServer = (params) => { return req("post", "/pm2-api/AppCenterController/start", params) };
// 服务管理-停止服务
export const stopServer = (params) => { return req("post", "/pm2-api/AppCenterController/stop", params) };
// 服务管理-重启服务
export const restartServer = (params) => { return req("post", "/pm2-api/AppCenterController/restart" , params ) };
/**
* 菜单管理
**/
// 菜单管理-获取菜单Module/list
export const ModuleList = () => { return req("post", "/api/Module/list") };
// 菜单管理-根据菜单获取数据
export const ModuleGet = (params) => { return axios.get("/api/Module/get/" + params + "?token=" + localStorage.getItem('logintoken')) };
// 菜单管理-获取父级菜单Module/nodes
export const ModuleNodes = (params) => { return req("post", "/api/Module/nodes", params) };
// 菜单管理-修改菜单
export const ModuleSave = (params) => { return req("post", "/api/Module/save", params) };
// 菜单管理-删除菜单
export const ModuleDelete = (params) => { return axios.delete("/api/Module/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
/**
* 角色管理
**/
// 角色管理-获取角色列表
export const roleList = (params) => { return req("post", "/api/Role/list", params) };
// 角色管理-保存(添加编辑)
export const roleSave = (params) => { return req("post", "/api/Role/save", params) };
// 角色管理-删除角色
export const roleDelete = (params) => { return axios.delete("/api/Role/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
// 角色管理-菜单权限(获取)
export const RoleRightTree = (params) => { return axios.get("/api/RoleRight/tree/" + params + "?token=" + localStorage.getItem('logintoken')) };
// 角色管理-菜单权限(保存)
export const RoleRightSave = (params) => { return req("post", "/api/RoleRight/save", params) };
/**
* 公司管理
**/
// 公司管理-获取公司列表
export const deptList = (params) => { return req("post", "/api/Dept/list", params) };
// 公司管理-保存(添加编辑)
export const deptSave = (params) => { return req("post", "/api/Dept/save", params) };
// 公司管理-删除公司
export const deptDelete = (params) => { return axios.get("/api/Dept/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
/**
* 系统环境变量
**/
// 系统环境变量-获取系统环境变量列表
export const variableList = (params) => { return req("post", "/api/Variable/list", params) };
// 系统环境变量-保存(添加编辑)
export const variableSave = (params) => { return req("post", "/api/Variable/save", params) };
// 系统环境变量-删除系统环境变量
export const variableDelete = (params) => { return axios.delete("/api/Variable/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
/**
* 权限管理
**/
// 权限管理-获取权限列表
export const permissionList = (params) => { return req("post", "/api/Permission/list", params) };
// 权限管理-保存权限
export const ermissionSave = (params) => { return req("post", "/api/Permission/save", params) };
// 权限管理-删除权限
export const ermissionDelete = (params) => { return axios.delete("/api/Permission/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
// 权限管理-获取权限
export const roleDropDown = () => { return axios.get("/api/Role/dropDown/all?&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
// 权限管理-配置权限
export const RolePermission = (params) => { return req("post", "/api/RolePermission/save", params) };

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

@ -0,0 +1,48 @@
/**
* 分页组件
*/
<template>
<el-pagination class="page-box" @size-change="handleSizeChange" @current-change="handleCurrentChange" background :current-page="childMsg.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="childMsg.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="childMsg.total">
</el-pagination>
</template>
<script>
export default {
name: 'Pagination',
props: ['childMsg'],
data() {
return {
pageparm: {
currentPage: this.childMsg.currentPage,
pageSize: this.childMsg.pageSize
}
}
},
created() {},
methods: {
handleSizeChange(val) {
/**
* 子传父
* 参数1 父元素方法
* 参数2 数据
*/
this.pageparm.pageSize = val
this.$emit('callFather', this.pageparm)
},
handleCurrentChange(val) {
/**
* 子传父
* 参数1 父元素方法
* 参数2 数据
*/
this.pageparm.currentPage = val
this.$emit('callFather', this.pageparm)
}
}
}
</script>
<style>
.page-box {
margin: 10px auto;
}
</style>

@ -0,0 +1,26 @@
/**
* 404
*/
<template>
<div class="page-404">
<h1>404!</h1>
<h2>Sorry, page not found</h2>
</div>
</template>
<style scoped>
.page-404 {
text-align: center;
}
.page-404 h1 {
font-size: 98px;
font-weight: 700;
line-height: 150px;
text-shadow: rgba(61, 61, 61, 0.3) 1px 1px, rgba(61, 61, 61, 0.2) 2px 2px,
rgba(61, 61, 61, 0.3) 3px 3px;
}
.page-404 h2 {
line-height: 30px;
font-size: 30px;
}
</style>

@ -0,0 +1,227 @@
/**
* 左边菜单
*/
<template>
<el-menu default-active="2" :collapse="collapsed" collapse-transition router :default-active="$route.path" unique-opened class="el-menu-vertical-demo" background-color="#334157" text-color="#fff" active-text-color="#ffd04b">
<div class="logobox">
<img class="logoimg" src="../assets/img/logo.png" alt="">
</div>
<el-submenu v-for="menu in allmenu" :key="menu.menuid" :index="menu.menuname">
<template slot="title">
<i class="iconfont" :class="menu.icon"></i>
<span>{{menu.menuname}}</span>
</template>
<el-menu-item-group>
<el-menu-item v-for="chmenu in menu.menus" :index="'/'+chmenu.url" :key="chmenu.menuid">
<i class="iconfont" :class="chmenu.icon"></i>
<span>{{chmenu.menuname}}</span>
</el-menu-item>
</el-menu-item-group>
</el-submenu>
</el-menu>
</template>
<script>
import { menu } from '../api/userMG'
export default {
name: 'leftnav',
data() {
return {
collapsed: false,
allmenu: []
}
},
// ()
created() {
//
let res = {
success: true,
data: [
{
menuid: 1,
icon: 'li-icon-xiangmuguanli',
menuname: '基础管理',
hasThird: null,
url: null,
menus: [
{
menuid: 2,
icon: 'icon-cat-skuQuery',
menuname: '服务管理',
hasThird: 'N',
url: 'system/user',
menus: null
}
]
// },
// {
// menuid: 33,
// icon: 'li-icon-dingdanguanli',
// menuname: '',
// hasThird: null,
// url: null,
// menus: [
// {
// menuid: 34,
// icon: 'icon-order-manage',
// menuname: '',
// hasThird: 'N',
// url: 'pay/Order',
// menus: null
// }
// ]
// },
// {
// menuid: 71,
// icon: 'li-icon-xitongguanli',
// menuname: '',
// hasThird: null,
// url: null,
// menus: [
// {
// menuid: 72,
// icon: 'icon-cus-manage',
// menuname: '',
// hasThird: 'N',
// url: 'system/user',
// menus: null
// },
// {
// menuid: 174,
// icon: 'icon-cms-manage',
// menuname: '',
// hasThird: 'N',
// url: 'system/Module',
// menus: null
// },
// {
// menuid: 73,
// icon: 'icon-news-manage',
// menuname: '',
// hasThird: 'N',
// url: 'system/Role',
// menus: null
// },
// {
// menuid: 74,
// icon: 'icon-cs-manage',
// menuname: '',
// hasThird: 'N',
// url: 'system/Dept',
// menus: null
// },
// {
// menuid: 75,
// icon: 'icon-promotion-manage',
// menuname: '',
// hasThird: 'N',
// url: 'system/Variable',
// menus: null
// },
// {
// menuid: 76,
// icon: 'icon-cms-manage',
// menuname: '',
// hasThird: 'N',
// url: 'system/Permission',
// menus: null
// }
// ]
// },
// {
// menuid: 128,
// icon: 'li-icon-shangchengxitongtubiaozitihuayuanwenjian91',
// menuname: '',
// hasThird: null,
// url: null,
// menus: [
// {
// menuid: 129,
// icon: 'icon-provider-manage',
// menuname: '',
// hasThird: 'N',
// url: 'machine/MachineConfig',
// menus: null
// },
// {
// menuid: 175,
// icon: 'icon-provider-manage',
// menuname: '',
// hasThird: 'N',
// url: 'pay/Config',
// menus: null
// }
// ]
// },
// {
// menuid: 150,
// icon: 'li-icon-shangchengxitongtubiaozitihuayuanwenjian91',
// menuname: '',
// hasThird: null,
// url: null,
// menus: [
// {
// menuid: 159,
// icon: 'icon-provider-manage',
// menuname: '',
// hasThird: 'N',
// url: 'charts/statistics',
// menus: null
// }
// ]
// }
}
],
msg: 'success'
}
this.allmenu = res.data
// menu(localStorage.getItem('logintoken'))
// .then(res => {
// console.log(JSON.stringify(res))
// if (res.success) {
// this.allmenu = res.data
// } else {
// this.$message.error(res.msg)
// return false
// }
// })
// .catch(err => {
// this.$message.error('')
// })
//
this.$root.Bus.$on('toggle', value => {
this.collapsed = !value
})
}
}
</script>
<style>
.el-menu-vertical-demo:not(.el-menu--collapse) {
width: 240px;
min-height: 400px;
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
border: none;
text-align: left;
}
.el-menu-item-group__title {
padding: 0px;
}
.el-menu-bg {
background-color: #1f2d3d !important;
}
.el-menu {
border: none;
}
.logobox {
height: 40px;
line-height: 40px;
color: #9d9d9d;
font-size: 20px;
text-align: center;
padding: 20px 0px;
}
.logoimg {
height: 40px;
}
</style>

@ -0,0 +1,113 @@
/**
* 头部菜单
*/
<template>
<el-menu class="el-menu-demo" mode="horizontal" background-color="#334157" text-color="#fff" active-text-color="#fff">
<el-button class="buttonimg">
<img class="showimg" :src="collapsed?imgsq:imgshow" @click="toggle(collapsed)">
</el-button>
<el-submenu index="2" class="submenu">
<!-- <template slot="title">{{user.userRealName}}</template> -->
<template slot="title">超级管理员</template>
<el-menu-item index="2-1">设置</el-menu-item>
<el-menu-item @click="content()" index="2-2">个人中心</el-menu-item>
<el-menu-item @click="exit()" index="2-3">退出</el-menu-item>
</el-submenu>
</el-menu>
</template>
<script>
import { loginout } from '../api/userMG'
export default {
name: 'navcon',
data() {
return {
collapsed: true,
imgshow: require('../assets/img/show.png'),
imgsq: require('../assets/img/sq.png'),
user: {}
}
},
// ()
created() {
this.user = JSON.parse(localStorage.getItem('userdata'))
},
methods: {
// 退
exit() {
this.$confirm('退出登录, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
setTimeout(() => {
this.$store.commit('logout', 'false')
this.$router.push({ path: '/login' })
this.$message({
type: 'success',
message: '已退出登录!'
})
}, 1000)
// loginout()
// .then(res => {
// if (res.success) {
// //2
// setTimeout(() => {
// this.$store.commit('logout', 'false')
// this.$router.push({ path: '/login' })
// this.$message({
// type: 'success',
// message: '退!'
// })
// }, 1000)
// } else {
// this.$message.error(res.msg)
// this.logining = false
// return false
// }
// })
// .catch(err => {
// //
// this.getcode()
// this.logining = false
// this.$message.error('退')
// })
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
})
},
//
toggle(showtype) {
this.collapsed = !showtype
this.$root.Bus.$emit('toggle', this.collapsed)
}
}
}
</script>
<style scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) {
border: none;
}
.submenu {
float: right;
}
.buttonimg {
height: 60px;
background-color: transparent;
border: none;
}
.showimg {
width: 26px;
height: 26px;
position: absolute;
top: 17px;
left: 17px;
}
.showimg:active {
border: none;
}
</style>

@ -0,0 +1,58 @@
/**
* 模版
**/
<template>
<div>
</div>
</template>
<script>
//
import headerComponent from "./head.vue";
//
export default {
//
name: "template",
//
data() {
//
return {};
},
//
components: {
headerComponent
},
//
watch: {},
//
methods: {
addFun() {},
submitFun() {}
},
// ()
beforeCreate() {},
// ()
created() {},
// ()
beforeMount() {},
// ()
mounted() {},
// ()
beforeUpdate() {},
// ()
updated() {},
// ()
beforeDestroy() {},
// ()
destroyed() {}
};
</script>
// scoped 使
<style scoped>
/**
* 导入css样式组件
* @import "../assets/css/components/index.css";
*/
</style>

@ -0,0 +1,83 @@
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
// 引入element UI
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App';
// 引入路由
import router from './router';
// 引入状态管理
import store from './vuex/store';
// 引入icon
import './assets/icon/iconfont.css'
//
// 引入echarts
import echarts from 'echarts'
Vue.prototype.$echarts = echarts
import axios from 'axios';
Vue.prototype.$axios = axios;
Vue.config.productionTip = false;
// 使用element UI
Vue.use(ElementUI);
// 过滤器
import * as custom from './utils/util'
Object.keys(custom).forEach(key => {
Vue.filter(key, custom[key])
})
// 路由拦截器
router.beforeEach((to, from, next) => {
// if (to.matched.length != 0) {
// if (to.meta.requireAuth) { // 判断该路由是否需要登录权限
// next();
// // if (Boolean(localStorage.getItem("userInfo"))) { // 通过vuex state获取当前的user是否存在
// // next();
// // } else {
// // next({
// // path: '/login',
// // query: { redirect: to.fullPath } // 将跳转的路由path作为参数登录成功后跳转到该路由
// // })
// // }
// } else {
// if (Boolean(localStorage.getItem("userInfo"))) { // 判断是否登录
// if (to.path != "/" && to.path != "/login") { //判断是否要跳到登录界面
// next();
// } else {
// /**
// * 防刷新,如果登录,修改路由跳转到登录页面,修改路由为登录后的首页
// */
// }
// } else {
// next();
// }
// }
// } else {
// next({
// path: '/login',
// query: { redirect: to.fullPath } // 将跳转的路由path作为参数登录成功后跳转到该路由
// })
// }
next()
})
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store, //使用store vuex状态管理
components: { App },
template: '<App/>',
data: {
// 空的实例放到根组件下,所有的子组件都能调用
Bus: new Vue()
}
})

@ -0,0 +1,45 @@
// 导入组件
import Router from 'vue-router';
import Vue from 'vue';
// 首页
import index from '@/views/index';
/**
* 系统管理
*/
// 用户管理
import user from '@/views/system/user';
// 启用路由
Vue.use(Router);
// 导出路由
export default new Router({
routes: [ {
path: '/',
name: '',
component: user,
redirect:"/system/user",
hidden: true,
meta: {
requireAuth: false
}
}, {
path: '/index',
name: '首页',
component: index,
iconCls: 'el-icon-tickets',
children: [{
path: '/system/user',
name: '服务管理',
component: user,
meta: {
requireAuth: true
}
}
]
}]
})

@ -0,0 +1,90 @@
/**
* 时间戳
* @param {*} timestamp 时间戳
*/
const timestampToTime = (timestamp) => {
let date = new Date(timestamp) //时间戳为10位需*1000时间戳为13位的话不需乘1000
let Y = date.getFullYear() + '-'
let M =
(date.getMonth() + 1 < 10 ?
'0' + (date.getMonth() + 1) :
date.getMonth() + 1) + '-'
let D =
(date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' '
let h =
(date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
let m =
(date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) +
':'
let s =
date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
return Y + M + D + h + m + s
};
/**
* 存储localStorage
*/
const setStore = (name, content) => {
if (!name) return;
if (typeof content !== 'string') {
content = JSON.stringify(content);
}
window.localStorage.setItem(name, content);
}
/**
* 获取localStorage
*/
const getStore = name => {
if (!name) return;
return window.localStorage.getItem(name);
}
/**
* 删除localStorage
*/
const removeStore = name => {
if (!name) return;
window.localStorage.removeItem(name);
}
/**
* 设置cookie
**/
function setCookie(name, value, day) {
let date = new Date();
date.setDate(date.getDate() + day);
document.cookie = name + '=' + value + ';expires=' + date;
};
/**
* 获取cookie
**/
function getCookie(name) {
let reg = RegExp(name + '=([^;]+)');
let arr = document.cookie.match(reg);
if (arr) {
return arr[1];
} else {
return '';
}
};
/**
* 删除cookie
**/
function delCookie(name) {
setCookie(name, null, -1);
};
/**
* 导出
**/
export {
timestampToTime,
setStore,
getStore,
removeStore,
setCookie,
getCookie,
delCookie
}

@ -0,0 +1,82 @@
<template>
<el-container class="index-con">
<el-aside :class="showclass">
<leftnav></leftnav>
</el-aside>
<el-container class="main-con">
<el-header class="index-header">
<navcon></navcon>
</el-header>
<el-main clss="index-main">
<router-view></router-view>
</el-main>
</el-container>
</el-container>
</template>
<script>
//
import navcon from '../components/navcon.vue'
import leftnav from '../components/leftnav.vue'
export default {
name: 'index',
data() {
return {
showclass: 'asideshow',
showtype: false
}
},
//
components: {
navcon,
leftnav
},
methods: {},
created() {
//
this.$root.Bus.$on('toggle', value => {
if (value) {
this.showclass = 'asideshow'
} else {
setTimeout(() => {
this.showclass = 'aside'
}, 300)
}
})
},
beforeUpdate() {},
// ()
beforeMount() {
//
this.$message({
message: '登录成功',
type: 'success'
})
}
}
</script>
<style >
.index-con {
height: 100%;
width: 100%;
box-sizing: border-box;
}
.aside {
width: 64px !important;
height: 100%;
background-color: #334157;
margin: 0px;
}
.asideshow {
width: 240px !important;
height: 100%;
background-color: #334157;
margin: 0px;
}
.index-header,
.index-main {
padding: 0px;
border-left: 2px solid #333;
}
</style>

File diff suppressed because one or more lines are too long

@ -0,0 +1,727 @@
/**
* 系统管理 用户管理
*/
<template>
<div>
<!-- 面包屑导航 -->
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>服务管理</el-breadcrumb-item>
</el-breadcrumb>
<!-- 搜索筛选 -->
<el-form :inline="true" :model="formInline" class="user-search">
<el-form-item label="搜索:">
<el-select size="small" v-model="formInline.onOff" placeholder="请选择">
<el-option label="全部" value=""></el-option>
<el-option label="运行中" value='true'></el-option>
<el-option label="未运行" value='false'></el-option>
</el-select>
</el-form-item>
<el-form-item label="">
<el-input size="small" v-model="formInline.name" placeholder="输入服务名"></el-input>
</el-form-item>
<!-- <el-form-item label="">
<el-input size="small" v-model="formInline.userMobile" placeholder="输入手机号"></el-input>
</el-form-item> -->
<el-form-item>
<el-button size="small" type="primary" icon="el-icon-search" @click="selectAppData"></el-button>
<el-button size="small" type="primary" icon="el-icon-plus" @click="handleEdit()"></el-button>
<el-button size="small" type="primary" @click="searchServers()"></el-button>
</el-form-item>
</el-form>
<!--列表-->
<el-table size="small" @selection-change="selectChange" :data="userData" highlight-current-row v-loading="loading" border element-loading-text="拼命加载中" style="width: 100%;">
<el-table-column align="center" type="selection" width="50">
</el-table-column>
<el-table-column align="center" sortable prop="script" label="脚本" width="100">
</el-table-column>
<el-table-column align="center" sortable prop="name" label="服务名" width="200">
</el-table-column>
<el-table-column align="center" sortable prop="onOff" label="状态" width="100">
<template slot-scope="scope">
<span v-show="!scope.row.iseditor">{{scope.row.onOff ? '':''}}</span>
</template>
</el-table-column>
<el-table-column align="center" sortable prop="pid" label="pid" width="120">
</el-table-column>
<el-table-column align="center" sortable prop="ram" label="内存使用" width="120">
</el-table-column>
<el-table-column align="center" sortable prop="startTime" label="启动时间" min-width="110">
</el-table-column>
<!-- <el-table-column align="center" sortable prop="editTime" label="修改时间" min-width="100">
<template slot-scope="scope">
<div>{{scope.row.editTime|timestampToTime}}</div>
</template>
</el-table-column> -->
<el-table-column align="center" sortable prop="onOff" label="状态" min-width="50">
<template slot-scope="scope">
<el-switch v-model="scope.row.onOff?nshow:fshow" active-color="#13ce66" inactive-color="#ff4949" @change="editType(scope.$index, scope.row)">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" min-width="230">
<template slot-scope="scope">
<el-button size="mini" @click="handleEdit(scope.$index, scope.row)">修改</el-button>
<el-button size="mini" type="danger" @click="deleteServe(scope.$index, scope.row)">删除</el-button>
<el-button size="mini" type="danger" @click="removeServe(scope.$index, scope.row)">去除</el-button>
<el-button size="mini" type="success" @click="start(scope.$index, scope.row)">启动</el-button>
<el-button size="mini" type="success" @click="restart(scope.$index, scope.row)">重启</el-button>
<el-button size="mini" type="success" @click="stop(scope.$index, scope.row)">停止</el-button>
<el-button size="mini" type="success" @click="getLog(scope.$index, scope.row)">查看log</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件
<Pagination v-bind:child-msg="pageparm" @callFather="callFather"></Pagination> -->
<!-- 编辑界面 -->
<el-dialog :title="title" :visible.sync="editFormVisible" width="30%" @click='closeDialog("edit")'>
<el-form label-width="80px" ref="editForm" :model="editForm" :rules="rules">
<el-form-item label="path" prop="path">
<el-input size="small" v-model="editForm.path" auto-complete="off" placeholder="请输入路径"></el-input>
</el-form-item>
<el-form-item label="参数" prop="args">
<el-input size="small" v-model="editForm.argsString" auto-complete="off" placeholder="请输入参数逗号隔开"></el-input>
</el-form-item>
<el-form-item label="服务名" prop="name">
<el-input size="small" v-model="editForm.name" auto-complete="off" placeholder="请输入服务名"></el-input>
</el-form-item>
<el-form-item label="脚本" prop="script">
<el-input size="small" v-model="editForm.script" auto-complete="off" placeholder="请输入脚本"></el-input>
</el-form-item>
<el-form-item label="端口号" prop="port">
<el-input size="small" v-model="editForm.port" auto-complete="off" placeholder="请输入端口号"></el-input>
</el-form-item>
<el-form-item label="自启动" prop="enable">
<el-switch v-model="editForm.enable"></el-switch>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click='closeDialog("edit")'>取消</el-button>
<el-button size="small" type="primary" :loading="loading" class="title" @click="submitForm('editForm')"></el-button>
</div>
</el-dialog>
</div>
</template>
<script>
//
import {
selectApp,
saveApp,
deleteApp,
searchApp,
startServer,
stopServer,
restartServer,
userSave,
userDelete,
userPwd,
userExpireToken,
userFlashCache,
userLock,
UserDeptTree,
UserDeptSave,
UserDeptdeptTree,
UserChangeDept
} from '../../api/userMG'
import Pagination from '../../components/Pagination'
export default {
data() {
return {
nshow: true, //switch
fshow: false, //switch
loading: false, //
title: '添加用户',
editFormVisible: false, //
dataAccessshow: false, //
unitAccessshow: false, //
//
editForm: {
path: '',
argsString: '',
name: '',
script: '',
port: '',
enable: false
},
//
unitparm: {
userIds: '',
deptId: '',
deptName: ''
},
//
selectdata: [],
// rules
rules: {
},
//
seletedata: {
ids: '',
token: localStorage.getItem('logintoken')
},
//
resetpsd: {
userId: '',
token: localStorage.getItem('logintoken')
},
// 线
offline: {
token: localStorage.getItem('logintoken')
},
//
formInline: {
onOff:"",
name:""
},
//
userData: [],
//
UserDept: [],
defaultProps: {
children: 'children',
label: 'name'
},
//
checkmenu: [],
//role
saveroleId: '',
//
pageparm: {
currentPage: 1,
pageSize: 10,
total: 10
}
}
},
//
components: {
Pagination
},
/**
* 数据发生改变
*/
watch: {},
/**
* 创建完毕
*/
created() {
this.getdata(this.formInline)
},
/**
* 里面的方法只有被调用才会执行
*/
methods: {
//
getdata(parameter) {
this.loading = true
//
let res = {
code: 0,
msg: null,
count: 12,
data: [
// {
// addUser: null,
// editUser: null,
// addTime: 1526452756000,
// editTime: 1527128981000,
// userId: 62,
// systemNo: null,
// userName: '211111111',
// userPassword: 'e10adc3949ba59abbe56e057f20f883e',
// userRealName: '21111111111',
// userSex: '',
// userMobile: '13601478451',
// userEmail: '222222@qq.com',
// isLock: 'N',
// deptId: 17,
// deptName: 'v',
// roleId: 2
// }
]
}
this.loading = false
this.userData = res.data
// //
// this.pageparm.currentPage = this.formInline.page
// this.pageparm.pageSize = this.formInline.limit
// this.pageparm.total = res.count
//
/***
* 调用接口注释上面模拟数据 取消下面注释
*/
//
selectApp(parameter).then(res => {
this.loading = false
if (res.success == false) {
this.$message({
type: 'info',
message: res.msg
})
} else {
this.userData = res.data
}
})
},
//
searchServers() {
searchApp(this.formInline).then(res => {
this.loading = false
if (res.success == false) {
this.$message({
type: 'info',
message: res.msg
})
} else {
this.userData = res.data
}
})
},
//
selectAppData() {
selectApp(this.formInline).then(res =>{
this.userData = res.data
})
},
//
updateOrInstall(index, row) {
saveApp(row).then(res =>{
this.userData = res.data
})
},
// type
editType(index, row) {
this.loading = true
let parm = {
lock: '',
userId: '',
token: localStorage.getItem('logintoken')
}
parm.userId = row.userId
let lock = row.onOff
if (lock ) {
this.stop(index,row).then(res => {this.getdata(row)})
} else {
this.start(index,row).then(res => {
console.log("1111");
this.getdata(row)})
}
},
//
handleEdit: function(index, row) {
this.editFormVisible = true
if (row != undefined && row != 'undefined') {
this.title = '修改'
this.editForm.path= row.path
this.editForm.argsString= row.argsString
this.editForm.name= row.name
this.editForm.script= row.script
this.editForm.port= row.port
this.editForm.enable= row.enable
} else {
this.title = '添加'
this.editForm.path= ''
this.editForm.argsString= ''
this.editForm.name= ''
this.editForm.script= ''
this.editForm.port= ''
this.editForm.enable= false
}
},
// //
submitForm(editData) {
console.log(this.editForm);
saveApp(this.editForm).then(res => {
this.$message.info('保存!')
})
.catch(err => {
this.loading = false
this.$message.error('保存失败!')
})
},
//
handleunit: function(index, row) {
this.unitAccessshow = true
let parms = 0
UserDeptdeptTree(parms)
.then(res => {
if (res.data.success) {
this.UserDept = this.changeArr(res.data.data)
} else {
this.$message({
type: 'info',
message: res.msg
})
}
})
.catch(err => {
this.loading = false
this.$message.error('配置权限失败,请稍后再试!')
})
},
handleClick(data, checked, node) {
if (checked) {
this.$refs.tree.setCheckedNodes([])
this.$refs.tree.setCheckedNodes([data])
this.unitparm.deptId = data.id
this.unitparm.deptName = data.name
//
} else {
}
},
//
selectChange(val) {
this.selectdata = val
},
//
closeDialog(dialog) {
if (dialog == 'edit') {
this.editFormVisible = false
} else if (dialog == 'perm') {
this.dataAccessshow = false
} else if (dialog == 'unit') {
this.unitAccessshow = false
}
},
//
deleteServe(index, row) {
this.$confirm('确定要删除服务及其记录吗?', '信息', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
row.permanentlyDelete = true
//
userDelete(row)
.then(res => {
if (res.success) {
this.$message({
type: 'success',
message: '数据已删除!'
})
this.getdata(this.formInline)
} else {
this.$message({
type: 'info',
message: res.msg
})
}
})
.catch(err => {
this.loading = false
this.$message.error('数据删除失败,请稍后再试!')
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除!'
})
})
},
//
removeServe(index, row) {
this.$confirm('确定要去除服务吗?,可以通过搜索服务重新找回记录', '信息', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
row.permanentlyDelete = false
//
userDelete(row)
.then(res => {
if (res.success) {
this.$message({
type: 'success',
message: '数据已删除!'
})
this.getdata(this.formInline)
} else {
this.$message({
type: 'info',
message: res.msg
})
}
})
.catch(err => {
this.loading = false
this.$message.error('数据删除失败,请稍后再试!')
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除!'
})
})
},
//
start(index, row) {
startServer(row)
.then(res => {
if (res.message == "SUCCESS") {
this.$message({
type: 'success',
message: '启动服务成功'
})
this.selectAppData()
} else {
this.$message({
type: 'info',
message: res.msg
})
}
})
.catch(err => {
this.loading = false
this.$message.error('启动服务失败')
})
},
//
stop(index, row) {
stopServer(row)
.then(res => {
if (res.message == "SUCCESS") {
this.$message({
type: 'success',
message: '启动服务成功'
})
this.selectAppData()
} else {
this.$message({
type: 'info',
message: res.msg
})
}
})
.catch(err => {
this.loading = false
this.$message.error('启动服务失败')
})
},
//
restart(index, row) {
restartServer(row)
.then(res => {
if (res.message == "SUCCESS") {
this.$message({
type: 'success',
message: '启动服务成功'
})
this.getdata(this.formInline)
} else {
this.$message({
type: 'info',
message: res.msg
})
}
})
.catch(err => {
this.loading = false
this.$message.error('启动服务失败')
})
},
//
dataAccess: function(index, row) {
this.dataAccessshow = true
this.saveroleId = row.userId
UserDeptTree(row.userId)
.then(res => {
if (res.data.success) {
this.checkmenu = this.changemenu(res.data.data)
this.UserDept = this.changeArr(res.data.data)
} else {
this.$message({
type: 'info',
message: res.data.msg
})
}
})
.catch(err => {
this.loading = false
this.$message.error('获取权限失败,请稍后再试!')
})
},
//
changeArr(data) {
var pos = {}
var tree = []
var i = 0
while (data.length != 0) {
if (data[i].pId == 0) {
tree.push({
id: data[i].id,
name: data[i].name,
pId: data[i].pId,
open: data[i].open,
checked: data[i].checked,
children: []
})
pos[data[i].id] = [tree.length - 1]
data.splice(i, 1)
i--
} else {
var posArr = pos[data[i].pId]
if (posArr != undefined) {
var obj = tree[posArr[0]]
for (var j = 1; j < posArr.length; j++) {
obj = obj.children[posArr[j]]
}
obj.children.push({
id: data[i].id,
name: data[i].name,
pId: data[i].pId,
open: data[i].open,
checked: data[i].checked,
children: []
})
pos[data[i].id] = posArr.concat([obj.children.length - 1])
data.splice(i, 1)
i--
}
}
i++
if (i > data.length - 1) {
i = 0
}
}
return tree
},
//
changemenu(arr) {
let change = []
for (let i = 0; i < arr.length; i++) {
if (arr[i].checked) {
change.push(arr[i].id)
}
}
return change
},
// -
menuPermSave() {
let parm = {
userId: this.saveroleId,
deptIds: ''
}
let node = this.$refs.tree.getCheckedNodes()
let moduleIds = []
if (node.length != 0) {
for (let i = 0; i < node.length; i++) {
moduleIds.push(node[i].id)
}
parm.deptIds = JSON.stringify(moduleIds)
}
UserDeptSave(parm)
.then(res => {
if (res.success) {
this.$message({
type: 'success',
message: '权限保存成功'
})
this.dataAccessshow = false
this.getdata(this.formInline)
} else {
this.$message({
type: 'info',
message: res.msg
})
}
})
.catch(err => {
this.loading = false
this.$message.error('权限保存失败,请稍后再试!')
})
},
// // 线
// offlineUser(index, row) {
// this.$confirm('' + row.userName + '线?', '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning'
// })
// .then(() => {
// userExpireToken(row.userName)
// .then(res => {
// if (res.success) {
// this.$message({
// type: 'success',
// message: '' + row.userName + '线'
// })
// this.getdata(this.formInline)
// } else {
// this.$message({
// type: 'info',
// message: res.msg
// })
// }
// })
// .catch(err => {
// this.loading = false
// this.$message.error('线')
// })
// })
// .catch(() => {
// this.$message({
// type: 'info',
// message: ''
// })
// })
// },
//
// refreshCache(index, row) {
// userFlashCache(row.userName)
// .then(res => {
// if (res.success) {
// this.$message({
// type: 'success',
// message: ''
// })
// this.getdata(this.formInline)
// } else {
// this.$message({
// type: 'info',
// message: res.msg
// })
// }
// })
// .catch(err => {
// this.loading = false
// this.$message.error('')
// })
// }
}
}
</script>
<style scoped>
.user-search {
margin-top: 20px;
}
.userRole {
width: 100%;
}
</style>

@ -0,0 +1,22 @@
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
// 登录验证
export default new Vuex.Store({
state: {
user: false
},
mutations: {
// 登录
login(state, user) {
state.user = user;
localStorage.setItem("userInfo", user);
},
// 退出
logout(state, user) {
state.user = "";
localStorage.setItem("userInfo", "");
}
}
})
Loading…
Cancel
Save