├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .postcssrc.js ├── README.md ├── build ├── build.js ├── check-versions.js ├── logo.png ├── 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 ├── index.html ├── package-lock.json ├── package.json ├── src ├── App.vue ├── assets │ ├── css │ │ ├── jsplumb.css │ │ └── ping.css │ ├── img │ │ └── login_bg.jpeg │ └── js │ │ ├── assist.js │ │ ├── jsPlumb.js │ │ ├── jsPlumb2.js │ │ ├── plugin.js │ │ └── vueGlobal.js ├── axios │ ├── ajax.js │ └── index.js ├── components │ ├── form │ │ ├── FormButton.vue │ │ └── index.js │ ├── format │ │ ├── FormatDate.vue │ │ ├── FormatGrowthRate.vue │ │ ├── FormatSufRate.vue │ │ ├── FormatVal.vue │ │ └── index.js │ ├── jsplumb │ │ ├── JspNode.vue │ │ └── index.js │ ├── layout │ │ ├── Header.vue │ │ ├── Layout.vue │ │ ├── LayoutNoSide.vue │ │ ├── Panel.vue │ │ └── index.js │ └── navside │ │ ├── Menu.vue │ │ ├── MenuItem.vue │ │ └── index.js ├── main.js ├── mock │ └── index.js ├── pages │ ├── JspNodeTest.vue │ ├── Test.vue │ ├── bdmap │ │ ├── BDMap.vue │ │ ├── api │ │ │ └── index.js │ │ ├── heatmap │ │ │ └── Heat.vue │ │ ├── index.js │ │ ├── mock │ │ │ └── index.js │ │ ├── pgheatmap │ │ │ └── PGHeat.vue │ │ └── polygon │ │ │ └── Polygon.vue │ ├── echarts │ │ ├── Echarts.vue │ │ ├── api │ │ │ └── index.js │ │ ├── bar │ │ │ └── Bar.vue │ │ ├── dashboard │ │ │ └── Dashboard.vue │ │ ├── index.js │ │ ├── line │ │ │ ├── Area.vue │ │ │ ├── Line.vue │ │ │ └── LineBar.vue │ │ └── pie │ │ │ └── Pie.vue │ ├── login │ │ ├── Login.vue │ │ ├── api │ │ │ └── index.js │ │ ├── index.js │ │ └── mock │ │ │ └── index.js │ ├── scene │ │ ├── Scene.vue │ │ ├── SceneDevelop.vue │ │ ├── SceneDevelop2.vue │ │ ├── api │ │ │ └── index.js │ │ ├── index.js │ │ └── mock │ │ │ └── index.js │ └── sysmanage │ │ ├── SysManage.vue │ │ ├── index.js │ │ ├── role │ │ └── Role.vue │ │ └── user │ │ └── User.vue └── router │ └── index.js └── static └── .gitkeep /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false 5 | }], 6 | "stage-2" 7 | ], 8 | "plugins": [ 9 | "transform-runtime", 10 | "transform-vue-jsx" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /config/ 3 | /dist/ 4 | /*.js 5 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | // https://eslint.org/docs/user-guide/configuring 2 | 3 | module.exports = { 4 | root: true, 5 | parser: 'babel-eslint', 6 | parserOptions: { 7 | sourceType: 'module' 8 | }, 9 | env: { 10 | browser: true, 11 | }, 12 | // https://github.com/standard/standard/blob/master/docs/RULES-en.md 13 | extends: 'standard', 14 | // required to lint *.vue files 15 | plugins: [ 16 | 'html' 17 | ], 18 | // add your custom rules here 19 | 'rules': { 20 | // allow paren-less arrow functions 21 | 'arrow-parens': 0, 22 | // allow async-await 23 | 'generator-star-spacing': 0, 24 | // allow debugger during development 25 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, 26 | "no-unused-vars": ["off", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }], 27 | "no-irregular-whitespace": 0, 28 | "no-undef": 0, 29 | "indent": 0, 30 | "eol-last": 0, 31 | "semi": [0,"always"], 32 | "no-extra-semi": 0, 33 | "no-irregular-whitespace":0, 34 | "lines-around-comment": [0,{"beforeBlockComment":true}] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | .idea 8 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | // to edit target browsers: use "browserslist" field in package.json 6 | "postcss-import": {}, 7 | "autoprefixer": {} 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # web-ui 2 | 3 | > A Vue.js project 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | npm install 10 | 11 | # serve with hot reload at localhost:8080 12 | npm run dev 13 | 14 | # build for production with minification 15 | npm run build 16 | 17 | # build for production and view the bundle analyzer report 18 | npm run build --report 19 | ``` 20 | 21 | For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). 22 | -------------------------------------------------------------------------------- /build/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | require('./check-versions')() 3 | 4 | process.env.NODE_ENV = 'production' 5 | 6 | const ora = require('ora') 7 | const rm = require('rimraf') 8 | const path = require('path') 9 | const chalk = require('chalk') 10 | const webpack = require('webpack') 11 | const config = require('../config') 12 | const webpackConfig = require('./webpack.prod.conf') 13 | 14 | const spinner = ora('building for production...') 15 | spinner.start() 16 | 17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 18 | if (err) throw err 19 | webpack(webpackConfig, function (err, stats) { 20 | spinner.stop() 21 | if (err) throw err 22 | process.stdout.write(stats.toString({ 23 | colors: true, 24 | modules: false, 25 | children: false, 26 | chunks: false, 27 | chunkModules: false 28 | }) + '\n\n') 29 | 30 | if (stats.hasErrors()) { 31 | console.log(chalk.red(' Build failed with errors.\n')) 32 | process.exit(1) 33 | } 34 | 35 | console.log(chalk.cyan(' Build complete.\n')) 36 | console.log(chalk.yellow( 37 | ' Tip: built files are meant to be served over an HTTP server.\n' + 38 | ' Opening index.html over file:// won\'t work.\n' 39 | )) 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /build/check-versions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const chalk = require('chalk') 3 | const semver = require('semver') 4 | const packageConfig = require('../package.json') 5 | const shell = require('shelljs') 6 | function exec (cmd) { 7 | return require('child_process').execSync(cmd).toString().trim() 8 | } 9 | 10 | const versionRequirements = [ 11 | { 12 | name: 'node', 13 | currentVersion: semver.clean(process.version), 14 | versionRequirement: packageConfig.engines.node 15 | } 16 | ] 17 | 18 | if (shell.which('npm')) { 19 | versionRequirements.push({ 20 | name: 'npm', 21 | currentVersion: exec('npm --version'), 22 | versionRequirement: packageConfig.engines.npm 23 | }) 24 | } 25 | 26 | module.exports = function () { 27 | const warnings = [] 28 | for (let i = 0; i < versionRequirements.length; i++) { 29 | const mod = versionRequirements[i] 30 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 31 | warnings.push(mod.name + ': ' + 32 | chalk.red(mod.currentVersion) + ' should be ' + 33 | chalk.green(mod.versionRequirement) 34 | ) 35 | } 36 | } 37 | 38 | if (warnings.length) { 39 | console.log('') 40 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 41 | console.log() 42 | for (let i = 0; i < warnings.length; i++) { 43 | const warning = warnings[i] 44 | console.log(' ' + warning) 45 | } 46 | console.log() 47 | process.exit(1) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /build/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoping1988/ping-vue-admin/6b9666d431fb4d4dc80fc6e025cb1f945cb23881/build/logo.png -------------------------------------------------------------------------------- /build/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const config = require('../config') 4 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 5 | const pkg = require('../package.json') 6 | 7 | exports.assetsPath = function (_path) { 8 | const assetsSubDirectory = process.env.NODE_ENV === 'production' 9 | ? config.build.assetsSubDirectory 10 | : config.dev.assetsSubDirectory 11 | return path.posix.join(assetsSubDirectory, _path) 12 | } 13 | 14 | exports.cssLoaders = function (options) { 15 | options = options || {} 16 | 17 | const cssLoader = { 18 | loader: 'css-loader', 19 | options: { 20 | sourceMap: options.sourceMap 21 | } 22 | } 23 | 24 | var postcssLoader = { 25 | loader: 'postcss-loader', 26 | options: { 27 | sourceMap: options.sourceMap 28 | } 29 | } 30 | 31 | // generate loader string to be used with extract text plugin 32 | function generateLoaders (loader, loaderOptions) { 33 | const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] 34 | if (loader) { 35 | loaders.push({ 36 | loader: loader + '-loader', 37 | options: Object.assign({}, loaderOptions, { 38 | sourceMap: options.sourceMap 39 | }) 40 | }) 41 | } 42 | 43 | // Extract CSS when that option is specified 44 | // (which is the case during production build) 45 | if (options.extract) { 46 | return ExtractTextPlugin.extract({ 47 | use: loaders, 48 | fallback: 'vue-style-loader' 49 | }) 50 | } else { 51 | return ['vue-style-loader'].concat(loaders) 52 | } 53 | } 54 | 55 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html 56 | return { 57 | css: generateLoaders(), 58 | postcss: generateLoaders(), 59 | less: generateLoaders('less'), 60 | sass: generateLoaders('sass', { indentedSyntax: true }), 61 | scss: generateLoaders('sass'), 62 | stylus: generateLoaders('stylus'), 63 | styl: generateLoaders('stylus') 64 | } 65 | } 66 | 67 | // Generate loaders for standalone style files (outside of .vue) 68 | exports.styleLoaders = function (options) { 69 | const output = [] 70 | const loaders = exports.cssLoaders(options) 71 | for (const extension in loaders) { 72 | const loader = loaders[extension] 73 | output.push({ 74 | test: new RegExp('\\.' + extension + '$'), 75 | use: loader 76 | }) 77 | } 78 | return output 79 | } 80 | 81 | exports.createNotifierCallback = function () { 82 | const notifier = require('node-notifier') 83 | 84 | return (severity, errors) => { 85 | if (severity !== 'error') { 86 | return 87 | } 88 | const error = errors[0] 89 | 90 | const filename = error.file && error.file.split('!').pop() 91 | notifier.notify({ 92 | title: pkg.name, 93 | message: severity + ': ' + error.name, 94 | subtitle: filename || '', 95 | icon: path.join(__dirname, 'logo.png') 96 | }) 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const config = require('../config') 4 | const isProduction = process.env.NODE_ENV === 'production' 5 | const sourceMapEnabled = isProduction 6 | ? config.build.productionSourceMap 7 | : config.dev.cssSourceMap 8 | 9 | 10 | module.exports = { 11 | loaders: utils.cssLoaders({ 12 | sourceMap: sourceMapEnabled, 13 | extract: isProduction 14 | }), 15 | cssSourceMap: sourceMapEnabled, 16 | cacheBusting: config.dev.cacheBusting, 17 | transformToRequire: { 18 | video: 'src', 19 | source: 'src', 20 | img: 'src', 21 | image: 'xlink:href' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const config = require('../config') 5 | const vueLoaderConfig = require('./vue-loader.conf') 6 | 7 | function resolve (dir) { 8 | return path.join(__dirname, '..', dir) 9 | } 10 | 11 | module.exports = { 12 | context: path.resolve(__dirname, '../'), 13 | entry: { 14 | app: './src/main.js' 15 | }, 16 | output: { 17 | path: config.build.assetsRoot, 18 | filename: '[name].js', 19 | publicPath: process.env.NODE_ENV === 'production' 20 | ? config.build.assetsPublicPath 21 | : config.dev.assetsPublicPath 22 | }, 23 | resolve: { 24 | extensions: ['.js', '.vue', '.json'], 25 | alias: { 26 | 'vue$': 'vue/dist/vue.esm.js', 27 | '@': resolve('src'), 28 | } 29 | }, 30 | module: { 31 | rules: [ 32 | ...(config.dev.useEslint? [{ 33 | test: /\.(js|vue)$/, 34 | loader: 'eslint-loader', 35 | enforce: 'pre', 36 | include: [resolve('src'), resolve('test')], 37 | options: { 38 | formatter: require('eslint-friendly-formatter'), 39 | emitWarning: !config.dev.showEslintErrorsInOverlay 40 | } 41 | }] : []), 42 | { 43 | test: /\.vue$/, 44 | loader: 'vue-loader', 45 | options: vueLoaderConfig 46 | }, 47 | { 48 | test: /\.js$/, 49 | loader: 'babel-loader', 50 | include: [resolve('src'), resolve('test')] 51 | }, 52 | { 53 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 54 | loader: 'url-loader', 55 | options: { 56 | limit: 10000, 57 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 58 | } 59 | }, 60 | { 61 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, 62 | loader: 'url-loader', 63 | options: { 64 | limit: 10000, 65 | name: utils.assetsPath('media/[name].[hash:7].[ext]') 66 | } 67 | }, 68 | { 69 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 70 | loader: 'url-loader', 71 | options: { 72 | limit: 10000, 73 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 74 | } 75 | } 76 | ] 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const webpack = require('webpack') 4 | const config = require('../config') 5 | const merge = require('webpack-merge') 6 | const baseWebpackConfig = require('./webpack.base.conf') 7 | const HtmlWebpackPlugin = require('html-webpack-plugin') 8 | const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') 9 | const portfinder = require('portfinder') 10 | 11 | const devWebpackConfig = merge(baseWebpackConfig, { 12 | module: { 13 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) 14 | }, 15 | // cheap-module-eval-source-map is faster for development 16 | devtool: config.dev.devtool, 17 | 18 | // these devServer options should be customized in /config/index.js 19 | devServer: { 20 | clientLogLevel: 'warning', 21 | historyApiFallback: true, 22 | hot: true, 23 | compress: true, 24 | host: process.env.HOST || config.dev.host, 25 | port: process.env.PORT || config.dev.port, 26 | open: config.dev.autoOpenBrowser, 27 | overlay: config.dev.errorOverlay ? { 28 | warnings: false, 29 | errors: true, 30 | } : false, 31 | publicPath: config.dev.assetsPublicPath, 32 | proxy: config.dev.proxyTable, 33 | quiet: true, // necessary for FriendlyErrorsPlugin 34 | watchOptions: { 35 | poll: config.dev.poll, 36 | } 37 | }, 38 | plugins: [ 39 | new webpack.DefinePlugin({ 40 | 'process.env': require('../config/dev.env') 41 | }), 42 | new webpack.HotModuleReplacementPlugin(), 43 | new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. 44 | new webpack.NoEmitOnErrorsPlugin(), 45 | // https://github.com/ampedandwired/html-webpack-plugin 46 | new HtmlWebpackPlugin({ 47 | filename: 'index.html', 48 | template: 'index.html', 49 | inject: true 50 | }), 51 | ] 52 | }) 53 | 54 | module.exports = new Promise((resolve, reject) => { 55 | portfinder.basePort = process.env.PORT || config.dev.port 56 | portfinder.getPort((err, port) => { 57 | if (err) { 58 | reject(err) 59 | } else { 60 | // publish the new Port, necessary for e2e tests 61 | process.env.PORT = port 62 | // add port to devServer config 63 | devWebpackConfig.devServer.port = port 64 | 65 | // Add FriendlyErrorsPlugin 66 | devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ 67 | compilationSuccessInfo: { 68 | messages: [`Your application is running here: http://${config.dev.host}:${port}`], 69 | }, 70 | onErrors: config.dev.notifyOnErrors 71 | ? utils.createNotifierCallback() 72 | : undefined 73 | })) 74 | 75 | resolve(devWebpackConfig) 76 | } 77 | }) 78 | }) 79 | -------------------------------------------------------------------------------- /build/webpack.prod.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const webpack = require('webpack') 5 | const config = require('../config') 6 | const merge = require('webpack-merge') 7 | const baseWebpackConfig = require('./webpack.base.conf') 8 | const CopyWebpackPlugin = require('copy-webpack-plugin') 9 | const HtmlWebpackPlugin = require('html-webpack-plugin') 10 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 11 | const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') 12 | 13 | const env = require('../config/prod.env') 14 | 15 | const webpackConfig = merge(baseWebpackConfig, { 16 | module: { 17 | rules: utils.styleLoaders({ 18 | sourceMap: config.build.productionSourceMap, 19 | extract: true, 20 | usePostCSS: true 21 | }) 22 | }, 23 | devtool: config.build.productionSourceMap ? config.build.devtool : false, 24 | output: { 25 | path: config.build.assetsRoot, 26 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 27 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 28 | }, 29 | plugins: [ 30 | // http://vuejs.github.io/vue-loader/en/workflow/production.html 31 | new webpack.DefinePlugin({ 32 | 'process.env': env 33 | }), 34 | // UglifyJs do not support ES6+, you can also use babel-minify for better treeshaking: https://github.com/babel/minify 35 | new webpack.optimize.UglifyJsPlugin({ 36 | compress: { 37 | warnings: false 38 | }, 39 | sourceMap: config.build.productionSourceMap, 40 | parallel: true 41 | }), 42 | // extract css into its own file 43 | new ExtractTextPlugin({ 44 | filename: utils.assetsPath('css/[name].[contenthash].css'), 45 | // set the following option to `true` if you want to extract CSS from 46 | // codesplit chunks into this main css file as well. 47 | // This will result in *all* of your app's CSS being loaded upfront. 48 | allChunks: false, 49 | }), 50 | // Compress extracted CSS. We are using this plugin so that possible 51 | // duplicated CSS from different components can be deduped. 52 | new OptimizeCSSPlugin({ 53 | cssProcessorOptions: config.build.productionSourceMap 54 | ? { safe: true, map: { inline: false } } 55 | : { safe: true } 56 | }), 57 | // generate dist index.html with correct asset hash for caching. 58 | // you can customize output by editing /index.html 59 | // see https://github.com/ampedandwired/html-webpack-plugin 60 | new HtmlWebpackPlugin({ 61 | filename: config.build.index, 62 | template: 'index.html', 63 | inject: true, 64 | minify: { 65 | removeComments: true, 66 | collapseWhitespace: true, 67 | removeAttributeQuotes: true 68 | // more options: 69 | // https://github.com/kangax/html-minifier#options-quick-reference 70 | }, 71 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 72 | chunksSortMode: 'dependency' 73 | }), 74 | // keep module.id stable when vender modules does not change 75 | new webpack.HashedModuleIdsPlugin(), 76 | // enable scope hoisting 77 | new webpack.optimize.ModuleConcatenationPlugin(), 78 | // split vendor js into its own file 79 | new webpack.optimize.CommonsChunkPlugin({ 80 | name: 'vendor', 81 | minChunks: function (module) { 82 | // any required modules inside node_modules are extracted to vendor 83 | return ( 84 | module.resource && 85 | /\.js$/.test(module.resource) && 86 | module.resource.indexOf( 87 | path.join(__dirname, '../node_modules') 88 | ) === 0 89 | ) 90 | } 91 | }), 92 | // extract webpack runtime and module manifest to its own file in order to 93 | // prevent vendor hash from being updated whenever app bundle is updated 94 | new webpack.optimize.CommonsChunkPlugin({ 95 | name: 'manifest', 96 | minChunks: Infinity 97 | }), 98 | // This instance extracts shared chunks from code splitted chunks and bundles them 99 | // in a separate chunk, similar to the vendor chunk 100 | // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk 101 | new webpack.optimize.CommonsChunkPlugin({ 102 | name: 'app', 103 | async: 'vendor-async', 104 | children: true, 105 | minChunks: 3 106 | }), 107 | 108 | // copy custom static assets 109 | new CopyWebpackPlugin([ 110 | { 111 | from: path.resolve(__dirname, '../static'), 112 | to: config.build.assetsSubDirectory, 113 | ignore: ['.*'] 114 | } 115 | ]) 116 | ] 117 | }) 118 | 119 | if (config.build.productionGzip) { 120 | const CompressionWebpackPlugin = require('compression-webpack-plugin') 121 | 122 | webpackConfig.plugins.push( 123 | new CompressionWebpackPlugin({ 124 | asset: '[path].gz[query]', 125 | algorithm: 'gzip', 126 | test: new RegExp( 127 | '\\.(' + 128 | config.build.productionGzipExtensions.join('|') + 129 | ')$' 130 | ), 131 | threshold: 10240, 132 | minRatio: 0.8 133 | }) 134 | ) 135 | } 136 | 137 | if (config.build.bundleAnalyzerReport) { 138 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 139 | webpackConfig.plugins.push(new BundleAnalyzerPlugin()) 140 | } 141 | 142 | module.exports = webpackConfig 143 | -------------------------------------------------------------------------------- /config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"' 7 | }) 8 | -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // Template version: 1.2.4 3 | // see http://vuejs-templates.github.io/webpack for documentation. 4 | 5 | const path = require('path') 6 | 7 | module.exports = { 8 | dev: { 9 | 10 | // Paths 11 | assetsSubDirectory: 'static', 12 | assetsPublicPath: '/', 13 | proxyTable: {}, 14 | disableHostCheck: true, 15 | // Various Dev Server settings 16 | host: '0.0.0.0', // can be overwritten by process.env.HOST 17 | port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined 18 | autoOpenBrowser: false, 19 | errorOverlay: true, 20 | notifyOnErrors: true, 21 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- 22 | 23 | // Use Eslint Loader? 24 | // If true, your code will be linted during bundling and 25 | // linting errors and warnings will be shown in the console. 26 | useEslint: true, 27 | // If true, eslint errors and warnings will also be shown in the error overlay 28 | // in the browser. 29 | showEslintErrorsInOverlay: false, 30 | 31 | /** 32 | * Source Maps 33 | */ 34 | 35 | // https://webpack.js.org/configuration/devtool/#development 36 | devtool: 'eval-source-map', 37 | 38 | // If you have problems debugging vue-files in devtools, 39 | // set this to false - it *may* help 40 | // https://vue-loader.vuejs.org/en/options.html#cachebusting 41 | cacheBusting: true, 42 | 43 | // CSS Sourcemaps off by default because relative paths are "buggy" 44 | // with this option, according to the CSS-Loader README 45 | // (https://github.com/webpack/css-loader#sourcemaps) 46 | // In our experience, they generally work as expected, 47 | // just be aware of this issue when enabling this option. 48 | cssSourceMap: false, 49 | }, 50 | 51 | build: { 52 | // Template for index.html 53 | index: path.resolve(__dirname, '../dist/index.html'), 54 | 55 | // Paths 56 | assetsRoot: path.resolve(__dirname, '../dist'), 57 | assetsSubDirectory: 'static', 58 | assetsPublicPath: '/', 59 | 60 | /** 61 | * Source Maps 62 | */ 63 | 64 | productionSourceMap: true, 65 | // https://webpack.js.org/configuration/devtool/#production 66 | devtool: '#source-map', 67 | 68 | // Gzip off by default as many popular static hosts such as 69 | // Surge or Netlify already gzip all static assets for you. 70 | // Before setting to `true`, make sure to: 71 | // npm install --save-dev compression-webpack-plugin 72 | productionGzip: false, 73 | productionGzipExtensions: ['js', 'css'], 74 | 75 | // Run the build command with an extra argument to 76 | // View the bundle analyzer report after build finishes: 77 | // `npm run build --report` 78 | // Set to `true` or `false` to always turn it on or off 79 | bundleAnalyzerReport: process.env.npm_config_report 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 后台系统模板 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web-ui", 3 | "version": "1.0.0", 4 | "description": "A Vue.js project", 5 | "author": "liujiangping ", 6 | "private": true, 7 | "scripts": { 8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", 9 | "start": "npm run dev", 10 | "lint": "eslint --ext .js,.vue src", 11 | "build": "node build/build.js" 12 | }, 13 | "dependencies": { 14 | "axios": "^0.17.1", 15 | "axios-mock-adapter": "^1.10.0", 16 | "babel-helper-vue-jsx-merge-props": "^2.0.3", 17 | "babel-plugin-syntax-jsx": "^6.18.0", 18 | "babel-plugin-transform-vue-jsx": "^3.5.0", 19 | "bootstrap": "^3.3.7", 20 | "element-ui": "^2.0.5", 21 | "font-awesome": "^4.7.0", 22 | "jsplumb": "^2.5.7", 23 | "mockjs": "^1.0.1-beta3", 24 | "ping-ui": "^1.0.1", 25 | "vue": "^2.5.2", 26 | "vue-router": "^3.0.1" 27 | }, 28 | "devDependencies": { 29 | "autoprefixer": "^7.1.2", 30 | "babel-core": "^6.22.1", 31 | "babel-eslint": "^7.1.1", 32 | "babel-loader": "^7.1.1", 33 | "babel-plugin-transform-runtime": "^6.22.0", 34 | "babel-preset-env": "^1.3.2", 35 | "babel-preset-stage-2": "^6.22.0", 36 | "babel-register": "^6.22.0", 37 | "chalk": "^2.0.1", 38 | "copy-webpack-plugin": "^4.0.1", 39 | "css-loader": "^0.28.0", 40 | "eslint": "^3.19.0", 41 | "eslint-friendly-formatter": "^3.0.0", 42 | "eslint-loader": "^1.7.1", 43 | "eslint-plugin-html": "^3.0.0", 44 | "eslint-config-standard": "^10.2.1", 45 | "eslint-plugin-promise": "^3.4.0", 46 | "eslint-plugin-standard": "^3.0.1", 47 | "eslint-plugin-import": "^2.7.0", 48 | "eslint-plugin-node": "^5.2.0", 49 | "eventsource-polyfill": "^0.9.6", 50 | "extract-text-webpack-plugin": "^3.0.0", 51 | "file-loader": "^1.1.4", 52 | "friendly-errors-webpack-plugin": "^1.6.1", 53 | "html-webpack-plugin": "^2.30.1", 54 | "webpack-bundle-analyzer": "^2.9.0", 55 | "node-notifier": "^5.1.2", 56 | "postcss-import": "^11.0.0", 57 | "postcss-loader": "^2.0.8", 58 | "semver": "^5.3.0", 59 | "shelljs": "^0.7.6", 60 | "optimize-css-assets-webpack-plugin": "^3.2.0", 61 | "ora": "^1.2.0", 62 | "rimraf": "^2.6.0", 63 | "url-loader": "^0.5.8", 64 | "vue-loader": "^13.3.0", 65 | "vue-style-loader": "^3.0.1", 66 | "vue-template-compiler": "^2.5.2", 67 | "portfinder": "^1.0.13", 68 | "webpack": "^3.6.0", 69 | "webpack-dev-server": "^2.9.1", 70 | "webpack-merge": "^4.1.0" 71 | }, 72 | "engines": { 73 | "node": ">= 4.0.0", 74 | "npm": ">= 3.0.0" 75 | }, 76 | "browserslist": [ 77 | "> 1%", 78 | "last 2 versions", 79 | "not ie <= 8" 80 | ] 81 | } 82 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 19 | -------------------------------------------------------------------------------- /src/assets/css/jsplumb.css: -------------------------------------------------------------------------------- 1 | .jsp-develop-title { 2 | text-align: center; 3 | font-size: 20px; 4 | font-weight: 700; 5 | height: 43px; 6 | } 7 | 8 | .jsp-develop-left, 9 | .jsp-develop-right, 10 | .jsp-develop-canvas { 11 | border-top: 1px solid #dfe4ed; 12 | float: left; 13 | height: calc(100% - 43px); 14 | overflow: auto; 15 | } 16 | 17 | .jsp-develop-left { 18 | width: 15%; 19 | } 20 | 21 | .jsp-develop-right { 22 | width: 25%; 23 | } 24 | 25 | .jsp-develop-canvas { 26 | width: 60%; 27 | border-left: 1px solid #dfe4ed; 28 | border-right: 1px solid #dfe4ed; 29 | } 30 | 31 | .jsp-develop-canvas .jsp-node { 32 | position: absolute; 33 | } 34 | 35 | .jsp-node { 36 | width: fit-content; 37 | height: 30px; 38 | line-height: 30px; 39 | font-size: 14px; 40 | border: 1px solid #2e6f9a; 41 | border-radius: 20px; 42 | cursor: pointer; 43 | background-color: white; 44 | z-index: 4; 45 | padding-right: 10px; 46 | padding-left: 10px; 47 | } 48 | 49 | .jsp-node i { 50 | color: #2e6f9a; 51 | } 52 | 53 | .jsp-selected, 54 | .jsp-node:hover, 55 | .jsp-node:hover .jsp-node-name i{ 56 | background-color: #5c96bc; 57 | color: white; 58 | } 59 | 60 | .jsp-selected, 61 | .jsp-selected i, 62 | .jsp-node:hover i{ 63 | color: white; 64 | } 65 | 66 | .jsp-node-tree { 67 | color: #888; 68 | font-size: 14px; 69 | } 70 | 71 | .jsp-node-tree i { 72 | color: #5c96bc; 73 | margin-right: 5px; 74 | } 75 | 76 | .jsp-node:hover .jsp-endpoint-circle, 77 | .jsp-node:hover .jsp-node-remove { 78 | display: block; 79 | } 80 | 81 | .jsp-endpoint-circle { 82 | display: none; 83 | width: 10px; 84 | height: 10px; 85 | border-radius: 100px; 86 | border: 1px solid #2e6f9a; 87 | position: absolute; 88 | left: calc(50% - 5px); 89 | background-color: white; 90 | } 91 | 92 | .jsp-endpoint-circle-top { 93 | top: -5px; 94 | } 95 | 96 | .jsp-endpoint-circle-bottom { 97 | bottom: -5px; 98 | } 99 | 100 | .jsp-node-remove { 101 | display: none; 102 | position: absolute; 103 | width: 15px; 104 | height: 15px; 105 | border-radius: 100px; 106 | /*border: 1px solid #5c96bc;*/ 107 | line-height: 15px; 108 | text-align: center; 109 | top: -15px; 110 | right: 0px; 111 | background-color: red!important; 112 | } 113 | 114 | .jtk-source-hover i, 115 | .jtk-target-hover i { 116 | color: white; 117 | } 118 | 119 | 120 | .aLabel.jtk-hover, .jtk-source-hover, .jtk-target-hover { 121 | background-color: #1e8151!important; 122 | color: white!important; 123 | } 124 | 125 | .jsp-container { 126 | position: relative; 127 | overflow: auto; 128 | width: 100%; 129 | height: calc(100% - 45px); 130 | } 131 | 132 | .jsp-flow-tool { 133 | width: 100%; 134 | height: 45px; 135 | text-align: center; 136 | line-height: 45px; 137 | } 138 | 139 | path { 140 | cursor: pointer; 141 | } 142 | -------------------------------------------------------------------------------- /src/assets/css/ping.css: -------------------------------------------------------------------------------- 1 | body, html { 2 | margin: 0; 3 | padding: 0; 4 | height: 100%; 5 | /*font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,SimSun,sans-serif;*/ 6 | font-family: "SF Pro SC","SF Pro Text","SF Pro Icons","PingFang SC","Helvetica Neue","Helvetica","Arial",sans-serif; 7 | font-weight: 400; 8 | font-size: 16px; 9 | color: #888; 10 | -webkit-font-smoothing: antialiased; 11 | overflow: hidden; 12 | display: block; 13 | /*background-color: #e8ebed;*/ 14 | } 15 | 16 | /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/ 17 | ::-webkit-scrollbar 18 | { 19 | width: 8px; 20 | height: 8px; 21 | background-color: #F5F5F5; 22 | } 23 | 24 | /*定义滚动条轨道 内阴影+圆角*/ 25 | ::-webkit-scrollbar-track 26 | { 27 | -webkit-box-shadow: inset 0 0 6px #E8EBED; 28 | border-radius: 10px; 29 | background-color: #F5F5F5; 30 | } 31 | 32 | /*定义滑块 内阴影+圆角*/ 33 | ::-webkit-scrollbar-thumb 34 | { 35 | border-radius: 10px; 36 | -webkit-box-shadow: inset 0 0 6px #E8EBED; 37 | background-color: #ccc; 38 | } 39 | 40 | .p-row { 41 | margin: 0px; 42 | } 43 | 44 | .p-col { 45 | padding: 0px; 46 | } 47 | 48 | .p-login { 49 | width: 100%; 50 | height: 100%; 51 | background: url(../img/login_bg.jpeg) no-repeat center; 52 | background-size: 100% 100%; 53 | } 54 | 55 | .p-login-input { 56 | text-align: center; 57 | margin-bottom: 20px; 58 | } 59 | 60 | .p-login-input input::-webkit-input-placeholder { 61 | color: white; 62 | } 63 | 64 | .p-login-input input, 65 | .p-login-submit-button{ 66 | width: 80%; 67 | height: 30px; 68 | line-height: 10px; 69 | background: transparent; 70 | outline: none; 71 | color: white; 72 | text-align: center; 73 | border: 3px solid #0095ff; 74 | border-radius: 20px; 75 | font-size: 16px; 76 | letter-spacing: 4px; 77 | /*display: flex;*/ 78 | margin: 0 auto; 79 | text-align: center; 80 | } 81 | 82 | .p-login-input input:focus, 83 | .p-login-input.has-text input{ 84 | background: rgba(22, 94, 128, 0.67); 85 | } 86 | 87 | .p-login-submit-button { 88 | font-size: 20px; 89 | background-color: rgba(0,180,255,0.6); 90 | border: none; 91 | } 92 | 93 | .p-header { 94 | position: fixed; 95 | width: 100%; 96 | height: 60px; 97 | line-height: 60px; 98 | border-bottom: 1px solid #dfe4ed; 99 | } 100 | 101 | .p-logo { 102 | height: 100%; 103 | text-align: center; 104 | width: 180px; 105 | font-size: 18px; 106 | font-weight: 700; 107 | color: #50bfff; 108 | float: left; 109 | } 110 | 111 | .p-header-navbar { 112 | height: 100%; 113 | float: left; 114 | } 115 | 116 | .p-header-navbar ul { 117 | height: 100%; 118 | margin-bottom: 0px; 119 | } 120 | 121 | .p-header-navbar ul li { 122 | height: 100%; 123 | display: inline-block; 124 | padding-left: 15px; 125 | padding-right: 15px; 126 | cursor: pointer; 127 | } 128 | 129 | .p-header-navbar ul li:hover, 130 | .p-header-navbar ul .actived { 131 | color: #50bfff; 132 | border-bottom: 3px solid #50bfff; 133 | } 134 | 135 | .p-header-right { 136 | float: right; 137 | margin-right: 15px; 138 | } 139 | 140 | .p-header-right span { 141 | cursor: pointer; 142 | padding-left: 10px; 143 | } 144 | 145 | .p-full-screen .p-header, 146 | .p-full-screen .p-navside{ 147 | display: none!important; 148 | } 149 | 150 | .p-full-screen .p-page-content { 151 | width: 100%!important; 152 | height: 100%!important; 153 | top: 0px!important; 154 | margin-left: 0px!important; 155 | } 156 | 157 | .p-layout .p-navside { 158 | width: 180px; 159 | } 160 | 161 | .p-layout .p-page-content { 162 | margin-left: 180px; 163 | width: calc(100% - 180px); 164 | } 165 | 166 | .p-no-navside .p-page-content { 167 | margin-left: 0px!important; 168 | width: 100%!important; 169 | } 170 | 171 | .p-navside { 172 | position: fixed; 173 | top: 60px; 174 | height: calc(100% - 60px); 175 | border-right: 1px solid #dfe4ed; 176 | overflow: auto; 177 | font-size: 14px; 178 | } 179 | 180 | .p-navside-toggle { 181 | background: rgba(221, 221, 221, 0.19); 182 | text-align: center; 183 | height: 30px; 184 | line-height: 30px; 185 | cursor: pointer; 186 | } 187 | 188 | .p-navside .p-menu-item-icon { 189 | margin-left: 20px; 190 | margin-right: 10px; 191 | } 192 | 193 | .p-navside-menu { 194 | padding-left: 15px; 195 | padding-right: 15px; 196 | } 197 | 198 | .p-navside-menu ul { 199 | margin-bottom: 0px; 200 | padding-left: 0px; 201 | } 202 | 203 | .p-navside-menu ul li{ 204 | list-style: none; 205 | height: 35px; 206 | line-height: 35px; 207 | margin-top: 15px; 208 | margin-bottom: 15px; 209 | cursor: pointer; 210 | } 211 | 212 | .p-navside-menu ul li:hover{ 213 | background: rgba(0, 162, 255, 0.2); 214 | border-radius: 20px; 215 | color: #FFFFFF; 216 | } 217 | 218 | .p-navside-menu ul .actived{ 219 | background: #50bfff!important; 220 | border-radius: 20px; 221 | color: #FFFFFF; 222 | } 223 | 224 | .p-navside-stop .p-navside { 225 | width: 70px!important; 226 | text-align: center; 227 | } 228 | 229 | .p-navside-stop .p-navside .p-menu-item-name { 230 | display: none; 231 | } 232 | 233 | .p-navside-stop .p-navside .p-menu-item-icon { 234 | margin-left: 0px; 235 | margin-right: 0px; 236 | } 237 | 238 | .p-navside-stop .p-page-content { 239 | margin-left: 70px!important; 240 | width: calc(100% - 70px)!important; 241 | } 242 | 243 | .p-page-content { 244 | padding: 15px; 245 | position: absolute; 246 | top: 60px; 247 | height: calc(100% - 60px); 248 | overflow: auto; 249 | } 250 | 251 | .p-full-page { 252 | padding: 15px; 253 | position: absolute; 254 | width: 100%; 255 | height: 100%; 256 | overflow: auto; 257 | } 258 | 259 | button { 260 | border-radius: 20px!important; 261 | } 262 | 263 | button .fa { 264 | margin-right: 5px; 265 | } 266 | 267 | .p-panel-head { 268 | max-height: 45px; 269 | } 270 | 271 | .p-panel-head .p-panel-title, 272 | .p-panel-head .p-panel-head-right { 273 | /*height: 45px;*/ 274 | /*line-height: 45px;*/ 275 | /*position: relative;*/ 276 | } 277 | 278 | .p-panel-title { 279 | padding-left: 10px; 280 | } 281 | 282 | .p-panel-head-right { 283 | padding-right: 10px; 284 | } 285 | 286 | .p-panel-content { 287 | padding: 10px; 288 | box-shadow: 0px 0px 6px 2px #eee; 289 | border-radius: 5px; 290 | } 291 | 292 | .p-scene-list { 293 | padding: 50px 100px; 294 | } 295 | 296 | .p-scene-panel { 297 | width: 140px; 298 | height: 250px; 299 | float: left; 300 | position: relative; 301 | margin-right: 10px; 302 | margin-bottom: 10px; 303 | box-shadow: 0px 0px 6px 2px #eee; 304 | cursor: pointer; 305 | } 306 | 307 | .p-middle { 308 | display: flex; 309 | justify-content: center; 310 | align-items: center; 311 | } 312 | 313 | .p-scene-add { 314 | text-align: center; 315 | background-color: #50bfff; 316 | color: white; 317 | font-weight: 700; 318 | } 319 | 320 | .p-scene-item .p-scene-item-data, 321 | .p-scene-item .p-scene-item-action { 322 | padding: 5px; 323 | position: absolute; 324 | width: 100%; 325 | height: 100%; 326 | } 327 | 328 | .p-scene-item:hover .p-scene-item-action { 329 | display: flex; 330 | } 331 | 332 | .p-scene-item-action { 333 | display: none; 334 | z-index: 100; 335 | text-align: center; 336 | background-color: rgba(0, 162, 255, 0.57); 337 | } 338 | 339 | .p-scene-item-action .el-button{ 340 | background: none; 341 | color: white; 342 | border: 1px solid white; 343 | } 344 | 345 | .p-scene-item-action .el-button:hover{ 346 | color: #409EFF; 347 | background-color: #FFFFFF; 348 | } 349 | 350 | .p-scene-item-action-button { 351 | margin-bottom: 10px; 352 | } 353 | 354 | .p-scene-item-title { 355 | width: 100%; 356 | text-align: center; 357 | font-weight: 700; 358 | height: 44px; 359 | } 360 | 361 | .p-scene-item-icon { 362 | width: 100%; 363 | height: 100px; 364 | line-height: 110px; 365 | text-align: center; 366 | color: #eb9e05; 367 | } 368 | 369 | .p-scene-item-detail { 370 | font-size: 12px; 371 | } 372 | 373 | .p-scene-item-desc { 374 | width: 100%; 375 | height: 52px; 376 | display: -webkit-box; 377 | -webkit-box-orient: vertical; 378 | -webkit-line-clamp: 3; 379 | overflow: hidden; 380 | } 381 | 382 | .p-scene-item-bottom { 383 | height: 34px; 384 | width: 100%; 385 | padding-top: 15px; 386 | /*text-align: center;*/ 387 | } 388 | 389 | .p-scene-loadmore { 390 | text-align: center; 391 | line-height: 250px; 392 | } 393 | 394 | .p-scene-loadmore:hover { 395 | color: white; 396 | background-color: rgba(0, 162, 255, 0.57); 397 | } 398 | 399 | .p-map { 400 | height: calc(100% + 30px); 401 | margin: -15px; 402 | } 403 | 404 | .BMapLabel { 405 | margin-bottom: 0px!important; 406 | max-width: none!important; 407 | } 408 | 409 | .p-map-left-panel { 410 | position: absolute; 411 | top: 30px; 412 | left: 30px; 413 | z-index: 100; 414 | background-color: #FFFFFF; 415 | } 416 | 417 | .p-map-right-panel { 418 | position: absolute; 419 | top: 30px; 420 | right: 30px; 421 | z-index: 100; 422 | background-color: #FFFFFF; 423 | } 424 | 425 | .legendInfo { 426 | background: #fff; 427 | line-height: 30px; 428 | font-size: 12px; 429 | width:fit-content; 430 | } 431 | 432 | .legendInfo > ul { 433 | margin-bottom: 0px; 434 | padding: 8px 10px 10px 10px; 435 | width:fit-content; 436 | } 437 | 438 | .legendInfo > ul > li{ 439 | line-height: 0px; 440 | vertical-align: top; 441 | width:fit-content; 442 | list-style-type: none; 443 | } 444 | 445 | .legendInfo > ul > li:hover{ 446 | cursor: pointer; 447 | } 448 | 449 | .legend-label{ 450 | float: left; 451 | width: 10px; 452 | height: 10px; 453 | padding-top: 0px; 454 | margin: 7px 0px 0px 0px; 455 | } 456 | 457 | .legend-name{ 458 | font-size: 12px; 459 | padding: 0px 0px 0px 15px; 460 | margin: 0px; 461 | width:fit-content; 462 | } 463 | 464 | 465 | .legend-label-long{ 466 | float: left; 467 | width: 25px; 468 | height: 15px; 469 | padding-top: 0px; 470 | margin: 7px 0px 0px 0px; 471 | } 472 | 473 | .legend-name-long{ 474 | height: 25px; 475 | line-height: 30px; 476 | font-size: 12px; 477 | padding: 0px 0px 0px 35px; 478 | margin: 0px; 479 | width:fit-content; 480 | } 481 | -------------------------------------------------------------------------------- /src/assets/img/login_bg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoping1988/ping-vue-admin/6b9666d431fb4d4dc80fc6e025cb1f945cb23881/src/assets/img/login_bg.jpeg -------------------------------------------------------------------------------- /src/assets/js/assist.js: -------------------------------------------------------------------------------- 1 | const cookieTokenKey = 'p_token' 2 | 3 | const sessionUserKey = 'p_user' 4 | 5 | /** 6 | * 将登录用户放到sessionStorage中 7 | * @param user 8 | */ 9 | function setLoginUser (user) { 10 | localStorage.setItem(sessionUserKey, JSON.stringify(user)) 11 | addCookie(cookieTokenKey, user.token, 24) 12 | } 13 | export {setLoginUser} 14 | /** 15 | * 移除sessionStorage中的登录用户 16 | */ 17 | function removeLoginUser () { 18 | localStorage.removeItem(sessionUserKey) 19 | deleteCookie(cookieTokenKey) 20 | } 21 | export {removeLoginUser} 22 | /** 23 | * 获取登录用户信息 24 | */ 25 | function getLoginUser () { 26 | return JSON.parse(localStorage.getItem(sessionUserKey)) 27 | } 28 | export {getLoginUser} 29 | 30 | /** 31 | * 获取登录用户页面元素权限信息 32 | */ 33 | function getPageAuth () { 34 | return JSON.parse(localStorage.getItem(sessionUserKey)).pageIdsObj 35 | } 36 | export {getPageAuth} 37 | 38 | /** 39 | * 添加cookie 40 | * @param name 41 | * @param value 42 | * @param expireHours 有效时间,单位小时,为0 43 | */ 44 | function addCookie (name, value, expireHours) { 45 | let cookieString = name + '=' + value 46 | // 判断是否设置过期时间 47 | if (expireHours > 0) { 48 | let date = new Date() 49 | date.setTime(date.getTime + expireHours * 3600 * 1000) 50 | cookieString = cookieString + '; expires=' + date.toGMTString() 51 | } 52 | document.cookie = cookieString 53 | } 54 | 55 | export {addCookie} 56 | 57 | /** 58 | * 获取cookie 59 | * @param name 60 | * @returns {*} 61 | */ 62 | function getCookie (name) { 63 | let strCookie = document.cookie 64 | let arrCookie = strCookie.split('; ') 65 | for (let i = 0; i < arrCookie.length; i++) { 66 | let arr = arrCookie[i].split('=') 67 | if (arr[0] === name) return arr[1] 68 | } 69 | return '' 70 | } 71 | 72 | export {getCookie} 73 | 74 | /** 75 | * 删除cookie, 即把value设置为空 76 | * @param name 77 | */ 78 | function deleteCookie (name) { 79 | let date = new Date() 80 | date.setTime(date.getTime() - 10000) 81 | document.cookie = name + '=v; expires=' + date.toGMTString() 82 | } 83 | 84 | export {deleteCookie} 85 | 86 | /** 87 | * 获取cookie中的token 88 | * @returns {*} 89 | */ 90 | function getTokenCookie () { 91 | return getCookie(cookieTokenKey) 92 | } 93 | 94 | export {getTokenCookie} 95 | 96 | /** 97 | * 删除cookie中的token 98 | */ 99 | function removeTokenCookie () { 100 | deleteCookie(cookieTokenKey) 101 | } 102 | 103 | export {removeTokenCookie} 104 | 105 | const defaultDatePattern = 'yyyy-MM-dd' 106 | 107 | /** 108 | * 解析日期字符串为日期Date对象 109 | * @param dateStr 字符串日期 110 | * @param pattern 日期格式 111 | * @returns {Date} 112 | */ 113 | function parseStrToDate (dateStr, pattern) { 114 | if (!pattern || pattern === '') pattern = defaultDatePattern 115 | let date = new Date() 116 | if (pattern.includes('yyyy')) { // 年份 117 | date.setFullYear(Number(dateStr.substr(pattern.indexOf('yyyy'), 4))) 118 | } 119 | if (pattern.includes('MM')) { // 月份 120 | date.setMonth(Number(dateStr.substr(pattern.indexOf('MM'), 2)) - 1) 121 | } 122 | if (pattern.includes('dd')) { // 天 123 | date.setDate(Number(dateStr.substr(pattern.indexOf('dd'), 2))) 124 | } 125 | if (pattern.includes('HH')) { // 小时 126 | date.setHours(Number(dateStr.substr(pattern.indexOf('HH'), 2))) 127 | } 128 | if (pattern.includes('mm')) { // 分钟 129 | date.setMinutes(Number(dateStr.substr(pattern.indexOf('mm'), 2))) 130 | } 131 | if (pattern.includes('ss')) { // 秒 132 | date.setSeconds(Number(dateStr.substr(pattern.indexOf('ss'), 2))) 133 | } 134 | if (pattern.includes('SSS')) { // 毫秒 135 | date.setMilliseconds(Number(dateStr.substr(pattern.indexOf('SSS'), 3))) 136 | } 137 | return date 138 | } 139 | 140 | export {parseStrToDate} 141 | 142 | /** 143 | * 格式化日期 144 | * @param dat 日期对象 145 | * @param parttern 格式 146 | * @returns {*} 147 | */ 148 | function formatDate (dat, parttern) { 149 | if (!parttern || parttern === '') parttern = defaultDatePattern 150 | let o = { 151 | 'M+': dat.getMonth() + 1, // 月份 152 | 'd+': dat.getDate(), // 日 153 | 'h+': dat.getHours() % 12 === 0 ? 12 : dat.getHours() % 12, // 小时 154 | 'H+': dat.getHours(), // 小时 155 | 'm+': dat.getMinutes(), // 分 156 | 's+': dat.getSeconds(), // 秒 157 | 'q+': Math.floor((dat.getMonth() + 3) / 3), // 季度 158 | 'S': dat.getMilliseconds() // 毫秒 159 | }; 160 | let week = { 161 | '0': '/u65e5', 162 | '1': '/u4e00', 163 | '2': '/u4e8c', 164 | '3': '/u4e09', 165 | '4': '/u56db', 166 | '5': '/u4e94', 167 | '6': '/u516d' 168 | }; 169 | if (/(y+)/.test(parttern)) { 170 | parttern = parttern.replace(RegExp.$1, (dat.getFullYear() + '').substr(4 - RegExp.$1.length)); 171 | } 172 | if (/(E+)/.test(parttern)) { 173 | parttern = parttern.replace(RegExp.$1, ((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? '/u661f/u671f' : '/u5468') : '') + week[dat.getDay() + '']); 174 | } 175 | for (let k in o) { 176 | if (new RegExp('(' + k + ')').test(parttern)) { 177 | parttern = parttern.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))); 178 | } 179 | } 180 | return parttern; 181 | } 182 | 183 | export {formatDate} 184 | 185 | /** 186 | * 获取某个日期范围内的所有日期 187 | * @param startDate 188 | * @param stopDate 189 | * @returns {Array} 190 | */ 191 | function getDates (startDate, stopDate, parttern) { 192 | if (!parttern || parttern === '') parttern = defaultDatePattern 193 | let dateArray = [] 194 | let currentDate = startDate 195 | while (currentDate <= stopDate) { 196 | dateArray.push(formatDate(currentDate, parttern)) 197 | currentDate = new Date(currentDate.setDate(currentDate.getDate() + 1)) 198 | } 199 | return dateArray; 200 | } 201 | 202 | export {getDates} 203 | 204 | /** 205 | * 获取两个时间区间的天数 206 | * @param startDate 207 | * @param stopDate 208 | * @param parttern 209 | * @returns {Number} 210 | */ 211 | function getDays (startDate, stopDate, parttern) { 212 | if (!parttern || parttern === '') parttern = defaultDatePattern 213 | return getDates(parseStrToDate(startDate, parttern), parseStrToDate(stopDate, parttern)).length 214 | } 215 | 216 | export {getDays} 217 | 218 | // const ak = 'DD279b2a90afdf0ae7a3796787a0742e' 219 | const ak = 'C442db13ee343023e84546b6765dfcff' 220 | /** 221 | * 异步加载百度地图 222 | * @returns {Promise} 223 | * @constructor 224 | */ 225 | function loadBaiDuMap () { 226 | return new Promise(function (resolve, reject) { 227 | window.init = function () { 228 | resolve(BMap) 229 | } 230 | let script1 = document.createElement('script') 231 | script1.type = 'text/javascript' 232 | script1.src = 'https://api.map.baidu.com/api?v=2.0&ak=' + ak + '&callback=init' 233 | script1.onerror = reject 234 | document.head.appendChild(script1) 235 | }) 236 | } 237 | 238 | export {loadBaiDuMap} 239 | 240 | /** 241 | * 异步加载百度地图,以及热力图插件 242 | * @returns {Promise} 243 | * @constructor 244 | */ 245 | function loadBaiDuHeatMap () { 246 | return new Promise(function (resolve, reject) { 247 | window.init = function () { 248 | resolve(BMap) 249 | let script2 = document.createElement('script') 250 | script2.type = 'text/javascript' 251 | script2.src = 'https://api.map.baidu.com/library/Heatmap/2.0/src/Heatmap_min.js' 252 | script2.onerror = reject 253 | document.body.appendChild(script2) 254 | } 255 | let script1 = document.createElement('script') 256 | script1.type = 'text/javascript' 257 | script1.src = 'https://api.map.baidu.com/api?v=2.0&ak=' + ak + '&callback=init' 258 | script1.onerror = reject 259 | document.body.appendChild(script1) 260 | }) 261 | } 262 | 263 | export {loadBaiDuHeatMap} 264 | -------------------------------------------------------------------------------- /src/assets/js/jsPlumb.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 流程节点类型,依赖约束 3 | * @type {{database: {code: string, name: string, icon: string, next: (*)}, featureProcess: {code: string, name: string, icon: string, next: (*)}, dataSegment: {code: string, name: string, icon: string}}} 4 | */ 5 | const flowNodeType = { 6 | /** 7 | * 数据源,后面只能接特征处理组件 8 | */ 9 | database: { 10 | code: 'database', 11 | name: '数据源', 12 | icon: 'database', 13 | next: ['featureProcess'], 14 | msg: '数据源组件后面只能连接特征处理组件' 15 | }, 16 | /** 17 | * 特征处理,后面只能接数据切分组件 18 | */ 19 | featureProcess: { 20 | code: 'featureProcess', 21 | name: '特征处理', 22 | icon: 'wrench', 23 | next: ['dataSegment'], 24 | msg: '特征处理组件后面只能连接数据切分组件' 25 | }, 26 | /** 27 | * 数据切分,后面不能再有组件 28 | */ 29 | dataSegment: { 30 | code: 'dataSegment', 31 | name: '数据切分', 32 | icon: 'cube', 33 | msg: '数据切分组件后面不能再连接组件' 34 | } 35 | } 36 | 37 | /** 38 | * 流程节点组件 39 | * @type {{db_hive: {code: string, name: string, nodeType: (*)}, fp_miss_value: {code: string, name: string, nodeType: (*)}, fp_value_range: {code: string, name: string, nodeType: (*)}, fp_normalization: {code: string, name: string, nodeType: (*)}, fp_bucket: {code: string, name: string, nodeType: (*)}, fp_discretization: {code: string, name: string, nodeType: (*)}, ds_time: {code: string, name: string, nodeType: (*)}, ds_random: {code: string, name: string, nodeType: (*)}}} 40 | */ 41 | const flowNode = { 42 | /** 43 | * hive数据源 44 | */ 45 | db_hive: { 46 | code: 'db_hive', 47 | name: 'hive', 48 | nodeType: flowNodeType.database 49 | }, 50 | /** 51 | * 特征处理,缺失值处理 52 | */ 53 | fp_miss_value: { 54 | code: 'fp_miss_value', 55 | name: '缺失值处理', 56 | nodeType: flowNodeType.featureProcess 57 | }, 58 | /** 59 | * 特征处理,取值范围 60 | */ 61 | fp_value_range: { 62 | code: 'fp_value_range', 63 | name: '取值范围', 64 | nodeType: flowNodeType.featureProcess 65 | }, 66 | /** 67 | * 特征处理,归一化 68 | */ 69 | fp_normalization: { 70 | code: 'fp_normalization', 71 | name: '归一化', 72 | nodeType: flowNodeType.featureProcess 73 | }, 74 | /** 75 | * 特征处理,分箱 76 | */ 77 | fp_bucket: { 78 | code: 'fp_bucket', 79 | name: '分箱', 80 | nodeType: flowNodeType.featureProcess 81 | }, 82 | /** 83 | * 特征处理,离散化 84 | */ 85 | fp_discretization: { 86 | code: 'fp_discretization', 87 | name: '离散化', 88 | nodeType: flowNodeType.featureProcess 89 | }, 90 | /** 91 | * 数据切分,时间分组 92 | */ 93 | ds_time: { 94 | code: 'ds_time', 95 | name: '时间分组', 96 | nodeType: flowNodeType.dataSegment 97 | }, 98 | /** 99 | * 数据切分,随机分组 100 | */ 101 | ds_random: { 102 | code: 'ds_random', 103 | name: '随机分组', 104 | nodeType: flowNodeType.dataSegment 105 | } 106 | } 107 | 108 | /** 109 | * 获取某个node的icon 110 | * @param id 111 | * @returns {string} 112 | */ 113 | function getNodeIcon (nodeCode) { 114 | if (flowNode[nodeCode]) { 115 | return flowNode[nodeCode].nodeType.icon 116 | } 117 | return 'dot-circle-o' 118 | } 119 | 120 | export {getNodeIcon} 121 | 122 | /** 123 | * 获取组件数 124 | */ 125 | function getNodeTree () { 126 | let tree = [] 127 | Object.keys(flowNodeType).forEach(key => { 128 | let _children = [] 129 | Object.values(flowNode).forEach(value => { 130 | if (value.nodeType.code === flowNodeType[key].code) { 131 | _children.push({code: value.code, label: value.name, icon: flowNodeType[key].icon, isLeaf: true}) 132 | } 133 | }) 134 | tree.push({code: flowNodeType[key].code, label: flowNodeType[key].name, icon: 'folder', children: _children}) 135 | }) 136 | return tree 137 | } 138 | 139 | export {getNodeTree} 140 | 141 | /** 142 | * 判断两个节点连接是否合法 143 | * @param sourceNodeCode 源节点 144 | * @param targetNodeCode 目标节点 145 | * @returns {{code: number, msg: string}} 返回,code=0代表合法,code=1代表不合法,msg是提示消息 146 | */ 147 | function validNodeConnect (sourceNodeCode, targetNodeCode) { 148 | let res = { 149 | code: 0, 150 | msg: '' 151 | } 152 | if (!flowNode[sourceNodeCode].nodeType.next || !flowNode[sourceNodeCode].nodeType.next.includes(flowNode[targetNodeCode].nodeType.code)) { 153 | res.code = 1 154 | res.msg = flowNode[sourceNodeCode].nodeType.msg 155 | } 156 | return res 157 | } 158 | 159 | export {validNodeConnect} 160 | // /** 161 | // * 获取组件树 162 | // */ 163 | // function getNodeTree () { 164 | // let root = { 165 | // id: 0 166 | // } 167 | // addChild(root) 168 | // return root.children 169 | // } 170 | // 171 | // export {getNodeTree} 172 | // 173 | // /** 174 | // * 递归增加child 175 | // * @param parent 176 | // */ 177 | // function addChild (parent) { 178 | // let _nodes = nodes.filter(n => n.pid === parent.id) 179 | // if (_nodes && _nodes.length > 0) { 180 | // parent.children = [] 181 | // _nodes.forEach(n => { 182 | // let treeNode = { 183 | // id: n.id, 184 | // label: n.name, 185 | // icon: n.icon 186 | // } 187 | // parent.children.push(treeNode) 188 | // addChild(treeNode) 189 | // }) 190 | // } else { 191 | // parent.isLeaf = true 192 | // } 193 | // } 194 | -------------------------------------------------------------------------------- /src/assets/js/jsPlumb2.js: -------------------------------------------------------------------------------- 1 | const nodes = [ 2 | {id: 1, name: '数据源', icon: 'folder', pid: 0}, 3 | {id: 2, name: 'hive', icon: 'database', pid: 1}, 4 | {id: 3, name: 'mysql', icon: 'database', pid: 1}, 5 | {id: 4, name: 'hbase', icon: 'database', pid: 1}, 6 | {id: 5, name: '特征处理', icon: 'folder', pid: 0}, 7 | {id: 6, name: '归一化', icon: 'wrench', pid: 5}, 8 | {id: 7, name: '离散化', icon: 'wrench', pid: 5}, 9 | {id: 8, name: '模型', icon: 'folder', pid: 0}, 10 | {id: 9, name: '分类', icon: 'folder', pid: 8}, 11 | {id: 11, name: '逻辑回归', icon: 'crosshairs', pid: 9}, 12 | {id: 12, name: '朴素贝叶斯', icon: 'crosshairs', pid: 9}, 13 | {id: 13, name: '决策树', icon: 'crosshairs', pid: 9}, 14 | {id: 14, name: '支持向量机', icon: 'crosshairs', pid: 9}, 15 | {id: 15, name: '随机森林', icon: 'crosshairs', pid: 9}, 16 | {id: 16, name: '聚类', icon: 'folder', pid: 8}, 17 | {id: 17, name: 'K-MEANS', icon: 'crosshairs', pid: 16}, 18 | {id: 18, name: 'K-MEDOIDS', icon: 'crosshairs', pid: 16}, 19 | {id: 19, name: '层次聚类', icon: 'crosshairs', pid: 16}, 20 | {id: 20, name: 'GMM', icon: 'crosshairs', pid: 16}, 21 | {id: 21, name: '回归', icon: 'folder', pid: 8}, 22 | {id: 22, name: '线性回归', icon: 'crosshairs', pid: 21}, 23 | {id: 23, name: '一般线性回归', icon: 'crosshairs', pid: 21}, 24 | {id: 24, name: '数据拆分', icon: 'folder', pid: 0}, 25 | {id: 25, name: '训练数据', icon: 'cube', pid: 24}, 26 | {id: 26, name: '测试数据', icon: 'cube', pid: 24} 27 | ] 28 | 29 | /** 30 | * 获取某个node的icon 31 | * @param id 32 | * @returns {string} 33 | */ 34 | function getNodeIcon (id) { 35 | for (let index in nodes) { 36 | if (nodes[index].id === id) { 37 | return nodes[index].icon 38 | } 39 | } 40 | return 'dot-circle-o' 41 | } 42 | 43 | export {getNodeIcon} 44 | 45 | /** 46 | * 获取组件树 47 | */ 48 | function getNodeTree () { 49 | let root = { 50 | id: 0 51 | } 52 | addChild(root) 53 | return root.children 54 | } 55 | 56 | export {getNodeTree} 57 | 58 | /** 59 | * 递归增加child 60 | * @param parent 61 | */ 62 | function addChild (parent) { 63 | let _nodes = nodes.filter(n => n.pid === parent.id) 64 | if (_nodes && _nodes.length > 0) { 65 | parent.children = [] 66 | _nodes.forEach(n => { 67 | let treeNode = { 68 | id: n.id, 69 | label: n.name, 70 | icon: n.icon 71 | } 72 | parent.children.push(treeNode) 73 | addChild(treeNode) 74 | }) 75 | } else { 76 | parent.isLeaf = true 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/assets/js/plugin.js: -------------------------------------------------------------------------------- 1 | import {getLoginUser} from './assist' 2 | import Layout from '../../components/layout' 3 | import Menu from '../../components/navside' 4 | import JSPlumb from '../../components/jsplumb' 5 | import Form from '../../components/form' 6 | import Format from '../../components/format' 7 | import {message, messageSuccess, messageWarn, messageError, notify, notifySuccess, notifyWarn, notifyError} from './vueGlobal' 8 | 9 | const CCcomponents = { 10 | CHeader: Layout.Header, 11 | CLayout: Layout, 12 | CLayoutNoSide: Layout.LayoutNoSide, 13 | CMenu: Menu, 14 | CMenuItem: Menu.MenuItem, 15 | CPanel: Layout.Panel, 16 | JspNode: JSPlumb.JspNode, 17 | CFormButton: Form.FormButton, 18 | CFormatDate: Format.CFormatDate, 19 | CFormatSufRate: Format.CFormatSufRate, 20 | CFormatGrowthRate: Format.CFormatGrowthRate, 21 | CFormatVal: Format.CFormatVal 22 | } 23 | 24 | export default { 25 | install (Vue) { 26 | /** 27 | * 返回上一级 28 | */ 29 | Vue.prototype.goBack = () => { window.history.go(-1) } 30 | /** 31 | * 统一处理promise catch的错误 32 | * @param error 错误信息 33 | */ 34 | Vue.prototype.handleError = (error) => { console.warn(error) } 35 | /** 36 | * 获取登录用户 37 | * @returns {*} 38 | */ 39 | Vue.prototype.getLoginUser = () => { return getLoginUser() } 40 | /** 41 | * 右边页面内容全屏切换 42 | */ 43 | Vue.prototype.toggleFullScreen = () => { 44 | let layout = document.getElementById('p-layout') 45 | if (layout.classList.contains('p-full-screen')) { 46 | layout.classList.remove('p-full-screen') 47 | } else { 48 | layout.classList.add('p-full-screen') 49 | } 50 | } 51 | 52 | // 消息提示 53 | Vue.prototype.message = (msg) => { message(msg) } 54 | Vue.prototype.messageSuccess = (msg) => { messageSuccess(msg) } 55 | Vue.prototype.messageWarn = (msg) => { messageWarn(msg) } 56 | Vue.prototype.messageError = (msg) => { messageError(msg) } 57 | 58 | // 通知提示 59 | Vue.prototype.notify = (msg) => { notify(msg) } 60 | Vue.prototype.notifySuccess = (msg) => { notifySuccess(msg) } 61 | Vue.prototype.notifyWarn = (msg) => { notifyWarn(msg) } 62 | Vue.prototype.notifyError = (msg) => { notifyError(msg) } 63 | 64 | Object.keys(CCcomponents).forEach((key) => { 65 | Vue.component(key, CCcomponents[key]) 66 | }) 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/assets/js/vueGlobal.js: -------------------------------------------------------------------------------- 1 | import vue from '../../main' 2 | 3 | /** 4 | * 普通提示消息 5 | * @param msg 6 | */ 7 | export const message = (msg) => { vue.$message(msg) } 8 | 9 | /** 10 | * 成功提示消息 11 | * @param msg 12 | */ 13 | export const messageSuccess = (msg) => { vue.$message({message: msg, type: 'success'}) } 14 | 15 | /** 16 | * 警告提示消息 17 | * @param msg 18 | */ 19 | export const messageWarn = (msg) => { vue.$message({message: msg, type: 'warning'}) } 20 | 21 | /** 22 | * 错误提示消息 23 | * @param msg 24 | */ 25 | export const messageError = (msg) => { vue.$message.error(msg) } 26 | 27 | /** 28 | * 普通通知消息 29 | * @param msg 30 | */ 31 | export const notify = (msg) => { vue.$notify.info({title: '消息', message: msg}) } 32 | 33 | /** 34 | * 成功通知消息 35 | * @param msg 36 | */ 37 | export const notifySuccess = (msg) => { vue.$notify({title: '成功', message: msg, type: 'success'}) } 38 | 39 | /** 40 | * 警告通知消息 41 | * @param msg 42 | */ 43 | export const notifyWarn = (msg) => { vue.$notify({title: '警告', message: msg, type: 'warning'}) } 44 | 45 | /** 46 | * 错误通知消息 47 | * @param msg 48 | */ 49 | export const notifyError = (msg) => { vue.$notify.error({title: '错误', message: msg}) } 50 | -------------------------------------------------------------------------------- /src/axios/ajax.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import qs from 'qs' 3 | import {getLoginUser} from '../assets/js/assist.js' 4 | 5 | export const get = (url, params) => { return axios.get(url, params).then(res => res.data) } 6 | export const post = (url, params) => { return axios.post(url, params).then(res => res.data) } 7 | export const download = (url, params) => { window.location.href = axios.defaults.baseURL + url + '?token=' + getLoginUser().token + '&' + qs.stringify(params) } 8 | -------------------------------------------------------------------------------- /src/axios/index.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import { getLoginUser, removeTokenCookie } from '../assets/js/assist' 3 | import {notifyError} from '../assets/js/vueGlobal' 4 | 5 | // Add a request interceptor 6 | axios.defaults.baseURL = '' 7 | if (process.env.NODE_ENV === 'development') { 8 | } 9 | // axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded' 10 | axios.interceptors.request.use(function (config) { 11 | let user = getLoginUser() 12 | if (user) { 13 | if (config.data) { 14 | config.data.token = user.token 15 | } else { 16 | config.data = {token: user.token} 17 | } 18 | } 19 | return config 20 | }, function (error) { 21 | return Promise.reject(error) 22 | }); 23 | 24 | // Add a response interceptor 25 | axios.interceptors.response.use(function (response) { 26 | if (response.data) { 27 | if (response.data.code === 0) { 28 | return response 29 | } else { 30 | if (response.data.code === 400 || response.data.code === 401) { // token失效 31 | removeTokenCookie() 32 | window.location.href = '/' 33 | } else { 34 | notifyError(response.data.msg) 35 | return Promise.reject(response.data.msg) 36 | } 37 | } 38 | } else { 39 | vue.$notify.error({ 40 | title: '错误提示', 41 | message: 'response error' 42 | }) 43 | return Promise.reject(new Error('response error')) 44 | } 45 | }, function (error) { 46 | return Promise.reject(error) 47 | }); 48 | 49 | export default axios 50 | -------------------------------------------------------------------------------- /src/components/form/FormButton.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 29 | 30 | 33 | -------------------------------------------------------------------------------- /src/components/form/index.js: -------------------------------------------------------------------------------- 1 | import FormButton from './FormButton.vue' 2 | 3 | const Form = { 4 | FormButton: FormButton 5 | } 6 | 7 | export default Form 8 | -------------------------------------------------------------------------------- /src/components/format/FormatDate.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 22 | 23 | 26 | -------------------------------------------------------------------------------- /src/components/format/FormatGrowthRate.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 20 | -------------------------------------------------------------------------------- /src/components/format/FormatSufRate.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 16 | -------------------------------------------------------------------------------- /src/components/format/FormatVal.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 42 | 43 | 46 | -------------------------------------------------------------------------------- /src/components/format/index.js: -------------------------------------------------------------------------------- 1 | import CFormatDate from './FormatDate.vue' 2 | import CFormatSufRate from './FormatSufRate.vue' 3 | import CFormatVal from './FormatVal.vue' 4 | import CFormatGrowthRate from './FormatGrowthRate.vue' 5 | 6 | let CFormat = { 7 | CFormatDate: CFormatDate, 8 | CFormatSufRate: CFormatSufRate, 9 | CFormatVal: CFormatVal, 10 | CFormatGrowthRate: CFormatGrowthRate 11 | } 12 | 13 | export default CFormat 14 | -------------------------------------------------------------------------------- /src/components/jsplumb/JspNode.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 97 | 98 | 101 | -------------------------------------------------------------------------------- /src/components/jsplumb/index.js: -------------------------------------------------------------------------------- 1 | import JspNode from './JspNode.vue' 2 | 3 | export default { 4 | JspNode: JspNode 5 | } 6 | -------------------------------------------------------------------------------- /src/components/layout/Header.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 40 | 41 | 44 | -------------------------------------------------------------------------------- /src/components/layout/Layout.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 17 | 18 | 21 | -------------------------------------------------------------------------------- /src/components/layout/LayoutNoSide.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 15 | 16 | 19 | -------------------------------------------------------------------------------- /src/components/layout/Panel.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 20 | 21 | 24 | -------------------------------------------------------------------------------- /src/components/layout/index.js: -------------------------------------------------------------------------------- 1 | import Header from './Header.vue' 2 | import Layout from './Layout.vue' 3 | import LayoutNoSide from './LayoutNoSide.vue' 4 | import Panel from './Panel.vue' 5 | 6 | Layout.Header = Header 7 | Layout.LayoutNoSide = LayoutNoSide 8 | Layout.Panel = Panel 9 | 10 | export default Layout 11 | -------------------------------------------------------------------------------- /src/components/navside/Menu.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 34 | 35 | 38 | -------------------------------------------------------------------------------- /src/components/navside/MenuItem.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 83 | 84 | 87 | -------------------------------------------------------------------------------- /src/components/navside/index.js: -------------------------------------------------------------------------------- 1 | import Menu from './Menu.vue' 2 | import MenuItem from './MenuItem.vue' 3 | 4 | Menu.MenuItem = MenuItem 5 | 6 | export default Menu 7 | -------------------------------------------------------------------------------- /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 Mock from './mock' 9 | import axios from './axios' 10 | import 'bootstrap/dist/css/bootstrap.css' 11 | import 'font-awesome/css/font-awesome.min.css' 12 | import './assets/css/ping.css' 13 | import './assets/css/jsplumb.css' 14 | import MyPlugin from './assets/js/plugin' 15 | import PingUI from 'ping-ui' 16 | 17 | Vue.config.productionTip = false 18 | Vue.use(ElementUI) 19 | Vue.use(MyPlugin) 20 | Vue.use(PingUI) 21 | 22 | // if (process.env.NODE_ENV === 'development') { 23 | Mock.bootstrap() 24 | // } 25 | 26 | /* eslint-disable no-new */ 27 | let vue = new Vue({ 28 | el: '#app', 29 | router, 30 | template: '', 31 | components: { App } 32 | }) 33 | 34 | export default vue 35 | -------------------------------------------------------------------------------- /src/mock/index.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import MockAdapter from 'axios-mock-adapter' 3 | import Login from '../pages/login/mock' 4 | import Scene from '../pages/scene/mock' 5 | import BDMap from '../pages/bdmap/mock' 6 | 7 | export default { 8 | /** 9 | * mock bootstrap 10 | */ 11 | bootstrap () { 12 | let mock = new MockAdapter(axios) 13 | Login.bootstrap(mock) 14 | Scene.bootstrap(mock) 15 | BDMap.bootstrap(mock) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/pages/JspNodeTest.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 105 | 106 | 109 | -------------------------------------------------------------------------------- /src/pages/Test.vue: -------------------------------------------------------------------------------- 1 | 52 | 53 | 231 | 232 | 235 | -------------------------------------------------------------------------------- /src/pages/bdmap/BDMap.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 14 | 15 | 18 | -------------------------------------------------------------------------------- /src/pages/bdmap/api/index.js: -------------------------------------------------------------------------------- 1 | import {get, post} from '../../../axios/ajax' 2 | 3 | const mapBaseUrl = '/api/map' 4 | export const mapUrls = { 5 | heat: mapBaseUrl + '/heat', 6 | polygon: mapBaseUrl + '/polygon', 7 | pgHeat: mapBaseUrl + '/pg-heat' 8 | } 9 | 10 | /** 11 | * 获取热力图数据 12 | * @param params 13 | */ 14 | export const getHeatMapData = params => { return get(mapUrls.heat, params) } 15 | /** 16 | * 获取区域图数据 17 | * @param params 18 | */ 19 | export const getPloygonMapData = params => { return get(mapUrls.polygon, params) } 20 | /** 21 | * 获取区域热力图数据 22 | * @param params 23 | */ 24 | export const getPGHeatMapData = params => { return get(mapUrls.pgHeat, params) } 25 | -------------------------------------------------------------------------------- /src/pages/bdmap/heatmap/Heat.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | 117 | 118 | 137 | -------------------------------------------------------------------------------- /src/pages/bdmap/index.js: -------------------------------------------------------------------------------- 1 | import BDMap from './BDMap.vue' 2 | import HeatMap from './heatmap/Heat.vue' 3 | import PGHeat from './pgheatmap/PGHeat.vue' 4 | import Polygon from './polygon/Polygon.vue' 5 | 6 | BDMap.HeatMap = HeatMap 7 | BDMap.PGHeat = PGHeat 8 | BDMap.Polygon = Polygon 9 | 10 | export default BDMap 11 | -------------------------------------------------------------------------------- /src/pages/bdmap/mock/index.js: -------------------------------------------------------------------------------- 1 | import {mapUrls} from '../api' 2 | 3 | const heatPoints = [ 4 | {lng: 116.418261, lat: 39.921984, count: Math.round(Math.random() * 100)}, 5 | {lng: 116.423332, lat: 39.916532, count: Math.round(Math.random() * 100)}, 6 | {lng: 116.419787, lat: 39.930658, count: Math.round(Math.random() * 100)}, 7 | {lng: 116.418455, lat: 39.920921, count: Math.round(Math.random() * 100)}, 8 | {lng: 116.418843, lat: 39.915516, count: Math.round(Math.random() * 100)}, 9 | {lng: 116.42546, lat: 39.918503, count: Math.round(Math.random() * 100)}, 10 | {lng: 116.423289, lat: 39.919989, count: Math.round(Math.random() * 100)}, 11 | {lng: 116.418162, lat: 39.915051, count: Math.round(Math.random() * 100)}, 12 | {lng: 116.422039, lat: 39.91782, count: Math.round(Math.random() * 100)}, 13 | {lng: 116.41387, lat: 39.917253, count: Math.round(Math.random() * 100)}, 14 | {lng: 116.41773, lat: 39.919426, count: Math.round(Math.random() * 100)}, 15 | {lng: 116.421107, lat: 39.916445, count: Math.round(Math.random() * 100)}, 16 | {lng: 116.417521, lat: 39.917943, count: Math.round(Math.random() * 100)}, 17 | {lng: 116.419812, lat: 39.920836, count: Math.round(Math.random() * 100)}, 18 | {lng: 116.420682, lat: 39.91463, count: Math.round(Math.random() * 100)}, 19 | {lng: 116.415424, lat: 39.924675, count: Math.round(Math.random() * 100)}, 20 | {lng: 116.419242, lat: 39.914509, count: Math.round(Math.random() * 100)}, 21 | {lng: 116.422766, lat: 39.921408, count: Math.round(Math.random() * 100)}, 22 | {lng: 116.421674, lat: 39.924396, count: Math.round(Math.random() * 100)}, 23 | {lng: 116.427268, lat: 39.92267, count: Math.round(Math.random() * 100)}, 24 | {lng: 116.417721, lat: 39.920034, count: Math.round(Math.random() * 100)}, 25 | {lng: 116.412456, lat: 39.92667, count: Math.round(Math.random() * 100)}, 26 | {lng: 116.420432, lat: 39.919114, count: Math.round(Math.random() * 100)}, 27 | {lng: 116.425013, lat: 39.921611, count: Math.round(Math.random() * 100)}, 28 | {lng: 116.418733, lat: 39.931037, count: Math.round(Math.random() * 100)}, 29 | {lng: 116.419336, lat: 39.931134, count: Math.round(Math.random() * 100)}, 30 | {lng: 116.413557, lat: 39.923254, count: Math.round(Math.random() * 100)}, 31 | {lng: 116.418367, lat: 39.92943, count: Math.round(Math.random() * 100)}, 32 | {lng: 116.424312, lat: 39.919621, count: Math.round(Math.random() * 100)}, 33 | {lng: 116.423874, lat: 39.919447, count: Math.round(Math.random() * 100)}, 34 | {lng: 116.424225, lat: 39.923091, count: Math.round(Math.random() * 100)}, 35 | {lng: 116.417801, lat: 39.921854, count: Math.round(Math.random() * 100)}, 36 | {lng: 116.417129, lat: 39.928227, count: Math.round(Math.random() * 100)}, 37 | {lng: 116.426426, lat: 39.922286, count: Math.round(Math.random() * 100)}, 38 | {lng: 116.421597, lat: 39.91948, count: Math.round(Math.random() * 100)}, 39 | {lng: 116.423895, lat: 39.920787, count: Math.round(Math.random() * 100)}, 40 | {lng: 116.423563, lat: 39.921197, count: Math.round(Math.random() * 100)}, 41 | {lng: 116.417982, lat: 39.922547, count: Math.round(Math.random() * 100)}, 42 | {lng: 116.426126, lat: 39.921938, count: Math.round(Math.random() * 100)}, 43 | {lng: 116.42326, lat: 39.915782, count: Math.round(Math.random() * 100)}, 44 | {lng: 116.419239, lat: 39.916759, count: Math.round(Math.random() * 100)}, 45 | {lng: 116.417185, lat: 39.929123, count: Math.round(Math.random() * 100)}, 46 | {lng: 116.417237, lat: 39.927518, count: Math.round(Math.random() * 100)}, 47 | {lng: 116.417784, lat: 39.915754, count: Math.round(Math.random() * 100)}, 48 | {lng: 116.420193, lat: 39.917061, count: Math.round(Math.random() * 100)}, 49 | {lng: 116.422735, lat: 39.915619, count: Math.round(Math.random() * 100)}, 50 | {lng: 116.418495, lat: 39.915958, count: Math.round(Math.random() * 100)}, 51 | {lng: 116.416292, lat: 39.931166, count: Math.round(Math.random() * 100)}, 52 | {lng: 116.419916, lat: 39.924055, count: Math.round(Math.random() * 100)}, 53 | {lng: 116.42189, lat: 39.921308, count: Math.round(Math.random() * 100)}, 54 | {lng: 116.413765, lat: 39.929376, count: Math.round(Math.random() * 100)}, 55 | {lng: 116.418232, lat: 39.920348, count: Math.round(Math.random() * 100)}, 56 | {lng: 116.417554, lat: 39.930511, count: Math.round(Math.random() * 100)}, 57 | {lng: 116.418568, lat: 39.918161, count: Math.round(Math.random() * 100)}, 58 | {lng: 116.413461, lat: 39.926306, count: Math.round(Math.random() * 100)}, 59 | {lng: 116.42232, lat: 39.92161, count: Math.round(Math.random() * 100)}, 60 | {lng: 116.4174, lat: 39.928616, count: Math.round(Math.random() * 100)}, 61 | {lng: 116.424679, lat: 39.915499, count: Math.round(Math.random() * 100)}, 62 | {lng: 116.42171, lat: 39.915738, count: Math.round(Math.random() * 100)}, 63 | {lng: 116.417836, lat: 39.916998, count: Math.round(Math.random() * 100)}, 64 | {lng: 116.420755, lat: 39.928001, count: Math.round(Math.random() * 100)}, 65 | {lng: 116.414077, lat: 39.930655, count: Math.round(Math.random() * 100)}, 66 | {lng: 116.426092, lat: 39.922995, count: Math.round(Math.random() * 100)}, 67 | {lng: 116.41535, lat: 39.931054, count: Math.round(Math.random() * 100)}, 68 | {lng: 116.413022, lat: 39.921895, count: Math.round(Math.random() * 100)}, 69 | {lng: 116.415551, lat: 39.913373, count: Math.round(Math.random() * 100)}, 70 | {lng: 116.421191, lat: 39.926572, count: Math.round(Math.random() * 100)}, 71 | {lng: 116.419612, lat: 39.917119, count: Math.round(Math.random() * 100)}, 72 | {lng: 116.418237, lat: 39.921337, count: Math.round(Math.random() * 100)}, 73 | {lng: 116.423776, lat: 39.921919, count: Math.round(Math.random() * 100)}, 74 | {lng: 116.417694, lat: 39.92536, count: Math.round(Math.random() * 100)}, 75 | {lng: 116.415377, lat: 39.914137, count: Math.round(Math.random() * 100)}, 76 | {lng: 116.417434, lat: 39.914394, count: Math.round(Math.random() * 100)}, 77 | {lng: 116.42588, lat: 39.922622, count: Math.round(Math.random() * 100)}, 78 | {lng: 116.418345, lat: 39.919467, count: Math.round(Math.random() * 100)}, 79 | {lng: 116.426883, lat: 39.917171, count: Math.round(Math.random() * 100)}, 80 | {lng: 116.423877, lat: 39.916659, count: Math.round(Math.random() * 100)}, 81 | {lng: 116.415712, lat: 39.915613, count: Math.round(Math.random() * 100)}, 82 | {lng: 116.419869, lat: 39.931416, count: Math.round(Math.random() * 100)}, 83 | {lng: 116.416956, lat: 39.925377, count: Math.round(Math.random() * 100)}, 84 | {lng: 116.42066, lat: 39.925017, count: Math.round(Math.random() * 100)}, 85 | {lng: 116.416244, lat: 39.920215, count: Math.round(Math.random() * 100)}, 86 | {lng: 116.41929, lat: 39.915908, count: Math.round(Math.random() * 100)}, 87 | {lng: 116.422116, lat: 39.919658, count: Math.round(Math.random() * 100)}, 88 | {lng: 116.4183, lat: 39.925015, count: Math.round(Math.random() * 100)}, 89 | {lng: 116.421969, lat: 39.913527, count: Math.round(Math.random() * 100)}, 90 | {lng: 116.422936, lat: 39.921854, count: Math.round(Math.random() * 100)}, 91 | {lng: 116.41905, lat: 39.929217, count: Math.round(Math.random() * 100)}, 92 | {lng: 116.424579, lat: 39.914987, count: Math.round(Math.random() * 100)}, 93 | {lng: 116.42076, lat: 39.915251, count: Math.round(Math.random() * 100)}, 94 | {lng: 116.425867, lat: 39.918989, count: Math.round(Math.random() * 100)} 95 | ] 96 | 97 | const polygon = [ 98 | { 99 | center: { 100 | lat: 39.794986, 101 | lng: 116.323645 102 | }, 103 | count: Math.round(Math.random() * 1000), 104 | id: '125', 105 | name: '', 106 | range: [ 107 | { 108 | lat: 39.781486, 109 | lng: 116.305645 110 | }, 111 | { 112 | lat: 39.781486, 113 | lng: 116.341645 114 | }, 115 | { 116 | lat: 39.808486, 117 | lng: 116.341645 118 | }, 119 | { 120 | lat: 39.808486, 121 | lng: 116.305645 122 | } 123 | ] 124 | }, 125 | { 126 | center: { 127 | lat: 39.848986, 128 | lng: 116.323645 129 | }, 130 | count: Math.round(Math.random() * 1000), 131 | id: '123', 132 | name: '', 133 | range: [ 134 | { 135 | lat: 39.835486, 136 | lng: 116.305645 137 | }, 138 | { 139 | lat: 39.835486, 140 | lng: 116.341645 141 | }, 142 | { 143 | lat: 39.862486, 144 | lng: 116.341645 145 | }, 146 | { 147 | lat: 39.862486, 148 | lng: 116.305645 149 | } 150 | ] 151 | }, 152 | { 153 | center: { 154 | lat: 39.821986, 155 | lng: 116.323645 156 | }, 157 | count: Math.round(Math.random() * 1000), 158 | id: '124', 159 | name: '', 160 | range: [ 161 | { 162 | lat: 39.808486, 163 | lng: 116.305645 164 | }, 165 | { 166 | lat: 39.808486, 167 | lng: 116.341645 168 | }, 169 | { 170 | lat: 39.835486, 171 | lng: 116.341645 172 | }, 173 | { 174 | lat: 39.835486, 175 | lng: 116.305645 176 | } 177 | ] 178 | }, 179 | { 180 | center: { 181 | lat: 40.118986, 182 | lng: 116.287645 183 | }, 184 | count: Math.round(Math.random() * 1000), 185 | id: '137', 186 | name: '', 187 | range: [ 188 | { 189 | lat: 40.105486, 190 | lng: 116.269645 191 | }, 192 | { 193 | lat: 40.105486, 194 | lng: 116.305645 195 | }, 196 | { 197 | lat: 40.132486, 198 | lng: 116.305645 199 | }, 200 | { 201 | lat: 40.132486, 202 | lng: 116.269645 203 | } 204 | ] 205 | }, 206 | { 207 | center: { 208 | lat: 39.686986, 209 | lng: 116.359645 210 | }, 211 | count: Math.round(Math.random() * 1000), 212 | id: '119', 213 | name: '', 214 | range: [ 215 | { 216 | lat: 39.673486, 217 | lng: 116.341645 218 | }, 219 | { 220 | lat: 39.673486, 221 | lng: 116.377645 222 | }, 223 | { 224 | lat: 39.700486, 225 | lng: 116.377645 226 | }, 227 | { 228 | lat: 39.700486, 229 | lng: 116.341645 230 | } 231 | ] 232 | }, 233 | { 234 | center: { 235 | lat: 39.848986, 236 | lng: 116.359645 237 | }, 238 | count: Math.round(Math.random() * 1000), 239 | id: '113', 240 | name: '', 241 | range: [ 242 | { 243 | lat: 39.835486, 244 | lng: 116.341645 245 | }, 246 | { 247 | lat: 39.835486, 248 | lng: 116.377645 249 | }, 250 | { 251 | lat: 39.862486, 252 | lng: 116.377645 253 | }, 254 | { 255 | lat: 39.862486, 256 | lng: 116.341645 257 | } 258 | ] 259 | }, 260 | { 261 | center: { 262 | lat: 39.821986, 263 | lng: 116.359645 264 | }, 265 | count: Math.round(Math.random() * 1000), 266 | id: '114', 267 | name: '', 268 | range: [ 269 | { 270 | lat: 39.808486, 271 | lng: 116.341645 272 | }, 273 | { 274 | lat: 39.808486, 275 | lng: 116.377645 276 | }, 277 | { 278 | lat: 39.835486, 279 | lng: 116.377645 280 | }, 281 | { 282 | lat: 39.835486, 283 | lng: 116.341645 284 | } 285 | ] 286 | }, 287 | { 288 | center: { 289 | lat: 39.848986, 290 | lng: 116.575645 291 | }, 292 | count: Math.round(Math.random() * 1000), 293 | id: '153', 294 | name: '', 295 | range: [ 296 | { 297 | lat: 39.835486, 298 | lng: 116.557645 299 | }, 300 | { 301 | lat: 39.835486, 302 | lng: 116.593645 303 | }, 304 | { 305 | lat: 39.862486, 306 | lng: 116.593645 307 | }, 308 | { 309 | lat: 39.862486, 310 | lng: 116.557645 311 | } 312 | ] 313 | }, 314 | { 315 | center: { 316 | lat: 39.902986, 317 | lng: 116.575645 318 | }, 319 | count: Math.round(Math.random() * 1000), 320 | id: '151', 321 | name: '', 322 | range: [ 323 | { 324 | lat: 39.889486, 325 | lng: 116.557645 326 | }, 327 | { 328 | lat: 39.889486, 329 | lng: 116.593645 330 | }, 331 | { 332 | lat: 39.916486, 333 | lng: 116.593645 334 | }, 335 | { 336 | lat: 39.916486, 337 | lng: 116.557645 338 | } 339 | ] 340 | }, 341 | { 342 | center: { 343 | lat: 39.767986, 344 | lng: 116.575645 345 | }, 346 | count: Math.round(Math.random() * 1000), 347 | id: '156', 348 | name: '', 349 | range: [ 350 | { 351 | lat: 39.754486, 352 | lng: 116.557645 353 | }, 354 | { 355 | lat: 39.754486, 356 | lng: 116.593645 357 | }, 358 | { 359 | lat: 39.781486, 360 | lng: 116.593645 361 | }, 362 | { 363 | lat: 39.781486, 364 | lng: 116.557645 365 | } 366 | ] 367 | }, 368 | { 369 | center: { 370 | lat: 40.091986, 371 | lng: 116.323645 372 | }, 373 | count: Math.round(Math.random() * 1000), 374 | id: '126', 375 | name: '', 376 | range: [ 377 | { 378 | lat: 40.078486, 379 | lng: 116.305645 380 | }, 381 | { 382 | lat: 40.078486, 383 | lng: 116.341645 384 | }, 385 | { 386 | lat: 40.105486, 387 | lng: 116.341645 388 | }, 389 | { 390 | lat: 40.105486, 391 | lng: 116.305645 392 | } 393 | ] 394 | }, 395 | { 396 | center: { 397 | lat: 40.064986, 398 | lng: 116.323645 399 | }, 400 | count: Math.round(Math.random() * 1000), 401 | id: '125', 402 | name: '', 403 | range: [ 404 | { 405 | lat: 40.051486, 406 | lng: 116.305645 407 | }, 408 | { 409 | lat: 40.051486, 410 | lng: 116.341645 411 | }, 412 | { 413 | lat: 40.078486, 414 | lng: 116.341645 415 | }, 416 | { 417 | lat: 40.078486, 418 | lng: 116.305645 419 | } 420 | ] 421 | }, 422 | { 423 | center: { 424 | lat: 40.037986, 425 | lng: 116.323645 426 | }, 427 | count: Math.round(Math.random() * 1000), 428 | id: '124', 429 | name: '', 430 | range: [ 431 | { 432 | lat: 40.024486, 433 | lng: 116.305645 434 | }, 435 | { 436 | lat: 40.024486, 437 | lng: 116.341645 438 | }, 439 | { 440 | lat: 40.051486, 441 | lng: 116.341645 442 | }, 443 | { 444 | lat: 40.051486, 445 | lng: 116.305645 446 | } 447 | ] 448 | }, 449 | { 450 | center: { 451 | lat: 39.983986, 452 | lng: 116.323645 453 | }, 454 | count: Math.round(Math.random() * 1000), 455 | id: '122', 456 | name: '', 457 | range: [ 458 | { 459 | lat: 39.970486, 460 | lng: 116.305645 461 | }, 462 | { 463 | lat: 39.970486, 464 | lng: 116.341645 465 | }, 466 | { 467 | lat: 39.997486, 468 | lng: 116.341645 469 | }, 470 | { 471 | lat: 39.997486, 472 | lng: 116.305645 473 | } 474 | ] 475 | }, 476 | { 477 | center: { 478 | lat: 39.956986, 479 | lng: 116.323645 480 | }, 481 | count: Math.round(Math.random() * 1000), 482 | id: '121', 483 | name: '', 484 | range: [ 485 | { 486 | lat: 39.943486, 487 | lng: 116.305645 488 | }, 489 | { 490 | lat: 39.943486, 491 | lng: 116.341645 492 | }, 493 | { 494 | lat: 39.970486, 495 | lng: 116.341645 496 | }, 497 | { 498 | lat: 39.970486, 499 | lng: 116.305645 500 | } 501 | ] 502 | }, 503 | { 504 | center: { 505 | lat: 39.875986, 506 | lng: 116.287645 507 | }, 508 | count: Math.round(Math.random() * 1000), 509 | id: '132', 510 | name: '', 511 | range: [ 512 | { 513 | lat: 39.862486, 514 | lng: 116.269645 515 | }, 516 | { 517 | lat: 39.862486, 518 | lng: 116.305645 519 | }, 520 | { 521 | lat: 39.889486, 522 | lng: 116.305645 523 | }, 524 | { 525 | lat: 39.889486, 526 | lng: 116.269645 527 | } 528 | ] 529 | }, 530 | { 531 | center: { 532 | lat: 39.902986, 533 | lng: 116.503645 534 | }, 535 | count: Math.round(Math.random() * 1000), 536 | id: '131', 537 | name: '', 538 | range: [ 539 | { 540 | lat: 39.889486, 541 | lng: 116.485645 542 | }, 543 | { 544 | lat: 39.889486, 545 | lng: 116.521645 546 | }, 547 | { 548 | lat: 39.916486, 549 | lng: 116.521645 550 | }, 551 | { 552 | lat: 39.916486, 553 | lng: 116.485645 554 | } 555 | ] 556 | }, 557 | { 558 | center: { 559 | lat: 39.875986, 560 | lng: 116.503645 561 | }, 562 | count: Math.round(Math.random() * 1000), 563 | id: '132', 564 | name: '', 565 | range: [ 566 | { 567 | lat: 39.862486, 568 | lng: 116.485645 569 | }, 570 | { 571 | lat: 39.862486, 572 | lng: 116.521645 573 | }, 574 | { 575 | lat: 39.889486, 576 | lng: 116.521645 577 | }, 578 | { 579 | lat: 39.889486, 580 | lng: 116.485645 581 | } 582 | ] 583 | }, 584 | { 585 | center: { 586 | lat: 39.848986, 587 | lng: 116.503645 588 | }, 589 | count: Math.round(Math.random() * 1000), 590 | id: '133', 591 | name: '', 592 | range: [ 593 | { 594 | lat: 39.835486, 595 | lng: 116.485645 596 | }, 597 | { 598 | lat: 39.835486, 599 | lng: 116.521645 600 | }, 601 | { 602 | lat: 39.862486, 603 | lng: 116.521645 604 | }, 605 | { 606 | lat: 39.862486, 607 | lng: 116.485645 608 | } 609 | ] 610 | }, 611 | { 612 | center: { 613 | lat: 39.821986, 614 | lng: 116.503645 615 | }, 616 | count: Math.round(Math.random() * 1000), 617 | id: '134', 618 | name: '', 619 | range: [ 620 | { 621 | lat: 39.808486, 622 | lng: 116.485645 623 | }, 624 | { 625 | lat: 39.808486, 626 | lng: 116.521645 627 | }, 628 | { 629 | lat: 39.835486, 630 | lng: 116.521645 631 | }, 632 | { 633 | lat: 39.835486, 634 | lng: 116.485645 635 | } 636 | ] 637 | }, 638 | { 639 | center: { 640 | lat: 39.875986, 641 | lng: 116.539645 642 | }, 643 | count: Math.round(Math.random() * 1000), 644 | id: '142', 645 | name: '', 646 | range: [ 647 | { 648 | lat: 39.862486, 649 | lng: 116.521645 650 | }, 651 | { 652 | lat: 39.862486, 653 | lng: 116.557645 654 | }, 655 | { 656 | lat: 39.889486, 657 | lng: 116.557645 658 | }, 659 | { 660 | lat: 39.889486, 661 | lng: 116.521645 662 | } 663 | ] 664 | }, 665 | { 666 | center: { 667 | lat: 39.848986, 668 | lng: 116.539645 669 | }, 670 | count: Math.round(Math.random() * 1000), 671 | id: '143', 672 | name: '', 673 | range: [ 674 | { 675 | lat: 39.835486, 676 | lng: 116.521645 677 | }, 678 | { 679 | lat: 39.835486, 680 | lng: 116.557645 681 | }, 682 | { 683 | lat: 39.862486, 684 | lng: 116.557645 685 | }, 686 | { 687 | lat: 39.862486, 688 | lng: 116.521645 689 | } 690 | ] 691 | }, 692 | { 693 | center: { 694 | lat: 39.902986, 695 | lng: 116.539645 696 | }, 697 | count: Math.round(Math.random() * 1000), 698 | id: '141', 699 | name: '', 700 | range: [ 701 | { 702 | lat: 39.889486, 703 | lng: 116.521645 704 | }, 705 | { 706 | lat: 39.889486, 707 | lng: 116.557645 708 | }, 709 | { 710 | lat: 39.916486, 711 | lng: 116.557645 712 | }, 713 | { 714 | lat: 39.916486, 715 | lng: 116.521645 716 | } 717 | ] 718 | }, 719 | { 720 | center: { 721 | lat: 39.929986, 722 | lng: 116.251645 723 | }, 724 | count: Math.round(Math.random() * 1000), 725 | id: '140', 726 | name: '', 727 | range: [ 728 | { 729 | lat: 39.916486, 730 | lng: 116.233645 731 | }, 732 | { 733 | lat: 39.916486, 734 | lng: 116.269645 735 | }, 736 | { 737 | lat: 39.943486, 738 | lng: 116.269645 739 | }, 740 | { 741 | lat: 39.943486, 742 | lng: 116.233645 743 | } 744 | ] 745 | }, 746 | { 747 | center: { 748 | lat: 39.902986, 749 | lng: 116.467645 750 | }, 751 | count: Math.round(Math.random() * 1000), 752 | id: '121', 753 | name: '', 754 | range: [ 755 | { 756 | lat: 39.889486, 757 | lng: 116.449645 758 | }, 759 | { 760 | lat: 39.889486, 761 | lng: 116.485645 762 | }, 763 | { 764 | lat: 39.916486, 765 | lng: 116.485645 766 | }, 767 | { 768 | lat: 39.916486, 769 | lng: 116.449645 770 | } 771 | ] 772 | }, 773 | { 774 | center: { 775 | lat: 39.848986, 776 | lng: 116.467645 777 | }, 778 | count: Math.round(Math.random() * 1000), 779 | id: '123', 780 | name: '', 781 | range: [ 782 | { 783 | lat: 39.835486, 784 | lng: 116.449645 785 | }, 786 | { 787 | lat: 39.835486, 788 | lng: 116.485645 789 | }, 790 | { 791 | lat: 39.862486, 792 | lng: 116.485645 793 | }, 794 | { 795 | lat: 39.862486, 796 | lng: 116.449645 797 | } 798 | ] 799 | }, 800 | { 801 | center: { 802 | lat: 39.875986, 803 | lng: 116.467645 804 | }, 805 | count: Math.round(Math.random() * 1000), 806 | id: '122', 807 | name: '', 808 | range: [ 809 | { 810 | lat: 39.862486, 811 | lng: 116.449645 812 | }, 813 | { 814 | lat: 39.862486, 815 | lng: 116.485645 816 | }, 817 | { 818 | lat: 39.889486, 819 | lng: 116.485645 820 | }, 821 | { 822 | lat: 39.889486, 823 | lng: 116.449645 824 | } 825 | ] 826 | }, 827 | { 828 | center: { 829 | lat: 39.821986, 830 | lng: 116.467645 831 | }, 832 | count: Math.round(Math.random() * 1000), 833 | id: '124', 834 | name: '', 835 | range: [ 836 | { 837 | lat: 39.808486, 838 | lng: 116.449645 839 | }, 840 | { 841 | lat: 39.808486, 842 | lng: 116.485645 843 | }, 844 | { 845 | lat: 39.835486, 846 | lng: 116.485645 847 | }, 848 | { 849 | lat: 39.835486, 850 | lng: 116.449645 851 | } 852 | ] 853 | }, 854 | { 855 | center: { 856 | lat: 39.956986, 857 | lng: 116.611645 858 | }, 859 | count: Math.round(Math.random() * 1000), 860 | id: '161', 861 | name: '', 862 | range: [ 863 | { 864 | lat: 39.943486, 865 | lng: 116.593645 866 | }, 867 | { 868 | lat: 39.943486, 869 | lng: 116.629645 870 | }, 871 | { 872 | lat: 39.970486, 873 | lng: 116.629645 874 | }, 875 | { 876 | lat: 39.970486, 877 | lng: 116.593645 878 | } 879 | ] 880 | }, 881 | { 882 | center: { 883 | lat: 39.929986, 884 | lng: 116.611645 885 | }, 886 | count: Math.round(Math.random() * 1000), 887 | id: '160', 888 | name: '', 889 | range: [ 890 | { 891 | lat: 39.916486, 892 | lng: 116.593645 893 | }, 894 | { 895 | lat: 39.916486, 896 | lng: 116.629645 897 | }, 898 | { 899 | lat: 39.943486, 900 | lng: 116.629645 901 | }, 902 | { 903 | lat: 39.943486, 904 | lng: 116.593645 905 | } 906 | ] 907 | }, 908 | { 909 | center: { 910 | lat: 39.848986, 911 | lng: 116.755645 912 | }, 913 | count: Math.round(Math.random() * 1000), 914 | id: '1103', 915 | name: '', 916 | range: [ 917 | { 918 | lat: 39.835486, 919 | lng: 116.737645 920 | }, 921 | { 922 | lat: 39.835486, 923 | lng: 116.773645 924 | }, 925 | { 926 | lat: 39.862486, 927 | lng: 116.773645 928 | }, 929 | { 930 | lat: 39.862486, 931 | lng: 116.737645 932 | } 933 | ] 934 | }, 935 | { 936 | center: { 937 | lat: 39.929986, 938 | lng: 116.647645 939 | }, 940 | count: Math.round(Math.random() * 1000), 941 | id: '170', 942 | name: '', 943 | range: [ 944 | { 945 | lat: 39.916486, 946 | lng: 116.629645 947 | }, 948 | { 949 | lat: 39.916486, 950 | lng: 116.665645 951 | }, 952 | { 953 | lat: 39.943486, 954 | lng: 116.665645 955 | }, 956 | { 957 | lat: 39.943486, 958 | lng: 116.629645 959 | } 960 | ] 961 | }, 962 | { 963 | center: { 964 | lat: 39.983986, 965 | lng: 116.647645 966 | }, 967 | count: Math.round(Math.random() * 1000), 968 | id: '172', 969 | name: '', 970 | range: [ 971 | { 972 | lat: 39.970486, 973 | lng: 116.629645 974 | }, 975 | { 976 | lat: 39.970486, 977 | lng: 116.665645 978 | }, 979 | { 980 | lat: 39.997486, 981 | lng: 116.665645 982 | }, 983 | { 984 | lat: 39.997486, 985 | lng: 116.629645 986 | } 987 | ] 988 | }, 989 | { 990 | center: { 991 | lat: 39.848986, 992 | lng: 116.251645 993 | }, 994 | count: Math.round(Math.random() * 1000), 995 | id: '143', 996 | name: '', 997 | range: [ 998 | { 999 | lat: 39.835486, 1000 | lng: 116.233645 1001 | }, 1002 | { 1003 | lat: 39.835486, 1004 | lng: 116.269645 1005 | }, 1006 | { 1007 | lat: 39.862486, 1008 | lng: 116.269645 1009 | }, 1010 | { 1011 | lat: 39.862486, 1012 | lng: 116.233645 1013 | } 1014 | ] 1015 | }, 1016 | { 1017 | center: { 1018 | lat: 39.875986, 1019 | lng: 116.251645 1020 | }, 1021 | count: Math.round(Math.random() * 1000), 1022 | id: '142', 1023 | name: '', 1024 | range: [ 1025 | { 1026 | lat: 39.862486, 1027 | lng: 116.233645 1028 | }, 1029 | { 1030 | lat: 39.862486, 1031 | lng: 116.269645 1032 | }, 1033 | { 1034 | lat: 39.889486, 1035 | lng: 116.269645 1036 | }, 1037 | { 1038 | lat: 39.889486, 1039 | lng: 116.233645 1040 | } 1041 | ] 1042 | }, 1043 | { 1044 | center: { 1045 | lat: 39.902986, 1046 | lng: 116.251645 1047 | }, 1048 | count: Math.round(Math.random() * 1000), 1049 | id: '141', 1050 | name: '', 1051 | range: [ 1052 | { 1053 | lat: 39.889486, 1054 | lng: 116.233645 1055 | }, 1056 | { 1057 | lat: 39.889486, 1058 | lng: 116.269645 1059 | }, 1060 | { 1061 | lat: 39.916486, 1062 | lng: 116.269645 1063 | }, 1064 | { 1065 | lat: 39.916486, 1066 | lng: 116.233645 1067 | } 1068 | ] 1069 | }, 1070 | { 1071 | center: { 1072 | lat: 39.902986, 1073 | lng: 116.431645 1074 | }, 1075 | count: Math.round(Math.random() * 1000), 1076 | id: '111', 1077 | name: '', 1078 | range: [ 1079 | { 1080 | lat: 39.889486, 1081 | lng: 116.413645 1082 | }, 1083 | { 1084 | lat: 39.889486, 1085 | lng: 116.449645 1086 | }, 1087 | { 1088 | lat: 39.916486, 1089 | lng: 116.449645 1090 | }, 1091 | { 1092 | lat: 39.916486, 1093 | lng: 116.413645 1094 | } 1095 | ] 1096 | }, 1097 | { 1098 | center: { 1099 | lat: 39.848986, 1100 | lng: 116.431645 1101 | }, 1102 | count: Math.round(Math.random() * 1000), 1103 | id: '113', 1104 | name: '', 1105 | range: [ 1106 | { 1107 | lat: 39.835486, 1108 | lng: 116.413645 1109 | }, 1110 | { 1111 | lat: 39.835486, 1112 | lng: 116.449645 1113 | }, 1114 | { 1115 | lat: 39.862486, 1116 | lng: 116.449645 1117 | }, 1118 | { 1119 | lat: 39.862486, 1120 | lng: 116.413645 1121 | } 1122 | ] 1123 | }, 1124 | { 1125 | center: { 1126 | lat: 39.767986, 1127 | lng: 116.431645 1128 | }, 1129 | count: Math.round(Math.random() * 1000), 1130 | id: '116', 1131 | name: '', 1132 | range: [ 1133 | { 1134 | lat: 39.754486, 1135 | lng: 116.413645 1136 | }, 1137 | { 1138 | lat: 39.754486, 1139 | lng: 116.449645 1140 | }, 1141 | { 1142 | lat: 39.781486, 1143 | lng: 116.449645 1144 | }, 1145 | { 1146 | lat: 39.781486, 1147 | lng: 116.413645 1148 | } 1149 | ] 1150 | }, 1151 | { 1152 | center: { 1153 | lat: 39.713986, 1154 | lng: 116.431645 1155 | }, 1156 | count: Math.round(Math.random() * 1000), 1157 | id: '118', 1158 | name: '', 1159 | range: [ 1160 | { 1161 | lat: 39.700486, 1162 | lng: 116.413645 1163 | }, 1164 | { 1165 | lat: 39.700486, 1166 | lng: 116.449645 1167 | }, 1168 | { 1169 | lat: 39.727486, 1170 | lng: 116.449645 1171 | }, 1172 | { 1173 | lat: 39.727486, 1174 | lng: 116.413645 1175 | } 1176 | ] 1177 | }, 1178 | { 1179 | center: { 1180 | lat: 39.983986, 1181 | lng: 116.467645 1182 | }, 1183 | count: Math.round(Math.random() * 1000), 1184 | id: '122', 1185 | name: '', 1186 | range: [ 1187 | { 1188 | lat: 39.970486, 1189 | lng: 116.449645 1190 | }, 1191 | { 1192 | lat: 39.970486, 1193 | lng: 116.485645 1194 | }, 1195 | { 1196 | lat: 39.997486, 1197 | lng: 116.485645 1198 | }, 1199 | { 1200 | lat: 39.997486, 1201 | lng: 116.449645 1202 | } 1203 | ] 1204 | }, 1205 | { 1206 | center: { 1207 | lat: 39.956986, 1208 | lng: 116.467645 1209 | }, 1210 | count: Math.round(Math.random() * 1000), 1211 | id: '121', 1212 | name: '', 1213 | range: [ 1214 | { 1215 | lat: 39.943486, 1216 | lng: 116.449645 1217 | }, 1218 | { 1219 | lat: 39.943486, 1220 | lng: 116.485645 1221 | }, 1222 | { 1223 | lat: 39.970486, 1224 | lng: 116.485645 1225 | }, 1226 | { 1227 | lat: 39.970486, 1228 | lng: 116.449645 1229 | } 1230 | ] 1231 | }, 1232 | { 1233 | center: { 1234 | lat: 39.929986, 1235 | lng: 116.467645 1236 | }, 1237 | count: Math.round(Math.random() * 1000), 1238 | id: '120', 1239 | name: '', 1240 | range: [ 1241 | { 1242 | lat: 39.916486, 1243 | lng: 116.449645 1244 | }, 1245 | { 1246 | lat: 39.916486, 1247 | lng: 116.485645 1248 | }, 1249 | { 1250 | lat: 39.943486, 1251 | lng: 116.485645 1252 | }, 1253 | { 1254 | lat: 39.943486, 1255 | lng: 116.449645 1256 | } 1257 | ] 1258 | }, 1259 | { 1260 | center: { 1261 | lat: 40.037986, 1262 | lng: 116.467645 1263 | }, 1264 | count: Math.round(Math.random() * 1000), 1265 | id: '124', 1266 | name: '', 1267 | range: [ 1268 | { 1269 | lat: 40.024486, 1270 | lng: 116.449645 1271 | }, 1272 | { 1273 | lat: 40.024486, 1274 | lng: 116.485645 1275 | }, 1276 | { 1277 | lat: 40.051486, 1278 | lng: 116.485645 1279 | }, 1280 | { 1281 | lat: 40.051486, 1282 | lng: 116.449645 1283 | } 1284 | ] 1285 | }, 1286 | { 1287 | center: { 1288 | lat: 39.902986, 1289 | lng: 116.395645 1290 | }, 1291 | count: Math.round(Math.random() * 1000), 1292 | id: '101', 1293 | name: '', 1294 | range: [ 1295 | { 1296 | lat: 39.889486, 1297 | lng: 116.377645 1298 | }, 1299 | { 1300 | lat: 39.889486, 1301 | lng: 116.413645 1302 | }, 1303 | { 1304 | lat: 39.916486, 1305 | lng: 116.413645 1306 | }, 1307 | { 1308 | lat: 39.916486, 1309 | lng: 116.377645 1310 | } 1311 | ] 1312 | }, 1313 | { 1314 | center: { 1315 | lat: 39.848986, 1316 | lng: 116.395645 1317 | }, 1318 | count: Math.round(Math.random() * 1000), 1319 | id: '103', 1320 | name: '', 1321 | range: [ 1322 | { 1323 | lat: 39.835486, 1324 | lng: 116.377645 1325 | }, 1326 | { 1327 | lat: 39.835486, 1328 | lng: 116.413645 1329 | }, 1330 | { 1331 | lat: 39.862486, 1332 | lng: 116.413645 1333 | }, 1334 | { 1335 | lat: 39.862486, 1336 | lng: 116.377645 1337 | } 1338 | ] 1339 | }, 1340 | { 1341 | center: { 1342 | lat: 39.875986, 1343 | lng: 116.395645 1344 | }, 1345 | count: Math.round(Math.random() * 1000), 1346 | id: '102', 1347 | name: '', 1348 | range: [ 1349 | { 1350 | lat: 39.862486, 1351 | lng: 116.377645 1352 | }, 1353 | { 1354 | lat: 39.862486, 1355 | lng: 116.413645 1356 | }, 1357 | { 1358 | lat: 39.889486, 1359 | lng: 116.413645 1360 | }, 1361 | { 1362 | lat: 39.889486, 1363 | lng: 116.377645 1364 | } 1365 | ] 1366 | }, 1367 | { 1368 | center: { 1369 | lat: 39.956986, 1370 | lng: 116.503645 1371 | }, 1372 | count: Math.round(Math.random() * 1000), 1373 | id: '131', 1374 | name: '', 1375 | range: [ 1376 | { 1377 | lat: 39.943486, 1378 | lng: 116.485645 1379 | }, 1380 | { 1381 | lat: 39.943486, 1382 | lng: 116.521645 1383 | }, 1384 | { 1385 | lat: 39.970486, 1386 | lng: 116.521645 1387 | }, 1388 | { 1389 | lat: 39.970486, 1390 | lng: 116.485645 1391 | } 1392 | ] 1393 | }, 1394 | { 1395 | center: { 1396 | lat: 39.821986, 1397 | lng: 116.395645 1398 | }, 1399 | count: Math.round(Math.random() * 1000), 1400 | id: '104', 1401 | name: '', 1402 | range: [ 1403 | { 1404 | lat: 39.808486, 1405 | lng: 116.377645 1406 | }, 1407 | { 1408 | lat: 39.808486, 1409 | lng: 116.413645 1410 | }, 1411 | { 1412 | lat: 39.835486, 1413 | lng: 116.413645 1414 | }, 1415 | { 1416 | lat: 39.835486, 1417 | lng: 116.377645 1418 | } 1419 | ] 1420 | }, 1421 | { 1422 | center: { 1423 | lat: 39.929986, 1424 | lng: 116.503645 1425 | }, 1426 | count: Math.round(Math.random() * 1000), 1427 | id: '130', 1428 | name: '', 1429 | range: [ 1430 | { 1431 | lat: 39.916486, 1432 | lng: 116.485645 1433 | }, 1434 | { 1435 | lat: 39.916486, 1436 | lng: 116.521645 1437 | }, 1438 | { 1439 | lat: 39.943486, 1440 | lng: 116.521645 1441 | }, 1442 | { 1443 | lat: 39.943486, 1444 | lng: 116.485645 1445 | } 1446 | ] 1447 | }, 1448 | { 1449 | center: { 1450 | lat: 39.767986, 1451 | lng: 116.395645 1452 | }, 1453 | count: Math.round(Math.random() * 1000), 1454 | id: '106', 1455 | name: '', 1456 | range: [ 1457 | { 1458 | lat: 39.754486, 1459 | lng: 116.377645 1460 | }, 1461 | { 1462 | lat: 39.754486, 1463 | lng: 116.413645 1464 | }, 1465 | { 1466 | lat: 39.781486, 1467 | lng: 116.413645 1468 | }, 1469 | { 1470 | lat: 39.781486, 1471 | lng: 116.377645 1472 | } 1473 | ] 1474 | }, 1475 | { 1476 | center: { 1477 | lat: 39.713986, 1478 | lng: 116.395645 1479 | }, 1480 | count: Math.round(Math.random() * 1000), 1481 | id: '108', 1482 | name: '', 1483 | range: [ 1484 | { 1485 | lat: 39.700486, 1486 | lng: 116.377645 1487 | }, 1488 | { 1489 | lat: 39.700486, 1490 | lng: 116.413645 1491 | }, 1492 | { 1493 | lat: 39.727486, 1494 | lng: 116.413645 1495 | }, 1496 | { 1497 | lat: 39.727486, 1498 | lng: 116.377645 1499 | } 1500 | ] 1501 | }, 1502 | { 1503 | center: { 1504 | lat: 40.010986, 1505 | lng: 116.503645 1506 | }, 1507 | count: Math.round(Math.random() * 1000), 1508 | id: '133', 1509 | name: '', 1510 | range: [ 1511 | { 1512 | lat: 39.997486, 1513 | lng: 116.485645 1514 | }, 1515 | { 1516 | lat: 39.997486, 1517 | lng: 116.521645 1518 | }, 1519 | { 1520 | lat: 40.024486, 1521 | lng: 116.521645 1522 | }, 1523 | { 1524 | lat: 40.024486, 1525 | lng: 116.485645 1526 | } 1527 | ] 1528 | }, 1529 | { 1530 | center: { 1531 | lat: 39.983986, 1532 | lng: 116.503645 1533 | }, 1534 | count: Math.round(Math.random() * 1000), 1535 | id: '132', 1536 | name: '', 1537 | range: [ 1538 | { 1539 | lat: 39.970486, 1540 | lng: 116.485645 1541 | }, 1542 | { 1543 | lat: 39.970486, 1544 | lng: 116.521645 1545 | }, 1546 | { 1547 | lat: 39.997486, 1548 | lng: 116.521645 1549 | }, 1550 | { 1551 | lat: 39.997486, 1552 | lng: 116.485645 1553 | } 1554 | ] 1555 | }, 1556 | { 1557 | center: { 1558 | lat: 39.929986, 1559 | lng: 116.539645 1560 | }, 1561 | count: Math.round(Math.random() * 1000), 1562 | id: '140', 1563 | name: '', 1564 | range: [ 1565 | { 1566 | lat: 39.916486, 1567 | lng: 116.521645 1568 | }, 1569 | { 1570 | lat: 39.916486, 1571 | lng: 116.557645 1572 | }, 1573 | { 1574 | lat: 39.943486, 1575 | lng: 116.557645 1576 | }, 1577 | { 1578 | lat: 39.943486, 1579 | lng: 116.521645 1580 | } 1581 | ] 1582 | }, 1583 | { 1584 | center: { 1585 | lat: 40.010986, 1586 | lng: 116.539645 1587 | }, 1588 | count: Math.round(Math.random() * 1000), 1589 | id: '143', 1590 | name: '', 1591 | range: [ 1592 | { 1593 | lat: 39.997486, 1594 | lng: 116.521645 1595 | }, 1596 | { 1597 | lat: 39.997486, 1598 | lng: 116.557645 1599 | }, 1600 | { 1601 | lat: 40.024486, 1602 | lng: 116.557645 1603 | }, 1604 | { 1605 | lat: 40.024486, 1606 | lng: 116.521645 1607 | } 1608 | ] 1609 | }, 1610 | { 1611 | center: { 1612 | lat: 40.145986, 1613 | lng: 116.575645 1614 | }, 1615 | count: Math.round(Math.random() * 1000), 1616 | id: '158', 1617 | name: '', 1618 | range: [ 1619 | { 1620 | lat: 40.132486, 1621 | lng: 116.557645 1622 | }, 1623 | { 1624 | lat: 40.132486, 1625 | lng: 116.593645 1626 | }, 1627 | { 1628 | lat: 40.159486, 1629 | lng: 116.593645 1630 | }, 1631 | { 1632 | lat: 40.159486, 1633 | lng: 116.557645 1634 | } 1635 | ] 1636 | }, 1637 | { 1638 | center: { 1639 | lat: 39.902986, 1640 | lng: 116.647645 1641 | }, 1642 | count: Math.round(Math.random() * 1000), 1643 | id: '171', 1644 | name: '', 1645 | range: [ 1646 | { 1647 | lat: 39.889486, 1648 | lng: 116.629645 1649 | }, 1650 | { 1651 | lat: 39.889486, 1652 | lng: 116.665645 1653 | }, 1654 | { 1655 | lat: 39.916486, 1656 | lng: 116.665645 1657 | }, 1658 | { 1659 | lat: 39.916486, 1660 | lng: 116.629645 1661 | } 1662 | ] 1663 | }, 1664 | { 1665 | center: { 1666 | lat: 39.794986, 1667 | lng: 116.683645 1668 | }, 1669 | count: Math.round(Math.random() * 1000), 1670 | id: '185', 1671 | name: '', 1672 | range: [ 1673 | { 1674 | lat: 39.781486, 1675 | lng: 116.665645 1676 | }, 1677 | { 1678 | lat: 39.781486, 1679 | lng: 116.701645 1680 | }, 1681 | { 1682 | lat: 39.808486, 1683 | lng: 116.701645 1684 | }, 1685 | { 1686 | lat: 39.808486, 1687 | lng: 116.665645 1688 | } 1689 | ] 1690 | }, 1691 | { 1692 | center: { 1693 | lat: 39.848986, 1694 | lng: 116.611645 1695 | }, 1696 | count: Math.round(Math.random() * 1000), 1697 | id: '163', 1698 | name: '', 1699 | range: [ 1700 | { 1701 | lat: 39.835486, 1702 | lng: 116.593645 1703 | }, 1704 | { 1705 | lat: 39.835486, 1706 | lng: 116.629645 1707 | }, 1708 | { 1709 | lat: 39.862486, 1710 | lng: 116.629645 1711 | }, 1712 | { 1713 | lat: 39.862486, 1714 | lng: 116.593645 1715 | } 1716 | ] 1717 | }, 1718 | { 1719 | center: { 1720 | lat: 39.875986, 1721 | lng: 116.611645 1722 | }, 1723 | count: Math.round(Math.random() * 1000), 1724 | id: '162', 1725 | name: '', 1726 | range: [ 1727 | { 1728 | lat: 39.862486, 1729 | lng: 116.593645 1730 | }, 1731 | { 1732 | lat: 39.862486, 1733 | lng: 116.629645 1734 | }, 1735 | { 1736 | lat: 39.889486, 1737 | lng: 116.629645 1738 | }, 1739 | { 1740 | lat: 39.889486, 1741 | lng: 116.593645 1742 | } 1743 | ] 1744 | }, 1745 | { 1746 | center: { 1747 | lat: 39.767986, 1748 | lng: 116.611645 1749 | }, 1750 | count: Math.round(Math.random() * 1000), 1751 | id: '166', 1752 | name: '', 1753 | range: [ 1754 | { 1755 | lat: 39.754486, 1756 | lng: 116.593645 1757 | }, 1758 | { 1759 | lat: 39.754486, 1760 | lng: 116.629645 1761 | }, 1762 | { 1763 | lat: 39.781486, 1764 | lng: 116.629645 1765 | }, 1766 | { 1767 | lat: 39.781486, 1768 | lng: 116.593645 1769 | } 1770 | ] 1771 | }, 1772 | { 1773 | center: { 1774 | lat: 39.983986, 1775 | lng: 116.395645 1776 | }, 1777 | count: Math.round(Math.random() * 1000), 1778 | id: '102', 1779 | name: '', 1780 | range: [ 1781 | { 1782 | lat: 39.970486, 1783 | lng: 116.377645 1784 | }, 1785 | { 1786 | lat: 39.970486, 1787 | lng: 116.413645 1788 | }, 1789 | { 1790 | lat: 39.997486, 1791 | lng: 116.413645 1792 | }, 1793 | { 1794 | lat: 39.997486, 1795 | lng: 116.377645 1796 | } 1797 | ] 1798 | }, 1799 | { 1800 | center: { 1801 | lat: 40.118986, 1802 | lng: 116.395645 1803 | }, 1804 | count: Math.round(Math.random() * 1000), 1805 | id: '107', 1806 | name: '', 1807 | range: [ 1808 | { 1809 | lat: 40.105486, 1810 | lng: 116.377645 1811 | }, 1812 | { 1813 | lat: 40.105486, 1814 | lng: 116.413645 1815 | }, 1816 | { 1817 | lat: 40.132486, 1818 | lng: 116.413645 1819 | }, 1820 | { 1821 | lat: 40.132486, 1822 | lng: 116.377645 1823 | } 1824 | ] 1825 | }, 1826 | { 1827 | center: { 1828 | lat: 40.091986, 1829 | lng: 116.359645 1830 | }, 1831 | count: Math.round(Math.random() * 1000), 1832 | id: '116', 1833 | name: '', 1834 | range: [ 1835 | { 1836 | lat: 40.078486, 1837 | lng: 116.341645 1838 | }, 1839 | { 1840 | lat: 40.078486, 1841 | lng: 116.377645 1842 | }, 1843 | { 1844 | lat: 40.105486, 1845 | lng: 116.377645 1846 | }, 1847 | { 1848 | lat: 40.105486, 1849 | lng: 116.341645 1850 | } 1851 | ] 1852 | }, 1853 | { 1854 | center: { 1855 | lat: 40.064986, 1856 | lng: 116.359645 1857 | }, 1858 | count: Math.round(Math.random() * 1000), 1859 | id: '115', 1860 | name: '', 1861 | range: [ 1862 | { 1863 | lat: 40.051486, 1864 | lng: 116.341645 1865 | }, 1866 | { 1867 | lat: 40.051486, 1868 | lng: 116.377645 1869 | }, 1870 | { 1871 | lat: 40.078486, 1872 | lng: 116.377645 1873 | }, 1874 | { 1875 | lat: 40.078486, 1876 | lng: 116.341645 1877 | } 1878 | ] 1879 | }, 1880 | { 1881 | center: { 1882 | lat: 40.037986, 1883 | lng: 116.359645 1884 | }, 1885 | count: Math.round(Math.random() * 1000), 1886 | id: '114', 1887 | name: '', 1888 | range: [ 1889 | { 1890 | lat: 40.024486, 1891 | lng: 116.341645 1892 | }, 1893 | { 1894 | lat: 40.024486, 1895 | lng: 116.377645 1896 | }, 1897 | { 1898 | lat: 40.051486, 1899 | lng: 116.377645 1900 | }, 1901 | { 1902 | lat: 40.051486, 1903 | lng: 116.341645 1904 | } 1905 | ] 1906 | }, 1907 | { 1908 | center: { 1909 | lat: 39.983986, 1910 | lng: 116.359645 1911 | }, 1912 | count: Math.round(Math.random() * 1000), 1913 | id: '112', 1914 | name: '', 1915 | range: [ 1916 | { 1917 | lat: 39.970486, 1918 | lng: 116.341645 1919 | }, 1920 | { 1921 | lat: 39.970486, 1922 | lng: 116.377645 1923 | }, 1924 | { 1925 | lat: 39.997486, 1926 | lng: 116.377645 1927 | }, 1928 | { 1929 | lat: 39.997486, 1930 | lng: 116.341645 1931 | } 1932 | ] 1933 | }, 1934 | { 1935 | center: { 1936 | lat: 39.956986, 1937 | lng: 116.359645 1938 | }, 1939 | count: Math.round(Math.random() * 1000), 1940 | id: '111', 1941 | name: '', 1942 | range: [ 1943 | { 1944 | lat: 39.943486, 1945 | lng: 116.341645 1946 | }, 1947 | { 1948 | lat: 39.943486, 1949 | lng: 116.377645 1950 | }, 1951 | { 1952 | lat: 39.970486, 1953 | lng: 116.377645 1954 | }, 1955 | { 1956 | lat: 39.970486, 1957 | lng: 116.341645 1958 | } 1959 | ] 1960 | }, 1961 | { 1962 | center: { 1963 | lat: 39.929986, 1964 | lng: 116.359645 1965 | }, 1966 | count: Math.round(Math.random() * 1000), 1967 | id: '110', 1968 | name: '', 1969 | range: [ 1970 | { 1971 | lat: 39.916486, 1972 | lng: 116.341645 1973 | }, 1974 | { 1975 | lat: 39.916486, 1976 | lng: 116.377645 1977 | }, 1978 | { 1979 | lat: 39.943486, 1980 | lng: 116.377645 1981 | }, 1982 | { 1983 | lat: 39.943486, 1984 | lng: 116.341645 1985 | } 1986 | ] 1987 | }, 1988 | { 1989 | center: { 1990 | lat: 40.010986, 1991 | lng: 116.431645 1992 | }, 1993 | count: Math.round(Math.random() * 1000), 1994 | id: '113', 1995 | name: '', 1996 | range: [ 1997 | { 1998 | lat: 39.997486, 1999 | lng: 116.413645 2000 | }, 2001 | { 2002 | lat: 39.997486, 2003 | lng: 116.449645 2004 | }, 2005 | { 2006 | lat: 40.024486, 2007 | lng: 116.449645 2008 | }, 2009 | { 2010 | lat: 40.024486, 2011 | lng: 116.413645 2012 | } 2013 | ] 2014 | }, 2015 | { 2016 | center: { 2017 | lat: 39.983986, 2018 | lng: 116.431645 2019 | }, 2020 | count: Math.round(Math.random() * 1000), 2021 | id: '112', 2022 | name: '', 2023 | range: [ 2024 | { 2025 | lat: 39.970486, 2026 | lng: 116.413645 2027 | }, 2028 | { 2029 | lat: 39.970486, 2030 | lng: 116.449645 2031 | }, 2032 | { 2033 | lat: 39.997486, 2034 | lng: 116.449645 2035 | }, 2036 | { 2037 | lat: 39.997486, 2038 | lng: 116.413645 2039 | } 2040 | ] 2041 | }, 2042 | { 2043 | center: { 2044 | lat: 39.956986, 2045 | lng: 116.431645 2046 | }, 2047 | count: Math.round(Math.random() * 1000), 2048 | id: '111', 2049 | name: '', 2050 | range: [ 2051 | { 2052 | lat: 39.943486, 2053 | lng: 116.413645 2054 | }, 2055 | { 2056 | lat: 39.943486, 2057 | lng: 116.449645 2058 | }, 2059 | { 2060 | lat: 39.970486, 2061 | lng: 116.449645 2062 | }, 2063 | { 2064 | lat: 39.970486, 2065 | lng: 116.413645 2066 | } 2067 | ] 2068 | }, 2069 | { 2070 | center: { 2071 | lat: 39.929986, 2072 | lng: 116.431645 2073 | }, 2074 | count: Math.round(Math.random() * 1000), 2075 | id: '110', 2076 | name: '未命名商圈', 2077 | range: [ 2078 | { 2079 | lat: 39.916486, 2080 | lng: 116.413645 2081 | }, 2082 | { 2083 | lat: 39.916486, 2084 | lng: 116.449645 2085 | }, 2086 | { 2087 | lat: 39.943486, 2088 | lng: 116.449645 2089 | }, 2090 | { 2091 | lat: 39.943486, 2092 | lng: 116.413645 2093 | } 2094 | ] 2095 | }, 2096 | { 2097 | center: { 2098 | lat: 40.118986, 2099 | lng: 116.431645 2100 | }, 2101 | count: Math.round(Math.random() * 1000), 2102 | id: '117', 2103 | name: '', 2104 | range: [ 2105 | { 2106 | lat: 40.105486, 2107 | lng: 116.413645 2108 | }, 2109 | { 2110 | lat: 40.105486, 2111 | lng: 116.449645 2112 | }, 2113 | { 2114 | lat: 40.132486, 2115 | lng: 116.449645 2116 | }, 2117 | { 2118 | lat: 40.132486, 2119 | lng: 116.413645 2120 | } 2121 | ] 2122 | }, 2123 | { 2124 | center: { 2125 | lat: 40.091986, 2126 | lng: 116.431645 2127 | }, 2128 | count: Math.round(Math.random() * 1000), 2129 | id: '116', 2130 | name: '', 2131 | range: [ 2132 | { 2133 | lat: 40.078486, 2134 | lng: 116.413645 2135 | }, 2136 | { 2137 | lat: 40.078486, 2138 | lng: 116.449645 2139 | }, 2140 | { 2141 | lat: 40.105486, 2142 | lng: 116.449645 2143 | }, 2144 | { 2145 | lat: 40.105486, 2146 | lng: 116.413645 2147 | } 2148 | ] 2149 | }, 2150 | { 2151 | center: { 2152 | lat: 40.064986, 2153 | lng: 116.431645 2154 | }, 2155 | count: Math.round(Math.random() * 1000), 2156 | id: '115', 2157 | name: '', 2158 | range: [ 2159 | { 2160 | lat: 40.051486, 2161 | lng: 116.413645 2162 | }, 2163 | { 2164 | lat: 40.051486, 2165 | lng: 116.449645 2166 | }, 2167 | { 2168 | lat: 40.078486, 2169 | lng: 116.449645 2170 | }, 2171 | { 2172 | lat: 40.078486, 2173 | lng: 116.413645 2174 | } 2175 | ] 2176 | }, 2177 | { 2178 | center: { 2179 | lat: 40.037986, 2180 | lng: 116.431645 2181 | }, 2182 | count: Math.round(Math.random() * 1000), 2183 | id: '114', 2184 | name: '', 2185 | range: [ 2186 | { 2187 | lat: 40.024486, 2188 | lng: 116.413645 2189 | }, 2190 | { 2191 | lat: 40.024486, 2192 | lng: 116.449645 2193 | }, 2194 | { 2195 | lat: 40.051486, 2196 | lng: 116.449645 2197 | }, 2198 | { 2199 | lat: 40.051486, 2200 | lng: 116.413645 2201 | } 2202 | ] 2203 | } 2204 | ] 2205 | 2206 | export default { 2207 | /** 2208 | * mock bootstrap 2209 | */ 2210 | bootstrap (mock) { 2211 | mock.onGet(mapUrls.heat).reply(config => { 2212 | return new Promise((resolve, reject) => { 2213 | resolve([200, { code: 0, msg: '', result: heatPoints }]) 2214 | }) 2215 | }) 2216 | 2217 | mock.onGet(mapUrls.polygon).reply(config => { 2218 | return new Promise((resolve, reject) => { 2219 | resolve([200, { code: 0, msg: '', result: polygon }]) 2220 | }) 2221 | }) 2222 | 2223 | mock.onGet(mapUrls.pgHeat).reply(config => { 2224 | return new Promise((resolve, reject) => { 2225 | resolve([200, { code: 0, msg: '', result: polygon }]) 2226 | }) 2227 | }) 2228 | } 2229 | } 2230 | -------------------------------------------------------------------------------- /src/pages/bdmap/pgheatmap/PGHeat.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | 198 | 199 | 202 | -------------------------------------------------------------------------------- /src/pages/bdmap/polygon/Polygon.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 113 | 114 | 117 | -------------------------------------------------------------------------------- /src/pages/echarts/Echarts.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 17 | 18 | 21 | -------------------------------------------------------------------------------- /src/pages/echarts/api/index.js: -------------------------------------------------------------------------------- 1 | export const getLineChartData = () => { 2 | return { 3 | title: '折线图标题', 4 | type: 'line', // 图类型 ['line','bar','linebar','pie'] 5 | reverse: false, // 是否要颠倒系列里的data数据 6 | columns: [ 7 | { 8 | name: 'dim', // 与data中的key一样 9 | title: '维度', // 10 | x: true // 用于x轴 11 | }, 12 | { 13 | name: 'index', // 与data中的key一样 14 | title: '指标' // 即图例 15 | } 16 | ], 17 | data: [ 18 | {dim: '周一', index: 800}, 19 | {dim: '周二', index: 600}, 20 | {dim: '周三', index: 500}, 21 | {dim: '周四', index: 400}, 22 | {dim: '周五', index: 500}, 23 | {dim: '周六', index: 600}, 24 | {dim: '周日', index: 700} 25 | ] 26 | } 27 | } 28 | 29 | export const getAreaChartData = () => { 30 | return { 31 | title: '折线图标题', 32 | type: 'line', // 图类型 ['line','bar','linebar','pie'] 33 | reverse: false, // 是否要颠倒系列里的data数据 34 | columns: [ 35 | { 36 | name: 'dim', // 与data中的key一样 37 | title: '维度', // 38 | x: true // 用于x轴 39 | }, 40 | { 41 | name: 'index', // 与data中的key一样 42 | title: '指标', // 即图例 43 | area: true 44 | } 45 | ], 46 | data: [ 47 | {dim: '周一', index: 800}, 48 | {dim: '周二', index: 600}, 49 | {dim: '周三', index: 500}, 50 | {dim: '周四', index: 400}, 51 | {dim: '周五', index: 500}, 52 | {dim: '周六', index: 600}, 53 | {dim: '周日', index: 700} 54 | ] 55 | } 56 | } 57 | 58 | export const getBarChartData = () => { 59 | return { 60 | title: '柱状图标题', 61 | type: 'bar', // 图类型 ['line','bar','linebar','pie'] 62 | reverse: false, // 是否要颠倒系列里的data数据 63 | columns: [ 64 | { 65 | name: 'dim', // 与data中的key一样 66 | title: '维度', // 67 | x: true // 用于x轴 68 | }, 69 | { 70 | name: 'index', // 与data中的key一样 71 | title: '指标' // 即图例 72 | } 73 | ], 74 | data: [ 75 | {dim: '周一', index: 100}, 76 | {dim: '周二', index: 200}, 77 | {dim: '周三', index: 300}, 78 | {dim: '周四', index: 400}, 79 | {dim: '周五', index: 500}, 80 | {dim: '周六', index: 600}, 81 | {dim: '周日', index: 700} 82 | ] 83 | } 84 | } 85 | 86 | export const getLineBarChartData = () => { 87 | return { 88 | title: '折线&柱状混图标题', 89 | type: 'linebar', // 图类型 ['line','bar','linebar','pie'] 90 | reverse: false, // 是否要颠倒系列里的data数据 91 | columns: [ 92 | { 93 | name: 'dim', // 与data中的key一样 94 | title: '维度', // 95 | x: true // 用于x轴 96 | }, 97 | { 98 | name: 'index1', // 与data中的key一样 99 | title: '指标1', // 即图例 100 | type: 'line' // 上面的type为'linebar'时才有效 101 | }, 102 | { 103 | name: 'index2', // 与data中的key一样 104 | title: '指标2', // 即图例 105 | type: 'bar' // 上面的type为'linebar'时才有效 106 | } 107 | ], 108 | data: [ 109 | {dim: '周一', index1: 100, index2: 800}, 110 | {dim: '周二', index1: 200, index2: 600}, 111 | {dim: '周三', index1: 300, index2: 400}, 112 | {dim: '周四', index1: 400, index2: 300}, 113 | {dim: '周五', index1: 500, index2: 500}, 114 | {dim: '周六', index1: 600, index2: 700}, 115 | {dim: '周日', index1: 700, index2: 900} 116 | ] 117 | } 118 | } 119 | 120 | export const getPieChartData = () => { 121 | return { 122 | title: '饼状图标题', 123 | type: 'pie', // 图类型 ['line','bar','linebar','pie'] 124 | reverse: false, // 是否要颠倒系列里的data数据 125 | columns: [ 126 | { 127 | name: 'index1', // 与data中的key一样 128 | title: '指标1' // 即图例 129 | }, 130 | { 131 | name: 'index2', // 与data中的key一样 132 | title: '指标2' // 即图例 133 | }, 134 | { 135 | name: 'index3', // 与data中的key一样 136 | title: '指标3' // 即图例 137 | }, 138 | { 139 | name: 'index4', // 与data中的key一样 140 | title: '指标4' // 即图例 141 | } 142 | ], 143 | data: [ 144 | {index1: 100, index2: 800, index3: 200, index4: 400} 145 | ] 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /src/pages/echarts/bar/Bar.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | -------------------------------------------------------------------------------- /src/pages/echarts/dashboard/Dashboard.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 56 | -------------------------------------------------------------------------------- /src/pages/echarts/index.js: -------------------------------------------------------------------------------- 1 | import Echarts from './Echarts.vue' 2 | import Bar from './bar/Bar.vue' 3 | import Dashboard from './dashboard/Dashboard.vue' 4 | import Line from './line/Line.vue' 5 | import LineBar from './line/LineBar.vue' 6 | import Area from './line/Area.vue' 7 | import Pie from './pie/Pie.vue' 8 | 9 | Echarts.Dashboard = Dashboard 10 | Echarts.Bar = Bar 11 | Echarts.Line = Line 12 | Echarts.LineBar = LineBar 13 | Echarts.Area = Area 14 | Echarts.Pie = Pie 15 | 16 | export default Echarts 17 | -------------------------------------------------------------------------------- /src/pages/echarts/line/Area.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | -------------------------------------------------------------------------------- /src/pages/echarts/line/Line.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | -------------------------------------------------------------------------------- /src/pages/echarts/line/LineBar.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | -------------------------------------------------------------------------------- /src/pages/echarts/pie/Pie.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | -------------------------------------------------------------------------------- /src/pages/login/Login.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 52 | 53 | 56 | -------------------------------------------------------------------------------- /src/pages/login/api/index.js: -------------------------------------------------------------------------------- 1 | import {post} from '../../../axios/ajax' 2 | 3 | const loginBaseUrl = '/api' 4 | export const loginUrls = { 5 | login: loginBaseUrl + '/login', 6 | logout: loginBaseUrl + '/logout' 7 | } 8 | 9 | /** 10 | * 登录请求 11 | * @param params 12 | */ 13 | export const requestLogin = params => { return post(loginUrls.login, params) } 14 | /** 15 | * 登出请求 16 | * @param params 17 | */ 18 | export const requestLogout = params => { return post(loginUrls.logout, params) } 19 | -------------------------------------------------------------------------------- /src/pages/login/index.js: -------------------------------------------------------------------------------- 1 | import Login from './Login.vue' 2 | 3 | export default Login 4 | -------------------------------------------------------------------------------- /src/pages/login/mock/index.js: -------------------------------------------------------------------------------- 1 | import {loginUrls} from '../api' 2 | 3 | const LoginUsers = [ 4 | { 5 | name: '张某某', 6 | email: 'admin@daojia.com', 7 | password: '123456', 8 | username: 'admin', 9 | token: '43e3ec99-c8a3-47ec-afd7-775b7c073285' 10 | } 11 | ] 12 | 13 | export default { 14 | /** 15 | * mock bootstrap 16 | */ 17 | bootstrap (mock) { 18 | // 登录 19 | mock.onPost(loginUrls.login).reply(config => { 20 | let {username, password} = JSON.parse(config.data) 21 | return new Promise((resolve, reject) => { 22 | let user = null 23 | setTimeout(() => { 24 | let msg = '请求成功' 25 | let hasUser = LoginUsers.some(u => { 26 | if (u.username !== username || u.password !== password) { 27 | msg = '账号或密码错误' 28 | return false 29 | } 30 | user = u 31 | return true 32 | }) 33 | 34 | if (hasUser) { 35 | resolve([200, { code: 0, msg: msg, result: user }]) 36 | } else { 37 | resolve([200, { code: 100, msg: msg, result: {} }]) 38 | } 39 | }, 500) 40 | }) 41 | }) 42 | 43 | // 登出 44 | mock.onPost(loginUrls.logout).reply(config => { 45 | return new Promise((resolve, reject) => { 46 | resolve([200, { code: 0, msg: 'success', result: {} }]) 47 | }) 48 | }) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/pages/scene/Scene.vue: -------------------------------------------------------------------------------- 1 | 65 | 66 | 153 | 154 | 157 | -------------------------------------------------------------------------------- /src/pages/scene/SceneDevelop.vue: -------------------------------------------------------------------------------- 1 | 55 | 56 | 265 | 266 | 269 | -------------------------------------------------------------------------------- /src/pages/scene/SceneDevelop2.vue: -------------------------------------------------------------------------------- 1 | 55 | 56 | 265 | 266 | 269 | -------------------------------------------------------------------------------- /src/pages/scene/api/index.js: -------------------------------------------------------------------------------- 1 | import {get, post} from '../../../axios/ajax' 2 | 3 | const sceneBaseUrl = '/api/scene' 4 | export const sceneUrls = { 5 | list: sceneBaseUrl + '/list', 6 | saveOrUpdate: sceneBaseUrl + '/save-or-update', 7 | flowChart: sceneBaseUrl + '/flow-chart' 8 | } 9 | 10 | /** 11 | * 分页查询场景实验列表 12 | * @param params 13 | */ 14 | export const listScene = params => { return get(sceneUrls.list, params) } 15 | 16 | /** 17 | * 新增或编辑场景 18 | * @param params 19 | */ 20 | export const saveOrUpdateScene = params => { return post(sceneUrls.saveOrUpdate, params) } 21 | 22 | /** 23 | * 新增实验,获取默认流程图 24 | */ 25 | export const getSceneDefaultFlowNodes = () => { 26 | let time = new Date().getTime() 27 | let node1 = 'jspnode_' + time + '_1' 28 | let node2 = 'jspnode_' + time + '_2' 29 | let node3 = 'jspnode_' + time + '_3' 30 | let nodes = [ 31 | {nodeCode: 'db_hive', nodeDomId: node1, name: 'hive', x: 500, y: 20, parents: [], children: [node2]}, 32 | {nodeCode: 'fp_normalization', nodeDomId: node2, name: '归一化', x: 500, y: 200, parents: [node1], children: [node3]}, 33 | {nodeCode: 'ds_random', nodeDomId: node3, name: '随机分组', x: 500, y: 400, parents: [node2], children: []} 34 | ] 35 | return nodes 36 | } 37 | 38 | /** 39 | * 新增或编辑场景 40 | * @param params 41 | */ 42 | export const getSceneFlowChart = params => { return post(sceneUrls.flowChart, params) } 43 | -------------------------------------------------------------------------------- /src/pages/scene/index.js: -------------------------------------------------------------------------------- 1 | import Scene from './Scene.vue' 2 | import SceneDevelop from './SceneDevelop.vue' 3 | 4 | Scene.SceneDevelop = SceneDevelop 5 | 6 | export default Scene 7 | -------------------------------------------------------------------------------- /src/pages/scene/mock/index.js: -------------------------------------------------------------------------------- 1 | import {sceneUrls} from '../api' 2 | 3 | const scenes = [ 4 | {id: 1, name: '场景一', description: '不知道飞机打开了房间啊的骄傲放开了房间啊jfkasl打开房间啊可怜的房间爱上了健康kdsjfklasj肯德基疯狂拉升的减肥啦大的发', creator: 'admin', createtime: new Date().getTime()}, 5 | {id: 2, name: '场景二', description: '的法法师法师法师打发查', creator: 'admin', createtime: new Date().getTime()}, 6 | {id: 3, name: '场景三', description: '而委托人为他人违规放到后端法规和方式', creator: 'admin', createtime: new Date().getTime()}, 7 | {id: 4, name: '场景四', description: '发生的发生的发生发生的发', creator: 'admin', createtime: new Date().getTime()}, 8 | {id: 5, name: '场景五', description: '覆盖公司的弗格森的符合符合人体无法v在v', creator: 'admin', createtime: new Date().getTime()}, 9 | {id: 6, name: '场景六', description: '不知道飞机打开了房间啊的骄傲放开了房间啊大的发', creator: 'admin', createtime: new Date().getTime()}, 10 | {id: 7, name: '场景七', description: '与各界提供方便v成本持续', creator: 'admin', createtime: new Date().getTime()}, 11 | {id: 8, name: '场景八', description: '股一统江湖甘拜下风大大方方地方v', creator: 'admin', createtime: new Date().getTime()}, 12 | {id: 9, name: '场景九', description: '不知道飞机打开了房间啊的骄傲放开了房间啊大的发', creator: 'admin', createtime: new Date().getTime()}, 13 | {id: 10, name: '场景十', description: '不知道飞机打开了房间啊的骄傲放开了房间啊大的发', creator: 'admin', createtime: new Date().getTime()}, 14 | {id: 11, name: '场景十一', description: '不知道飞机打开了房间啊的骄傲放开了房间啊大的发', creator: 'admin', createtime: new Date().getTime()}, 15 | {id: 12, name: '场景十二', description: '不知道飞机打开了房间啊的骄傲放开了房间啊大的发', creator: 'admin', createtime: new Date().getTime()}, 16 | {id: 13, name: '场景十三', description: '不知道飞机打开了房间啊的骄傲放开了房间啊大的发', creator: 'admin', createtime: new Date().getTime()}, 17 | {id: 14, name: '场景十四', description: '不知道飞机打开了房间啊的骄傲放开了房间啊大的发', creator: 'admin', createtime: new Date().getTime()}, 18 | {id: 15, name: '场景十五', description: '不知道飞机打开了房间啊的骄傲放开了房间啊大的发', creator: 'admin', createtime: new Date().getTime()}, 19 | {id: 16, name: '场景十六', description: '不知道飞机打开了房间啊的骄傲放开了房间啊大的发', creator: 'admin', createtime: new Date().getTime()}, 20 | {id: 17, name: '场景十七', description: '不知道飞机打开了房间啊的骄傲放开了房间啊大的发', creator: 'admin', createtime: new Date().getTime()}, 21 | {id: 18, name: '场景十八', description: '不知道飞机打开了房间啊的骄傲放开了房间啊大的发', creator: 'admin', createtime: new Date().getTime()}, 22 | {id: 19, name: '场景十九', description: '不知道飞机打开了房间啊的骄傲放开了房间啊大的发', creator: 'admin', createtime: new Date().getTime()} 23 | ] 24 | 25 | export default { 26 | /** 27 | * mock bootstrap 28 | */ 29 | bootstrap (mock) { 30 | /** 31 | * 分页查询场景实验列表 32 | */ 33 | mock.onGet(sceneUrls.list).reply(config => { 34 | let {page, pageSize} = config 35 | console.log('分页查询场景实验列表,参数:{}', {page, pageSize}) 36 | return new Promise((resolve, reject) => { 37 | let res = [] 38 | let startIndex = (page - 1) * pageSize 39 | if (scenes.length > startIndex) { 40 | let endIndex = startIndex + pageSize 41 | res = scenes.slice(startIndex, endIndex) 42 | } 43 | resolve([200, { code: 0, msg: '', result: res }]) 44 | }) 45 | }) 46 | 47 | /** 48 | * 新增场景 49 | */ 50 | mock.onPost(sceneUrls.saveOrUpdate).reply(config => { 51 | let {id, name, description} = JSON.parse(config.data) 52 | console.log('新增场景实验,参数:{}', JSON.parse(config.data)) 53 | return new Promise((resolve, reject) => { 54 | let data = { 55 | id: (id && id !== '' ? Number(id) : scenes.length + 1), 56 | name: name, 57 | description: description, 58 | creator: 'admin', 59 | createtime: new Date().getTime() 60 | } 61 | if (id && id !== '') { 62 | for (let index in scenes) { 63 | if (scenes[index].id === data.id) { 64 | scenes[index] = data 65 | } 66 | } 67 | } else { 68 | scenes.unshift(data) 69 | } 70 | resolve([200, { code: 0, msg: '', result: data }]) 71 | }) 72 | }) 73 | 74 | /** 75 | * 编辑流程,获取流程图 76 | */ 77 | mock.onPost(sceneUrls.flowChart).reply(config => { 78 | let {sceneId} = JSON.parse(config.data) 79 | console.log('获取流程图,参数:{}', JSON.parse(config.data)) 80 | return new Promise((resolve, reject) => { 81 | let time = new Date().getTime() 82 | let node1 = 'jspnode_' + time + '_1' 83 | let node2 = 'jspnode_' + time + '_2' 84 | let node3 = 'jspnode_' + time + '_3' 85 | let node4 = 'jspnode_' + time + '_4' 86 | let node5 = 'jspnode_' + time + '_5' 87 | let node6 = 'jspnode_' + time + '_6' 88 | let node7 = 'jspnode_' + time + '_7' 89 | let nodes = [ 90 | {nodeCode: 'db_hive', nodeDomId: node1, name: 'hive', x: 500, y: 20, parents: [], children: [node2, node4, node5, node6, node7]}, 91 | {nodeCode: 'fp_normalization', nodeDomId: node2, name: '归一化', x: 200, y: 200, parents: [node1], children: [node3]}, 92 | {nodeCode: 'ds_random', nodeDomId: node3, name: '随机分组', x: 500, y: 400, parents: [node2, node4, node5, node6, node7], children: []}, 93 | {nodeCode: 'fp_miss_value', nodeDomId: node4, name: '缺失值处理', x: 300, y: 200, parents: [node1], children: [node3]}, 94 | {nodeCode: 'fp_bucket', nodeDomId: node5, name: '分箱', x: 500, y: 200, parents: [node1], children: [node3]}, 95 | {nodeCode: 'fp_discretization', nodeDomId: node6, name: '离散化', x: 700, y: 200, parents: [node1], children: [node3]}, 96 | {nodeCode: 'fp_value_range', nodeDomId: node7, name: '取值范围', x: 800, y: 200, parents: [node1], children: [node3]} 97 | ] 98 | resolve([200, { code: 0, msg: '', result: nodes }]) 99 | }) 100 | }) 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /src/pages/sysmanage/SysManage.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 13 | 14 | 17 | -------------------------------------------------------------------------------- /src/pages/sysmanage/index.js: -------------------------------------------------------------------------------- 1 | import SysManage from './SysManage.vue' 2 | import User from './user/User.vue' 3 | import Role from './role/Role.vue' 4 | 5 | SysManage.User = User 6 | SysManage.Role = Role 7 | 8 | export default SysManage 9 | -------------------------------------------------------------------------------- /src/pages/sysmanage/role/Role.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | 74 | -------------------------------------------------------------------------------- /src/pages/sysmanage/user/User.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 47 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import { getLoginUser, removeTokenCookie } from '../assets/js/assist' 4 | import Login from '../pages/login' 5 | import Scene from '../pages/scene' 6 | import Test from '../pages/Test.vue' 7 | import SysManage from '../pages/sysmanage' 8 | import Echarts from '../pages/echarts' 9 | import BDMap from '../pages/bdmap' 10 | 11 | Vue.use(Router) 12 | 13 | const menuType = { 14 | header: 'headerMenu', 15 | left: 'leftMenu' 16 | } 17 | 18 | let router = new Router({ 19 | routes: [ 20 | { 21 | path: '/', 22 | name: 'Login', 23 | component: Login 24 | }, 25 | { 26 | path: '/test', 27 | name: 'Test', 28 | component: Test 29 | }, 30 | { 31 | path: '/scene', 32 | name: 'Scene', 33 | component: Scene 34 | }, 35 | { 36 | path: '/scene/develop', 37 | name: 'SceneDevelop', 38 | component: Scene.SceneDevelop 39 | }, 40 | { 41 | path: '/sys', 42 | name: '', 43 | component: SysManage, 44 | type: menuType.header, 45 | children: [ 46 | {path: 'user', name: '用户管理', component: SysManage.User, type: menuType.left}, 47 | {path: 'role', name: '角色管理', component: SysManage.Role, type: menuType.left} 48 | ] 49 | }, 50 | { 51 | path: '/echarts', 52 | name: '', 53 | component: Echarts, 54 | type: menuType.header, 55 | children: [ 56 | {path: 'dashboard', name: '仪表盘', component: Echarts.Dashboard, type: menuType.left}, 57 | {path: 'line', name: '折线图', component: Echarts.Line, type: menuType.left}, 58 | {path: 'area', name: '面积图', component: Echarts.Area, type: menuType.left}, 59 | {path: 'bar', name: '柱状图', component: Echarts.Bar, type: menuType.left}, 60 | {path: 'linebar', name: '折线&柱状混图', component: Echarts.LineBar, type: menuType.left}, 61 | {path: 'pie', name: '饼图图', component: Echarts.Pie, type: menuType.left} 62 | ] 63 | }, 64 | { 65 | path: '/bdmap', 66 | name: '', 67 | component: BDMap, 68 | type: menuType.header, 69 | children: [ 70 | {path: 'heat', name: '热力图', component: BDMap.HeatMap, type: menuType.left}, 71 | {path: 'polygon', name: '区域图', component: BDMap.Polygon, type: menuType.left}, 72 | {path: 'pg-heat', name: '区域热力图', component: BDMap.PGHeat, type: menuType.left} 73 | ] 74 | } 75 | ] 76 | }) 77 | 78 | /** 79 | * 不做登录校验的路由集合 80 | * @type {[*]} 81 | */ 82 | const unLoginCheckRoutes = ['/noauth', '/test', '/console'] 83 | 84 | router.beforeEach(function (to, from, next) { 85 | // 是否要做登录及权限校验 86 | let loginCheck = false 87 | unLoginCheckRoutes.forEach(r => { 88 | if (to.path === '/' || (r !== '/' && to.path.startsWith(r))) { 89 | loginCheck = false 90 | } 91 | }) 92 | if (loginCheck) { 93 | let user = getLoginUser() 94 | if (user === null) { 95 | removeTokenCookie() 96 | next('/') 97 | } 98 | } else { 99 | let _route = {} 100 | router.options.routes.forEach(r => { 101 | if (r.path === to.path) _route = r 102 | }) 103 | if (_route === {} || _route.children === undefined || _route.children.length === 0) { 104 | next() 105 | } else { 106 | let _firstR = _route.children[0] 107 | next(to.path + '/' + _firstR.path) 108 | } 109 | } 110 | }) 111 | export default router 112 | -------------------------------------------------------------------------------- /static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoping1988/ping-vue-admin/6b9666d431fb4d4dc80fc6e025cb1f945cb23881/static/.gitkeep --------------------------------------------------------------------------------