├── .babelrc ├── .editorconfig ├── .gitignore ├── .idea ├── .name ├── clouddo-view.iml ├── misc.xml ├── modules.xml └── vcs.xml ├── .postcssrc.js ├── README.md ├── build ├── build.js ├── check-versions.js ├── dev-client.js ├── dev-server.js ├── utils.js ├── vue-loader.conf.js ├── webpack.base.conf.js ├── webpack.dev.conf.js └── webpack.prod.conf.js ├── config ├── dev.env.js ├── index.js └── prod.env.js ├── dist ├── index.html └── static │ ├── css │ ├── app.7d2ea8116390210e333b8fcdc286441c.css │ └── app.7d2ea8116390210e333b8fcdc286441c.css.map │ ├── defaultCover.jpg │ ├── fonts │ ├── element-icons.6f0a763.ttf │ ├── fontawesome-webfont.674f50d.eot │ ├── fontawesome-webfont.af7ae50.woff2 │ ├── fontawesome-webfont.b06871f.ttf │ └── fontawesome-webfont.fee66e7.woff │ ├── img │ ├── fontawesome-webfont.acf3dcb.svg │ └── iconfont.5c9ad9e.svg │ ├── index_backgroud.jpg │ └── js │ ├── 0.98b04c084adca6662464.js │ ├── 0.98b04c084adca6662464.js.map │ ├── app.62aa9549640ebf351371.js │ ├── app.62aa9549640ebf351371.js.map │ ├── manifest.1bff35b46d6bf4c63ff9.js │ ├── manifest.1bff35b46d6bf4c63ff9.js.map │ ├── vendor.85f050d87ccf9607a7e8.js │ └── vendor.85f050d87ccf9607a7e8.js.map ├── index.html ├── package-lock.json ├── package.json ├── src ├── App.vue ├── api │ ├── api_file.js │ ├── api_log.js │ ├── api_menu.js │ ├── api_role.js │ ├── api_user.js │ ├── env.js │ └── index.js ├── assets │ ├── css │ │ ├── font-awesome.css │ │ └── font-awesome.min.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ ├── fontawesome-webfont.woff2 │ │ ├── iconfont.eot │ │ ├── iconfont.svg │ │ ├── iconfont.ttf │ │ └── iconfont.woff │ ├── iconfont.css │ ├── images │ │ ├── index1.jpg │ │ └── index2.jpg │ ├── logo.png │ ├── logotxt.png │ └── styles │ │ └── main.scss ├── bus.js ├── common │ └── util.js ├── components │ ├── Dashboard.vue │ ├── Home.vue │ ├── Login.vue │ ├── TreeTable │ │ ├── eval.js │ │ ├── index.vue │ │ └── readme.md │ ├── content │ │ └── blog.vue │ ├── file │ │ └── List.vue │ ├── log │ │ └── List.vue │ ├── menu │ │ └── list.vue │ ├── quill │ │ └── qeditor │ ├── role │ │ └── list.vue │ ├── user │ │ ├── changepwd.vue │ │ ├── list.vue │ │ └── profile.vue │ └── welcome │ │ ├── bootdo.vue │ │ ├── home.vue │ │ └── index.vue ├── main.js └── router │ └── index.js └── static ├── .gitkeep └── defaultCover.jpg /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { "modules": false }], 4 | "stage-2" 5 | ], 6 | "plugins": ["transform-runtime"], 7 | "comments": false, 8 | "env": { 9 | "test": { 10 | "presets": ["env", "stage-2"], 11 | "plugins": [ "istanbul" ] 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | clouddo-view -------------------------------------------------------------------------------- /.idea/clouddo-view.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | // to edit target browsers: use "browserlist" field in package.json 6 | "autoprefixer": {} 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # clouddo-view 2 | > cloudo的前端系统 3 | 4 | ## 介绍 5 | 6 | 7 | ### 说明 8 | 9 |  这是一个用vuejs2.0和element-ui 2.x搭建的后台管理界面。 10 | 11 | 12 | ### 项目结构 13 | ``` 14 | ├── build #webpack编译相关文件目录,一般不用动 15 | ├── config #配置目录 16 | │ ├────dev.env.js #开发环境变量 17 | │ ├────index.js #主配置文件 18 | │ └────prod.env.js #生产环境变量 19 | ├── dist #生产环境下build后的文件存放目录(发布目录) 20 | ├── server #服务端代码目录,提供给前端接口 21 | ├── src #前端项目源码目录 22 | │ ├───—api #封装的接口文件目录 23 | │ ├───—assets #资源目录 24 | │ ├───—common #公用文件目录 25 | │ ├───—components #组件及页面文件目录 26 | │ ├───—router #路由目录 27 | │ ├───—App.vue #项目入口文件 28 | │ ├───—bus.js #公共通信组件 29 | │ └────main.js #项目的核心文件 30 | ├── static #开发模式下的静态资源目录 31 | ├── index.html #首页入口文件,你可以添加一些 meta 信息或同统计代码啥的 32 | ├── package.json #项目配置文件 33 | └── README.md #项目的说明文档,markdown 格式 34 | ``` 35 | 36 | ### 相关技术: 37 | 38 | * vuejs2.0:一套构建用户界面的渐进式框架,易用、灵活、高效。 39 | * element-ui:一套为开发者、设计师和产品经理准备的基于 Vue 2.0 的组件库。 40 | * vue-router:官方的路由组件,配合vue.js创建单页应用(SPA)非常简单。 41 | * axios: 基于 Promise 的 HTTP 请求客户端,可同时在浏览器和 node.js 中使用。 42 | 43 | ## 项目编译和运行 44 | 45 | ``` bash 46 | 第一步: 先安装node v8.2.1环境,可以用nvm安装,支持多版本切换 47 | 48 | 49 | 第二步:下载项目 50 | 可以直接在git上下载项目源码。 51 | 或者通过git命令下载 52 | #git命令下载 53 | git clone 54 | 假定项目已经下载下来了。 55 | 56 | 第三步:启动服务端 57 | 58 | 59 | 60 | 第四步:启动前端 61 | (1)新开一个命令行窗口 62 | (2)定位到项目目录并安装依赖 63 | > cd 你自己的位置/clouddo-view 64 | > npm install 65 | (3)依赖安装成功后执行启动命令 66 | > npm run dev 67 | # 显示如下内容说明本地启动成功 68 | # DONE Compiled successfully in 7515ms 69 | # Listening at http://localhost:8081 70 | 71 | 72 | #正式环境编译命令 73 | # build for production with minification 74 | npm run build 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /build/build.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | 3 | process.env.NODE_ENV = 'production' 4 | 5 | var ora = require('ora') 6 | var rm = require('rimraf') 7 | var path = require('path') 8 | var chalk = require('chalk') 9 | var webpack = require('webpack') 10 | var config = require('../config') 11 | var webpackConfig = require('./webpack.prod.conf') 12 | 13 | var spinner = ora('building for production...') 14 | spinner.start() 15 | 16 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 17 | if (err) throw err 18 | webpack(webpackConfig, function (err, stats) { 19 | spinner.stop() 20 | if (err) throw err 21 | process.stdout.write(stats.toString({ 22 | colors: true, 23 | modules: false, 24 | children: false, 25 | chunks: false, 26 | chunkModules: false 27 | }) + '\n\n') 28 | 29 | console.log(chalk.cyan(' Build complete.\n')) 30 | console.log(chalk.yellow( 31 | ' Tip: built files are meant to be served over an HTTP server.\n' + 32 | ' Opening index.html over file:// won\'t work.\n' 33 | )) 34 | }) 35 | }) 36 | -------------------------------------------------------------------------------- /build/check-versions.js: -------------------------------------------------------------------------------- 1 | var chalk = require('chalk') 2 | var semver = require('semver') 3 | var packageConfig = require('../package.json') 4 | 5 | function exec (cmd) { 6 | return require('child_process').execSync(cmd).toString().trim() 7 | } 8 | 9 | var versionRequirements = [ 10 | { 11 | name: 'node', 12 | currentVersion: semver.clean(process.version), 13 | versionRequirement: packageConfig.engines.node 14 | }, 15 | { 16 | name: 'npm', 17 | currentVersion: exec('npm --version'), 18 | versionRequirement: packageConfig.engines.npm 19 | } 20 | ] 21 | 22 | module.exports = function () { 23 | var warnings = [] 24 | for (let i = 0; i < versionRequirements.length; i++) { 25 | var mod = versionRequirements[i] 26 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 27 | warnings.push(mod.name + ': ' + 28 | chalk.red(mod.currentVersion) + ' should be ' + 29 | chalk.green(mod.versionRequirement) 30 | ) 31 | } 32 | } 33 | 34 | if (warnings.length) { 35 | console.log('') 36 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 37 | console.log() 38 | for (let i = 0; i < warnings.length; i++) { 39 | var warning = warnings[i] 40 | console.log(' ' + warning) 41 | } 42 | console.log() 43 | process.exit(1) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /build/dev-server.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | 3 | var config = require('../config') 4 | if (!process.env.NODE_ENV) { 5 | process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV) 6 | } 7 | 8 | var opn = require('opn') 9 | var path = require('path') 10 | var express = require('express') 11 | var webpack = require('webpack') 12 | var proxyMiddleware = require('http-proxy-middleware') 13 | var webpackConfig = require('./webpack.dev.conf') 14 | 15 | // default port where dev server listens for incoming traffic 16 | var port = process.env.PORT || config.dev.port 17 | // automatically open browser, if not set will be false 18 | var autoOpenBrowser = !!config.dev.autoOpenBrowser 19 | // Define HTTP proxies to your custom API backend 20 | // https://github.com/chimurai/http-proxy-middleware 21 | var proxyTable = config.dev.proxyTable 22 | 23 | var app = express() 24 | var compiler = webpack(webpackConfig) 25 | 26 | var devMiddleware = require('webpack-dev-middleware')(compiler, { 27 | publicPath: webpackConfig.output.publicPath, 28 | quiet: true 29 | }) 30 | 31 | var hotMiddleware = require('webpack-hot-middleware')(compiler, { 32 | log: () => {} 33 | }) 34 | // force page reload when html-webpack-plugin template changes 35 | compiler.plugin('compilation', function (compilation) { 36 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { 37 | hotMiddleware.publish({ action: 'reload' }) 38 | cb() 39 | }) 40 | }) 41 | 42 | // proxy api requests 43 | Object.keys(proxyTable).forEach(function (context) { 44 | var options = proxyTable[context] 45 | if (typeof options === 'string') { 46 | options = { target: options } 47 | } 48 | app.use(proxyMiddleware(options.filter || context, options)) 49 | }) 50 | 51 | // handle fallback for HTML5 history API 52 | app.use(require('connect-history-api-fallback')()) 53 | 54 | // serve webpack bundle output 55 | app.use(devMiddleware) 56 | 57 | // enable hot-reload and state-preserving 58 | // compilation error display 59 | app.use(hotMiddleware) 60 | 61 | // serve pure static assets 62 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) 63 | app.use(staticPath, express.static('./static')) 64 | 65 | var uri = 'http://localhost:' + port 66 | 67 | var _resolve 68 | var readyPromise = new Promise(resolve => { 69 | _resolve = resolve 70 | }) 71 | 72 | console.log('> Starting dev server...') 73 | devMiddleware.waitUntilValid(() => { 74 | console.log('> Listening at ' + uri + '\n') 75 | // when env is testing, don't need open it 76 | if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') { 77 | opn(uri) 78 | } 79 | _resolve() 80 | }) 81 | 82 | var server = app.listen(port) 83 | 84 | module.exports = { 85 | ready: readyPromise, 86 | close: () => { 87 | server.close() 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /build/utils.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 4 | 5 | exports.assetsPath = function (_path) { 6 | var assetsSubDirectory = process.env.NODE_ENV === 'production' 7 | ? config.build.assetsSubDirectory 8 | : config.dev.assetsSubDirectory 9 | return path.posix.join(assetsSubDirectory, _path) 10 | } 11 | 12 | exports.cssLoaders = function (options) { 13 | options = options || {} 14 | 15 | var cssLoader = { 16 | loader: 'css-loader', 17 | options: { 18 | minimize: process.env.NODE_ENV === 'production', 19 | sourceMap: options.sourceMap 20 | } 21 | } 22 | 23 | // generate loader string to be used with extract text plugin 24 | function generateLoaders (loader, loaderOptions) { 25 | var loaders = [cssLoader] 26 | if (loader) { 27 | loaders.push({ 28 | loader: loader + '-loader', 29 | options: Object.assign({}, loaderOptions, { 30 | sourceMap: options.sourceMap 31 | }) 32 | }) 33 | } 34 | 35 | // Extract CSS when that option is specified 36 | // (which is the case during production build) 37 | if (options.extract) { 38 | return ExtractTextPlugin.extract({ 39 | use: loaders, 40 | fallback: 'vue-style-loader' 41 | }) 42 | } else { 43 | return ['vue-style-loader'].concat(loaders) 44 | } 45 | } 46 | 47 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html 48 | return { 49 | css: generateLoaders(), 50 | postcss: generateLoaders(), 51 | less: generateLoaders('less'), 52 | sass: generateLoaders('sass', { indentedSyntax: true }), 53 | scss: generateLoaders('sass'), 54 | stylus: generateLoaders('stylus'), 55 | styl: generateLoaders('stylus') 56 | } 57 | } 58 | 59 | // Generate loaders for standalone style files (outside of .vue) 60 | exports.styleLoaders = function (options) { 61 | var output = [] 62 | var loaders = exports.cssLoaders(options) 63 | for (var extension in loaders) { 64 | var loader = loaders[extension] 65 | output.push({ 66 | test: new RegExp('\\.' + extension + '$'), 67 | use: loader 68 | }) 69 | } 70 | return output 71 | } 72 | -------------------------------------------------------------------------------- /build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | var utils = require('./utils') 2 | var config = require('../config') 3 | var isProduction = process.env.NODE_ENV === 'production' 4 | 5 | module.exports = { 6 | loaders: utils.cssLoaders({ 7 | sourceMap: isProduction 8 | ? config.build.productionSourceMap 9 | : config.dev.cssSourceMap, 10 | extract: isProduction 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var utils = require('./utils') 3 | var config = require('../config') 4 | var vueLoaderConfig = require('./vue-loader.conf') 5 | 6 | function resolve (dir) { 7 | return path.join(__dirname, '..', dir) 8 | } 9 | 10 | module.exports = { 11 | entry: { 12 | app: './src/main.js' 13 | }, 14 | output: { 15 | path: config.build.assetsRoot, 16 | filename: '[name].js', 17 | publicPath: process.env.NODE_ENV === 'production' 18 | ? config.build.assetsPublicPath 19 | : config.dev.assetsPublicPath 20 | }, 21 | resolve: { 22 | extensions: ['.js', '.vue', '.json'], 23 | alias: { 24 | 'vue$': 'vue/dist/vue.esm.js', 25 | '@': resolve('src') 26 | } 27 | }, 28 | module: { 29 | rules: [ 30 | { 31 | test: /\.vue$/, 32 | loader: 'vue-loader', 33 | options: vueLoaderConfig 34 | }, 35 | { 36 | test: /\.js$/, 37 | loader: 'babel-loader', 38 | include: [resolve('src'), resolve('test')] 39 | }, 40 | { 41 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 42 | loader: 'url-loader', 43 | options: { 44 | limit: 10000, 45 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 46 | } 47 | }, 48 | { 49 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 50 | loader: 'url-loader', 51 | options: { 52 | limit: 10000, 53 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 54 | } 55 | } 56 | ] 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | var utils = require('./utils') 2 | var webpack = require('webpack') 3 | var config = require('../config') 4 | var merge = require('webpack-merge') 5 | var baseWebpackConfig = require('./webpack.base.conf') 6 | var HtmlWebpackPlugin = require('html-webpack-plugin') 7 | var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') 8 | 9 | // add hot-reload related code to entry chunks 10 | Object.keys(baseWebpackConfig.entry).forEach(function (name) { 11 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) 12 | }) 13 | 14 | module.exports = merge(baseWebpackConfig, { 15 | module: { 16 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) 17 | }, 18 | // cheap-module-eval-source-map is faster for development 19 | devtool: '#cheap-module-eval-source-map', 20 | plugins: [ 21 | new webpack.DefinePlugin({ 22 | 'process.env': config.dev.env 23 | }), 24 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage 25 | new webpack.HotModuleReplacementPlugin(), 26 | new webpack.NoEmitOnErrorsPlugin(), 27 | // https://github.com/ampedandwired/html-webpack-plugin 28 | new HtmlWebpackPlugin({ 29 | filename: 'index.html', 30 | template: 'index.html', 31 | inject: true 32 | }), 33 | new FriendlyErrorsPlugin() 34 | ] 35 | }) 36 | -------------------------------------------------------------------------------- /build/webpack.prod.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var utils = require('./utils') 3 | var webpack = require('webpack') 4 | var config = require('../config') 5 | var merge = require('webpack-merge') 6 | var baseWebpackConfig = require('./webpack.base.conf') 7 | var CopyWebpackPlugin = require('copy-webpack-plugin') 8 | var HtmlWebpackPlugin = require('html-webpack-plugin') 9 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 10 | var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') 11 | 12 | var env = config.build.env 13 | 14 | var webpackConfig = merge(baseWebpackConfig, { 15 | module: { 16 | rules: utils.styleLoaders({ 17 | sourceMap: config.build.productionSourceMap, 18 | extract: true 19 | }) 20 | }, 21 | devtool: config.build.productionSourceMap ? '#source-map' : false, 22 | output: { 23 | path: config.build.assetsRoot, 24 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 25 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 26 | }, 27 | plugins: [ 28 | // http://vuejs.github.io/vue-loader/en/workflow/production.html 29 | new webpack.DefinePlugin({ 30 | 'process.env': env 31 | }), 32 | new webpack.optimize.UglifyJsPlugin({ 33 | compress: { 34 | warnings: false 35 | }, 36 | sourceMap: true 37 | }), 38 | // extract css into its own file 39 | new ExtractTextPlugin({ 40 | filename: utils.assetsPath('css/[name].[contenthash].css') 41 | }), 42 | // Compress extracted CSS. We are using this plugin so that possible 43 | // duplicated CSS from different components can be deduped. 44 | new OptimizeCSSPlugin({ 45 | cssProcessorOptions: { 46 | safe: true 47 | } 48 | }), 49 | // generate dist index.html with correct asset hash for caching. 50 | // you can customize output by editing /index.html 51 | // see https://github.com/ampedandwired/html-webpack-plugin 52 | new HtmlWebpackPlugin({ 53 | filename: config.build.index, 54 | template: 'index.html', 55 | inject: true, 56 | minify: { 57 | removeComments: true, 58 | collapseWhitespace: true, 59 | removeAttributeQuotes: true 60 | // more options: 61 | // https://github.com/kangax/html-minifier#options-quick-reference 62 | }, 63 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 64 | chunksSortMode: 'dependency' 65 | }), 66 | // split vendor js into its own file 67 | new webpack.optimize.CommonsChunkPlugin({ 68 | name: 'vendor', 69 | minChunks: function (module, count) { 70 | // any required modules inside node_modules are extracted to vendor 71 | return ( 72 | module.resource && 73 | /\.js$/.test(module.resource) && 74 | module.resource.indexOf( 75 | path.join(__dirname, '../node_modules') 76 | ) === 0 77 | ) 78 | } 79 | }), 80 | // extract webpack runtime and module manifest to its own file in order to 81 | // prevent vendor hash from being updated whenever app bundle is updated 82 | new webpack.optimize.CommonsChunkPlugin({ 83 | name: 'manifest', 84 | chunks: ['vendor'] 85 | }), 86 | // copy custom static assets 87 | new CopyWebpackPlugin([ 88 | { 89 | from: path.resolve(__dirname, '../static'), 90 | to: config.build.assetsSubDirectory, 91 | ignore: ['.*'] 92 | } 93 | ]) 94 | ] 95 | }) 96 | 97 | if (config.build.productionGzip) { 98 | var CompressionWebpackPlugin = require('compression-webpack-plugin') 99 | 100 | webpackConfig.plugins.push( 101 | new CompressionWebpackPlugin({ 102 | asset: '[path].gz[query]', 103 | algorithm: 'gzip', 104 | test: new RegExp( 105 | '\\.(' + 106 | config.build.productionGzipExtensions.join('|') + 107 | ')$' 108 | ), 109 | threshold: 10240, 110 | minRatio: 0.8 111 | }) 112 | ) 113 | } 114 | 115 | if (config.build.bundleAnalyzerReport) { 116 | var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 117 | webpackConfig.plugins.push(new BundleAnalyzerPlugin()) 118 | } 119 | 120 | module.exports = webpackConfig 121 | -------------------------------------------------------------------------------- /config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path') 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../dist/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../dist'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '/', 11 | productionSourceMap: true, 12 | // Gzip off by default as many popular static hosts such as 13 | // Surge or Netlify already gzip all static assets for you. 14 | // Before setting to `true`, make sure to: 15 | // npm install --save-dev compression-webpack-plugin 16 | productionGzip: false, 17 | productionGzipExtensions: ['js', 'css'], 18 | // Run the build command with an extra argument to 19 | // View the bundle analyzer report after build finishes: 20 | // `npm run build --report` 21 | // Set to `true` or `false` to always turn it on or off 22 | bundleAnalyzerReport: process.env.npm_config_report 23 | }, 24 | dev: { 25 | env: require('./dev.env'), 26 | port: 8082, 27 | autoOpenBrowser: true, 28 | assetsSubDirectory: 'static', 29 | assetsPublicPath: '/', 30 | proxyTable: { 31 | // '/api': { 32 | // target: 'http://localhost:3000', 33 | // changeOrigin: true, 34 | // pathRewrite: { 35 | // '^/api': '/api' 36 | // } 37 | // } 38 | }, 39 | // CSS Sourcemaps off by default because relative paths are "buggy" 40 | // with this option, according to the CSS-Loader README 41 | // (https://github.com/webpack/css-loader#sourcemaps) 42 | // In our experience, they generally work as expected, 43 | // just be aware of this issue when enabling this option. 44 | cssSourceMap: false 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | clouddo
-------------------------------------------------------------------------------- /dist/static/defaultCover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/dist/static/defaultCover.jpg -------------------------------------------------------------------------------- /dist/static/fonts/element-icons.6f0a763.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/dist/static/fonts/element-icons.6f0a763.ttf -------------------------------------------------------------------------------- /dist/static/fonts/fontawesome-webfont.674f50d.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/dist/static/fonts/fontawesome-webfont.674f50d.eot -------------------------------------------------------------------------------- /dist/static/fonts/fontawesome-webfont.af7ae50.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/dist/static/fonts/fontawesome-webfont.af7ae50.woff2 -------------------------------------------------------------------------------- /dist/static/fonts/fontawesome-webfont.b06871f.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/dist/static/fonts/fontawesome-webfont.b06871f.ttf -------------------------------------------------------------------------------- /dist/static/fonts/fontawesome-webfont.fee66e7.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/dist/static/fonts/fontawesome-webfont.fee66e7.woff -------------------------------------------------------------------------------- /dist/static/img/iconfont.5c9ad9e.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Created by FontForge 20120731 at Fri Apr 14 10:37:19 2017 6 | By admin 7 | 8 | 9 | 10 | 24 | 26 | 28 | 30 | 32 | 34 | 38 | 41 | 44 | 47 | 50 | 55 | 57 | 62 | 68 | 73 | 76 | 79 | 83 | 88 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /dist/static/index_backgroud.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/dist/static/index_backgroud.jpg -------------------------------------------------------------------------------- /dist/static/js/0.98b04c084adca6662464.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([0],{264:function(e,o,n){n(268),n(269);var t=n(7)(n(265),n(270),"data-v-1048794c",null);e.exports=t.exports},265:function(e,o,n){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var t=n(104),a=n.n(t),r=n(32);o.default={data:function(){return{loading:!1,account:{username:"admin",pwd:"123456"},rules:{username:[{required:!0,message:"请输入账号",trigger:"blur"}],pwd:[{required:!0,message:"请输入密码",trigger:"blur"}]},checked:!0}},methods:{handleLogin:function(){var e=this,o=this;this.$refs.AccountFrom.validate(function(n){if(n){e.loading=!0;var t={username:e.account.username,pwd:e.account.pwd};r.a.login(t).then(function(e){o.loading=!1,e&&0===e.code?(localStorage.setItem("access-token",e.token),console.log(e.router),localStorage.setItem("menus",a()(e.router)),localStorage.setItem("perms",a()(e.perms)),o.$router.push({path:"/"})):o.$message.error({showClose:!0,message:e.msg||"登录失败",duration:2e3})},function(e){o.loading=!1,o.$message.error({showClose:!0,message:e.toString(),duration:2e3})}).catch(function(e){o.loading=!1,console.log(e),o.$message.error({showClose:!0,message:"请求出现异常",duration:2e3})})}})}}}},266:function(e,o,n){o=e.exports=n(262)(),o.push([e.i,"body{background:#dfe9fb}","",{version:3,sources:["C:/Users/bootdo/opensource/clouddo-view/src/components/Login.vue"],names:[],mappings:"AACA,KACE,kBAAoB,CACrB",file:"Login.vue",sourcesContent:["\nbody {\n background: #dfe9fb;\n}\n"],sourceRoot:""}])},267:function(e,o,n){o=e.exports=n(262)(),o.push([e.i,".login-container[data-v-1048794c]{border-radius:5px;-moz-border-radius:5px;background-clip:padding-box;margin:160px auto;width:350px;padding:35px 35px 15px;background:#fff;border:1px solid #eaeaea;box-shadow:0 0 25px #cac6c6;background:-o-linear-gradient(top,#ace,#00c1de)}.login-container .title[data-v-1048794c]{margin:0 auto 40px;text-align:center;color:#505458}.login-container .remember[data-v-1048794c]{margin:0 0 35px}","",{version:3,sources:["C:/Users/bootdo/opensource/clouddo-view/src/components/Login.vue"],names:[],mappings:"AAEA,kCAEE,kBAAmB,AACnB,uBAAwB,AACxB,4BAA6B,AAC7B,kBAAmB,AACnB,YAAa,AACb,uBAA6B,AAC7B,gBAAiB,AACjB,yBAA0B,AAC1B,4BAA6B,AAK7B,+CAAmD,CAEpD,AACD,yCACI,mBAA2B,AAC3B,kBAAmB,AACnB,aAAe,CAClB,AACD,4CACI,eAAyB,CAC5B",file:"Login.vue",sourcesContent:['\n@charset "UTF-8";\n.login-container[data-v-1048794c] {\n /*box-shadow: 0 0px 8px 0 rgba(0, 0, 0, 0.06), 0 1px 0px 0 rgba(0, 0, 0, 0.02);*/\n border-radius: 5px;\n -moz-border-radius: 5px;\n background-clip: padding-box;\n margin: 160px auto;\n width: 350px;\n padding: 35px 35px 15px 35px;\n background: #fff;\n border: 1px solid #eaeaea;\n box-shadow: 0 0 25px #cac6c6;\n /* IE 10 */\n /*火狐*/\n /*谷歌*/\n /*Safari5.1 Chrome 10+*/\n background: -o-linear-gradient(top, #ace, #00c1de);\n /*Opera 11.10+*/\n}\n.login-container .title[data-v-1048794c] {\n margin: 0px auto 40px auto;\n text-align: center;\n color: #505458;\n}\n.login-container .remember[data-v-1048794c] {\n margin: 0px 0px 35px 0px;\n}\n'],sourceRoot:""}])},268:function(e,o,n){var t=n(266);"string"==typeof t&&(t=[[e.i,t,""]]),t.locals&&(e.exports=t.locals);n(263)("012a3c38",t,!0)},269:function(e,o,n){var t=n(267);"string"==typeof t&&(t=[[e.i,t,""]]),t.locals&&(e.exports=t.locals);n(263)("eb8f2b52",t,!0)},270:function(e,o){e.exports={render:function(){var e=this,o=e.$createElement,n=e._self._c||o;return n("el-form",{ref:"AccountFrom",staticClass:"demo-ruleForm login-container",attrs:{model:e.account,rules:e.rules,"label-position":"left","label-width":"0px"}},[n("h3",{staticClass:"title"},[e._v("管理员登录")]),e._v(" "),n("el-form-item",{attrs:{prop:"username"}},[n("el-input",{attrs:{type:"text","auto-complete":"off",placeholder:"账号"},model:{value:e.account.username,callback:function(o){e.$set(e.account,"username",o)},expression:"account.username"}})],1),e._v(" "),n("el-form-item",{attrs:{prop:"pwd"}},[n("el-input",{attrs:{type:"password","auto-complete":"off",placeholder:"密码"},model:{value:e.account.pwd,callback:function(o){e.$set(e.account,"pwd",o)},expression:"account.pwd"}})],1),e._v(" "),n("el-form-item",{staticStyle:{width:"100%"}},[n("el-button",{staticStyle:{width:"100%"},attrs:{type:"primary",loading:e.loading},nativeOn:{click:function(o){o.preventDefault(),e.handleLogin(o)}}},[e._v("登录")])],1)],1)},staticRenderFns:[]}}}); 2 | //# sourceMappingURL=0.98b04c084adca6662464.js.map -------------------------------------------------------------------------------- /dist/static/js/0.98b04c084adca6662464.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///static/js/0.98b04c084adca6662464.js","webpack:///./src/components/Login.vue","webpack:///Login.vue","webpack:///./src/components/Login.vue?14f3","webpack:///./src/components/Login.vue?56dc","webpack:///./src/components/Login.vue?4e64","webpack:///./src/components/Login.vue?09de","webpack:///./src/components/Login.vue?e145"],"names":["webpackJsonp","264","module","exports","__webpack_require__","Component","265","__webpack_exports__","Object","defineProperty","value","__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify__","__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default","n","__WEBPACK_IMPORTED_MODULE_1__api_api_user__","data","loading","account","username","pwd","rules","required","message","trigger","checked","methods","handleLogin","_this","this","that","$refs","AccountFrom","validate","valid","loginParams","login","then","result","code","localStorage","setItem","token","console","log","router","perms","$router","push","path","$message","error","showClose","msg","duration","err","toString","catch","266","i","version","sources","names","mappings","file","sourcesContent","sourceRoot","267","268","content","locals","269","270","render","_vm","_h","$createElement","_c","_self","ref","staticClass","attrs","model","label-position","label-width","_v","prop","type","auto-complete","placeholder","callback","$$v","$set","expression","staticStyle","width","nativeOn","click","$event","preventDefault","staticRenderFns"],"mappings":"AAAAA,cAAc,IAERC,IACA,SAAUC,EAAQC,EAASC,GCDjCA,EAAA,KACAA,EAAA,IAEA,IAAAC,GAAAD,EAAA,GAEAA,EAAA,KAEAA,EAAA,KAEA,kBAEA,KAGAF,GAAAC,QAAAE,EAAAF,SDUMG,IACA,SAAUJ,EAAQK,EAAqBH,GAE7C,YACAI,QAAOC,eAAeF,EAAqB,cAAgBG,OAAO,GAC7C,IAAIC,GAAqEP,EAAoB,KACzFQ,EAA6ER,EAAoBS,EAAEF,GACnGG,EAA8CV,EAAoB,GEb3FG,GAAA,SFoBEQ,KAAM,WACJ,OACEC,SElBN,EFmBMC,SACEC,SElBR,QFmBQC,IEjBR,UFmBMC,OACEF,WElBRG,UAAA,EAAAC,QAAA,QAAAC,QAGA,SFgBQJ,MEfRE,UAAA,EAAAC,QAAA,QAAAC,QAIA,UFaMC,SEXN,IFeEC,SACEC,YAAa,WEbjB,GAAAC,GAAAC,KFgBUC,EEfVD,IFgBMA,MAAKE,MAAMC,YAAYC,SAAS,SAAUC,GACxC,GAAIA,EEfZ,CFgBUN,EAAMX,SEfhB,CFgBU,IAAIkB,IACFhB,SAAUS,EAAMV,QEf5BC,SFgBYC,IAAKQ,EAAMV,QEdvBE,IFgBUL,GAA6D,EAAEqB,MEfzED,GACAE,KAAA,SAAAC,GFeYR,EAAKb,SEbjB,EFcgBqB,GAA0B,IAAhBA,EAAOC,MACnBC,aAAaC,QAAQ,eAAgBH,EETnDI,OFUcC,QAAQC,IAAIN,EET1BO,QFUcL,aAAaC,QAAQ,QAAS5B,IAA6EyB,EETzHO,SFUcL,aAAaC,QAAQ,QAAS5B,IAA6EyB,EELzHQ,QFOchB,EAAKiB,QAAQC,MAAOC,KENlC,OFQcnB,EAAKoB,SAASC,OACZC,WENhB,EFOgB7B,QAASe,EAAOe,KENhC,OFOgBC,SELhB,OAEA,SAAAC,GFOYzB,EAAKb,SELjB,EFMYa,EAAKoB,SAASC,OACZC,WELd,EFMc7B,QAASgC,EELvBC,WFMcF,SEJd,QAEAG,MAAA,SAAAN,GFKYrB,EAAKb,SEHjB,EFIY0B,QAAQC,IEHpBO,GFIYrB,EAAKoB,SAASC,OACZC,WEHd,EFIc7B,QEHd,SFIc+B,SEFd,eFaMI,IACA,SAAUvD,EAAQC,EAASC,GG5GjCD,EAAAD,EAAAC,QAAAC,EAAA,OAKAD,EAAA4C,MAAA7C,EAAAwD,EAAA,2BAAkD,IAAQC,QAAA,EAAAC,SAAA,oEAAAC,SAAAC,SAAA,yBAAAC,KAAA,YAAAC,gBAAA,yCAAmNC,WAAA,OHqHvQC,IACA,SAAUhE,EAAQC,EAASC,GI3HjCD,EAAAD,EAAAC,QAAAC,EAAA,OAKAD,EAAA4C,MAAA7C,EAAAwD,EAAA,4aAAmc,IAAQC,QAAA,EAAAC,SAAA,oEAAAC,SAAAC,SAAA,mNAAAC,KAAA,YAAAC,gBAAA,guBAAskCC,WAAA,OJoI3gDE,IACA,SAAUjE,EAAQC,EAASC,GKvIjC,GAAAgE,GAAAhE,EAAA,IACA,iBAAAgE,SAAAlE,EAAAwD,EAAAU,EAAA,MACAA,EAAAC,SAAAnE,EAAAC,QAAAiE,EAAAC,OAEAjE,GAAA,gBAAAgE,GAAA,ILgJME,IACA,SAAUpE,EAAQC,EAASC,GMrJjC,GAAAgE,GAAAhE,EAAA,IACA,iBAAAgE,SAAAlE,EAAAwD,EAAAU,EAAA,MACAA,EAAAC,SAAAnE,EAAAC,QAAAiE,EAAAC,OAEAjE,GAAA,gBAAAgE,GAAA,IN8JMG,IACA,SAAUrE,EAAQC,GOtKxBD,EAAAC,SAAgBqE,OAAA,WAAmB,GAAAC,GAAA7C,KAAa8C,EAAAD,EAAAE,eAA0BC,EAAAH,EAAAI,MAAAD,IAAAF,CAC1E,OAAAE,GAAA,WACAE,IAAA,cACAC,YAAA,gCACAC,OACAC,MAAAR,EAAAxD,QACAG,MAAAqD,EAAArD,MACA8D,iBAAA,OACAC,cAAA,SAEGP,EAAA,MACHG,YAAA,UACGN,EAAAW,GAAA,WAAAX,EAAAW,GAAA,KAAAR,EAAA,gBACHI,OACAK,KAAA,cAEGT,EAAA,YACHI,OACAM,KAAA,OACAC,gBAAA,MACAC,YAAA,MAEAP,OACAvE,MAAA+D,EAAAxD,QAAA,SACAwE,SAAA,SAAAC,GACAjB,EAAAkB,KAAAlB,EAAAxD,QAAA,WAAAyE,IAEAE,WAAA,uBAEG,GAAAnB,EAAAW,GAAA,KAAAR,EAAA,gBACHI,OACAK,KAAA,SAEGT,EAAA,YACHI,OACAM,KAAA,WACAC,gBAAA,MACAC,YAAA,MAEAP,OACAvE,MAAA+D,EAAAxD,QAAA,IACAwE,SAAA,SAAAC,GACAjB,EAAAkB,KAAAlB,EAAAxD,QAAA,MAAAyE,IAEAE,WAAA,kBAEG,GAAAnB,EAAAW,GAAA,KAAAR,EAAA,gBACHiB,aACAC,MAAA,UAEGlB,EAAA,aACHiB,aACAC,MAAA,QAEAd,OACAM,KAAA,UACAtE,QAAAyD,EAAAzD,SAEA+E,UACAC,MAAA,SAAAC,GACAA,EAAAC,iBACAzB,EAAA/C,YAAAuE,OAGGxB,EAAAW,GAAA,iBACFe","file":"static/js/0.98b04c084adca6662464.js","sourcesContent":["webpackJsonp([0],{\n\n/***/ 264:\n/***/ (function(module, exports, __webpack_require__) {\n\n\n/* styles */\n__webpack_require__(268)\n__webpack_require__(269)\n\nvar Component = __webpack_require__(7)(\n /* script */\n __webpack_require__(265),\n /* template */\n __webpack_require__(270),\n /* scopeId */\n \"data-v-1048794c\",\n /* cssModules */\n null\n)\n\nmodule.exports = Component.exports\n\n\n/***/ }),\n\n/***/ 265:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify__ = __webpack_require__(104);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__api_api_user__ = __webpack_require__(32);\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n data: function data() {\n return {\n loading: false,\n account: {\n username: \"admin\",\n pwd: \"123456\"\n },\n rules: {\n username: [{ required: true, message: \"请输入账号\", trigger: \"blur\" }],\n pwd: [{ required: true, message: \"请输入密码\", trigger: \"blur\" }]\n },\n checked: true\n };\n },\n\n methods: {\n handleLogin: function handleLogin() {\n var _this = this;\n\n var that = this;\n this.$refs.AccountFrom.validate(function (valid) {\n if (valid) {\n _this.loading = true;\n var loginParams = {\n username: _this.account.username,\n pwd: _this.account.pwd\n };\n __WEBPACK_IMPORTED_MODULE_1__api_api_user__[\"a\" /* default */].login(loginParams).then(function (result) {\n that.loading = false;\n if (result && result.code === 0) {\n localStorage.setItem(\"access-token\", result.token);\n console.log(result.router);\n localStorage.setItem(\"menus\", __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(result.router));\n localStorage.setItem(\"perms\", __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(result.perms));\n\n that.$router.push({ path: \"/\" });\n } else {\n that.$message.error({\n showClose: true,\n message: result.msg || \"登录失败\",\n duration: 2000\n });\n }\n }, function (err) {\n that.loading = false;\n that.$message.error({\n showClose: true,\n message: err.toString(),\n duration: 2000\n });\n }).catch(function (error) {\n that.loading = false;\n console.log(error);\n that.$message.error({\n showClose: true,\n message: \"请求出现异常\",\n duration: 2000\n });\n });\n }\n });\n }\n }\n});\n\n/***/ }),\n\n/***/ 266:\n/***/ (function(module, exports, __webpack_require__) {\n\nexports = module.exports = __webpack_require__(262)();\n// imports\n\n\n// module\nexports.push([module.i, \"body{background:#dfe9fb}\", \"\", {\"version\":3,\"sources\":[\"C:/Users/bootdo/opensource/clouddo-view/src/components/Login.vue\"],\"names\":[],\"mappings\":\"AACA,KACE,kBAAoB,CACrB\",\"file\":\"Login.vue\",\"sourcesContent\":[\"\\nbody {\\n background: #dfe9fb;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n\n// exports\n\n\n/***/ }),\n\n/***/ 267:\n/***/ (function(module, exports, __webpack_require__) {\n\nexports = module.exports = __webpack_require__(262)();\n// imports\n\n\n// module\nexports.push([module.i, \".login-container[data-v-1048794c]{border-radius:5px;-moz-border-radius:5px;background-clip:padding-box;margin:160px auto;width:350px;padding:35px 35px 15px;background:#fff;border:1px solid #eaeaea;box-shadow:0 0 25px #cac6c6;background:-o-linear-gradient(top,#ace,#00c1de)}.login-container .title[data-v-1048794c]{margin:0 auto 40px;text-align:center;color:#505458}.login-container .remember[data-v-1048794c]{margin:0 0 35px}\", \"\", {\"version\":3,\"sources\":[\"C:/Users/bootdo/opensource/clouddo-view/src/components/Login.vue\"],\"names\":[],\"mappings\":\"AAEA,kCAEE,kBAAmB,AACnB,uBAAwB,AACxB,4BAA6B,AAC7B,kBAAmB,AACnB,YAAa,AACb,uBAA6B,AAC7B,gBAAiB,AACjB,yBAA0B,AAC1B,4BAA6B,AAK7B,+CAAmD,CAEpD,AACD,yCACI,mBAA2B,AAC3B,kBAAmB,AACnB,aAAe,CAClB,AACD,4CACI,eAAyB,CAC5B\",\"file\":\"Login.vue\",\"sourcesContent\":[\"\\n@charset \\\"UTF-8\\\";\\n.login-container[data-v-1048794c] {\\n /*box-shadow: 0 0px 8px 0 rgba(0, 0, 0, 0.06), 0 1px 0px 0 rgba(0, 0, 0, 0.02);*/\\n border-radius: 5px;\\n -moz-border-radius: 5px;\\n background-clip: padding-box;\\n margin: 160px auto;\\n width: 350px;\\n padding: 35px 35px 15px 35px;\\n background: #fff;\\n border: 1px solid #eaeaea;\\n box-shadow: 0 0 25px #cac6c6;\\n /* IE 10 */\\n /*火狐*/\\n /*谷歌*/\\n /*Safari5.1 Chrome 10+*/\\n background: -o-linear-gradient(top, #ace, #00c1de);\\n /*Opera 11.10+*/\\n}\\n.login-container .title[data-v-1048794c] {\\n margin: 0px auto 40px auto;\\n text-align: center;\\n color: #505458;\\n}\\n.login-container .remember[data-v-1048794c] {\\n margin: 0px 0px 35px 0px;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n\n// exports\n\n\n/***/ }),\n\n/***/ 268:\n/***/ (function(module, exports, __webpack_require__) {\n\n// style-loader: Adds some css to the DOM by adding a \n\n\n\n\n// WEBPACK FOOTER //\n// Login.vue?1fd81355","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \"body{background:#dfe9fb}\", \"\", {\"version\":3,\"sources\":[\"C:/Users/bootdo/opensource/clouddo-view/src/components/Login.vue\"],\"names\":[],\"mappings\":\"AACA,KACE,kBAAoB,CACrB\",\"file\":\"Login.vue\",\"sourcesContent\":[\"\\nbody {\\n background: #dfe9fb;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/css-loader?{\"minimize\":true,\"sourceMap\":true}!./~/vue-loader/lib/style-compiler?{\"id\":\"data-v-1048794c\",\"scoped\":false,\"hasInlineConfig\":false}!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/components/Login.vue\n// module id = 266\n// module chunks = 0","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".login-container[data-v-1048794c]{border-radius:5px;-moz-border-radius:5px;background-clip:padding-box;margin:160px auto;width:350px;padding:35px 35px 15px;background:#fff;border:1px solid #eaeaea;box-shadow:0 0 25px #cac6c6;background:-o-linear-gradient(top,#ace,#00c1de)}.login-container .title[data-v-1048794c]{margin:0 auto 40px;text-align:center;color:#505458}.login-container .remember[data-v-1048794c]{margin:0 0 35px}\", \"\", {\"version\":3,\"sources\":[\"C:/Users/bootdo/opensource/clouddo-view/src/components/Login.vue\"],\"names\":[],\"mappings\":\"AAEA,kCAEE,kBAAmB,AACnB,uBAAwB,AACxB,4BAA6B,AAC7B,kBAAmB,AACnB,YAAa,AACb,uBAA6B,AAC7B,gBAAiB,AACjB,yBAA0B,AAC1B,4BAA6B,AAK7B,+CAAmD,CAEpD,AACD,yCACI,mBAA2B,AAC3B,kBAAmB,AACnB,aAAe,CAClB,AACD,4CACI,eAAyB,CAC5B\",\"file\":\"Login.vue\",\"sourcesContent\":[\"\\n@charset \\\"UTF-8\\\";\\n.login-container[data-v-1048794c] {\\n /*box-shadow: 0 0px 8px 0 rgba(0, 0, 0, 0.06), 0 1px 0px 0 rgba(0, 0, 0, 0.02);*/\\n border-radius: 5px;\\n -moz-border-radius: 5px;\\n background-clip: padding-box;\\n margin: 160px auto;\\n width: 350px;\\n padding: 35px 35px 15px 35px;\\n background: #fff;\\n border: 1px solid #eaeaea;\\n box-shadow: 0 0 25px #cac6c6;\\n /* IE 10 */\\n /*火狐*/\\n /*谷歌*/\\n /*Safari5.1 Chrome 10+*/\\n background: -o-linear-gradient(top, #ace, #00c1de);\\n /*Opera 11.10+*/\\n}\\n.login-container .title[data-v-1048794c] {\\n margin: 0px auto 40px auto;\\n text-align: center;\\n color: #505458;\\n}\\n.login-container .remember[data-v-1048794c] {\\n margin: 0px 0px 35px 0px;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/css-loader?{\"minimize\":true,\"sourceMap\":true}!./~/vue-loader/lib/style-compiler?{\"id\":\"data-v-1048794c\",\"scoped\":true,\"hasInlineConfig\":false}!./~/sass-loader/lib/loader.js?{\"sourceMap\":true}!./~/vue-loader/lib/selector.js?type=styles&index=1!./src/components/Login.vue\n// module id = 267\n// module chunks = 0","// style-loader: Adds some css to the DOM by adding a 29 | -------------------------------------------------------------------------------- /src/api/api_file.js: -------------------------------------------------------------------------------- 1 | import * as API from './' 2 | 3 | export default { 4 | files: params => { 5 | return API.GET('/api-cms/file', params) 6 | }, 7 | getToken:params =>{ 8 | return API.GET('/api-cms/file/getToken',params) 9 | }, 10 | remove: params=>{ 11 | return API.DELETE('/api-cms/file', params) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/api/api_log.js: -------------------------------------------------------------------------------- 1 | import * as API from './' 2 | 3 | export default { 4 | list: params => { 5 | return API.GET('/api-base/log', params) 6 | }, 7 | remove: params => { 8 | return API.DELETE('/api-base/log', params) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/api/api_menu.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 菜单相关的api 3 | * @author bootdo 1992lcg@163.com 4 | */ 5 | import * as API from './' 6 | 7 | export default { 8 | 9 | menus: params=>{ 10 | return API.GET('/api-admin/menu',params) 11 | }, 12 | editMenu: params=>{ 13 | return API.PUT('/api-admin/menu',params) 14 | }, 15 | menuIdsByRoleId: params=>{ 16 | return API.GET('/api-admin/menu/roleId',params) 17 | }, 18 | add: params=>{ 19 | return API.POST('/api-admin/menu',params) 20 | }, 21 | remove: params=>{ 22 | return API.DELETE('/api-admin/menu',params) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/api/api_role.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by bootdo. 3 | * 角色相关api 4 | */ 5 | import * as API from './' 6 | 7 | export default { 8 | 9 | //查询获取role列表(通过page分页) 10 | findList: params => { 11 | return API.GET('/api-admin/role', params) 12 | }, 13 | 14 | //查询获取一条role信息 15 | findById: id => { 16 | return API.GET('/api-admin/role/userId/'+id) 17 | }, 18 | 19 | add: params => { 20 | return API.POST(`/api-admin/role`, params) 21 | }, 22 | update: (id, params) => { 23 | return API.PUT('/api-admin/role', params) 24 | }, 25 | 26 | //单个删除role 27 | remove: id => { 28 | return API.DELETE(`/api/v1/roles/${id}`) 29 | }, 30 | 31 | //批量删除,传ids数组 32 | removeBatch: (ids) => { 33 | return API.DELETE(`/api/v1/roles/batch/${ids}`) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/api/api_user.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by bootdo. 3 | * 用户相关api 4 | */ 5 | import * as API from './' 6 | 7 | export default { 8 | //登录 9 | login: params => { 10 | return API.POST('/api-admin/login', params) 11 | }, 12 | //登出 13 | logout: params => { 14 | return API.GET('/api-admin/logout', params) 15 | }, 16 | tokenUser: params =>{ 17 | return API.GET('/api-admin/user/currentUser',params) 18 | }, 19 | //修改个人信息 20 | changeProfile: params => { 21 | return API.PATCH('/api/v1/users/profile', params) 22 | }, 23 | 24 | //查询获取user列表(通过page分页) 25 | findList: params => { 26 | return API.GET('/api-admin/user', params) 27 | }, 28 | 29 | //增加用户 30 | addUser:params =>{ 31 | return API.POST('/api-admin/user',params) 32 | }, 33 | //修改用户 34 | editUser:params =>{ 35 | return API.PUT('/api-admin/user',params) 36 | }, 37 | //删除用户 38 | removeUser:params =>{ 39 | return API.DELETE('/api-admin/user',params) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/api/env.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by bootdo 3 | * 设置api请求的baseURL 4 | * 实际项目中建议该文件不纳入版本管理 5 | */ 6 | export default { 7 | baseURL: 'http://localhost:8002', 8 | // baseURL: '', 9 | isDev: true 10 | } 11 | -------------------------------------------------------------------------------- /src/api/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by bootdo. 3 | */ 4 | import Env from './env'; 5 | import axios from 'axios' 6 | import { 7 | bus 8 | } from '../bus.js' 9 | 10 | axios.defaults.withCredentials = true; 11 | // axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; 12 | // axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';//配置请求头 13 | 14 | 15 | //添加一个请求拦截器 16 | axios.interceptors.request.use( 17 | config => { 18 | if (window.localStorage.getItem('access-token')) { 19 | config.headers.Authorization = window.localStorage.getItem('access-token'); 20 | } 21 | return config 22 | }, 23 | error => { 24 | return Promise.reject(error) 25 | } 26 | ); 27 | // 添加一个响应拦截器 28 | axios.interceptors.response.use(function (response) { 29 | if (response.data && response.data.code) { 30 | if (parseInt(response.data.code) === 401) { 31 | //未登录 32 | bus.$emit('goto', '/login') 33 | } 34 | } 35 | 36 | return response; 37 | }, function (error) { 38 | // Do something with response error 39 | return Promise.reject(error); 40 | }); 41 | 42 | //基地址 43 | let base = Env.baseURL; 44 | 45 | //测试使用 46 | export const ISDEV = Env.isDev; 47 | 48 | 49 | //通用方法 50 | export const POST = (url, params) => { 51 | return axios.post(`${base}${url}`, params).then(res => res.data) 52 | } 53 | 54 | export const GET = (url, params) => { 55 | return axios.get(`${base}${url}`, { 56 | params: params 57 | }).then(res => res.data) 58 | } 59 | 60 | export const PUT = (url, params) => { 61 | return axios.put(`${base}${url}`, params).then(res => res.data) 62 | } 63 | 64 | export const DELETE = (url, params) => { 65 | return axios.delete(`${base}${url}`, { 66 | params: params 67 | }).then(res => res.data) 68 | } 69 | 70 | export const PATCH = (url, params) => { 71 | return axios.patch(`${base}${url}`, params).then(res => res.data) 72 | } 73 | -------------------------------------------------------------------------------- /src/assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/src/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /src/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/src/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /src/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/src/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/src/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /src/assets/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/src/assets/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /src/assets/fonts/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/src/assets/fonts/iconfont.eot -------------------------------------------------------------------------------- /src/assets/fonts/iconfont.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Created by FontForge 20120731 at Fri Apr 14 10:37:19 2017 6 | By admin 7 | 8 | 9 | 10 | 24 | 26 | 28 | 30 | 32 | 34 | 38 | 41 | 44 | 47 | 50 | 55 | 57 | 62 | 68 | 73 | 76 | 79 | 83 | 88 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /src/assets/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/src/assets/fonts/iconfont.ttf -------------------------------------------------------------------------------- /src/assets/fonts/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/src/assets/fonts/iconfont.woff -------------------------------------------------------------------------------- /src/assets/iconfont.css: -------------------------------------------------------------------------------- 1 | 2 | @font-face {font-family: "iconfont"; 3 | src: url('fonts/iconfont.eot?t=1492137439402'); /* IE9*/ 4 | src: url('fonts/iconfont.eot?t=1492137439402#iefix') format('embedded-opentype'), /* IE6-IE8 */ 5 | url('fonts/iconfont.woff?t=1492137439402') format('woff'), /* chrome, firefox */ 6 | url('fonts/iconfont.ttf?t=1492137439402') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ 7 | url('fonts/iconfont.svg?t=1492137439402#iconfont') format('svg'); /* iOS 4.1- */ 8 | } 9 | 10 | .iconfont { 11 | font-family:"iconfont" !important; 12 | font-size:16px; 13 | font-style:normal; 14 | -webkit-font-smoothing: antialiased; 15 | -moz-osx-font-smoothing: grayscale; 16 | } 17 | 18 | .icon-user:before { content: "\e600"; } 19 | 20 | .icon-home1:before { content: "\e635"; } 21 | 22 | .icon-home:before { content: "\e6a1"; } 23 | 24 | .icon-setting1:before { content: "\e601"; } 25 | 26 | .icon-setting:before { content: "\e664"; } 27 | 28 | .icon-down:before { content: "\e623"; } 29 | 30 | .icon-books1:before { content: "\e67f"; } 31 | 32 | .icon-leaf:before { content: "\e645"; } 33 | 34 | .icon-users1:before { content: "\e65a"; } 35 | 36 | .icon-menuunfold:before { content: "\eacc"; } 37 | 38 | .icon-menufold:before { content: "\eacd"; } 39 | 40 | .icon-books:before { content: "\e605"; } 41 | 42 | .icon-users:before { content: "\e883"; } 43 | 44 | .icon-books2:before { content: "\e7b9"; } 45 | 46 | -------------------------------------------------------------------------------- /src/assets/images/index1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/src/assets/images/index1.jpg -------------------------------------------------------------------------------- /src/assets/images/index2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/src/assets/images/index2.jpg -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/src/assets/logo.png -------------------------------------------------------------------------------- /src/assets/logotxt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/src/assets/logotxt.png -------------------------------------------------------------------------------- /src/assets/styles/main.scss: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 0px; 3 | margin: 0px auto; 4 | } 5 | 6 | a { 7 | text-decoration: none; 8 | } 9 | 10 | #app { 11 | font-family: 'Avenir', Helvetica, Arial, sans-serif; 12 | -webkit-font-smoothing: antialiased; 13 | -moz-osx-font-smoothing: grayscale; 14 | text-align: left; 15 | color: #2c3e50; 16 | } 17 | 18 | //home.vue 19 | .el-menu-item, .el-submenu__title { 20 | color: #a7b1c2; 21 | } 22 | 23 | .el-menu .el-menu-item, .el-submenu .el-submenu__title { 24 | height: 46px; 25 | line-height: 46px; 26 | font-weight: 650; 27 | } 28 | 29 | .el-menu-item:hover, .el-submenu .el-menu-item:hover, .el-submenu__title:hover { 30 | background-color: #293846; 31 | color: #fff; 32 | } 33 | 34 | .el-submenu .el-menu-item { 35 | background-color: #2f4050 36 | } 37 | 38 | .el-submenu .el-menu-item:hover { 39 | background-color: #4A5064 40 | } 41 | 42 | .el-submenu .el-menu-item.is-active, .el-menu-item.is-active, 43 | .el-submenu .el-menu-item.is-active:hover, .el-menu-item.is-active:hover { 44 | //background-color: #293846; 45 | color: #fff; 46 | } 47 | 48 | .el-menu .iconfont { 49 | vertical-align: baseline; 50 | margin-right: 6px; 51 | } 52 | 53 | .el-menu .fa { 54 | vertical-align: middle; 55 | margin-right: 6px; 56 | font-size: 20px; 57 | } 58 | 59 | .warp-breadcrum{ 60 | margin: 5px 10px 15px 0px; 61 | } 62 | -------------------------------------------------------------------------------- /src/bus.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by bootdo. 3 | */ 4 | import Vue from 'vue' 5 | 6 | export let bus = new Vue() 7 | -------------------------------------------------------------------------------- /src/common/util.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by bootdo. 3 | */ 4 | var SIGN_REGEXP = /([yMdhsm])(\1*)/g 5 | var DEFAULT_PATTERN = 'yyyy-MM-dd' 6 | 7 | function padding(s, len) { 8 | let l = len - (s + '').length 9 | for (var i = 0; i < l; i++) { 10 | s = '0' + s 11 | } 12 | return s 13 | }; 14 | 15 | export default { 16 | getQueryStringByName: function (name) { 17 | var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i') 18 | var r = window.location.search.substr(1).match(reg) 19 | var context = '' 20 | if (r != null) { 21 | context = r[2] 22 | } 23 | reg = null 24 | r = null 25 | return context === null || context === '' || context === 'undefined' ? '' : context 26 | }, 27 | formatDate: { 28 | 29 | format: function (date, pattern) { 30 | pattern = pattern || DEFAULT_PATTERN 31 | return pattern.replace(SIGN_REGEXP, function ($0) { 32 | switch ($0.charAt(0)) { 33 | case 'y': 34 | return padding(date.getFullYear(), $0.length) 35 | case 'M': 36 | return padding(date.getMonth() + 1, $0.length) 37 | case 'd': 38 | return padding(date.getDate(), $0.length) 39 | case 'w': 40 | return date.getDay() + 1 41 | case 'h': 42 | return padding(date.getHours(), $0.length) 43 | case 'm': 44 | return padding(date.getMinutes(), $0.length) 45 | case 's': 46 | return padding(date.getSeconds(), $0.length) 47 | } 48 | }) 49 | }, 50 | parse: function (dateString, pattern) { 51 | var matchs1 = pattern.match(SIGN_REGEXP) 52 | var matchs2 = dateString.match(/(\d)+/g) 53 | if (matchs1.length === matchs2.length) { 54 | var _date = new Date(1970, 0, 1) 55 | for (var i = 0; i < matchs1.length; i++) { 56 | var _int = parseInt(matchs2[i]) 57 | var sign = matchs1[i] 58 | switch (sign.charAt(0)) { 59 | case 'y': 60 | _date.setFullYear(_int); 61 | break 62 | case 'M': 63 | _date.setMonth(_int - 1); 64 | break 65 | case 'd': 66 | _date.setDate(_int); 67 | break 68 | case 'h': 69 | _date.setHours(_int); 70 | break 71 | case 'm': 72 | _date.setMinutes(_int); 73 | break 74 | case 's': 75 | _date.setSeconds(_int); 76 | break 77 | } 78 | } 79 | return _date 80 | } 81 | return null 82 | } 83 | 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /src/components/Dashboard.vue: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /src/components/Home.vue: -------------------------------------------------------------------------------- 1 | 72 | 73 | 150 | 151 | 282 | -------------------------------------------------------------------------------- /src/components/Login.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 102 | 107 | 147 | -------------------------------------------------------------------------------- /src/components/TreeTable/eval.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @Author: jianglei 3 | * @Date: 2017-10-12 12:06:49 4 | */ 5 | 'use strict' 6 | import Vue from 'vue' 7 | export default function treeToArray(data, expandAll, parent = null, level = null) { 8 | let tmp = [] 9 | Array.from(data).forEach(function(record) { 10 | if (record._expanded === undefined) { 11 | Vue.set(record, '_expanded', expandAll) 12 | } 13 | let _level = 1 14 | if (level !== undefined && level !== null) { 15 | _level = level + 1 16 | } 17 | Vue.set(record, '_level', _level) 18 | // 如果有父元素 19 | if (parent) { 20 | Vue.set(record, 'parent', parent) 21 | } 22 | tmp.push(record) 23 | if (record.children && record.children.length > 0) { 24 | const children = treeToArray(record.children, expandAll, record, _level) 25 | tmp = tmp.concat(children) 26 | } 27 | }) 28 | return tmp 29 | } 30 | -------------------------------------------------------------------------------- /src/components/TreeTable/index.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 83 | 93 | 94 | 125 | -------------------------------------------------------------------------------- /src/components/TreeTable/readme.md: -------------------------------------------------------------------------------- 1 | ## 写在前面 2 | 此组件仅提供一个创建TreeTable的解决思路 3 | 4 | ## prop说明 5 | #### *data* 6 | **必填** 7 | 8 | 原始数据,要求是一个数组或者对象 9 | ```javascript 10 | [{ 11 | key1: value1, 12 | key2: value2, 13 | children: [{ 14 | key1: value1 15 | }, 16 | { 17 | key1: value1 18 | }] 19 | }, 20 | { 21 | key1: value1 22 | }] 23 | ``` 24 | 或者 25 | ```javascript 26 | { 27 | key1: value1, 28 | key2: value2, 29 | children: [{ 30 | key1: value1 31 | }, 32 | { 33 | key1: value1 34 | }] 35 | } 36 | ``` 37 | 38 | #### columns 39 | 列属性,要求是一个数组 40 | 41 | 1. text: 显示在表头的文字 42 | 2. value: 对应data的key。treeTable将显示相应的value 43 | 3. width: 每列的宽度,为一个数字(可选) 44 | 45 | 如果你想要每个字段都有自定义的样式或者嵌套其他组件,columns可不提供,直接像在el-table一样写即可,如果没有自定义内容,提供columns将更加的便捷方便 46 | 47 | 如果你有几个字段是需要自定义的,几个不需要,那么可以将不需要自定义的字段放入columns,将需要自定义的内容放入到slot中,详情见后文 48 | ```javascript 49 | [{ 50 | value:string, 51 | text:string, 52 | width:number 53 | },{ 54 | value:string, 55 | text:string, 56 | width:number 57 | }] 58 | ``` 59 | 60 | #### expandAll 61 | 是否默认全部展开,boolean值,默认为false 62 | 63 | #### evalFunc 64 | 解析函数,function,非必须 65 | 66 | 如果不提供,将使用默认的[evalFunc](./eval.js) 67 | 68 | 如果提供了evalFunc,那么会用提供的evalFunc去解析data,并返回treeTable渲染所需要的值。如何编写一个evalFunc,请参考[*eval.js*](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/components/TreeTable/eval.js)或[*customEval.js*](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/example/table/treeTable/customEval.js) 69 | 70 | #### evalArgs 71 | 解析函数的参数,是一个数组 72 | 73 | **请注意,自定义的解析函数参数第一个为this.data,第二个参数为, this.expandAll,你不需要在evalArgs填写。一定记住,这两个参数是强制性的,并且位置不可颠倒** *this.data为需要解析的数据,this.expandAll为是否默认展开* 74 | 75 | 如你的解析函数需要的参数为`(this.data, this.expandAll,1,2,3,4)`,那么你只需要将`[1,2,3,4]`赋值给`evalArgs`就可以了 76 | 77 | 如果你的解析函数参数只有`(this.data, this.expandAll)`,那么就可以不用填写evalArgs了 78 | 79 | 具体可参考[*customEval.js*](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/example/table/treeTable/customEval.js)的函数参数和[customTreeTable](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/example/table/treeTable/customTreeTable.vue)的`evalArgs`属性值 80 | 81 | ## slot 82 | 这是一个自定义列的插槽。 83 | 84 | 默认情况下,treeTable只有一行行展示数据的功能。但是一般情况下,我们会要给行加上一个操作按钮或者根据当行数据展示不同的样式,这时我们就需要自定义列了。请参考[customTreeTable](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/example/table/treeTable/customTreeTable.vue),[实例效果](http://panjiachen.github.io/vue-element-admin/#/example/table/custom-tree-table) 85 | 86 | `slot`和`columns属性`可同时存在,columns里面的数据列会在slot自定义列的左边展示 87 | 88 | ## 其他 89 | 如果有其他的需求,请参考[el-table](http://element-cn.eleme.io/#/en-US/component/table)的api自行修改index.vue 90 | -------------------------------------------------------------------------------- /src/components/content/blog.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | -------------------------------------------------------------------------------- /src/components/file/List.vue: -------------------------------------------------------------------------------- 1 | 53 | 54 | 121 | 122 | 125 | -------------------------------------------------------------------------------- /src/components/log/List.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 78 | 79 | 82 | -------------------------------------------------------------------------------- /src/components/menu/list.vue: -------------------------------------------------------------------------------- 1 | 116 | 117 | 283 | -------------------------------------------------------------------------------- /src/components/quill/qeditor: -------------------------------------------------------------------------------- 1 | 2 | 7 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/components/role/list.vue: -------------------------------------------------------------------------------- 1 | 100 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | -------------------------------------------------------------------------------- /src/components/user/changepwd.vue: -------------------------------------------------------------------------------- 1 | 29 | 47 | -------------------------------------------------------------------------------- /src/components/user/list.vue: -------------------------------------------------------------------------------- 1 | 119 | 120 | 351 | 352 | 355 | -------------------------------------------------------------------------------- /src/components/user/profile.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 107 | -------------------------------------------------------------------------------- /src/components/welcome/bootdo.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 14 | 17 | -------------------------------------------------------------------------------- /src/components/welcome/home.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | 11 | 14 | -------------------------------------------------------------------------------- /src/components/welcome/index.vue: -------------------------------------------------------------------------------- 1 | 77 | 78 | 88 | 89 | 105 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import router from './router' 6 | import ElementUI from 'element-ui' 7 | import 'element-ui/lib/theme-chalk/index.css' 8 | import '@/assets/iconfont.css' 9 | import '@/assets/styles/main.scss' 10 | import '@/assets/css/font-awesome.min.css' 11 | 12 | Vue.config.productionTip = false 13 | Vue.use(ElementUI) 14 | 15 | /* eslint-disable no-new */ 16 | new Vue({ 17 | el: '#app', 18 | router, 19 | template: '', 20 | components: {App} 21 | }) 22 | 23 | /**权限指令**/ 24 | Vue.directive('has', { 25 | bind: function(el, binding) { 26 | if (!Vue.prototype.$_has(binding.value)) { 27 | el.parentNode.removeChild(el); 28 | } 29 | } 30 | }); 31 | //权限检查方法 32 | Vue.prototype.$_has = function(value) { 33 | let isExist=false; 34 | let buttonpermsStr=localStorage.getItem("perms"); 35 | if(buttonpermsStr==undefined || buttonpermsStr==null){ 36 | return false; 37 | } 38 | let buttonperms=JSON.parse(buttonpermsStr); 39 | for(let i=0;i-1){ 41 | isExist=true; 42 | break; 43 | } 44 | } 45 | return isExist; 46 | }; 47 | 48 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import Home from '@/components/Home' 4 | import Dashboard from '@/components/Dashboard' 5 | import Index from '@/components/welcome/index.vue' 6 | 7 | import BookList from '@/components/role/list' 8 | 9 | import UserList from '@/components/user/list' 10 | import UserChangePwd from '@/components/user/changepwd' 11 | import UserProfile from '@/components/user/profile' 12 | 13 | import MenuList from '@/components/menu/list' 14 | 15 | import FileList from '../components/file/List.vue' 16 | 17 | import LogList from '../components/log/List' 18 | 19 | 20 | // 懒加载方式,当路由被访问的时候才加载对应组件 21 | const Login = resolve => require(['@/components/Login'], resolve) 22 | 23 | Vue.use(Router) 24 | 25 | let router = new Router({ 26 | mode: 'history', 27 | routes: [ 28 | { 29 | path: '/index', 30 | name: '首页', 31 | component: Index 32 | }, 33 | { 34 | path: '/login', 35 | name: '登录', 36 | component: Login 37 | }, 38 | { 39 | path: '/', 40 | name: 'home', 41 | component: Home, 42 | redirect: '/dashboard', 43 | leaf: true, // 只有一个节点 44 | menuShow: true, 45 | iconCls: 'fa fa-home', // 图标样式class 46 | children: [ 47 | {path: '/dashboard', component: Dashboard, name: '首页', menuShow: true} 48 | ] 49 | }, 50 | { 51 | path: '/', 52 | component: Home, 53 | name: '用户管理', 54 | menuShow: true, 55 | leaf: true, // 只有一个节点 56 | iconCls: 'fa fa-user', // 图标样式class 57 | children: [ 58 | {path: '/admin/user', component: UserList, name: '用户列表', menuShow: true} 59 | ] 60 | }, 61 | { 62 | path: '/', 63 | component: Home, 64 | name: '菜单管理', 65 | menuShow: true, 66 | leaf: true, // 只有一个节点 67 | iconCls: 'fa fa-server', // 图标样式class 68 | children: [ 69 | {path: '/admin/menu', component: MenuList, name: '菜单列表', menuShow: true} 70 | ] 71 | }, 72 | { 73 | path: '/', 74 | component: Home, 75 | name: '角色管理', 76 | menuShow: true, 77 | leaf: true, 78 | iconCls: 'fa fa-group', 79 | children: [ 80 | {path: '/admin/role', component: BookList, name: '角色管理', menuShow: true}, 81 | ] 82 | }, 83 | 84 | { 85 | path: '/', 86 | component: Home, 87 | name: '文件管理', 88 | menuShow: true, 89 | leaf: true, 90 | iconCls: 'fa fa-group', 91 | children: [ 92 | {path: '/cms/file', component: FileList, name: '文件管理', menuShow: true}, 93 | ] 94 | }, 95 | { 96 | path: '/', 97 | component: Home, 98 | name: '日志管理', 99 | menuShow: true, 100 | leaf: true, 101 | iconCls: 'fa fa-group', 102 | children: [ 103 | {path: '/base/log', component: LogList, name: '日志管理', menuShow: true}, 104 | ] 105 | }, 106 | { 107 | path: '/', 108 | component: Home, 109 | name: '设置', 110 | menuShow: true, 111 | iconCls: 'iconfont icon-setting1', 112 | children: [ 113 | {path: '/user/profile', component: UserProfile, name: '个人信息', menuShow: true}, 114 | {path: '/user/changepwd', component: UserChangePwd, name: '修改密码', menuShow: true} 115 | ] 116 | }, 117 | 118 | 119 | ] 120 | }) 121 | 122 | router.beforeEach((to, from, next) => { 123 | // console.log('to:' + to.path) 124 | if (to.path.startsWith('/login')) { 125 | window.localStorage.removeItem('access-token') 126 | //window.localStorage.removeItem('access-user') 127 | next() 128 | } else if (to.path.startsWith('/index')) { 129 | next() 130 | } else { 131 | //let user = JSON.parse(window.localStorage.getItem('access-token')) 132 | let user = window.localStorage.getItem('access-token'); 133 | if (!user) { 134 | next({path: '/login'}) 135 | } else { 136 | next() 137 | } 138 | } 139 | }) 140 | 141 | export default router 142 | -------------------------------------------------------------------------------- /static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/static/.gitkeep -------------------------------------------------------------------------------- /static/defaultCover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcg0124/clouddo-view/bb9122062b93ef4f26abb7e03343dcb62f42cb2f/static/defaultCover.jpg --------------------------------------------------------------------------------