diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/src/assets/images/small/kjfhyOn.png b/src/assets/images/small/kjfhyOn.png new file mode 100644 index 0000000..1dc3d63 --- /dev/null +++ b/src/assets/images/small/kjfhyOn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/src/assets/images/small/kjfhyOn.png b/src/assets/images/small/kjfhyOn.png new file mode 100644 index 0000000..1dc3d63 --- /dev/null +++ b/src/assets/images/small/kjfhyOn.png Binary files differ diff --git a/src/assets/images/small/qsw.png b/src/assets/images/small/qsw.png new file mode 100644 index 0000000..3c4af29 --- /dev/null +++ b/src/assets/images/small/qsw.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/src/assets/images/small/kjfhyOn.png b/src/assets/images/small/kjfhyOn.png new file mode 100644 index 0000000..1dc3d63 --- /dev/null +++ b/src/assets/images/small/kjfhyOn.png Binary files differ diff --git a/src/assets/images/small/qsw.png b/src/assets/images/small/qsw.png new file mode 100644 index 0000000..3c4af29 --- /dev/null +++ b/src/assets/images/small/qsw.png Binary files differ diff --git a/src/assets/images/small/qswOn.png b/src/assets/images/small/qswOn.png new file mode 100644 index 0000000..54dc676 --- /dev/null +++ b/src/assets/images/small/qswOn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/src/assets/images/small/kjfhyOn.png b/src/assets/images/small/kjfhyOn.png new file mode 100644 index 0000000..1dc3d63 --- /dev/null +++ b/src/assets/images/small/kjfhyOn.png Binary files differ diff --git a/src/assets/images/small/qsw.png b/src/assets/images/small/qsw.png new file mode 100644 index 0000000..3c4af29 --- /dev/null +++ b/src/assets/images/small/qsw.png Binary files differ diff --git a/src/assets/images/small/qswOn.png b/src/assets/images/small/qswOn.png new file mode 100644 index 0000000..54dc676 --- /dev/null +++ b/src/assets/images/small/qswOn.png Binary files differ diff --git a/src/assets/images/small/ysg.png b/src/assets/images/small/ysg.png new file mode 100644 index 0000000..5f0ee8f --- /dev/null +++ b/src/assets/images/small/ysg.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/src/assets/images/small/kjfhyOn.png b/src/assets/images/small/kjfhyOn.png new file mode 100644 index 0000000..1dc3d63 --- /dev/null +++ b/src/assets/images/small/kjfhyOn.png Binary files differ diff --git a/src/assets/images/small/qsw.png b/src/assets/images/small/qsw.png new file mode 100644 index 0000000..3c4af29 --- /dev/null +++ b/src/assets/images/small/qsw.png Binary files differ diff --git a/src/assets/images/small/qswOn.png b/src/assets/images/small/qswOn.png new file mode 100644 index 0000000..54dc676 --- /dev/null +++ b/src/assets/images/small/qswOn.png Binary files differ diff --git a/src/assets/images/small/ysg.png b/src/assets/images/small/ysg.png new file mode 100644 index 0000000..5f0ee8f --- /dev/null +++ b/src/assets/images/small/ysg.png Binary files differ diff --git a/src/assets/images/small/ysgOn.png b/src/assets/images/small/ysgOn.png new file mode 100644 index 0000000..0cd99f1 --- /dev/null +++ b/src/assets/images/small/ysgOn.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/src/assets/images/small/kjfhyOn.png b/src/assets/images/small/kjfhyOn.png new file mode 100644 index 0000000..1dc3d63 --- /dev/null +++ b/src/assets/images/small/kjfhyOn.png Binary files differ diff --git a/src/assets/images/small/qsw.png b/src/assets/images/small/qsw.png new file mode 100644 index 0000000..3c4af29 --- /dev/null +++ b/src/assets/images/small/qsw.png Binary files differ diff --git a/src/assets/images/small/qswOn.png b/src/assets/images/small/qswOn.png new file mode 100644 index 0000000..54dc676 --- /dev/null +++ b/src/assets/images/small/qswOn.png Binary files differ diff --git a/src/assets/images/small/ysg.png b/src/assets/images/small/ysg.png new file mode 100644 index 0000000..5f0ee8f --- /dev/null +++ b/src/assets/images/small/ysg.png Binary files differ diff --git a/src/assets/images/small/ysgOn.png b/src/assets/images/small/ysgOn.png new file mode 100644 index 0000000..0cd99f1 --- /dev/null +++ b/src/assets/images/small/ysgOn.png Binary files differ diff --git a/src/assets/images/spA.png b/src/assets/images/spA.png new file mode 100644 index 0000000..92c34ec --- /dev/null +++ b/src/assets/images/spA.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/src/assets/images/small/kjfhyOn.png b/src/assets/images/small/kjfhyOn.png new file mode 100644 index 0000000..1dc3d63 --- /dev/null +++ b/src/assets/images/small/kjfhyOn.png Binary files differ diff --git a/src/assets/images/small/qsw.png b/src/assets/images/small/qsw.png new file mode 100644 index 0000000..3c4af29 --- /dev/null +++ b/src/assets/images/small/qsw.png Binary files differ diff --git a/src/assets/images/small/qswOn.png b/src/assets/images/small/qswOn.png new file mode 100644 index 0000000..54dc676 --- /dev/null +++ b/src/assets/images/small/qswOn.png Binary files differ diff --git a/src/assets/images/small/ysg.png b/src/assets/images/small/ysg.png new file mode 100644 index 0000000..5f0ee8f --- /dev/null +++ b/src/assets/images/small/ysg.png Binary files differ diff --git a/src/assets/images/small/ysgOn.png b/src/assets/images/small/ysgOn.png new file mode 100644 index 0000000..0cd99f1 --- /dev/null +++ b/src/assets/images/small/ysgOn.png Binary files differ diff --git a/src/assets/images/spA.png b/src/assets/images/spA.png new file mode 100644 index 0000000..92c34ec --- /dev/null +++ b/src/assets/images/spA.png Binary files differ diff --git a/src/assets/images/spIos.png b/src/assets/images/spIos.png new file mode 100644 index 0000000..e39776e --- /dev/null +++ b/src/assets/images/spIos.png Binary files differ diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/src/assets/images/small/kjfhyOn.png b/src/assets/images/small/kjfhyOn.png new file mode 100644 index 0000000..1dc3d63 --- /dev/null +++ b/src/assets/images/small/kjfhyOn.png Binary files differ diff --git a/src/assets/images/small/qsw.png b/src/assets/images/small/qsw.png new file mode 100644 index 0000000..3c4af29 --- /dev/null +++ b/src/assets/images/small/qsw.png Binary files differ diff --git a/src/assets/images/small/qswOn.png b/src/assets/images/small/qswOn.png new file mode 100644 index 0000000..54dc676 --- /dev/null +++ b/src/assets/images/small/qswOn.png Binary files differ diff --git a/src/assets/images/small/ysg.png b/src/assets/images/small/ysg.png new file mode 100644 index 0000000..5f0ee8f --- /dev/null +++ b/src/assets/images/small/ysg.png Binary files differ diff --git a/src/assets/images/small/ysgOn.png b/src/assets/images/small/ysgOn.png new file mode 100644 index 0000000..0cd99f1 --- /dev/null +++ b/src/assets/images/small/ysgOn.png Binary files differ diff --git a/src/assets/images/spA.png b/src/assets/images/spA.png new file mode 100644 index 0000000..92c34ec --- /dev/null +++ b/src/assets/images/spA.png Binary files differ diff --git a/src/assets/images/spIos.png b/src/assets/images/spIos.png new file mode 100644 index 0000000..e39776e --- /dev/null +++ b/src/assets/images/spIos.png Binary files differ diff --git a/src/components/Home.vue b/src/components/Home.vue new file mode 100644 index 0000000..00f6888 --- /dev/null +++ b/src/components/Home.vue @@ -0,0 +1,103 @@ + + + diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/src/assets/images/small/kjfhyOn.png b/src/assets/images/small/kjfhyOn.png new file mode 100644 index 0000000..1dc3d63 --- /dev/null +++ b/src/assets/images/small/kjfhyOn.png Binary files differ diff --git a/src/assets/images/small/qsw.png b/src/assets/images/small/qsw.png new file mode 100644 index 0000000..3c4af29 --- /dev/null +++ b/src/assets/images/small/qsw.png Binary files differ diff --git a/src/assets/images/small/qswOn.png b/src/assets/images/small/qswOn.png new file mode 100644 index 0000000..54dc676 --- /dev/null +++ b/src/assets/images/small/qswOn.png Binary files differ diff --git a/src/assets/images/small/ysg.png b/src/assets/images/small/ysg.png new file mode 100644 index 0000000..5f0ee8f --- /dev/null +++ b/src/assets/images/small/ysg.png Binary files differ diff --git a/src/assets/images/small/ysgOn.png b/src/assets/images/small/ysgOn.png new file mode 100644 index 0000000..0cd99f1 --- /dev/null +++ b/src/assets/images/small/ysgOn.png Binary files differ diff --git a/src/assets/images/spA.png b/src/assets/images/spA.png new file mode 100644 index 0000000..92c34ec --- /dev/null +++ b/src/assets/images/spA.png Binary files differ diff --git a/src/assets/images/spIos.png b/src/assets/images/spIos.png new file mode 100644 index 0000000..e39776e --- /dev/null +++ b/src/assets/images/spIos.png Binary files differ diff --git a/src/components/Home.vue b/src/components/Home.vue new file mode 100644 index 0000000..00f6888 --- /dev/null +++ b/src/components/Home.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/components/common/Global.vue b/src/components/common/Global.vue new file mode 100644 index 0000000..4209335 --- /dev/null +++ b/src/components/common/Global.vue @@ -0,0 +1,12 @@ + diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/src/assets/images/small/kjfhyOn.png b/src/assets/images/small/kjfhyOn.png new file mode 100644 index 0000000..1dc3d63 --- /dev/null +++ b/src/assets/images/small/kjfhyOn.png Binary files differ diff --git a/src/assets/images/small/qsw.png b/src/assets/images/small/qsw.png new file mode 100644 index 0000000..3c4af29 --- /dev/null +++ b/src/assets/images/small/qsw.png Binary files differ diff --git a/src/assets/images/small/qswOn.png b/src/assets/images/small/qswOn.png new file mode 100644 index 0000000..54dc676 --- /dev/null +++ b/src/assets/images/small/qswOn.png Binary files differ diff --git a/src/assets/images/small/ysg.png b/src/assets/images/small/ysg.png new file mode 100644 index 0000000..5f0ee8f --- /dev/null +++ b/src/assets/images/small/ysg.png Binary files differ diff --git a/src/assets/images/small/ysgOn.png b/src/assets/images/small/ysgOn.png new file mode 100644 index 0000000..0cd99f1 --- /dev/null +++ b/src/assets/images/small/ysgOn.png Binary files differ diff --git a/src/assets/images/spA.png b/src/assets/images/spA.png new file mode 100644 index 0000000..92c34ec --- /dev/null +++ b/src/assets/images/spA.png Binary files differ diff --git a/src/assets/images/spIos.png b/src/assets/images/spIos.png new file mode 100644 index 0000000..e39776e --- /dev/null +++ b/src/assets/images/spIos.png Binary files differ diff --git a/src/components/Home.vue b/src/components/Home.vue new file mode 100644 index 0000000..00f6888 --- /dev/null +++ b/src/components/Home.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/components/common/Global.vue b/src/components/common/Global.vue new file mode 100644 index 0000000..4209335 --- /dev/null +++ b/src/components/common/Global.vue @@ -0,0 +1,12 @@ + diff --git a/src/components/common/util.js b/src/components/common/util.js new file mode 100644 index 0000000..19c45dd --- /dev/null +++ b/src/components/common/util.js @@ -0,0 +1,208 @@ +let Util = { + /*** + * 将任意数量对象或者字符串传入该方法,若有任意一个为空,则返回true + * 可判断 空对象 空数组 空字符串 undefined null + * @returns {boolean} + */ + isEmpty: function (){ + let len = arguments.length; + if(len===0){ return true; } + for(let i=0;i 0 && n <= 20 ? n : 2; + num = parseFloat((num + "").replace(/[^\d\.-]/g, "")).toFixed(n) + ""; + let l = num.split(".")[0].split("").reverse(), r = num.split(".")[1],t = ""; + for (let j = 0; j < l.length; j++) { + t += l[j] + ((j + 1) % 4 === 0 && (j + 1) !== l.length ? "," : ""); + } + item[keys[i]] = t.split("").reverse().join("") + "." + r; + } + }, + checkIDCard: function(rule, value, callback) { + setTimeout(function(){ + if (!value) { + return callback(new Error('请输入身份证号码')); + } + let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; + if(reg.test(value) === false){ + return callback(new Error('输入的身份证号码无效')); + } + callback(); + }, 200); + }, + checkPhone: function(rule, value, callback) { + setTimeout(function(){ + if (!value) { + return callback(new Error('请输入联系方式')); + } + let reg = /^1[3|4|5|7|8][0-9]{9}$/; + if(reg.test(value) === false){ + return callback(new Error('输入的手机号码无效')); + } + callback(); + }, 200); + }, + checkUsername: function(rule, value, callback) { + setTimeout(function(){ + let reg_first = /^[a-zA-Z_-]$/,reg = /^[a-zA-Z_-]([a-zA-Z0-9_.-]){5,19}$/; + if (!value) { + return callback(new Error('请输入用户名')); + }else if(reg_first.test(value.substr(0,1)) === false){ + return callback(new Error('请输入以a-zA-Z_-开头的内容')); + }else if(value.length < 6){ + return callback(new Error('用户名最小长度为6')); + }else if(value.length > 20){ + return callback(new Error('用户名最大长度为20')); + }else if(reg.test(value) === false){ + return callback(new Error('输入内容只能包含a-zA-Z0-9_.-')); + } + callback(); + }, 200); + }, + checkNumber: function(rule, value, callback) { + setTimeout(function(){ + if(rule.required && !value){ + return callback(new Error(rule.requiredMessage)); + } + if(value){ + let reg = /^[1-9]\d*$/; + if(reg.test(value) === false){ + return callback(new Error(rule.invalidMessage)); + } + } + callback(); + }, 200); + } +}; + +/** + * 扩展DATE属性,增加日期格式化方法 + * @param f + * @returns {*} + */ +Date.prototype.format = function(f){ + let o ={ + "M+" : this.getMonth()+1, //month + "d+" : this.getDate(), //day + "H+" : this.getHours(), //hour + "m+" : this.getMinutes(), //minute + "s+" : this.getSeconds(), //second + "q+" : Math.floor((this.getMonth()+3)/3), //quarter + "S" : this.getMilliseconds() //millisecond + }; + if(/(y+)/.test(f))f=f.replace(RegExp.$1,(this.getFullYear()+"").substr(4 - RegExp.$1.length)); + for(let k in o) + if(new RegExp("("+ k +")").test(f))f = f.replace(RegExp.$1,RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));return f +}; + +export default +{Util:Util} diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/src/assets/images/small/kjfhyOn.png b/src/assets/images/small/kjfhyOn.png new file mode 100644 index 0000000..1dc3d63 --- /dev/null +++ b/src/assets/images/small/kjfhyOn.png Binary files differ diff --git a/src/assets/images/small/qsw.png b/src/assets/images/small/qsw.png new file mode 100644 index 0000000..3c4af29 --- /dev/null +++ b/src/assets/images/small/qsw.png Binary files differ diff --git a/src/assets/images/small/qswOn.png b/src/assets/images/small/qswOn.png new file mode 100644 index 0000000..54dc676 --- /dev/null +++ b/src/assets/images/small/qswOn.png Binary files differ diff --git a/src/assets/images/small/ysg.png b/src/assets/images/small/ysg.png new file mode 100644 index 0000000..5f0ee8f --- /dev/null +++ b/src/assets/images/small/ysg.png Binary files differ diff --git a/src/assets/images/small/ysgOn.png b/src/assets/images/small/ysgOn.png new file mode 100644 index 0000000..0cd99f1 --- /dev/null +++ b/src/assets/images/small/ysgOn.png Binary files differ diff --git a/src/assets/images/spA.png b/src/assets/images/spA.png new file mode 100644 index 0000000..92c34ec --- /dev/null +++ b/src/assets/images/spA.png Binary files differ diff --git a/src/assets/images/spIos.png b/src/assets/images/spIos.png new file mode 100644 index 0000000..e39776e --- /dev/null +++ b/src/assets/images/spIos.png Binary files differ diff --git a/src/components/Home.vue b/src/components/Home.vue new file mode 100644 index 0000000..00f6888 --- /dev/null +++ b/src/components/Home.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/components/common/Global.vue b/src/components/common/Global.vue new file mode 100644 index 0000000..4209335 --- /dev/null +++ b/src/components/common/Global.vue @@ -0,0 +1,12 @@ + diff --git a/src/components/common/util.js b/src/components/common/util.js new file mode 100644 index 0000000..19c45dd --- /dev/null +++ b/src/components/common/util.js @@ -0,0 +1,208 @@ +let Util = { + /*** + * 将任意数量对象或者字符串传入该方法,若有任意一个为空,则返回true + * 可判断 空对象 空数组 空字符串 undefined null + * @returns {boolean} + */ + isEmpty: function (){ + let len = arguments.length; + if(len===0){ return true; } + for(let i=0;i 0 && n <= 20 ? n : 2; + num = parseFloat((num + "").replace(/[^\d\.-]/g, "")).toFixed(n) + ""; + let l = num.split(".")[0].split("").reverse(), r = num.split(".")[1],t = ""; + for (let j = 0; j < l.length; j++) { + t += l[j] + ((j + 1) % 4 === 0 && (j + 1) !== l.length ? "," : ""); + } + item[keys[i]] = t.split("").reverse().join("") + "." + r; + } + }, + checkIDCard: function(rule, value, callback) { + setTimeout(function(){ + if (!value) { + return callback(new Error('请输入身份证号码')); + } + let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; + if(reg.test(value) === false){ + return callback(new Error('输入的身份证号码无效')); + } + callback(); + }, 200); + }, + checkPhone: function(rule, value, callback) { + setTimeout(function(){ + if (!value) { + return callback(new Error('请输入联系方式')); + } + let reg = /^1[3|4|5|7|8][0-9]{9}$/; + if(reg.test(value) === false){ + return callback(new Error('输入的手机号码无效')); + } + callback(); + }, 200); + }, + checkUsername: function(rule, value, callback) { + setTimeout(function(){ + let reg_first = /^[a-zA-Z_-]$/,reg = /^[a-zA-Z_-]([a-zA-Z0-9_.-]){5,19}$/; + if (!value) { + return callback(new Error('请输入用户名')); + }else if(reg_first.test(value.substr(0,1)) === false){ + return callback(new Error('请输入以a-zA-Z_-开头的内容')); + }else if(value.length < 6){ + return callback(new Error('用户名最小长度为6')); + }else if(value.length > 20){ + return callback(new Error('用户名最大长度为20')); + }else if(reg.test(value) === false){ + return callback(new Error('输入内容只能包含a-zA-Z0-9_.-')); + } + callback(); + }, 200); + }, + checkNumber: function(rule, value, callback) { + setTimeout(function(){ + if(rule.required && !value){ + return callback(new Error(rule.requiredMessage)); + } + if(value){ + let reg = /^[1-9]\d*$/; + if(reg.test(value) === false){ + return callback(new Error(rule.invalidMessage)); + } + } + callback(); + }, 200); + } +}; + +/** + * 扩展DATE属性,增加日期格式化方法 + * @param f + * @returns {*} + */ +Date.prototype.format = function(f){ + let o ={ + "M+" : this.getMonth()+1, //month + "d+" : this.getDate(), //day + "H+" : this.getHours(), //hour + "m+" : this.getMinutes(), //minute + "s+" : this.getSeconds(), //second + "q+" : Math.floor((this.getMonth()+3)/3), //quarter + "S" : this.getMilliseconds() //millisecond + }; + if(/(y+)/.test(f))f=f.replace(RegExp.$1,(this.getFullYear()+"").substr(4 - RegExp.$1.length)); + for(let k in o) + if(new RegExp("("+ k +")").test(f))f = f.replace(RegExp.$1,RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));return f +}; + +export default +{Util:Util} diff --git a/src/components/company.vue b/src/components/company.vue new file mode 100644 index 0000000..2f63336 --- /dev/null +++ b/src/components/company.vue @@ -0,0 +1,71 @@ + + + + diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/src/assets/images/small/kjfhyOn.png b/src/assets/images/small/kjfhyOn.png new file mode 100644 index 0000000..1dc3d63 --- /dev/null +++ b/src/assets/images/small/kjfhyOn.png Binary files differ diff --git a/src/assets/images/small/qsw.png b/src/assets/images/small/qsw.png new file mode 100644 index 0000000..3c4af29 --- /dev/null +++ b/src/assets/images/small/qsw.png Binary files differ diff --git a/src/assets/images/small/qswOn.png b/src/assets/images/small/qswOn.png new file mode 100644 index 0000000..54dc676 --- /dev/null +++ b/src/assets/images/small/qswOn.png Binary files differ diff --git a/src/assets/images/small/ysg.png b/src/assets/images/small/ysg.png new file mode 100644 index 0000000..5f0ee8f --- /dev/null +++ b/src/assets/images/small/ysg.png Binary files differ diff --git a/src/assets/images/small/ysgOn.png b/src/assets/images/small/ysgOn.png new file mode 100644 index 0000000..0cd99f1 --- /dev/null +++ b/src/assets/images/small/ysgOn.png Binary files differ diff --git a/src/assets/images/spA.png b/src/assets/images/spA.png new file mode 100644 index 0000000..92c34ec --- /dev/null +++ b/src/assets/images/spA.png Binary files differ diff --git a/src/assets/images/spIos.png b/src/assets/images/spIos.png new file mode 100644 index 0000000..e39776e --- /dev/null +++ b/src/assets/images/spIos.png Binary files differ diff --git a/src/components/Home.vue b/src/components/Home.vue new file mode 100644 index 0000000..00f6888 --- /dev/null +++ b/src/components/Home.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/components/common/Global.vue b/src/components/common/Global.vue new file mode 100644 index 0000000..4209335 --- /dev/null +++ b/src/components/common/Global.vue @@ -0,0 +1,12 @@ + diff --git a/src/components/common/util.js b/src/components/common/util.js new file mode 100644 index 0000000..19c45dd --- /dev/null +++ b/src/components/common/util.js @@ -0,0 +1,208 @@ +let Util = { + /*** + * 将任意数量对象或者字符串传入该方法,若有任意一个为空,则返回true + * 可判断 空对象 空数组 空字符串 undefined null + * @returns {boolean} + */ + isEmpty: function (){ + let len = arguments.length; + if(len===0){ return true; } + for(let i=0;i 0 && n <= 20 ? n : 2; + num = parseFloat((num + "").replace(/[^\d\.-]/g, "")).toFixed(n) + ""; + let l = num.split(".")[0].split("").reverse(), r = num.split(".")[1],t = ""; + for (let j = 0; j < l.length; j++) { + t += l[j] + ((j + 1) % 4 === 0 && (j + 1) !== l.length ? "," : ""); + } + item[keys[i]] = t.split("").reverse().join("") + "." + r; + } + }, + checkIDCard: function(rule, value, callback) { + setTimeout(function(){ + if (!value) { + return callback(new Error('请输入身份证号码')); + } + let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; + if(reg.test(value) === false){ + return callback(new Error('输入的身份证号码无效')); + } + callback(); + }, 200); + }, + checkPhone: function(rule, value, callback) { + setTimeout(function(){ + if (!value) { + return callback(new Error('请输入联系方式')); + } + let reg = /^1[3|4|5|7|8][0-9]{9}$/; + if(reg.test(value) === false){ + return callback(new Error('输入的手机号码无效')); + } + callback(); + }, 200); + }, + checkUsername: function(rule, value, callback) { + setTimeout(function(){ + let reg_first = /^[a-zA-Z_-]$/,reg = /^[a-zA-Z_-]([a-zA-Z0-9_.-]){5,19}$/; + if (!value) { + return callback(new Error('请输入用户名')); + }else if(reg_first.test(value.substr(0,1)) === false){ + return callback(new Error('请输入以a-zA-Z_-开头的内容')); + }else if(value.length < 6){ + return callback(new Error('用户名最小长度为6')); + }else if(value.length > 20){ + return callback(new Error('用户名最大长度为20')); + }else if(reg.test(value) === false){ + return callback(new Error('输入内容只能包含a-zA-Z0-9_.-')); + } + callback(); + }, 200); + }, + checkNumber: function(rule, value, callback) { + setTimeout(function(){ + if(rule.required && !value){ + return callback(new Error(rule.requiredMessage)); + } + if(value){ + let reg = /^[1-9]\d*$/; + if(reg.test(value) === false){ + return callback(new Error(rule.invalidMessage)); + } + } + callback(); + }, 200); + } +}; + +/** + * 扩展DATE属性,增加日期格式化方法 + * @param f + * @returns {*} + */ +Date.prototype.format = function(f){ + let o ={ + "M+" : this.getMonth()+1, //month + "d+" : this.getDate(), //day + "H+" : this.getHours(), //hour + "m+" : this.getMinutes(), //minute + "s+" : this.getSeconds(), //second + "q+" : Math.floor((this.getMonth()+3)/3), //quarter + "S" : this.getMilliseconds() //millisecond + }; + if(/(y+)/.test(f))f=f.replace(RegExp.$1,(this.getFullYear()+"").substr(4 - RegExp.$1.length)); + for(let k in o) + if(new RegExp("("+ k +")").test(f))f = f.replace(RegExp.$1,RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));return f +}; + +export default +{Util:Util} diff --git a/src/components/company.vue b/src/components/company.vue new file mode 100644 index 0000000..2f63336 --- /dev/null +++ b/src/components/company.vue @@ -0,0 +1,71 @@ + + + + diff --git a/src/components/login.vue b/src/components/login.vue new file mode 100644 index 0000000..7d6f2e7 --- /dev/null +++ b/src/components/login.vue @@ -0,0 +1,149 @@ + + + + diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/src/assets/images/small/kjfhyOn.png b/src/assets/images/small/kjfhyOn.png new file mode 100644 index 0000000..1dc3d63 --- /dev/null +++ b/src/assets/images/small/kjfhyOn.png Binary files differ diff --git a/src/assets/images/small/qsw.png b/src/assets/images/small/qsw.png new file mode 100644 index 0000000..3c4af29 --- /dev/null +++ b/src/assets/images/small/qsw.png Binary files differ diff --git a/src/assets/images/small/qswOn.png b/src/assets/images/small/qswOn.png new file mode 100644 index 0000000..54dc676 --- /dev/null +++ b/src/assets/images/small/qswOn.png Binary files differ diff --git a/src/assets/images/small/ysg.png b/src/assets/images/small/ysg.png new file mode 100644 index 0000000..5f0ee8f --- /dev/null +++ b/src/assets/images/small/ysg.png Binary files differ diff --git a/src/assets/images/small/ysgOn.png b/src/assets/images/small/ysgOn.png new file mode 100644 index 0000000..0cd99f1 --- /dev/null +++ b/src/assets/images/small/ysgOn.png Binary files differ diff --git a/src/assets/images/spA.png b/src/assets/images/spA.png new file mode 100644 index 0000000..92c34ec --- /dev/null +++ b/src/assets/images/spA.png Binary files differ diff --git a/src/assets/images/spIos.png b/src/assets/images/spIos.png new file mode 100644 index 0000000..e39776e --- /dev/null +++ b/src/assets/images/spIos.png Binary files differ diff --git a/src/components/Home.vue b/src/components/Home.vue new file mode 100644 index 0000000..00f6888 --- /dev/null +++ b/src/components/Home.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/components/common/Global.vue b/src/components/common/Global.vue new file mode 100644 index 0000000..4209335 --- /dev/null +++ b/src/components/common/Global.vue @@ -0,0 +1,12 @@ + diff --git a/src/components/common/util.js b/src/components/common/util.js new file mode 100644 index 0000000..19c45dd --- /dev/null +++ b/src/components/common/util.js @@ -0,0 +1,208 @@ +let Util = { + /*** + * 将任意数量对象或者字符串传入该方法,若有任意一个为空,则返回true + * 可判断 空对象 空数组 空字符串 undefined null + * @returns {boolean} + */ + isEmpty: function (){ + let len = arguments.length; + if(len===0){ return true; } + for(let i=0;i 0 && n <= 20 ? n : 2; + num = parseFloat((num + "").replace(/[^\d\.-]/g, "")).toFixed(n) + ""; + let l = num.split(".")[0].split("").reverse(), r = num.split(".")[1],t = ""; + for (let j = 0; j < l.length; j++) { + t += l[j] + ((j + 1) % 4 === 0 && (j + 1) !== l.length ? "," : ""); + } + item[keys[i]] = t.split("").reverse().join("") + "." + r; + } + }, + checkIDCard: function(rule, value, callback) { + setTimeout(function(){ + if (!value) { + return callback(new Error('请输入身份证号码')); + } + let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; + if(reg.test(value) === false){ + return callback(new Error('输入的身份证号码无效')); + } + callback(); + }, 200); + }, + checkPhone: function(rule, value, callback) { + setTimeout(function(){ + if (!value) { + return callback(new Error('请输入联系方式')); + } + let reg = /^1[3|4|5|7|8][0-9]{9}$/; + if(reg.test(value) === false){ + return callback(new Error('输入的手机号码无效')); + } + callback(); + }, 200); + }, + checkUsername: function(rule, value, callback) { + setTimeout(function(){ + let reg_first = /^[a-zA-Z_-]$/,reg = /^[a-zA-Z_-]([a-zA-Z0-9_.-]){5,19}$/; + if (!value) { + return callback(new Error('请输入用户名')); + }else if(reg_first.test(value.substr(0,1)) === false){ + return callback(new Error('请输入以a-zA-Z_-开头的内容')); + }else if(value.length < 6){ + return callback(new Error('用户名最小长度为6')); + }else if(value.length > 20){ + return callback(new Error('用户名最大长度为20')); + }else if(reg.test(value) === false){ + return callback(new Error('输入内容只能包含a-zA-Z0-9_.-')); + } + callback(); + }, 200); + }, + checkNumber: function(rule, value, callback) { + setTimeout(function(){ + if(rule.required && !value){ + return callback(new Error(rule.requiredMessage)); + } + if(value){ + let reg = /^[1-9]\d*$/; + if(reg.test(value) === false){ + return callback(new Error(rule.invalidMessage)); + } + } + callback(); + }, 200); + } +}; + +/** + * 扩展DATE属性,增加日期格式化方法 + * @param f + * @returns {*} + */ +Date.prototype.format = function(f){ + let o ={ + "M+" : this.getMonth()+1, //month + "d+" : this.getDate(), //day + "H+" : this.getHours(), //hour + "m+" : this.getMinutes(), //minute + "s+" : this.getSeconds(), //second + "q+" : Math.floor((this.getMonth()+3)/3), //quarter + "S" : this.getMilliseconds() //millisecond + }; + if(/(y+)/.test(f))f=f.replace(RegExp.$1,(this.getFullYear()+"").substr(4 - RegExp.$1.length)); + for(let k in o) + if(new RegExp("("+ k +")").test(f))f = f.replace(RegExp.$1,RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));return f +}; + +export default +{Util:Util} diff --git a/src/components/company.vue b/src/components/company.vue new file mode 100644 index 0000000..2f63336 --- /dev/null +++ b/src/components/company.vue @@ -0,0 +1,71 @@ + + + + diff --git a/src/components/login.vue b/src/components/login.vue new file mode 100644 index 0000000..7d6f2e7 --- /dev/null +++ b/src/components/login.vue @@ -0,0 +1,149 @@ + + + + diff --git a/src/components/main.vue b/src/components/main.vue new file mode 100644 index 0000000..23e931c --- /dev/null +++ b/src/components/main.vue @@ -0,0 +1,694 @@ + + + diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/src/assets/images/small/kjfhyOn.png b/src/assets/images/small/kjfhyOn.png new file mode 100644 index 0000000..1dc3d63 --- /dev/null +++ b/src/assets/images/small/kjfhyOn.png Binary files differ diff --git a/src/assets/images/small/qsw.png b/src/assets/images/small/qsw.png new file mode 100644 index 0000000..3c4af29 --- /dev/null +++ b/src/assets/images/small/qsw.png Binary files differ diff --git a/src/assets/images/small/qswOn.png b/src/assets/images/small/qswOn.png new file mode 100644 index 0000000..54dc676 --- /dev/null +++ b/src/assets/images/small/qswOn.png Binary files differ diff --git a/src/assets/images/small/ysg.png b/src/assets/images/small/ysg.png new file mode 100644 index 0000000..5f0ee8f --- /dev/null +++ b/src/assets/images/small/ysg.png Binary files differ diff --git a/src/assets/images/small/ysgOn.png b/src/assets/images/small/ysgOn.png new file mode 100644 index 0000000..0cd99f1 --- /dev/null +++ b/src/assets/images/small/ysgOn.png Binary files differ diff --git a/src/assets/images/spA.png b/src/assets/images/spA.png new file mode 100644 index 0000000..92c34ec --- /dev/null +++ b/src/assets/images/spA.png Binary files differ diff --git a/src/assets/images/spIos.png b/src/assets/images/spIos.png new file mode 100644 index 0000000..e39776e --- /dev/null +++ b/src/assets/images/spIos.png Binary files differ diff --git a/src/components/Home.vue b/src/components/Home.vue new file mode 100644 index 0000000..00f6888 --- /dev/null +++ b/src/components/Home.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/components/common/Global.vue b/src/components/common/Global.vue new file mode 100644 index 0000000..4209335 --- /dev/null +++ b/src/components/common/Global.vue @@ -0,0 +1,12 @@ + diff --git a/src/components/common/util.js b/src/components/common/util.js new file mode 100644 index 0000000..19c45dd --- /dev/null +++ b/src/components/common/util.js @@ -0,0 +1,208 @@ +let Util = { + /*** + * 将任意数量对象或者字符串传入该方法,若有任意一个为空,则返回true + * 可判断 空对象 空数组 空字符串 undefined null + * @returns {boolean} + */ + isEmpty: function (){ + let len = arguments.length; + if(len===0){ return true; } + for(let i=0;i 0 && n <= 20 ? n : 2; + num = parseFloat((num + "").replace(/[^\d\.-]/g, "")).toFixed(n) + ""; + let l = num.split(".")[0].split("").reverse(), r = num.split(".")[1],t = ""; + for (let j = 0; j < l.length; j++) { + t += l[j] + ((j + 1) % 4 === 0 && (j + 1) !== l.length ? "," : ""); + } + item[keys[i]] = t.split("").reverse().join("") + "." + r; + } + }, + checkIDCard: function(rule, value, callback) { + setTimeout(function(){ + if (!value) { + return callback(new Error('请输入身份证号码')); + } + let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; + if(reg.test(value) === false){ + return callback(new Error('输入的身份证号码无效')); + } + callback(); + }, 200); + }, + checkPhone: function(rule, value, callback) { + setTimeout(function(){ + if (!value) { + return callback(new Error('请输入联系方式')); + } + let reg = /^1[3|4|5|7|8][0-9]{9}$/; + if(reg.test(value) === false){ + return callback(new Error('输入的手机号码无效')); + } + callback(); + }, 200); + }, + checkUsername: function(rule, value, callback) { + setTimeout(function(){ + let reg_first = /^[a-zA-Z_-]$/,reg = /^[a-zA-Z_-]([a-zA-Z0-9_.-]){5,19}$/; + if (!value) { + return callback(new Error('请输入用户名')); + }else if(reg_first.test(value.substr(0,1)) === false){ + return callback(new Error('请输入以a-zA-Z_-开头的内容')); + }else if(value.length < 6){ + return callback(new Error('用户名最小长度为6')); + }else if(value.length > 20){ + return callback(new Error('用户名最大长度为20')); + }else if(reg.test(value) === false){ + return callback(new Error('输入内容只能包含a-zA-Z0-9_.-')); + } + callback(); + }, 200); + }, + checkNumber: function(rule, value, callback) { + setTimeout(function(){ + if(rule.required && !value){ + return callback(new Error(rule.requiredMessage)); + } + if(value){ + let reg = /^[1-9]\d*$/; + if(reg.test(value) === false){ + return callback(new Error(rule.invalidMessage)); + } + } + callback(); + }, 200); + } +}; + +/** + * 扩展DATE属性,增加日期格式化方法 + * @param f + * @returns {*} + */ +Date.prototype.format = function(f){ + let o ={ + "M+" : this.getMonth()+1, //month + "d+" : this.getDate(), //day + "H+" : this.getHours(), //hour + "m+" : this.getMinutes(), //minute + "s+" : this.getSeconds(), //second + "q+" : Math.floor((this.getMonth()+3)/3), //quarter + "S" : this.getMilliseconds() //millisecond + }; + if(/(y+)/.test(f))f=f.replace(RegExp.$1,(this.getFullYear()+"").substr(4 - RegExp.$1.length)); + for(let k in o) + if(new RegExp("("+ k +")").test(f))f = f.replace(RegExp.$1,RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));return f +}; + +export default +{Util:Util} diff --git a/src/components/company.vue b/src/components/company.vue new file mode 100644 index 0000000..2f63336 --- /dev/null +++ b/src/components/company.vue @@ -0,0 +1,71 @@ + + + + diff --git a/src/components/login.vue b/src/components/login.vue new file mode 100644 index 0000000..7d6f2e7 --- /dev/null +++ b/src/components/login.vue @@ -0,0 +1,149 @@ + + + + diff --git a/src/components/main.vue b/src/components/main.vue new file mode 100644 index 0000000..23e931c --- /dev/null +++ b/src/components/main.vue @@ -0,0 +1,694 @@ + + + diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..82ac085 --- /dev/null +++ b/src/main.js @@ -0,0 +1,77 @@ +// The Vue build version to load with the `import` command +// (runtime-only or standalone) has been set in webpack.base.conf with an alias. +import Vue from 'vue' +import App from './App' +import router from './router' +import "babel-polyfill" +import axios from 'axios' +import ElementUI from 'element-ui' +import 'element-ui/lib/theme-chalk/index.css' +import './assets/css/style.css' +import echarts from 'echarts' +import $ from 'jquery' +import global_ from './components/common/Global' +import Util from './components/common/util' +import md5 from 'js-md5' + +Vue.use(ElementUI); +Vue.config.productionTip = false +Vue.prototype.$http = axios; +window.axios = axios; +Vue.prototype.$Util = Util.Util; +Vue.prototype.$echarts = echarts; +Vue.prototype.$md5 = md5; +Vue.prototype.GLOBAL = global_; + + +axios.defaults.timeout = 300000; +axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'; +axios.defaults.baseURL = global_.BASE_HTTP_URL; +let loading; +axios.interceptors.request.use((config) => { + if(Util.Util.isEmpty(config.bLoading) || config.bLoading){ + loading = ElementUI.Loading.service({fullscreen: true, text: 'Loading....', spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0)'}); + } + return config; +}, (error) => { + loading.close(); + return Promise.reject(error); +}); +axios.interceptors.response.use(res => { + if (res.headers && res.headers['content-disposition']) { + new Promise((resolve, reject) => { + let iframe = document.createElement('iframe'); + iframe.style.display = 'none'; + iframe.src = res.request.responseURL; + iframe.onload = function () { + document.body.removeChild(iframe); + }; + document.body.appendChild(iframe); + }).catch(() => {}); + } + if(!Util.Util.isEmpty(loading)){ + loading.close(); + } + if(res.data.code === 401){ + router.replace("/login"); + }/* + if(res.data.code === 500){ + ElementUI.Message.warning(res.data.message) + }*/ + return res; +}, error => { + loading.close() + if(error.code == "ECONNABORTED"){ + ElementUI.Message.warning("请求超时") + }else{ + return Promise.reject(error); + } +}); + +/* eslint-disable no-new */ +new Vue({ + el: '#app', + router, + components: { App }, + template: '' +}) diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/src/assets/images/small/kjfhyOn.png b/src/assets/images/small/kjfhyOn.png new file mode 100644 index 0000000..1dc3d63 --- /dev/null +++ b/src/assets/images/small/kjfhyOn.png Binary files differ diff --git a/src/assets/images/small/qsw.png b/src/assets/images/small/qsw.png new file mode 100644 index 0000000..3c4af29 --- /dev/null +++ b/src/assets/images/small/qsw.png Binary files differ diff --git a/src/assets/images/small/qswOn.png b/src/assets/images/small/qswOn.png new file mode 100644 index 0000000..54dc676 --- /dev/null +++ b/src/assets/images/small/qswOn.png Binary files differ diff --git a/src/assets/images/small/ysg.png b/src/assets/images/small/ysg.png new file mode 100644 index 0000000..5f0ee8f --- /dev/null +++ b/src/assets/images/small/ysg.png Binary files differ diff --git a/src/assets/images/small/ysgOn.png b/src/assets/images/small/ysgOn.png new file mode 100644 index 0000000..0cd99f1 --- /dev/null +++ b/src/assets/images/small/ysgOn.png Binary files differ diff --git a/src/assets/images/spA.png b/src/assets/images/spA.png new file mode 100644 index 0000000..92c34ec --- /dev/null +++ b/src/assets/images/spA.png Binary files differ diff --git a/src/assets/images/spIos.png b/src/assets/images/spIos.png new file mode 100644 index 0000000..e39776e --- /dev/null +++ b/src/assets/images/spIos.png Binary files differ diff --git a/src/components/Home.vue b/src/components/Home.vue new file mode 100644 index 0000000..00f6888 --- /dev/null +++ b/src/components/Home.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/components/common/Global.vue b/src/components/common/Global.vue new file mode 100644 index 0000000..4209335 --- /dev/null +++ b/src/components/common/Global.vue @@ -0,0 +1,12 @@ + diff --git a/src/components/common/util.js b/src/components/common/util.js new file mode 100644 index 0000000..19c45dd --- /dev/null +++ b/src/components/common/util.js @@ -0,0 +1,208 @@ +let Util = { + /*** + * 将任意数量对象或者字符串传入该方法,若有任意一个为空,则返回true + * 可判断 空对象 空数组 空字符串 undefined null + * @returns {boolean} + */ + isEmpty: function (){ + let len = arguments.length; + if(len===0){ return true; } + for(let i=0;i 0 && n <= 20 ? n : 2; + num = parseFloat((num + "").replace(/[^\d\.-]/g, "")).toFixed(n) + ""; + let l = num.split(".")[0].split("").reverse(), r = num.split(".")[1],t = ""; + for (let j = 0; j < l.length; j++) { + t += l[j] + ((j + 1) % 4 === 0 && (j + 1) !== l.length ? "," : ""); + } + item[keys[i]] = t.split("").reverse().join("") + "." + r; + } + }, + checkIDCard: function(rule, value, callback) { + setTimeout(function(){ + if (!value) { + return callback(new Error('请输入身份证号码')); + } + let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; + if(reg.test(value) === false){ + return callback(new Error('输入的身份证号码无效')); + } + callback(); + }, 200); + }, + checkPhone: function(rule, value, callback) { + setTimeout(function(){ + if (!value) { + return callback(new Error('请输入联系方式')); + } + let reg = /^1[3|4|5|7|8][0-9]{9}$/; + if(reg.test(value) === false){ + return callback(new Error('输入的手机号码无效')); + } + callback(); + }, 200); + }, + checkUsername: function(rule, value, callback) { + setTimeout(function(){ + let reg_first = /^[a-zA-Z_-]$/,reg = /^[a-zA-Z_-]([a-zA-Z0-9_.-]){5,19}$/; + if (!value) { + return callback(new Error('请输入用户名')); + }else if(reg_first.test(value.substr(0,1)) === false){ + return callback(new Error('请输入以a-zA-Z_-开头的内容')); + }else if(value.length < 6){ + return callback(new Error('用户名最小长度为6')); + }else if(value.length > 20){ + return callback(new Error('用户名最大长度为20')); + }else if(reg.test(value) === false){ + return callback(new Error('输入内容只能包含a-zA-Z0-9_.-')); + } + callback(); + }, 200); + }, + checkNumber: function(rule, value, callback) { + setTimeout(function(){ + if(rule.required && !value){ + return callback(new Error(rule.requiredMessage)); + } + if(value){ + let reg = /^[1-9]\d*$/; + if(reg.test(value) === false){ + return callback(new Error(rule.invalidMessage)); + } + } + callback(); + }, 200); + } +}; + +/** + * 扩展DATE属性,增加日期格式化方法 + * @param f + * @returns {*} + */ +Date.prototype.format = function(f){ + let o ={ + "M+" : this.getMonth()+1, //month + "d+" : this.getDate(), //day + "H+" : this.getHours(), //hour + "m+" : this.getMinutes(), //minute + "s+" : this.getSeconds(), //second + "q+" : Math.floor((this.getMonth()+3)/3), //quarter + "S" : this.getMilliseconds() //millisecond + }; + if(/(y+)/.test(f))f=f.replace(RegExp.$1,(this.getFullYear()+"").substr(4 - RegExp.$1.length)); + for(let k in o) + if(new RegExp("("+ k +")").test(f))f = f.replace(RegExp.$1,RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));return f +}; + +export default +{Util:Util} diff --git a/src/components/company.vue b/src/components/company.vue new file mode 100644 index 0000000..2f63336 --- /dev/null +++ b/src/components/company.vue @@ -0,0 +1,71 @@ + + + + diff --git a/src/components/login.vue b/src/components/login.vue new file mode 100644 index 0000000..7d6f2e7 --- /dev/null +++ b/src/components/login.vue @@ -0,0 +1,149 @@ + + + + diff --git a/src/components/main.vue b/src/components/main.vue new file mode 100644 index 0000000..23e931c --- /dev/null +++ b/src/components/main.vue @@ -0,0 +1,694 @@ + + + diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..82ac085 --- /dev/null +++ b/src/main.js @@ -0,0 +1,77 @@ +// The Vue build version to load with the `import` command +// (runtime-only or standalone) has been set in webpack.base.conf with an alias. +import Vue from 'vue' +import App from './App' +import router from './router' +import "babel-polyfill" +import axios from 'axios' +import ElementUI from 'element-ui' +import 'element-ui/lib/theme-chalk/index.css' +import './assets/css/style.css' +import echarts from 'echarts' +import $ from 'jquery' +import global_ from './components/common/Global' +import Util from './components/common/util' +import md5 from 'js-md5' + +Vue.use(ElementUI); +Vue.config.productionTip = false +Vue.prototype.$http = axios; +window.axios = axios; +Vue.prototype.$Util = Util.Util; +Vue.prototype.$echarts = echarts; +Vue.prototype.$md5 = md5; +Vue.prototype.GLOBAL = global_; + + +axios.defaults.timeout = 300000; +axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'; +axios.defaults.baseURL = global_.BASE_HTTP_URL; +let loading; +axios.interceptors.request.use((config) => { + if(Util.Util.isEmpty(config.bLoading) || config.bLoading){ + loading = ElementUI.Loading.service({fullscreen: true, text: 'Loading....', spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0)'}); + } + return config; +}, (error) => { + loading.close(); + return Promise.reject(error); +}); +axios.interceptors.response.use(res => { + if (res.headers && res.headers['content-disposition']) { + new Promise((resolve, reject) => { + let iframe = document.createElement('iframe'); + iframe.style.display = 'none'; + iframe.src = res.request.responseURL; + iframe.onload = function () { + document.body.removeChild(iframe); + }; + document.body.appendChild(iframe); + }).catch(() => {}); + } + if(!Util.Util.isEmpty(loading)){ + loading.close(); + } + if(res.data.code === 401){ + router.replace("/login"); + }/* + if(res.data.code === 500){ + ElementUI.Message.warning(res.data.message) + }*/ + return res; +}, error => { + loading.close() + if(error.code == "ECONNABORTED"){ + ElementUI.Message.warning("请求超时") + }else{ + return Promise.reject(error); + } +}); + +/* eslint-disable no-new */ +new Vue({ + el: '#app', + router, + components: { App }, + template: '' +}) diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 0000000..379faa6 --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,53 @@ +import Vue from 'vue' +import Router from 'vue-router' + +Vue.use(Router) + +const router = new Router({ + routes: [ + { + path: '/', + redirect: '/login' + }, + /*登录*/ + { + path: '/login', + name: 'login', + component: resolve => require(['@/components/login'], resolve), + }, + { + path: '/company', + name: 'company', + component: resolve => require(['../components/company'], resolve) + }, + /*主页面*/ + { + path: '/home', + name: 'home', + component: resolve => require(['@/components/Home'], resolve), + children:[ + { + path: '/main', + name: 'mainPage', + component: resolve => require(['../components/main'], resolve) + }, + + ] + } + ] +}) + +router.beforeEach((to, from, next) => { + if (to.matched.some(res => res.name!='login'&&res.name!='register')) { + if (sessionStorage.getItem('userData')) { + next() + }else{ + next({ + path: '/login' + }) + } + } else { + next() + } +}) +export default router diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9710a38 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/*.js +config/*.js +src/assets +src/utils/dateutils.js +static/BMap/js/*.js +src/components/BMap/*.vue diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a0ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/README.md b/README.md new file mode 100644 index 0000000..b49959d --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# collect + +> A Vue.js project + +## Build Setup + +``` bash +# install dependencies +npm install + +# serve with hot reload at localhost:8080 +npm run dev + +# build for production with minification +npm run build + +# build for production and view the bundle analyzer report +npm run build --report +``` + +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). diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/build/build.js @@ -0,0 +1,41 @@ +'use strict' +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +const ora = require('ora') +const rm = require('rimraf') +const path = require('path') +const chalk = require('chalk') +const webpack = require('webpack') +const config = require('../config') +const webpackConfig = require('./webpack.prod.conf') + +const spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, (err, stats) => { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. + chunks: false, + chunkModules: false + }) + '\n\n') + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')) + process.exit(1) + } + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,54 @@ +'use strict' +const chalk = require('chalk') +const semver = require('semver') +const packageConfig = require('../package.json') +const shell = require('shelljs') + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + } +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + const warnings = [] + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i] + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i] + console.log(' ' + warning) + } + + console.log() + process.exit(1) + } +} diff --git a/build/logo.png b/build/logo.png new file mode 100644 index 0000000..f3d2503 --- /dev/null +++ b/build/logo.png Binary files differ diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..bc98c13 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,102 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const packageConfig = require('../package.json') + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap + } + } + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader', + publicPath: '../../' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = [] + const loaders = exports.cssLoaders(options) + + for (const extension in loaders) { + const loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + + return output +} + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier') + + return (severity, errors) => { + if (severity !== 'error') return + + const error = errors[0] + const filename = error.file && error.file.split('!').pop() + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png') + }) + } +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..3ca1021 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,93 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') +var webpack=require("webpack") + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + + + +module.exports = { + context: path.resolve(__dirname, '../'), + /*entry: { + app: './src/main.js' + },*/ + entry: { + app: ["babel-polyfill", "./src/main.js"] + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('media/[name].[hash:7].[ext]') + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + } + ] + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty' + }, + plugins: [ + new webpack.optimize.CommonsChunkPlugin('common.js'), + new webpack.ProvidePlugin({ + jQuery: "jquery", + $: "jquery" + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..db0daf6 --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,96 @@ +'use strict' +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const path = require('path') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') +const portfinder = require('portfinder') + +const HOST = process.env.HOST +const PORT = process.env.PORT && Number(process.env.PORT) + +const devWebpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) + }, + // cheap-module-eval-source-map is faster for development + devtool: config.dev.devtool, + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, + hot: true, + contentBase: false, // since we use CopyWebpackPlugin. + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + } + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': require('../config/dev.env') + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico') // 新增 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { + if (err) { + reject(err) + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port + // add port to devServer config + devWebpackConfig.devServer.port = port + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined + })) + + resolve(devWebpackConfig) + } + }) +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..9a13daf --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,146 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const webpack = require('webpack') +const config = require('../config') +const merge = require('webpack-merge') +const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true + }) + }, + devtool: config.build.productionSourceMap ? config.build.devtool : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + favicon: path.resolve('favicon.ico'), //新增 + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..afdd136 --- /dev/null +++ b/config/index.js @@ -0,0 +1,95 @@ +'use strict' +// Template version: 1.3.1 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: { + '/uniform-auth':{ + target:'http://223.84.218.79:18094/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/dx-economy-api':{ + target:'http://jx.gc-it.com/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/smartdx':{ + target:'http://223.84.218.79:18087/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/baseService':{ + target:'http://223.84.218.79:18084/', + changeOrigin:true, + proxyTimeout:300000 + }, + '/bmsVideo':{ + target:'http://223.84.218.79:18083/', + changeOrigin:true, + proxyTimeout:300000 + }, + }, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: true, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-module-eval-source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + cssSourceMap: true + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: './', + + /** + * Source Maps + */ + + productionSourceMap: true, + // https://webpack.js.org/configuration/devtool/#production + devtool: '#source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..dbd5121 --- /dev/null +++ b/favicon.ico Binary files differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..ae3cae6 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 东乡智慧园区决策一张图 + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2223e9d --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "collect", + "version": "1.0.0", + "description": "A Vue.js project", + "author": "zhangyl <877245251@qq.com>", + "private": true, + "scripts": { + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", + "start": "npm run dev", + "build": "node build/build.js" + }, + "dependencies": { + "axios": "^0.18.0", + "echarts": "^4.2.1", + "element-ui": "^2.7.2", + "js-md5": "^0.7.3", + "vue": "^2.5.2", + "vue-router": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^7.1.2", + "babel-core": "^6.22.1", + "babel-helper-vue-jsx-merge-props": "^2.0.3", + "babel-loader": "^7.1.1", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-vue-jsx": "^3.5.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.3.2", + "babel-preset-stage-2": "^6.22.0", + "chalk": "^2.0.1", + "copy-webpack-plugin": "^4.0.1", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "^3.0.0", + "file-loader": "^1.1.4", + "friendly-errors-webpack-plugin": "^1.6.1", + "html-webpack-plugin": "^2.30.1", + "jquery": "^3.4.0", + "node-notifier": "^5.1.2", + "optimize-css-assets-webpack-plugin": "^3.2.0", + "ora": "^1.2.0", + "portfinder": "^1.0.13", + "postcss-import": "^11.0.0", + "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", + "rimraf": "^2.6.0", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "uglifyjs-webpack-plugin": "^1.1.1", + "url-loader": "^0.5.8", + "vue-loader": "^13.3.0", + "vue-style-loader": "^3.0.1", + "vue-template-compiler": "^2.5.2", + "webpack": "^3.6.0", + "webpack-bundle-analyzer": "^2.9.0", + "webpack-dev-server": "^2.9.1", + "webpack-merge": "^4.1.0" + }, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..f930157 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + 'autoprefixer': {browsers: 'last 5 version'} + } +} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..736ab62 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/assets/css/style.css b/src/assets/css/style.css new file mode 100644 index 0000000..1dcf04d --- /dev/null +++ b/src/assets/css/style.css @@ -0,0 +1,28 @@ +body{width: 100%;height: 100%;position: absolute;margin: 0;padding: 0;font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;overflow: hidden;} + +.clear {clear:both;height:0;overflow:hidden;display:block;} +* html .clearfix {zoom: 1;} +*+html .clearfix {zoom: 1;} +.clearfix:after {height: 0;visibility: hidden;content: ".";display: block;clear: both;} +ul li {list-style: none;} +#app{width: 100%;height: 100%;min-width: 1366px;min-height: 630px;} +.ellipsis{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +a{text-decoration:none;color:#000;display: block;} + +::-webkit-scrollbar{width: 10px;height: 10px;} +::-webkit-scrollbar-track{width:10px;border-radius:5px;background-color:#13396c;} +::-webkit-scrollbar-thumb{border-radius:5px;border:1px solid #166091;background:#166091;} +::-webkit-scrollbar-button{display:none;} +/*公用button*/ +.btn-normal{width: 98px;height: 32px;border:1px solid #fff;background: rgba(7,182,255,0.1);line-height: 32px;color: #fff;text-align: center;cursor: pointer;display: inline-block;} +.btn-normal:hover{background: rgba(7,182,255,0.2);} + +/*确认弹出框*/ +.el-message-box{background:#05204a;border:1px solid rgba(7,182,255,.3);border-radius:0;overflow: auto} +.el-message-box__title{color:#ccc;} +.el-message-box__content{color:white;} +.el-message-box__btns .el-button{width:56px;height:32px;line-height:32px;border:1px solid rgba(7,182,255,.5);background:rgba(7,182,255,.1);color:#ffffff;border-radius:0;padding:0;} +.el-message-box__btns .el-button:hover,.el-message-box__btns .el-button:focus{background:rgba(7,182,255,.2);} +.el-message-box__btns .el-button:active,.el-message-box__btns .el-button.is-active{background:rgba(7,182,255,.3);} +/*确认弹出框*/ +.tips{margin-left:10px;height:60px;line-height: 60px;color:#20dbfd;} diff --git a/src/assets/images/aj.png b/src/assets/images/aj.png new file mode 100644 index 0000000..fc820b6 --- /dev/null +++ b/src/assets/images/aj.png Binary files differ diff --git a/src/assets/images/ajEr.png b/src/assets/images/ajEr.png new file mode 100644 index 0000000..cbd926f --- /dev/null +++ b/src/assets/images/ajEr.png Binary files differ diff --git a/src/assets/images/app.png b/src/assets/images/app.png new file mode 100644 index 0000000..27ef594 --- /dev/null +++ b/src/assets/images/app.png Binary files differ diff --git a/src/assets/images/exit.png b/src/assets/images/exit.png new file mode 100644 index 0000000..9a960b7 --- /dev/null +++ b/src/assets/images/exit.png Binary files differ diff --git a/src/assets/images/hb.png b/src/assets/images/hb.png new file mode 100644 index 0000000..64abf42 --- /dev/null +++ b/src/assets/images/hb.png Binary files differ diff --git a/src/assets/images/hbEr.png b/src/assets/images/hbEr.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/hbEr.png Binary files differ diff --git a/src/assets/images/index/ajball.png b/src/assets/images/index/ajball.png new file mode 100644 index 0000000..fc07c6a --- /dev/null +++ b/src/assets/images/index/ajball.png Binary files differ diff --git a/src/assets/images/index/ajq.png b/src/assets/images/index/ajq.png new file mode 100644 index 0000000..9b74031 --- /dev/null +++ b/src/assets/images/index/ajq.png Binary files differ diff --git a/src/assets/images/index/bg.png b/src/assets/images/index/bg.png new file mode 100644 index 0000000..6712737 --- /dev/null +++ b/src/assets/images/index/bg.png Binary files differ diff --git a/src/assets/images/index/gw1.png b/src/assets/images/index/gw1.png new file mode 100644 index 0000000..5f88d41 --- /dev/null +++ b/src/assets/images/index/gw1.png Binary files differ diff --git a/src/assets/images/index/gw2.png b/src/assets/images/index/gw2.png new file mode 100644 index 0000000..662225e --- /dev/null +++ b/src/assets/images/index/gw2.png Binary files differ diff --git a/src/assets/images/index/gw3.png b/src/assets/images/index/gw3.png new file mode 100644 index 0000000..da1de97 --- /dev/null +++ b/src/assets/images/index/gw3.png Binary files differ diff --git a/src/assets/images/index/gw4.png b/src/assets/images/index/gw4.png new file mode 100644 index 0000000..7eaf1e2 --- /dev/null +++ b/src/assets/images/index/gw4.png Binary files differ diff --git a/src/assets/images/index/gw5.png b/src/assets/images/index/gw5.png new file mode 100644 index 0000000..0620eb9 --- /dev/null +++ b/src/assets/images/index/gw5.png Binary files differ diff --git a/src/assets/images/index/gw6.png b/src/assets/images/index/gw6.png new file mode 100644 index 0000000..b6cecb4 --- /dev/null +++ b/src/assets/images/index/gw6.png Binary files differ diff --git a/src/assets/images/index/hbAir.png b/src/assets/images/index/hbAir.png new file mode 100644 index 0000000..2a94b51 --- /dev/null +++ b/src/assets/images/index/hbAir.png Binary files differ diff --git a/src/assets/images/index/hbNoice.png b/src/assets/images/index/hbNoice.png new file mode 100644 index 0000000..b30fba0 --- /dev/null +++ b/src/assets/images/index/hbNoice.png Binary files differ diff --git a/src/assets/images/index/hbWater.png b/src/assets/images/index/hbWater.png new file mode 100644 index 0000000..0c8f356 --- /dev/null +++ b/src/assets/images/index/hbWater.png Binary files differ diff --git a/src/assets/images/index/hbYan.png b/src/assets/images/index/hbYan.png new file mode 100644 index 0000000..16c07c3 --- /dev/null +++ b/src/assets/images/index/hbYan.png Binary files differ diff --git a/src/assets/images/index/iconn.png b/src/assets/images/index/iconn.png new file mode 100644 index 0000000..c221fe6 --- /dev/null +++ b/src/assets/images/index/iconn.png Binary files differ diff --git a/src/assets/images/index/line-right.png b/src/assets/images/index/line-right.png new file mode 100644 index 0000000..7b73670 --- /dev/null +++ b/src/assets/images/index/line-right.png Binary files differ diff --git a/src/assets/images/index/line.png b/src/assets/images/index/line.png new file mode 100644 index 0000000..38dadfb --- /dev/null +++ b/src/assets/images/index/line.png Binary files differ diff --git a/src/assets/images/index/linebg.png b/src/assets/images/index/linebg.png new file mode 100644 index 0000000..cb14e2b --- /dev/null +++ b/src/assets/images/index/linebg.png Binary files differ diff --git a/src/assets/images/index/logobg.png b/src/assets/images/index/logobg.png new file mode 100644 index 0000000..f53fd36 --- /dev/null +++ b/src/assets/images/index/logobg.png Binary files differ diff --git a/src/assets/images/index/map.png b/src/assets/images/index/map.png new file mode 100644 index 0000000..45c1e0a --- /dev/null +++ b/src/assets/images/index/map.png Binary files differ diff --git a/src/assets/images/index/offline.png b/src/assets/images/index/offline.png new file mode 100644 index 0000000..4bfa779 --- /dev/null +++ b/src/assets/images/index/offline.png Binary files differ diff --git a/src/assets/images/index/online.png b/src/assets/images/index/online.png new file mode 100644 index 0000000..b1ddded --- /dev/null +++ b/src/assets/images/index/online.png Binary files differ diff --git a/src/assets/images/index/titlebg.png b/src/assets/images/index/titlebg.png new file mode 100644 index 0000000..86ea42b --- /dev/null +++ b/src/assets/images/index/titlebg.png Binary files differ diff --git a/src/assets/images/index/top_bg.png b/src/assets/images/index/top_bg.png new file mode 100644 index 0000000..85b97aa --- /dev/null +++ b/src/assets/images/index/top_bg.png Binary files differ diff --git a/src/assets/images/index/warn.png b/src/assets/images/index/warn.png new file mode 100644 index 0000000..da8b16d --- /dev/null +++ b/src/assets/images/index/warn.png Binary files differ diff --git a/src/assets/images/jx.png b/src/assets/images/jx.png new file mode 100644 index 0000000..acb4570 --- /dev/null +++ b/src/assets/images/jx.png Binary files differ diff --git a/src/assets/images/login/loginbody.png b/src/assets/images/login/loginbody.png new file mode 100644 index 0000000..494c659 --- /dev/null +++ b/src/assets/images/login/loginbody.png Binary files differ diff --git a/src/assets/images/login/logo.png b/src/assets/images/login/logo.png new file mode 100644 index 0000000..19c9dc9 --- /dev/null +++ b/src/assets/images/login/logo.png Binary files differ diff --git a/src/assets/images/login/logobg.png b/src/assets/images/login/logobg.png new file mode 100644 index 0000000..42a7f8d --- /dev/null +++ b/src/assets/images/login/logobg.png Binary files differ diff --git a/src/assets/images/login/pwd.png b/src/assets/images/login/pwd.png new file mode 100644 index 0000000..abd9bf9 --- /dev/null +++ b/src/assets/images/login/pwd.png Binary files differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..058d6f2 --- /dev/null +++ b/src/assets/images/login/user.png Binary files differ diff --git a/src/assets/images/loginbg.png b/src/assets/images/loginbg.png new file mode 100644 index 0000000..f50f9c3 --- /dev/null +++ b/src/assets/images/loginbg.png Binary files differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png new file mode 100644 index 0000000..194a088 --- /dev/null +++ b/src/assets/images/logo.png Binary files differ diff --git a/src/assets/images/logobg.png b/src/assets/images/logobg.png new file mode 100644 index 0000000..c11e762 --- /dev/null +++ b/src/assets/images/logobg.png Binary files differ diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..f5208a4 --- /dev/null +++ b/src/assets/images/map.png Binary files differ diff --git a/src/assets/images/map/df.png b/src/assets/images/map/df.png new file mode 100644 index 0000000..a448fdf --- /dev/null +++ b/src/assets/images/map/df.png Binary files differ diff --git a/src/assets/images/map/dfOn.png b/src/assets/images/map/dfOn.png new file mode 100644 index 0000000..200ee0c --- /dev/null +++ b/src/assets/images/map/dfOn.png Binary files differ diff --git a/src/assets/images/map/ds.png b/src/assets/images/map/ds.png new file mode 100644 index 0000000..ce06c2f --- /dev/null +++ b/src/assets/images/map/ds.png Binary files differ diff --git a/src/assets/images/map/dsOn.png b/src/assets/images/map/dsOn.png new file mode 100644 index 0000000..cdb4bb1 --- /dev/null +++ b/src/assets/images/map/dsOn.png Binary files differ diff --git a/src/assets/images/map/kjfhy.png b/src/assets/images/map/kjfhy.png new file mode 100644 index 0000000..ba6233c --- /dev/null +++ b/src/assets/images/map/kjfhy.png Binary files differ diff --git a/src/assets/images/map/kjfhyOn.png b/src/assets/images/map/kjfhyOn.png new file mode 100644 index 0000000..c816716 --- /dev/null +++ b/src/assets/images/map/kjfhyOn.png Binary files differ diff --git a/src/assets/images/map/qsw.png b/src/assets/images/map/qsw.png new file mode 100644 index 0000000..9945a8a --- /dev/null +++ b/src/assets/images/map/qsw.png Binary files differ diff --git a/src/assets/images/map/qswOn.png b/src/assets/images/map/qswOn.png new file mode 100644 index 0000000..9f8223a --- /dev/null +++ b/src/assets/images/map/qswOn.png Binary files differ diff --git a/src/assets/images/map/ysg.png b/src/assets/images/map/ysg.png new file mode 100644 index 0000000..e719e7a --- /dev/null +++ b/src/assets/images/map/ysg.png Binary files differ diff --git a/src/assets/images/map/ysgOn.png b/src/assets/images/map/ysgOn.png new file mode 100644 index 0000000..d0888b7 --- /dev/null +++ b/src/assets/images/map/ysgOn.png Binary files differ diff --git a/src/assets/images/map1.png b/src/assets/images/map1.png new file mode 100644 index 0000000..742f839 --- /dev/null +++ b/src/assets/images/map1.png Binary files differ diff --git a/src/assets/images/map12.png b/src/assets/images/map12.png new file mode 100644 index 0000000..3ea77c2 --- /dev/null +++ b/src/assets/images/map12.png Binary files differ diff --git a/src/assets/images/normal/df.png b/src/assets/images/normal/df.png new file mode 100644 index 0000000..2741203 --- /dev/null +++ b/src/assets/images/normal/df.png Binary files differ diff --git a/src/assets/images/normal/dfOn.png b/src/assets/images/normal/dfOn.png new file mode 100644 index 0000000..525fa71 --- /dev/null +++ b/src/assets/images/normal/dfOn.png Binary files differ diff --git a/src/assets/images/normal/ds.png b/src/assets/images/normal/ds.png new file mode 100644 index 0000000..5b63561 --- /dev/null +++ b/src/assets/images/normal/ds.png Binary files differ diff --git a/src/assets/images/normal/dsOn.png b/src/assets/images/normal/dsOn.png new file mode 100644 index 0000000..f4c7379 --- /dev/null +++ b/src/assets/images/normal/dsOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhy.png b/src/assets/images/normal/kjfhy.png new file mode 100644 index 0000000..96af64c --- /dev/null +++ b/src/assets/images/normal/kjfhy.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn.png b/src/assets/images/normal/kjfhyOn.png new file mode 100644 index 0000000..5a91cfc --- /dev/null +++ b/src/assets/images/normal/kjfhyOn.png Binary files differ diff --git a/src/assets/images/normal/kjfhyOn1.png b/src/assets/images/normal/kjfhyOn1.png new file mode 100644 index 0000000..5c866ae --- /dev/null +++ b/src/assets/images/normal/kjfhyOn1.png Binary files differ diff --git a/src/assets/images/normal/qsw.png b/src/assets/images/normal/qsw.png new file mode 100644 index 0000000..9217171 --- /dev/null +++ b/src/assets/images/normal/qsw.png Binary files differ diff --git a/src/assets/images/normal/qswOn.png b/src/assets/images/normal/qswOn.png new file mode 100644 index 0000000..9265003 --- /dev/null +++ b/src/assets/images/normal/qswOn.png Binary files differ diff --git a/src/assets/images/normal/ysg.png b/src/assets/images/normal/ysg.png new file mode 100644 index 0000000..4de0389 --- /dev/null +++ b/src/assets/images/normal/ysg.png Binary files differ diff --git a/src/assets/images/normal/ysgOn.png b/src/assets/images/normal/ysgOn.png new file mode 100644 index 0000000..a32b328 --- /dev/null +++ b/src/assets/images/normal/ysgOn.png Binary files differ diff --git a/src/assets/images/small/df.png b/src/assets/images/small/df.png new file mode 100644 index 0000000..878c180 --- /dev/null +++ b/src/assets/images/small/df.png Binary files differ diff --git a/src/assets/images/small/dfOn.png b/src/assets/images/small/dfOn.png new file mode 100644 index 0000000..fd10e29 --- /dev/null +++ b/src/assets/images/small/dfOn.png Binary files differ diff --git a/src/assets/images/small/ds.png b/src/assets/images/small/ds.png new file mode 100644 index 0000000..f21bc8b --- /dev/null +++ b/src/assets/images/small/ds.png Binary files differ diff --git a/src/assets/images/small/dsOn.png b/src/assets/images/small/dsOn.png new file mode 100644 index 0000000..4ba4915 --- /dev/null +++ b/src/assets/images/small/dsOn.png Binary files differ diff --git a/src/assets/images/small/kjfhy.png b/src/assets/images/small/kjfhy.png new file mode 100644 index 0000000..99df9bb --- /dev/null +++ b/src/assets/images/small/kjfhy.png Binary files differ diff --git a/src/assets/images/small/kjfhyOn.png b/src/assets/images/small/kjfhyOn.png new file mode 100644 index 0000000..1dc3d63 --- /dev/null +++ b/src/assets/images/small/kjfhyOn.png Binary files differ diff --git a/src/assets/images/small/qsw.png b/src/assets/images/small/qsw.png new file mode 100644 index 0000000..3c4af29 --- /dev/null +++ b/src/assets/images/small/qsw.png Binary files differ diff --git a/src/assets/images/small/qswOn.png b/src/assets/images/small/qswOn.png new file mode 100644 index 0000000..54dc676 --- /dev/null +++ b/src/assets/images/small/qswOn.png Binary files differ diff --git a/src/assets/images/small/ysg.png b/src/assets/images/small/ysg.png new file mode 100644 index 0000000..5f0ee8f --- /dev/null +++ b/src/assets/images/small/ysg.png Binary files differ diff --git a/src/assets/images/small/ysgOn.png b/src/assets/images/small/ysgOn.png new file mode 100644 index 0000000..0cd99f1 --- /dev/null +++ b/src/assets/images/small/ysgOn.png Binary files differ diff --git a/src/assets/images/spA.png b/src/assets/images/spA.png new file mode 100644 index 0000000..92c34ec --- /dev/null +++ b/src/assets/images/spA.png Binary files differ diff --git a/src/assets/images/spIos.png b/src/assets/images/spIos.png new file mode 100644 index 0000000..e39776e --- /dev/null +++ b/src/assets/images/spIos.png Binary files differ diff --git a/src/components/Home.vue b/src/components/Home.vue new file mode 100644 index 0000000..00f6888 --- /dev/null +++ b/src/components/Home.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/components/common/Global.vue b/src/components/common/Global.vue new file mode 100644 index 0000000..4209335 --- /dev/null +++ b/src/components/common/Global.vue @@ -0,0 +1,12 @@ + diff --git a/src/components/common/util.js b/src/components/common/util.js new file mode 100644 index 0000000..19c45dd --- /dev/null +++ b/src/components/common/util.js @@ -0,0 +1,208 @@ +let Util = { + /*** + * 将任意数量对象或者字符串传入该方法,若有任意一个为空,则返回true + * 可判断 空对象 空数组 空字符串 undefined null + * @returns {boolean} + */ + isEmpty: function (){ + let len = arguments.length; + if(len===0){ return true; } + for(let i=0;i 0 && n <= 20 ? n : 2; + num = parseFloat((num + "").replace(/[^\d\.-]/g, "")).toFixed(n) + ""; + let l = num.split(".")[0].split("").reverse(), r = num.split(".")[1],t = ""; + for (let j = 0; j < l.length; j++) { + t += l[j] + ((j + 1) % 4 === 0 && (j + 1) !== l.length ? "," : ""); + } + item[keys[i]] = t.split("").reverse().join("") + "." + r; + } + }, + checkIDCard: function(rule, value, callback) { + setTimeout(function(){ + if (!value) { + return callback(new Error('请输入身份证号码')); + } + let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; + if(reg.test(value) === false){ + return callback(new Error('输入的身份证号码无效')); + } + callback(); + }, 200); + }, + checkPhone: function(rule, value, callback) { + setTimeout(function(){ + if (!value) { + return callback(new Error('请输入联系方式')); + } + let reg = /^1[3|4|5|7|8][0-9]{9}$/; + if(reg.test(value) === false){ + return callback(new Error('输入的手机号码无效')); + } + callback(); + }, 200); + }, + checkUsername: function(rule, value, callback) { + setTimeout(function(){ + let reg_first = /^[a-zA-Z_-]$/,reg = /^[a-zA-Z_-]([a-zA-Z0-9_.-]){5,19}$/; + if (!value) { + return callback(new Error('请输入用户名')); + }else if(reg_first.test(value.substr(0,1)) === false){ + return callback(new Error('请输入以a-zA-Z_-开头的内容')); + }else if(value.length < 6){ + return callback(new Error('用户名最小长度为6')); + }else if(value.length > 20){ + return callback(new Error('用户名最大长度为20')); + }else if(reg.test(value) === false){ + return callback(new Error('输入内容只能包含a-zA-Z0-9_.-')); + } + callback(); + }, 200); + }, + checkNumber: function(rule, value, callback) { + setTimeout(function(){ + if(rule.required && !value){ + return callback(new Error(rule.requiredMessage)); + } + if(value){ + let reg = /^[1-9]\d*$/; + if(reg.test(value) === false){ + return callback(new Error(rule.invalidMessage)); + } + } + callback(); + }, 200); + } +}; + +/** + * 扩展DATE属性,增加日期格式化方法 + * @param f + * @returns {*} + */ +Date.prototype.format = function(f){ + let o ={ + "M+" : this.getMonth()+1, //month + "d+" : this.getDate(), //day + "H+" : this.getHours(), //hour + "m+" : this.getMinutes(), //minute + "s+" : this.getSeconds(), //second + "q+" : Math.floor((this.getMonth()+3)/3), //quarter + "S" : this.getMilliseconds() //millisecond + }; + if(/(y+)/.test(f))f=f.replace(RegExp.$1,(this.getFullYear()+"").substr(4 - RegExp.$1.length)); + for(let k in o) + if(new RegExp("("+ k +")").test(f))f = f.replace(RegExp.$1,RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));return f +}; + +export default +{Util:Util} diff --git a/src/components/company.vue b/src/components/company.vue new file mode 100644 index 0000000..2f63336 --- /dev/null +++ b/src/components/company.vue @@ -0,0 +1,71 @@ + + + + diff --git a/src/components/login.vue b/src/components/login.vue new file mode 100644 index 0000000..7d6f2e7 --- /dev/null +++ b/src/components/login.vue @@ -0,0 +1,149 @@ + + + + diff --git a/src/components/main.vue b/src/components/main.vue new file mode 100644 index 0000000..23e931c --- /dev/null +++ b/src/components/main.vue @@ -0,0 +1,694 @@ + + + diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..82ac085 --- /dev/null +++ b/src/main.js @@ -0,0 +1,77 @@ +// The Vue build version to load with the `import` command +// (runtime-only or standalone) has been set in webpack.base.conf with an alias. +import Vue from 'vue' +import App from './App' +import router from './router' +import "babel-polyfill" +import axios from 'axios' +import ElementUI from 'element-ui' +import 'element-ui/lib/theme-chalk/index.css' +import './assets/css/style.css' +import echarts from 'echarts' +import $ from 'jquery' +import global_ from './components/common/Global' +import Util from './components/common/util' +import md5 from 'js-md5' + +Vue.use(ElementUI); +Vue.config.productionTip = false +Vue.prototype.$http = axios; +window.axios = axios; +Vue.prototype.$Util = Util.Util; +Vue.prototype.$echarts = echarts; +Vue.prototype.$md5 = md5; +Vue.prototype.GLOBAL = global_; + + +axios.defaults.timeout = 300000; +axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'; +axios.defaults.baseURL = global_.BASE_HTTP_URL; +let loading; +axios.interceptors.request.use((config) => { + if(Util.Util.isEmpty(config.bLoading) || config.bLoading){ + loading = ElementUI.Loading.service({fullscreen: true, text: 'Loading....', spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0)'}); + } + return config; +}, (error) => { + loading.close(); + return Promise.reject(error); +}); +axios.interceptors.response.use(res => { + if (res.headers && res.headers['content-disposition']) { + new Promise((resolve, reject) => { + let iframe = document.createElement('iframe'); + iframe.style.display = 'none'; + iframe.src = res.request.responseURL; + iframe.onload = function () { + document.body.removeChild(iframe); + }; + document.body.appendChild(iframe); + }).catch(() => {}); + } + if(!Util.Util.isEmpty(loading)){ + loading.close(); + } + if(res.data.code === 401){ + router.replace("/login"); + }/* + if(res.data.code === 500){ + ElementUI.Message.warning(res.data.message) + }*/ + return res; +}, error => { + loading.close() + if(error.code == "ECONNABORTED"){ + ElementUI.Message.warning("请求超时") + }else{ + return Promise.reject(error); + } +}); + +/* eslint-disable no-new */ +new Vue({ + el: '#app', + router, + components: { App }, + template: '' +}) diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 0000000..379faa6 --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,53 @@ +import Vue from 'vue' +import Router from 'vue-router' + +Vue.use(Router) + +const router = new Router({ + routes: [ + { + path: '/', + redirect: '/login' + }, + /*登录*/ + { + path: '/login', + name: 'login', + component: resolve => require(['@/components/login'], resolve), + }, + { + path: '/company', + name: 'company', + component: resolve => require(['../components/company'], resolve) + }, + /*主页面*/ + { + path: '/home', + name: 'home', + component: resolve => require(['@/components/Home'], resolve), + children:[ + { + path: '/main', + name: 'mainPage', + component: resolve => require(['../components/main'], resolve) + }, + + ] + } + ] +}) + +router.beforeEach((to, from, next) => { + if (to.matched.some(res => res.name!='login'&&res.name!='register')) { + if (sessionStorage.getItem('userData')) { + next() + }else{ + next({ + path: '/login' + }) + } + } else { + next() + } +}) +export default router diff --git a/static/.gitkeep b/static/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/static/.gitkeep