Jelajahi Sumber

权限分配第一版本

xiaomin 5 tahun lalu
melakukan
0a1e9998ca
50 mengubah file dengan 20783 tambahan dan 0 penghapusan
  1. 12 0
      .babelrc
  2. 9 0
      .editorconfig
  3. 4 0
      .eslintignore
  4. 31 0
      .eslintrc.js
  5. 14 0
      .gitignore
  6. 10 0
      .postcssrc.js
  7. 28 0
      .project
  8. 21 0
      README.md
  9. 41 0
      build/build.js
  10. 54 0
      build/check-versions.js
  11. TEMPAT SAMPAH
      build/logo.png
  12. 101 0
      build/utils.js
  13. 22 0
      build/vue-loader.conf.js
  14. 106 0
      build/webpack.base.conf.js
  15. 95 0
      build/webpack.dev.conf.js
  16. 145 0
      build/webpack.prod.conf.js
  17. 7 0
      config/dev.env.js
  18. 164 0
      config/index.js
  19. 4 0
      config/prod.env.js
  20. 28 0
      index.html
  21. 11848 0
      package-lock.json
  22. 78 0
      package.json
  23. 17 0
      src/App.vue
  24. 2337 0
      src/assets/css/font-awesome.css
  25. 4 0
      src/assets/css/font-awesome.min.css
  26. 30 0
      src/assets/css/index.css
  27. TEMPAT SAMPAH
      src/assets/fonts/FontAwesome.otf
  28. TEMPAT SAMPAH
      src/assets/fonts/fontawesome-webfont.eot
  29. 2671 0
      src/assets/fonts/fontawesome-webfont.svg
  30. TEMPAT SAMPAH
      src/assets/fonts/fontawesome-webfont.ttf
  31. TEMPAT SAMPAH
      src/assets/fonts/fontawesome-webfont.woff
  32. TEMPAT SAMPAH
      src/assets/fonts/fontawesome-webfont.woff2
  33. TEMPAT SAMPAH
      src/assets/image/main.jpg
  34. 1 0
      src/assets/js/player.js
  35. 23 0
      src/components/MyBreadcrumb.vue
  36. 33 0
      src/main.js
  37. 44 0
      src/plugins/MyAxios.js
  38. 70 0
      src/router/index.js
  39. 248 0
      src/views/Home.vue
  40. 136 0
      src/views/Login.vue
  41. 30 0
      src/views/error/errorone.vue
  42. 185 0
      src/views/expense/waybill.vue
  43. 28 0
      src/views/main/main.vue
  44. 210 0
      src/views/meter/expense.vue
  45. 237 0
      src/views/meter/invoice.vue
  46. 281 0
      src/views/meter/waybill.vue
  47. 247 0
      src/views/sys/recharge.vue
  48. 419 0
      src/views/sys/role.vue
  49. 710 0
      src/views/sys/user.vue
  50. 0 0
      static/.gitkeep

+ 12 - 0
.babelrc

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

+ 9 - 0
.editorconfig

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

+ 4 - 0
.eslintignore

@@ -0,0 +1,4 @@
+/build/
+/config/
+/dist/
+/*.js

+ 31 - 0
.eslintrc.js

@@ -0,0 +1,31 @@
+// https://eslint.org/docs/user-guide/configuring
+
+module.exports = {
+  root: true,
+  parserOptions: {
+    parser: 'babel-eslint'
+  },
+  env: {
+    browser: true,
+  },
+  extends: [
+    // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
+    // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
+    'plugin:vue/essential',
+    // https://github.com/standard/standard/blob/master/docs/RULES-en.md
+    'standard'
+  ],
+  // required to lint *.vue files
+  plugins: [
+    'vue'
+  ],
+  // add your custom rules here
+  rules: {
+    // allow async-await
+    'generator-star-spacing': 'off',
+    // allow debugger during development
+    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
+    'semi': ['error', 'always'],
+    'space-before-function-paren': 'off'
+  }
+}

+ 14 - 0
.gitignore

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

+ 10 - 0
.postcssrc.js

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

+ 28 - 0
.project

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>houtaixiangmu</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.aptana.ide.core.unifiedBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.aptana.projects.webnature</nature>
+	</natures>
+	<filteredResources>
+		<filter>
+			<id>1539239485050</id>
+			<name></name>
+			<type>26</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-false-false-node_modules</arguments>
+			</matcher>
+		</filter>
+	</filteredResources>
+</projectDescription>

+ 21 - 0
README.md

@@ -0,0 +1,21 @@
+# 信用修复平台
+
+> 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).

+ 41 - 0
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'
+    ))
+  })
+})

+ 54 - 0
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)
+  }
+}

TEMPAT SAMPAH
build/logo.png


+ 101 - 0
build/utils.js

@@ -0,0 +1,101 @@
+'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'
+      })
+    } 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')
+    })
+  }
+}

+ 22 - 0
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'
+  }
+}

+ 106 - 0
build/webpack.base.conf.js

@@ -0,0 +1,106 @@
+'use strict'
+const path = require('path')
+const utils = require('./utils')
+const config = require('../config')
+const vueLoaderConfig = require('./vue-loader.conf')
+const webpack = require('webpack')
+
+function resolve (dir) {
+  return path.join(__dirname, '..', dir)
+}
+
+const createLintingRule = () => ({
+  test: /\.(js|vue)$/,
+  loader: 'eslint-loader',
+  enforce: 'pre',
+  include: [resolve('src'), resolve('test')],
+  options: {
+    formatter: require('eslint-friendly-formatter'),
+    emitWarning: !config.dev.showEslintErrorsInOverlay
+  }
+})
+
+module.exports = {
+  context: path.resolve(__dirname, '../'),
+  entry: {
+    app:['babel-polyfill','./src/main.js']
+  },
+  externals: {
+    vue: 'Vue',
+    axios: 'axios',
+    'vue-router': 'VueRouter',
+    'element-ui': 'ELEMENT',
+    // "QPlayer": "QPlayer"
+  },
+  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'),
+    }
+  },
+  plugins: [
+    new webpack.ProvidePlugin({
+        $: "jquery",
+        jQuery: "jquery"
+    })
+  ],
+  module: {
+    rules: [
+      ...(config.dev.useEslint ? [createLintingRule()] : []),
+      {
+        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'
+  }
+}

+ 95 - 0
build/webpack.dev.conf.js

@@ -0,0 +1,95 @@
+'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
+    }),
+    // 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)
+    }
+  })
+})

+ 145 - 0
build/webpack.prod.conf.js

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

+ 7 - 0
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"'
+})

+ 164 - 0
config/index.js

@@ -0,0 +1,164 @@
+'use strict'
+// Template version: 1.3.1
+// see http://vuejs-templates.github.io/webpack for documentation.
+
+const path = require('path')
+
+module.exports = {
+  dev: {
+    // Paths
+    assetsSubDirectory: 'static',
+    assetsPublicPath: '/',
+    proxyTable: {
+      '/api': {
+        // target: "http://invoice.back.jkcredit.com/",
+        // target: "http://192.168.1.184:18081/",
+        target: "http://192.168.1.184:18081/",
+        // target: "http://172.31.1.167:18081/",
+        changeOrigin: true,
+        pathRewrite: {
+          '^/api': ''
+        },
+        "secure": false,
+
+      }
+    },
+
+    // Various Dev Server settings
+    // host: "0.0.0.0", // can be overwritten by process.env.HOST
+    port: 8088, // 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-
+
+    // Use Eslint Loader?
+    // If true, your code will be linted during bundling and
+    // linting errors and warnings will be shown in the console.
+    useEslint: true,
+    // If true, eslint errors and warnings will also be shown in the error overlay
+    // in the browser.
+    showEslintErrorsInOverlay: false,
+
+    /**
+     * 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
+  }
+}
+// '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: {},
+
+//     // Various Dev Server settings
+//     host: 'localhost', // can be overwritten by process.env.HOST
+//     port: 8080, // 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-
+
+//     // Use Eslint Loader?
+//     // If true, your code will be linted during bundling and
+//     // linting errors and warnings will be shown in the console.
+//     useEslint: true,
+//     // If true, eslint errors and warnings will also be shown in the error overlay
+//     // in the browser.
+//     showEslintErrorsInOverlay: false,
+
+//     /**
+//      * 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
+//   }
+// }

+ 4 - 0
config/prod.env.js

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

+ 28 - 0
index.html

@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
+    <!-- <meta content="width=device-width,user-scalable=no" name="viewport"> -->
+    <title>quanxian</title>
+    <link href="https://cdn.bootcss.com/element-ui/2.8.2/theme-chalk/index.css" rel="stylesheet">
+    <style>
+      #app {
+        max-width: 1500px;
+        min-width: 300px;
+        margin: 0 auto;
+      }
+    </style>
+
+  </head>
+  <body>
+    <div id="app"></div>
+    <!-- built files will be auto injected -->
+    <!-- <script src="https://sdk-release.qnsdk.com/qiniu-web-player-1.2.0.js"></script> -->
+    <script src="https://cdn.bootcss.com/axios/0.18.0/axios.min.js"></script>
+    <script src="https://cdn.bootcss.com/vue/2.5.16/vue.min.js"></script>
+    <script src="https://cdn.bootcss.com/vue-router/3.0.1/vue-router.min.js"></script>
+    <script src="https://cdn.bootcss.com/element-ui/2.8.2/index.js"></script>
+  </body>
+</html>

File diff ditekan karena terlalu besar
+ 11848 - 0
package-lock.json


+ 78 - 0
package.json

@@ -0,0 +1,78 @@
+{
+  "name": "quanxianfenpei",
+  "version": "1.0.0",
+  "description": "A Vue.js project",
+  "author": "xiaomin <xiaomin@163.com>",
+  "private": true,
+  "scripts": {
+    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js --open",
+    "start": "npm run dev",
+    "lint": "eslint --ext .js,.vue src",
+    "lintfix": "eslint --ext .js,.vue src --fix",
+    "build": "node build/build.js"
+  },
+  "dependencies": {
+    "axios": "^0.18.0",
+    "babel-polyfill": "^6.26.0",
+    "element-ui": "^2.8.2",
+    "moment": "^2.24.0",
+    "vue": "^2.5.2",
+    "vue-router": "^3.0.1"
+  },
+  "devDependencies": {
+    "autoprefixer": "^7.1.2",
+    "babel-core": "^6.22.1",
+    "babel-eslint": "^8.2.1",
+    "babel-helper-vue-jsx-merge-props": "^2.0.3",
+    "babel-loader": "^7.1.1",
+    "babel-plugin-syntax-jsx": "^6.18.0",
+    "babel-plugin-transform-runtime": "^6.22.0",
+    "babel-plugin-transform-vue-jsx": "^3.5.0",
+    "babel-preset-env": "^1.3.2",
+    "babel-preset-stage-2": "^6.22.0",
+    "chalk": "^2.0.1",
+    "copy-webpack-plugin": "^4.0.1",
+    "css-loader": "^0.28.0",
+    "eslint": "^4.15.0",
+    "eslint-config-standard": "^10.2.1",
+    "eslint-friendly-formatter": "^3.0.0",
+    "eslint-loader": "^1.7.1",
+    "eslint-plugin-import": "^2.7.0",
+    "eslint-plugin-node": "^5.2.0",
+    "eslint-plugin-promise": "^3.4.0",
+    "eslint-plugin-standard": "^3.0.1",
+    "eslint-plugin-vue": "^4.0.0",
+    "extract-text-webpack-plugin": "^3.0.0",
+    "file-loader": "^1.1.4",
+    "friendly-errors-webpack-plugin": "^1.6.1",
+    "html-webpack-plugin": "^2.30.1",
+    "node-notifier": "^5.1.2",
+    "optimize-css-assets-webpack-plugin": "^3.2.0",
+    "ora": "^1.2.0",
+    "portfinder": "^1.0.13",
+    "postcss-import": "^11.0.0",
+    "postcss-loader": "^2.0.8",
+    "postcss-url": "^7.2.1",
+    "rimraf": "^2.6.0",
+    "semver": "^5.3.0",
+    "shelljs": "^0.7.6",
+    "uglifyjs-webpack-plugin": "^1.1.1",
+    "url-loader": "^0.5.8",
+    "vue-loader": "^13.3.0",
+    "vue-style-loader": "^3.0.1",
+    "vue-template-compiler": "^2.5.2",
+    "webpack": "^3.6.0",
+    "webpack-bundle-analyzer": "^2.9.0",
+    "webpack-dev-server": "^2.9.1",
+    "webpack-merge": "^4.1.0"
+  },
+  "engines": {
+    "node": ">= 6.0.0",
+    "npm": ">= 3.0.0"
+  },
+  "browserslist": [
+    "> 1%",
+    "last 2 versions",
+    "not ie <= 8"
+  ]
+}

+ 17 - 0
src/App.vue

@@ -0,0 +1,17 @@
+<template>
+  <div id="app">
+    <router-view/>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'App'
+};
+</script>
+
+<style>
+  #app{
+    height: 100%;
+  }
+</style>

File diff ditekan karena terlalu besar
+ 2337 - 0
src/assets/css/font-awesome.css


File diff ditekan karena terlalu besar
+ 4 - 0
src/assets/css/font-awesome.min.css


+ 30 - 0
src/assets/css/index.css

@@ -0,0 +1,30 @@
+body,html {
+  background-color: #fff;
+  height: 100%;
+  min-width: 1250px;
+  padding: 0;
+  margin: 0 auto;
+  width: 100%;
+}
+h1,h2,h3,h4,h5,h6,p,ul,li {
+  margin: 0;
+  padding: 0;
+}
+a {
+  text-decoration: none;
+}
+ul li{
+  list-style: none;
+  box-sizing:border-box;
+}
+div {
+   box-sizing:border-box;
+}
+i {
+  font-style:normal;
+}
+
+
+
+
+

TEMPAT SAMPAH
src/assets/fonts/FontAwesome.otf


TEMPAT SAMPAH
src/assets/fonts/fontawesome-webfont.eot


File diff ditekan karena terlalu besar
+ 2671 - 0
src/assets/fonts/fontawesome-webfont.svg


TEMPAT SAMPAH
src/assets/fonts/fontawesome-webfont.ttf


TEMPAT SAMPAH
src/assets/fonts/fontawesome-webfont.woff


TEMPAT SAMPAH
src/assets/fonts/fontawesome-webfont.woff2


TEMPAT SAMPAH
src/assets/image/main.jpg


File diff ditekan karena terlalu besar
+ 1 - 0
src/assets/js/player.js


+ 23 - 0
src/components/MyBreadcrumb.vue

@@ -0,0 +1,23 @@
+<template>
+  <el-breadcrumb separator-class="el-icon-arrow-right">
+    <el-breadcrumb-item >您的位置</el-breadcrumb-item>
+    <el-breadcrumb-item> {{level1}} </el-breadcrumb-item>
+    <el-breadcrumb-item> {{level2}} </el-breadcrumb-item>
+    <el-breadcrumb-item v-if="flag"> {{level3}} </el-breadcrumb-item>
+  </el-breadcrumb>
+</template>
+
+<script type="text/javascript">
+export default{
+  name: 'MyBreadcrumb',
+  props: ['level1', 'level2', 'level3','flag'],
+}
+</script>
+
+<style type="text/css">
+
+.el-breadcrumb__item:last-child .el-breadcrumb__inner {
+  color: #0e90ff;
+}
+</style>
+

+ 33 - 0
src/main.js

@@ -0,0 +1,33 @@
+// 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 ElementUI from 'element-ui';
+import moment from 'moment';
+import 'element-ui/lib/theme-chalk/index.css';
+import '@/assets/css/index.css';
+import '@/assets/css/font-awesome.min.css';
+// import axios from 'axios';
+import myaxios from '@/plugins/MyAxios';
+import MyBreadcrumb from '@/components/MyBreadcrumb';
+import 'babel-polyfill';
+
+Vue.use(ElementUI);
+Vue.use(myaxios);
+Vue.component(MyBreadcrumb.name, MyBreadcrumb);
+
+Vue.filter('fmtDate', (value, formatString) => {
+  formatString = formatString || 'YYYY-MM-DD HH:mm:ss';
+return moment(value).format(formatString);
+});
+
+Vue.config.productionTip = false;
+
+/* eslint-disable no-new */
+new Vue({
+  el: '#app',
+  router,
+  components: { App },
+  template: '<App/>'
+});

+ 44 - 0
src/plugins/MyAxios.js

@@ -0,0 +1,44 @@
+import axios from 'axios';
+// import { MessageBox } from 'element-ui';
+const MyAxios = {};
+MyAxios.install = function(Vue) {
+  axios.defaults.baseURL = '/api';
+  // axios.defaults.baseURL = 'http://222.35.31.66:18080/';
+  // axios.defaults.headers.common['app_id'] = 'RGZYQD'
+  axios.interceptors.request.use(function (config) {
+    // Do something before request is sent
+    if(config.url.toLocaleLowerCase() !== 'login') {
+
+      const token = sessionStorage.getItem('token');
+
+      config.headers.Authorization = 'Bearer ' + token;
+
+      // config.headers['Basic'] = 'dGVzdDoxMjM0NTY='
+    }
+    return config;
+  }, function (error) {
+    // Do something with request error
+    return Promise.reject(error);
+  });
+
+  // Add a response interceptor
+  axios.interceptors.response.use(function (response) {
+    // Do something with response data
+    return response;
+  }, function (error) {
+    // Do something with response error
+    if(error.response.status == 403) {
+      // MessageBox.alert('登录信息超时,请重新登录!','登录超时', {
+      //   confirmButtonText: '跳转登录页面',
+      //   callback: action => {
+          // window.location.href = '/errorone';
+      //   }
+      // })
+    }
+    return Promise.reject(error);
+  });
+
+  Vue.prototype.$http = axios;
+}
+
+export default MyAxios;

+ 70 - 0
src/router/index.js

@@ -0,0 +1,70 @@
+import Vue from 'vue';
+import Router from 'vue-router';
+const Login = () => import('@/views/Login');
+const Home = () => import('@/views/Home');
+// 首页
+const Main = () => import('@/views/main/main');
+//用户中心部分
+const User = () => import('@/views/sys/user');
+const Role = () => import('@/views/sys/role');
+const Recharge = () => import('@/views/sys/recharge');
+//消费统计部分
+const Waybill = () => import('@/views/meter/waybill');
+const Invoice = () => import('@/views/meter/invoice');
+const Expense = () => import('@/views/meter/expense');
+//没有权限报错403
+// const Errorone = () => import('@/views/error/errorone');
+
+import { Message } from 'element-ui';
+
+Vue.use(Router);
+
+const router = new Router({
+  routes: [
+    {name: 'Login', path: '/login', component: Login},
+    {name: 'Home',
+      path: '/',
+      component: Home,
+      redirect: '/main',
+      children:[
+        //首页
+        {name: 'Main', path: '/main',component: Main},
+        // 用户中心部分
+        {name: 'User', path: '/user', component: User},
+        {name: 'Role', path: '/role', component: Role},
+        {name: 'Recharge', path: '/recharge', component: Recharge},
+        // 消费统计部分
+        {name: 'Waybill', path: '/waybill', component: Waybill},
+        {name: 'Invoice', path: '/invoice', component: Invoice},
+        {name: 'Expense', path: '/expense', component: Expense},
+        //跳转403页面
+        // {name: 'Errorone', path: '/errorone', component: Errorone},
+
+      ]
+    }
+  ]
+});
+
+router.beforeEach((to, from, next) => {
+  // console.log(to);
+  // console.log(from);
+  // next();
+  // 如果是登录的时候不判断token ,不是登录才判断token
+  // console.log(to);
+  if (to.name && to.name.toLocaleLowerCase() !== 'login') {
+    // 判断token
+    const token = sessionStorage.getItem('token');
+    if (!token) {
+      // 没有token,跳转到登录页面
+      // this.$router.push('/login')
+      router.push('/login');
+      // 提示
+      // this.$message.warning('请先登录');
+      Message.warning('请先登录');
+      return;
+    }
+  }
+  next();
+});
+
+export default router;

+ 248 - 0
src/views/Home.vue

@@ -0,0 +1,248 @@
+<template>
+  <div class="home">
+    <el-container class="container">
+      <el-header class="header" style="height: 80px;">
+        <div>
+          <div class="logo">
+            <!-- <img src="../assets/image/logo.jpg"> -->
+            <h3>后台权限分配</h3>
+          </div>
+
+          <div class="message">
+            <div class="theUser"><span class="el-icon-user-solid"></span>{{name}}</div>
+            <!-- <div class="theUser"><span class="el-icon-s-custom" style="font-size: 18px;"></span></div> -->
+            <div class="theUser" @click="Logout"><span class="el-icon-s-unfold"></span>退出登录</div>
+          </div>
+        </div>
+      </el-header>
+
+      <el-main class="main" style="">
+        <div style="overflow: hidden;">
+          <div class="leftNav">
+            <template>
+
+              <template>
+                <el-menu
+                  :default-active="$route.path"
+                  unique-opened
+                  router
+                  background-color="#64b8fb"
+                  active-text-color="#ffd04b"
+                  style="height: 100%">
+                  <el-menu-item index="/main">
+                    <i class="el-icon-s-tools"></i>
+                    <span slot="title">首页</span>
+                  </el-menu-item>
+
+                  <el-submenu
+                    v-for="item in menus"
+                    :key="item.id"
+                    :index="item.id + ''">
+                    <template slot="title">
+                      <i class="el-icon-s-tools" style="font-size: 14px color: #fff;"></i>
+                      <span>{{ item.authName }}</span>
+                    </template>
+                    <el-menu-item
+                      v-for="item1 in item.children"
+                      :key="item1.id"
+                      :index="'/' + item1.path">
+                      <i class="el-icon-search" style="font-size: 14px color: #fff;"></i>
+                      {{ item1.authName }}
+                    </el-menu-item>
+                  </el-submenu>
+                </el-menu>
+              </template>
+
+            </template>
+
+          </div>
+          <div class="rightNav">
+            <router-view></router-view>
+          </div>
+        </div>
+
+
+      </el-main>
+    </el-container>
+
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      menus: [
+          {
+          id:1,
+          authName:"用户中心",
+          children:[
+            {
+              id:1,
+              path:"user",
+              authName:"用户管理"
+            },
+            {
+              id:2,
+              path:"role",
+              authName:"角色管理"
+            },
+            {
+              id:3,
+              path:"recharge",
+              authName:"充值管理"
+            },
+          ]
+        },
+        {
+          id:2,
+          authName:"消费统计",
+          children:[
+            {
+              id:1,
+              path:"waybill",
+              authName:"运单详情"
+            },
+            {
+              id:2,
+              path:"invoice",
+              authName:"发票详情"
+            },
+            {
+              id:3,
+              path:"expense",
+              authName:"消费统计"
+            },
+          ]
+        }
+      ],
+      roleId: '',
+      userName: '',
+      name: ''
+    };
+  },
+  components: {
+
+  },
+  beforeCreate() {
+
+  },
+  created() {
+     // 判断是否登录,token
+    var token = sessionStorage.getItem('token');
+    if (!token) {
+      // 提示
+      this.$message.warning('请先登录');
+      // 没有token,跳转到登录页面
+      this.$router.push('/login');
+    }
+
+  },
+  mounted () {
+
+  },
+  methods: {
+    // 退出登录
+    Logout() {
+      // 提示退出成功
+      this.$message.success('退出成功');
+      // 1 清除token
+      sessionStorage.clear();
+      // 2 跳转到登录页面
+      this.$router.push('/login');
+    },
+
+  }
+};
+</script>
+
+<style>
+.home {
+  height: 100%;
+  width: 100%;
+  font-size: 1px;
+}
+.home .container {
+  height: 100%;
+  background: -webkit-linear-gradient(top, #289dfa , #fff);
+  background: -o-linear-gradient(bottom, #289dfa , #fff);
+  background: -moz-linear-gradient(bottom, #289dfa, #fff);
+  background: linear-gradient(to bottom, #289dfa , #fff);
+}
+.home .header {
+  height: 130px;
+}
+.home .header > div {
+  overflow: hidden;
+}
+.home .header .logo {
+  float: left;
+  margin-top: 15px;
+  margin-left: 20px;
+}
+.home .header img {
+  height: 40px;
+  width: 40px;
+}
+.home .header h3 {
+  display: inline-block;
+  font-size: 30px;
+  color: #fff;
+  margin-left: 10px;
+}
+.home .header .message {
+  float: right;
+  margin-top: 24px;
+  margin-right: 35px;
+  background-color: #d3e7f9;
+  overflow: hidden;
+}
+.home .header .message .theUser {
+  float: left;
+  height: 40px;
+  line-height: 40px;
+  width: 100px;
+  font-size: 16px;
+  text-align: center;
+  cursor:pointer;
+}
+.home .main {
+  margin: 20px;
+  background-color: #fff;
+}
+.home .el-menu {
+  border: 0;
+}
+.home .el-submenu__title i{
+  color: #fff;
+  font-size: 16px;
+}
+.home .el-menu-item  {
+  color: #fff;
+  font-size: 16px;
+}
+.home .el-menu-item i{
+  color: #fff;
+  font-size: 16px;
+}
+.home .el-menu  span {
+  font-size: 16px;
+}
+.home .main .leftNav {
+  width: 18%;
+  float: left;
+}
+.home .main .rightNav {
+  margin-left: 2%;
+  width: 80%;
+  float: left;
+}
+.el-message  {
+  font-size: 35px !important;
+}
+.el-submenu__title {
+  color: #fff !important;
+}
+</style>
+
+

+ 136 - 0
src/views/Login.vue

@@ -0,0 +1,136 @@
+<template>
+  <div class="login-wrap">
+    <div>
+      <h1>后台权限分配</h1>
+    </div>
+    <div class="login">
+      <div class="record">
+        <span class="one">登录</span><span class="two">LOGIN</span>
+      </div>
+      <el-form
+        class="login-from"
+        label-position="top"
+        label-width="80px"
+        :model="fromDataone">
+        <el-form-item>
+          <el-input v-model="fromDataone.username" placeholder="输入用户名"></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-input @keyup.enter.native="handleLogin" type="password" v-model="fromDataone.password"  placeholder="输入密码"></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button @click="handleLogin" type="primary">登录</el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+  </div>
+</template>
+
+<script type="text/javascript">
+export default {
+  data() {
+    return {
+      fromDataone: {
+        "username": '',
+        "password": '',
+        // "grant_type": 'password',
+        // "client_id": 'test',
+        // "client_secret": '123456'
+      },
+      checked: false,
+    };
+  },
+  methods: {
+    async handleLogin () {
+      // 将数据转换为formData形式
+      const formData = new FormData();
+      formData.append('username', this.fromDataone.username);
+      formData.append('password', this.fromDataone.password);
+      // formData.append('grant_type', this.fromDataone.grant_type);
+      // formData.append('client_id', this.fromDataone.client_id);
+      // formData.append('client_secret', this.fromDataone.client_secret);
+      const response = await this.$http.post(`login`, formData);
+      if (response.data.code === 200) {
+        this.$message.success('登录成功');
+        // 将tocken取到
+        const token = document.cookie;
+        // console.log(token)
+        // 将tocken保存到sessionStorage中
+        sessionStorage.setItem('token', response.data.responseData.token);
+
+        this.$router.push('/main');
+      } else {
+        this.$message.error('登录失败');
+      }
+    },
+  }
+};
+</script>
+
+<style>
+.login-wrap{
+  background-color: #f6f6f6;
+  height: 100%;
+  width: 100%;
+  overflow: hidden;
+}
+.login-wrap h1 {
+  text-align: center;
+  /*color: #5885f7;*/
+  font-size: 70px;
+  margin-top: 80px;
+}
+.login-wrap .login{
+  width: 400px;
+  background-color: #fff;
+  border-radius: 5px;
+  padding: 35px;
+  margin: 50px auto;
+}
+.login-wrap .record {
+  font-size: 5px;
+  margin-bottom: 10px;
+}
+.login-wrap .record span:nth-child(1) {
+  /*color: #5885f7;*/
+  font-size: 25px;
+}
+.login-wrap .record span:nth-child(2) {
+  /*color: #b1bcc7;*/
+  font-size: 10px;
+  margin-left: 5px;
+}
+.login-wrap .el-form-item{
+  margin-bottom: 25px;
+}
+.login-wrap .code {
+  width: 70%;
+}
+.login-wrap .validation {
+  border: 1px solid #dddddd;
+  font-size: 6px;
+  display: inline-block;
+  height: 40px;
+  line-height: 40px;
+  width: 28%;
+  text-align: center;
+  margin-left: 1px;
+  cursor: pointer;
+  color: #b1bcc7;
+}
+.login-wrap .el-button--primary {
+  width: 100%;
+  background: -webkit-linear-gradient(left, #000000 , #ffffff);
+  background: -o-linear-gradient(right, #000000 , #ffffff);
+  background: -moz-linear-gradient(right, #000000, #ffffff);
+  background: linear-gradient(to right, #000000 , #ffffff);
+ /* background-color: #5885f7;*/
+  border-color: #000000;
+}
+.el-message  {
+  font-size: 35px !important;
+}
+</style>
+
+
+

+ 30 - 0
src/views/error/errorone.vue

@@ -0,0 +1,30 @@
+<template>
+  <div class="main">
+    <div class="main_img">
+      <h1>您没有该权限</h1>
+    </div>
+  </div>
+</template>
+
+<script>
+export default{
+  data() {
+    return {
+
+    }
+  },
+}
+</script>
+
+<style>
+.main .main_img {
+  height: 100%;
+  width: 100%;
+}
+.main .main_img h1 {
+  color: red;
+  transform: translate(-50%,-50%);
+  top: 50%;
+  left: 50%;
+}
+</style>

+ 185 - 0
src/views/expense/waybill.vue

@@ -0,0 +1,185 @@
+<template>
+  <div class="waybill">
+    <el-card>
+    <!-- 头部细节部分 -->
+    <div class="title">
+      <el-row class="bottom">
+        <el-col :span="24">
+          <div class="grid-content bg-purple-dark">
+            <!-- <el-button type="primary" @click="addRoleList = true">新增</el-button> -->
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+    <!-- 头部细节部分结束 -->
+    <!-- 表格部分 -->
+      <template>
+        <el-table
+          v-loading="loading"
+          ref="multipleTable"
+          :data="roletable"
+          border
+          tooltip-effect="dark"
+          style="width: 100%">
+          <el-table-column
+            label="序号"
+            type="index"
+            width="40"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            prop="num"
+            label="运单编号"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="plateNumber"
+            label="车牌号"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="status"
+            label="运单状态"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="isHistory"
+            label="运单类型"
+            show-overflow-tooltip>
+          </el-table-column>
+
+          <el-table-column
+            label="开始运单创建时间"
+            show-overflow-tooltip>
+            <template slot-scope="scope" show-overflow-tooltip>
+              <span>{{scope.row.startBillCreateTime | fmtDate}}</span>
+            </template>
+          </el-table-column>
+
+          <el-table-column
+            prop="realDestAddr"
+            label="运单实际目的地"
+            show-overflow-tooltip>
+          </el-table-column>
+
+          <el-table-column
+            label="运单结束创建时间"
+            show-overflow-tooltip>
+            <template slot-scope="scope" show-overflow-tooltip>
+              <span>{{scope.row.endBillCreateTime | fmtDate}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="appKey"
+            label="appKey"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            prop="company"
+            label="公司名称"
+            show-overflow-tooltip>
+          </el-table-column>
+
+        </el-table>
+      </template>
+    <!-- 分页 -->
+      <div class="block">
+        <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="current"
+          :page-sizes="[6, 8, 10]"
+          :page-size="pagesize"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total">
+        </el-pagination>
+      </div>
+
+    </el-card>
+  </div>
+
+</template>
+
+<script type="text/javascript">
+export default{
+  data() {
+    return {
+      loading: true,
+      roletable: [],
+      formList: {
+        "roleId": "",
+        "permissionIds": []
+      },
+      current: 1,
+      pagesize: 10,
+      total: 0,
+    }
+  },
+  created() {
+    this.loadData();
+  },
+  methods: {
+    // 请求查询数据
+    async loadData() {
+      const response = await this.$http.get(`app/billRecord?&current=${this.current}&size=${this.pagesize}`);
+      if (response.data.code === 1) {
+        this.loading = false;
+        this.roletable = response.data.responseData.records;
+        this.total = response.data.responseData.total;
+      }
+    },
+
+
+    // 分页方法
+    handleSizeChange(val) {
+      this.pagesize = val;
+      this.loadData();
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      this.current = val;
+      this.loadData();
+      console.log(`当前页: ${val}`);
+    },
+  }
+};
+</script>
+
+<style scoped>
+.waybill .title{
+  font-size: 5px;
+  margin-bottom: 20px;
+}
+.waybill .text {
+  font-size: 14px;
+  display: inline-block;
+}
+.waybill input {
+  margin-left: 10px;
+  margin-right: 10px;
+  width: 150px;
+}
+.waybill select {
+  border-radius: 3px;
+  width: 150px;
+}
+.waybill .middle {
+  margin-top: 20px;
+  margin-bottom:20px;
+}
+.waybill .bottom {
+  margin-bottom: 20px;
+}
+.waybill .el-button--primary {
+  background-color: #5885f7 !important;
+  border-color: #5885f7 !important;
+}
+.waybill .el-button {
+  padding: 4px 20px !important;
+}
+.waybill .block {
+  font-size: 5px;
+  text-align: center;
+  margin-top: 15px;
+}
+</style>

+ 28 - 0
src/views/main/main.vue

@@ -0,0 +1,28 @@
+<template>
+  <div class="main">
+    <div class="main_img">
+      <img src="@/assets/image/main.jpg">
+    </div>
+  </div>
+</template>
+
+<script>
+export default{
+  data() {
+    return {
+
+    }
+  },
+}
+</script>
+
+<style>
+.main .main_img {
+  height: 100%;
+  width: 100%;
+}
+.main .main_img img {
+  margin-left: 20%;
+  margin-top: 15%;
+}
+</style>

+ 210 - 0
src/views/meter/expense.vue

@@ -0,0 +1,210 @@
+<template>
+  <div class="expense">
+    <el-card>
+    <!-- 头部细节部分 -->
+    <div class="title">
+      <el-row>
+          <el-col :span="24">
+            <div class="top">
+              <el-input  placeholder="appKey" class="input-demo" v-model="appKey"></el-input>
+              <el-input  placeholder="公司名称" class="input-demo" v-model="company"></el-input>
+              <el-button type="success" style="margin-left: 1%;" @click="queryLook">查询</el-button>
+            </div>
+          </el-col>
+        </el-row>
+    </div>
+    <!-- 头部细节部分结束 -->
+    <!-- 表格部分 -->
+      <template>
+        <el-table
+          v-loading="loading"
+          ref="multipleTable"
+          :data="roletable"
+          border
+          tooltip-effect="dark"
+          style="width: 100%">
+          <el-table-column
+            label="序号"
+            type="index"
+            width="40"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="appKey"
+            label="appKey"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            prop="company"
+            label="公司名称"
+            show-overflow-tooltip>
+          </el-table-column>
+
+          <el-table-column
+            prop="startAmount"
+            label="运单开始总计"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="endAmount"
+            label="运单结束总计"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="invoiceAmount"
+            label="发票条数总计"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="chargeAmount"
+            label="计费条数总计"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="totalAmount"
+            label="总金额"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="totalTaxAmount"
+            label="抵税金额"
+            show-overflow-tooltip>
+          </el-table-column>
+
+        </el-table>
+      </template>
+    <!-- 分页 -->
+      <div class="block">
+        <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="current"
+          :page-sizes="[6, 8, 10]"
+          :page-size="pagesize"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total">
+        </el-pagination>
+      </div>
+
+    </el-card>
+  </div>
+
+</template>
+
+<script type="text/javascript">
+export default{
+  data() {
+    return {
+      loading: true,
+      appKey: '',
+      company: '',
+      roletable: [],
+      formList: {
+        "roleId": "",
+        "permissionIds": []
+      },
+      current: 1,
+      pagesize: 10,
+      total: 0,
+    }
+  },
+  created() {
+    this.loadData();
+  },
+  methods: {
+    // 请求查询数据
+    async loadData() {
+      const response = await this.$http.get(`app/consumptionStatistics?&current=${this.current}&size=${this.pagesize}`);
+      if (response.data.code === 1) {
+        this.loading = false;
+        this.roletable = response.data.responseData.records;
+        this.total = response.data.responseData.total;
+      }
+    },
+    //查询
+    async queryLook() {
+      const response = await this.$http.get(`app/consumptionStatistics?&current=${this.current}&size=${this.pagesize}&appKey=${this.appKey}&company=${this.company}`);
+      if (response.data.code === 1) {
+        this.loading = false;
+        this.roletable = response.data.data.records;
+        this.total = response.data.data.total;
+      }
+    },
+    // 分页方法
+    handleSizeChange(val) {
+      this.pagesize = val;
+      if(this.appKey !== '' || this.company !== '') {
+        this.queryLook();
+      }else{
+        this.loadData();
+      };
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      this.current = val;
+      if(this.appKey !== '' || this.company !== '') {
+        this.queryLook();
+      }else{
+        this.loadData();
+      };
+      console.log(`当前页: ${val}`);
+    },
+  }
+};
+</script>
+
+<style scoped>
+.expense {
+  border: 1px solid #d9d9d9;
+  border-radius: 10px;
+}
+.expense .title {
+  font-size: 5px;
+  margin-bottom: 20px;
+}
+.expense .top {
+  padding-top: 20px;
+  padding-left: 20px;
+}
+.expense .text {
+  display: inline-block;
+  color: #000;
+  font-size: 16px ;
+  margin-left: 1%;
+}
+.expense .input-demo {
+  display: inline-block;
+  width: 20%;
+  margin-left: 1%;
+}
+.expense .block {
+  font-size: 5px;
+  text-align: center;
+  margin-top: 25px;
+  margin-bottom: 25px;
+}
+.expense .el-dialog {
+  width: 60%;
+}
+.expense .el-dialog__header, .el-dialog__body {
+  padding: 0 20px;
+}
+.expense .tou {
+  font-size: 20px;
+  height: 30px;
+  line-height: 30px;
+  padding-top: 15px;
+}
+.expense .line {
+  margin-top: 15px;
+  margin-bottom: 15px;
+  width: 100%;
+  height: 2px;
+  background-color: #d9d9d9;
+}
+.expense .xinxi {
+  text-align: center;
+  margin: 15px auto;
+  font-size: 18px;
+}
+</style>

+ 237 - 0
src/views/meter/invoice.vue

@@ -0,0 +1,237 @@
+<template>
+  <div class="expense">
+    <el-card>
+    <!-- 头部细节部分 -->
+    <div class="title">
+      <el-row>
+          <el-col :span="24">
+            <div class="top">
+              <el-input  placeholder="appKey" class="input-demo" v-model="appKey"></el-input>
+              <el-input  placeholder="交易id" class="input-demo" v-model="transactionId"></el-input>
+              <el-input  placeholder="车牌号" class="input-demo" v-model="plateNum"></el-input>
+            </div>
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="24">
+            <div class="top">
+              <el-input  placeholder="运单编号" class="input-demo" v-model="waybillNum"></el-input>
+              <el-button type="success" style="margin-left: 1%;" @click="queryLook">查询</el-button>
+            </div>
+          </el-col>
+        </el-row>
+    </div>
+    <!-- 头部细节部分结束 -->
+    <!-- 表格部分 -->
+      <template>
+        <el-table
+          v-loading="loading"
+          ref="multipleTable"
+          :data="roletable"
+          border
+          tooltip-effect="dark"
+          style="width: 100%">
+          <el-table-column
+            label="序号"
+            type="index"
+            width="40"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="waybillNum"
+            label="运单编号"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            prop="plateNum"
+            label="车牌号"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            prop="transactionId"
+            label="交易id"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            prop="fee"
+            label="交易金额"
+            show-overflow-tooltip>
+          </el-table-column>
+
+           <el-table-column
+            prop="totalAmount"
+            label="价税合计"
+            show-overflow-tooltip>
+          </el-table-column>
+
+           <el-table-column
+            prop="taxRate"
+            label="税率"
+            show-overflow-tooltip>
+          </el-table-column>
+
+           <el-table-column
+            prop="amount"
+            label="金额"
+            show-overflow-tooltip>
+          </el-table-column>
+
+          <el-table-column
+            label="查询时间"
+            show-overflow-tooltip>
+            <template slot-scope="scope" show-overflow-tooltip>
+              <span>{{scope.row.createTime | fmtDate}}</span>
+            </template>
+          </el-table-column>
+
+           <el-table-column
+            prop="appKey"
+            label="appKey"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            prop="company"
+            label="公司名称"
+            show-overflow-tooltip>
+          </el-table-column>
+
+        </el-table>
+      </template>
+    <!-- 分页 -->
+      <div class="block">
+        <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="current"
+          :page-sizes="[6, 8, 10]"
+          :page-size="pagesize"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total">
+        </el-pagination>
+      </div>
+
+    </el-card>
+  </div>
+
+</template>
+
+<script type="text/javascript">
+export default{
+  data() {
+    return {
+      loading: true,
+      appKey: '',
+      transactionId: '',
+      plateNum: '',
+      waybillNum: '',
+      roletable: [],
+      formList: {
+        "roleId": "",
+        "permissionIds": []
+      },
+      current: 1,
+      pagesize: 10,
+      total: 0,
+    }
+  },
+  created() {
+    this.loadData();
+  },
+  methods: {
+    // 请求查询数据
+    async loadData() {
+      const response = await this.$http.get(`app/invoiceRecord?&current=${this.current}&size=${this.pagesize}`);
+      if (response.data.code === 1) {
+        this.loading = false;
+        this.roletable = response.data.responseData.records;
+        this.total = response.data.responseData.total;
+      }
+    },
+    //查询
+    async queryLook() {
+      const response = await this.$http.get(`app/invoiceRecord?&current=${this.current}&size=${this.pagesize}&appKey=${this.appKey}&company=${this.company}`);
+      if (response.data.code === 1) {
+        this.loading = false;
+        this.roletable = response.data.data.records;
+        this.total = response.data.data.total;
+      }
+    },
+    // 分页方法
+    handleSizeChange(val) {
+      this.pagesize = val;
+      if(this.appKey !== '' || this.transactionId !== '' || this.plateNum !== '' || this.waybillNum !== '') {
+        this.queryLook();
+      }else{
+        this.loadData();
+      };
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      this.current = val;
+      if(this.appKey !== '' || this.transactionId !== '' || this.plateNum !== '' || this.waybillNum !== '') {
+        this.queryLook();
+      }else{
+        this.loadData();
+      };
+      console.log(`当前页: ${val}`);
+    },
+  }
+};
+</script>
+
+<style scoped>
+.expense {
+  border: 1px solid #d9d9d9;
+  border-radius: 10px;
+}
+.expense .title {
+  font-size: 5px;
+  margin-bottom: 20px;
+}
+.expense .top {
+  padding-top: 20px;
+  padding-left: 20px;
+}
+.expense .text {
+  display: inline-block;
+  color: #000;
+  font-size: 16px ;
+  margin-left: 1%;
+}
+.expense .input-demo {
+  display: inline-block;
+  width: 20%;
+  margin-left: 1%;
+}
+.expense .block {
+  font-size: 5px;
+  text-align: center;
+  margin-top: 25px;
+  margin-bottom: 25px;
+}
+.expense .el-dialog {
+  width: 60%;
+}
+.expense .el-dialog__header, .el-dialog__body {
+  padding: 0 20px;
+}
+.expense .tou {
+  font-size: 20px;
+  height: 30px;
+  line-height: 30px;
+  padding-top: 15px;
+}
+.expense .line {
+  margin-top: 15px;
+  margin-bottom: 15px;
+  width: 100%;
+  height: 2px;
+  background-color: #d9d9d9;
+}
+.expense .xinxi {
+  text-align: center;
+  margin: 15px auto;
+  font-size: 18px;
+}
+</style>

+ 281 - 0
src/views/meter/waybill.vue

@@ -0,0 +1,281 @@
+<template>
+  <div class="waybill">
+    <el-card>
+    <!-- 头部细节部分 -->
+    <div class="title">
+      <el-row>
+          <el-col :span="24">
+            <div class="top">
+              <el-input  placeholder="appKey" class="input-demo" v-model="appKey"></el-input>
+              <el-input  placeholder="运单编号" class="input-demo" v-model="num"></el-input>
+              <el-input  placeholder="车牌号" class="input-demo" v-model="plateNumber"></el-input>
+              <label style="margin-left: 1%;">运单类型:</label>
+              <el-select v-model="isHistory" placeholder="请选择">
+                <el-option
+                  v-for="item in optionone"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+            </div>
+          </el-col>
+        </el-row>
+
+         <el-row>
+          <el-col :span="24">
+            <div class="top">
+              <label style="margin-left: 1%;">运单状态:</label>
+              <el-select v-model="status" placeholder="请选择">
+                <el-option
+                  v-for="item in optiontwo"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+
+              <el-button type="success" style="margin-left: 1%;" @click="queryLook">查询</el-button>
+            </div>
+          </el-col>
+        </el-row>
+    </div>
+    <!-- 头部细节部分结束 -->
+    <!-- 表格部分 -->
+      <template>
+        <el-table
+          v-loading="loading"
+          ref="multipleTable"
+          :data="roletable"
+          border
+          tooltip-effect="dark"
+          style="width: 100%">
+          <el-table-column
+            label="序号"
+            type="index"
+            width="40"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            prop="num"
+            label="运单编号"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="plateNumber"
+            label="车牌号"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="status"
+            label="运单状态"
+            show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span v-if="scope.row.status == 1">未结束</span>
+              <span v-if="scope.row.status == 2">已结束运单</span>
+              <span v-if="scope.row.status == 3">已开发票</span>
+              <span v-if="scope.row.status == 4">开票中</span>
+              <span v-if="scope.row.status == 9">状态错误</span>
+            </template>
+          </el-table-column>
+           <el-table-column
+            prop="isHistory"
+            label="运单类型"
+            show-overflow-tooltip>
+          </el-table-column>
+
+          <el-table-column
+            label="开始运单创建时间"
+            show-overflow-tooltip>
+            <template slot-scope="scope" show-overflow-tooltip>
+              <span>{{scope.row.startBillCreateTime | fmtDate}}</span>
+            </template>
+          </el-table-column>
+
+          <el-table-column
+            prop="realDestAddr"
+            label="运单实际目的地"
+            show-overflow-tooltip>
+          </el-table-column>
+
+          <el-table-column
+            label="运单结束创建时间"
+            show-overflow-tooltip>
+            <template slot-scope="scope" show-overflow-tooltip>
+              <span>{{scope.row.endBillCreateTime | fmtDate}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="appKey"
+            label="appKey"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            prop="company"
+            label="公司名称"
+            show-overflow-tooltip>
+          </el-table-column>
+
+        </el-table>
+      </template>
+    <!-- 分页 -->
+      <div class="block">
+        <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="current"
+          :page-sizes="[6, 8, 10]"
+          :page-size="pagesize"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total">
+        </el-pagination>
+      </div>
+
+    </el-card>
+  </div>
+
+</template>
+
+<script type="text/javascript">
+export default{
+  data() {
+    return {
+      loading: true,
+      appKey: '',
+      num: '',
+      status: '',
+      isHistory: '',
+      plateNumber: '',
+      roletable: [],
+      optionone: [{
+          value: '1',
+          label: '实时运单'
+        }, {
+          value: '2',
+          label: '历史运单'
+      }],
+      optiontwo: [{
+          value: '1',
+          label: '未结束'
+        }, {
+          value: '2',
+          label: '已结束运单'
+        }, {
+          value: '3',
+          label: '已开发票'
+        }, {
+          value: '4',
+          label: '开票中'
+        }, {
+          value: '9',
+          label: '状态错误'
+        }],
+      formList: {
+        "roleId": "",
+        "permissionIds": []
+      },
+      current: 1,
+      pagesize: 10,
+      total: 0,
+    }
+  },
+  created() {
+    this.loadData();
+  },
+  methods: {
+    // 请求查询数据
+    async loadData() {
+      const response = await this.$http.get(`app/billRecord?&current=${this.current}&size=${this.pagesize}`);
+      if (response.data.code === 1) {
+        this.loading = false;
+        this.roletable = response.data.responseData.records;
+        this.total = response.data.responseData.total;
+      }
+    },
+    //查询
+    async queryLook() {
+      const response = await this.$http.get(`app/billRecord?&current=${this.current}&size=${this.pagesize}&appKey=${this.appKey}&num=${this.num}&status=${this.status}&isHistory=${this.isHistory}&plateNumber=${this.plateNumber}`);
+      if (response.data.code === 1) {
+        this.loading = false;
+        this.roletable = response.data.data.records;
+        this.total = response.data.data.total;
+      }
+    },
+    // 分页方法
+    handleSizeChange(val) {
+      this.pagesize = val;
+      if(this.appKey !== '' || this.num !== '' || this.status !== '' || this.isHistory !== '' || this.plateNumber !== '') {
+        this.queryLook();
+      }else{
+        this.loadData();
+      };
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      this.current = val;
+      if(this.appKey !== '' || this.num !== '' || this.status !== '' || this.isHistory !== '' || this.plateNumber !== '') {
+        this.queryLook();
+      }else{
+        this.loadData();
+      };
+      console.log(`当前页: ${val}`);
+    },
+  }
+};
+</script>
+
+<style scoped>
+.waybill {
+  border: 1px solid #d9d9d9;
+  border-radius: 10px;
+}
+.waybill .title {
+  font-size: 5px;
+  margin-bottom: 20px;
+}
+.waybill .top {
+  padding-top: 20px;
+  padding-left: 20px;
+}
+.waybill .text {
+  display: inline-block;
+  color: #000;
+  font-size: 16px ;
+  margin-left: 1%;
+}
+.waybill .input-demo {
+  display: inline-block;
+  width: 20%;
+  margin-left: 1%;
+}
+.waybill .block {
+  font-size: 5px;
+  text-align: center;
+  margin-top: 25px;
+  margin-bottom: 25px;
+}
+.waybill .el-dialog {
+  width: 60%;
+}
+.waybill .el-dialog__header, .el-dialog__body {
+  padding: 0 20px;
+}
+.waybill .tou {
+  font-size: 20px;
+  height: 30px;
+  line-height: 30px;
+  padding-top: 15px;
+}
+.waybill .line {
+  margin-top: 15px;
+  margin-bottom: 15px;
+  width: 100%;
+  height: 2px;
+  background-color: #d9d9d9;
+}
+.waybill .xinxi {
+  text-align: center;
+  margin: 15px auto;
+  font-size: 18px;
+}
+</style>

+ 247 - 0
src/views/sys/recharge.vue

@@ -0,0 +1,247 @@
+<template>
+  <div class="management-recharge">
+    <el-card>
+    <!-- 头部细节部分 -->
+    <div class="title">
+      <el-row class="bottom">
+        <el-col :span="24">
+          <div class="grid-content bg-purple-dark">
+            <!-- <el-button type="primary" @click="addRoleList = true">新增</el-button> -->
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+    <!-- 头部细节部分结束 -->
+    <!-- 表格部分 -->
+      <template>
+        <el-table
+          v-loading="loading"
+          ref="multipleTable"
+          :data="roletable"
+          border
+          tooltip-effect="dark"
+          style="width: 100%"
+          @select="handleSelectionChange">
+          <el-table-column
+            type="selection"
+            width="40"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            label="序号"
+            type="index"
+            width="40"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            prop="appKey"
+            label="appKey"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="company"
+            label="公司名称"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="roleName"
+            label="角色名称"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="price"
+            label="单价"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            prop="beforeBalance"
+            label="充值前金额"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            prop="money"
+            label="充值金额"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            label="创建时间"
+            show-overflow-tooltip>
+            <template slot-scope="scope" show-overflow-tooltip>
+              <span>{{scope.row.createTime | fmtDate}}</span>
+            </template>
+          </el-table-column>
+          <!-- <el-table-column
+            label="操作"
+            width="420">
+            <template slot-scope="scope" show-overflow-tooltip>
+              <el-button
+                @click="openEidtRole(scope.row)"
+                type="primary">修改
+              </el-button>
+              <el-button
+                @click="handleDelete(scope.row.id)"
+                type="primary">删除
+              </el-button>
+              <el-button
+                type="primary"
+                @click="lookCheck(scope.row.id)">查看权限
+              </el-button>
+              <el-button
+                type="primary"
+                @click="changeCheck(scope.row.id)">修改权限
+              </el-button>
+            </template>
+          </el-table-column> -->
+        </el-table>
+      </template>
+    <!-- 分页 -->
+      <div class="block">
+        <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="current"
+          :page-sizes="[6, 8, 10]"
+          :page-size="pagesize"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total">
+        </el-pagination>
+      </div>
+
+    </el-card>
+  </div>
+
+</template>
+
+<script type="text/javascript">
+export default{
+  data() {
+    return {
+      loading: true,
+      roletable: [],
+      formList: {
+        "roleId": "",
+        "permissionIds": []
+      },
+      current: 1,
+      pagesize: 10,
+      total: 0,
+    }
+  },
+  created() {
+    this.loadData();
+  },
+  methods: {
+    // 请求查询数据
+    async loadData() {
+      const response = await this.$http.get(`app/page/rechargeRecords?&current=${this.current}&size=${this.pagesize}`);
+      if (response.data.code === 1) {
+        this.loading = false;
+        this.roletable = response.data.responseData.records;
+        this.total = response.data.responseData.total;
+      }
+    },
+
+    // 添加角色
+    handleAddRole(formName) {
+      this.$refs[formName].validate(async (valid) => {
+        if(valid) {
+          const response = await this.$http.post(`app/role`, this.formRoleList);
+          if(response.data.code === 1) {
+            this.loadData();
+            this.addRoleList = false;
+            this.$message({
+              type: 'success',
+              message: '添加成功'
+            });
+          }else {
+            this.$message({
+              type: 'error',
+              message: '添加失败'
+            });
+          }
+        }else {
+          this.$message.error('请查看是否有选项未填写或填错项');
+          return false;
+        }
+      })
+    },
+
+    // 点击删除按钮
+    handleDelete(id) {
+      this.$confirm('是否删除该分类', '提示' ,{
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          const response = await this.$http.put(`app/role/${id}`);
+          if(response.data.code === 0) {
+            this.loadData();
+            this.$message({
+              type: 'success',
+              message: '删除成功'
+            });
+          }else {
+            this.$message({
+              type: 'error',
+              message: '删除失败'
+            });
+          }
+        }).catch(() => {
+          this.$message({ type: 'info', message: '已取消删除'});
+      });
+    },
+
+
+    // 分页方法
+    handleSizeChange(val) {
+      this.pagesize = val;
+      this.loadData();
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      this.current = val;
+      this.loadData();
+      console.log(`当前页: ${val}`);
+    },
+  }
+};
+</script>
+
+<style scoped>
+.management-recharge .title{
+  font-size: 5px;
+  margin-bottom: 20px;
+}
+.management-recharge .text {
+  font-size: 14px;
+  display: inline-block;
+}
+.management-recharge input {
+  margin-left: 10px;
+  margin-right: 10px;
+  width: 150px;
+}
+.management-recharge select {
+  border-radius: 3px;
+  width: 150px;
+}
+.management-recharge .middle {
+  margin-top: 20px;
+  margin-bottom:20px;
+}
+.management-recharge .bottom {
+  margin-bottom: 20px;
+}
+.management-recharge .el-button--primary {
+  background-color: #5885f7 !important;
+  border-color: #5885f7 !important;
+}
+.management-recharge .el-button {
+  padding: 4px 20px !important;
+}
+.management-recharge .block {
+  font-size: 5px;
+  text-align: center;
+  margin-top: 15px;
+}
+</style>

+ 419 - 0
src/views/sys/role.vue

@@ -0,0 +1,419 @@
+<template>
+  <div class="management-role">
+    <el-card>
+    <!-- 头部细节部分 -->
+    <div class="title">
+      <el-row class="bottom">
+        <el-col :span="24">
+          <div class="grid-content bg-purple-dark">
+            <el-button type="primary" @click="addRoleList = true">新增</el-button>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+    <!-- 头部细节部分结束 -->
+    <!-- 表格部分 -->
+      <template>
+        <el-table
+          v-loading="loading"
+          ref="multipleTable"
+          :data="roletable"
+          border
+          tooltip-effect="dark"
+          style="width: 100%"
+          @select="handleSelectionChange">
+          <el-table-column
+            type="selection"
+            width="55">
+          </el-table-column>
+          <el-table-column
+            label="序号"
+            type="index"
+            width="60">
+          </el-table-column>
+          <el-table-column
+            label="角色id"
+            prop="id"
+            width="100">
+          </el-table-column>
+          <el-table-column
+            prop="roleName"
+            label="角色名称">
+          </el-table-column>
+          <el-table-column
+            prop="role"
+            label="角色标识">
+          </el-table-column>
+
+          <el-table-column
+            label="操作"
+            width="420">
+            <template slot-scope="scope" show-overflow-tooltip>
+              <el-button
+                @click="openEidtRole(scope.row)"
+                type="primary">修改
+              </el-button>
+              <el-button
+                @click="handleDelete(scope.row.id)"
+                type="primary">删除
+              </el-button>
+              <el-button
+                type="primary"
+                @click="lookCheck(scope.row.id)">查看权限
+              </el-button>
+              <el-button
+                type="primary"
+                @click="changeCheck(scope.row.id)">修改权限
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </template>
+    <!-- 分页 -->
+      <div class="block">
+        <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="current"
+          :page-sizes="[6, 8, 10]"
+          :page-size="pagesize"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total">
+        </el-pagination>
+      </div>
+
+    <!-- 新增角色 -->
+    <el-dialog
+      @close="handleEditDialogClose"
+      title="新增"
+      :visible.sync="addRoleList"
+      style="font-size: 0px">
+      <el-form
+        label-position="right"
+        label-width="80px"
+        :rules="rules"
+        ref="ruleForm"
+        :model="formRoleList">
+        <el-form-item label="角色名称" prop="roleName">
+          <el-input v-model="formRoleList.roleName" auto-complete="off" placeholder="请输入角色名称"></el-input>
+        </el-form-item>
+        <el-form-item label="角色标识" prop="role">
+          <el-input v-model="formRoleList.role" auto-complete="off" placeholder="请输角色标识"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="addRoleList = false">取 消</el-button>
+        <el-button type="primary" @click="handleAddRole('ruleForm')">新 增</el-button>
+      </div>
+    </el-dialog>
+    <!-- 修改角色 -->
+    <el-dialog
+      @close="handleEditDialogClose"
+      title="修改"
+      :visible.sync="changeRoleList"
+      style="font-size: 0px">
+      <el-form
+        label-position="right"
+        label-width="80px"
+        :model="formChangeList">
+        <el-form-item label="角色Id">
+          <el-input v-model="formChangeList.id" auto-complete="off" placeholder="请输入角色Id"></el-input>
+        </el-form-item>
+        <el-form-item label="角色名称">
+          <el-input v-model="formChangeList.roleName" auto-complete="off" placeholder="请输入角色名称"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="changeRoleList = false">取 消</el-button>
+        <el-button type="primary" @click="handlechangeRole">修 改</el-button>
+      </div>
+    </el-dialog>
+    <!-- 查看权限 -->
+    <el-dialog
+      @close="handleEditDialogClose"
+      title="查看权限"
+      :visible.sync="openCheck"
+      style="font-size: 0px">
+      <template>
+        <el-checkbox-group v-model="haveRight">
+          <el-checkbox v-for="quanli in powerList" :label="quanli.id" :key="quanli.id">{{quanli.permissionName}}</el-checkbox>
+        </el-checkbox-group>
+      </template>
+    </el-dialog>
+
+    <!-- 修改权限 -->
+    <el-dialog
+      @close="handleEditDialogClose"
+      title="修改权限"
+      :visible.sync="openAmend"
+      style="font-size: 0px">
+      <template>
+        <el-checkbox-group v-model="haveRight" @change="handleCheckedCitiesChange">
+          <el-checkbox v-for="quanli in powerList" :label="quanli.id" :key="quanli.id">{{quanli.permissionName}}</el-checkbox>
+        </el-checkbox-group>
+      </template>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="openAmend = false">取 消</el-button>
+        <el-button type="primary" @click="changeMenu">修 改</el-button>
+      </div>
+    </el-dialog>
+    </el-card>
+  </div>
+
+</template>
+
+<script type="text/javascript">
+export default{
+  data() {
+    return {
+      loading: true,
+      rules: {
+        roleName: [
+          { required: true, message: '请输入角色名称', trigger: 'blur' },
+          { min: 3, max: 30, message: '长度在 3 到 30 个字符', trigger: 'blur' }
+        ],
+        role: [
+          { required: true, message: '请输入角色标识', trigger: 'blur' },
+        ],
+      },
+      haveRight: [],
+      powerList: [],
+      rolenames: '',
+      roletable: [],
+      multipleSelection: [],
+      formRoleList: {
+      "roleName": "",
+      "role": "",
+      },
+      formChangeList: {
+      "id": "",
+      "roleName": "",
+      },
+      formList: {
+        "roleId": "",
+        "permissionIds": []
+      },
+      current: 1,
+      pagesize: 10,
+      total: 0,
+      addRoleList: false,
+      changeRoleList: false,
+      openCheck: false,
+      openAmend: false,
+    }
+  },
+  created() {
+    this.loadData();
+    this.loadPower();
+  },
+  methods: {
+    handleCheckedCitiesChange(value) {
+      // var object = new Object();
+      // object.plateNum = this.plateNum;
+      // object.plateColor = this.plateColor;
+      // this.formList.vehicleList.push(object);
+      this.formList.permissionIds = value;
+    },
+    // 请求查询数据
+    async loadData() {
+      const response = await this.$http.get(`app/page/roles?&current=${this.current}&size=${this.pagesize}`);
+      if (response.data.code === 1) {
+        this.loading = false;
+        this.roletable = response.data.responseData.records;
+        this.total = response.data.responseData.total;
+      }
+    },
+    //请求所有权限
+    async loadPower() {
+      const response = await this.$http.get(`app/permissions`);
+      if (response.data.code === 1) {
+        this.powerList = response.data.responseData;
+      }
+    },
+    // 添加角色
+    handleAddRole(formName) {
+      this.$refs[formName].validate(async (valid) => {
+        if(valid) {
+          const response = await this.$http.post(`app/role`, this.formRoleList);
+          if(response.data.code === 1) {
+            this.loadData();
+            this.addRoleList = false;
+            this.$message({
+              type: 'success',
+              message: '添加成功'
+            });
+          }else {
+            this.$message({
+              type: 'error',
+              message: '添加失败'
+            });
+          }
+        }else {
+          this.$message.error('请查看是否有选项未填写或填错项');
+          return false;
+        }
+      })
+    },
+    // 获取查看权限ID
+    handleSelectionChange(val) {
+        this.multipleSelection = val;
+    },
+    // 打开修改角色的弹框
+    openEidtRole(user) {
+      this.changeRoleList = true;
+      this.formChangeList.id = user.id;
+      this.formChangeList.roleName = user.roleName;
+    },
+    // 修改角色
+    async handlechangeRole() {
+      const response = await this.$http.put(`app/role`, this.formChangeList);
+      if(response.data.code === 1) {
+        this.loadData();
+        this.changeRoleList = false;
+        this.$message({
+          type: 'success',
+          message: '修改成功'
+        });
+      }else {
+        this.$message({
+          type: 'error',
+          message: '修改失败'
+        });
+      }
+    },
+    // 点击删除按钮
+    handleDelete(id) {
+      this.$confirm('是否删除该分类', '提示' ,{
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          const response = await this.$http.put(`app/role/${id}`);
+          if(response.data.code === 0) {
+            this.loadData();
+            this.$message({
+              type: 'success',
+              message: '删除成功'
+            });
+          }else {
+            this.$message({
+              type: 'error',
+              message: '删除失败'
+            });
+          }
+        }).catch(() => {
+          this.$message({ type: 'info', message: '已取消删除'});
+      });
+    },
+    // 打开修改权限的弹框
+    async changeCheck(id) {
+      this.openAmend = true;
+      this.formList.roleId = id;
+      const response = await this.$http.get(`app/rolePermissions/${id}`);
+      if(response.data.code === 1) {
+        this.haveRight = response.data.responseData;
+      }
+    },
+    // 修改权限
+    async changeMenu() {
+      const response = await this.$http.post(`app/rolePermission`, this.formList);
+      if (response.data.code === 1) {
+        this.loadData();
+        this.openAmend = false;
+        this.$message({
+          type: 'success',
+          message: '修改成功'
+        });
+      }else {
+        this.$message({
+          type: 'error',
+          message: '修改失败'
+        });
+      }
+    },
+
+    // 查看权限
+    async lookCheck (id) {
+      this.openCheck = true;
+      const response = await this.$http.get(`app/rolePermissions/${id}`);
+      if(response.data.code === 1) {
+        this.haveRight = response.data.responseData;
+        // this.$refs.tree.setCheckedKeys([]);
+      }
+    },
+    //搜索单条数据
+    // async searchuser() {
+    //   const response = await this.$http.get(`role/page?${this.token}&roleName=${this.rolenames}&delFlag=${0}&current=${this.current}&size=${this.pagesize}`);
+    //   if(response.data.code === 0) {
+    //     this.loading = false;
+    //     this.roletable = response.data.data.records;
+    //     this.total = response.data.data.total;
+    //   }
+    // },
+    // 清空表单数据
+    handleEditDialogClose() {
+      // this.$refs.tree.setCheckedKeys([]);
+      this.haveRight = [];
+      for (var key in this.formRoleList) {
+        this.formRoleList[key] = '';
+      };
+      for (var key in this.formChangeList) {
+        this.formChangeList[key] = '';
+      };
+      for (var key in this.formList) {
+        this.formList[key] = '';
+      };
+    },
+    // 分页方法
+    handleSizeChange(val) {
+      this.pagesize = val;
+      this.loadData();
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      this.current = val;
+      this.loadData();
+      console.log(`当前页: ${val}`);
+    },
+  }
+};
+</script>
+
+<style scoped>
+.management-role .title{
+  font-size: 5px;
+  margin-bottom: 20px;
+}
+.management-role .text {
+  font-size: 14px;
+  display: inline-block;
+}
+.management-role input {
+  margin-left: 10px;
+  margin-right: 10px;
+  width: 150px;
+}
+.management-role select {
+  border-radius: 3px;
+  width: 150px;
+}
+.management-role .middle {
+  margin-top: 20px;
+  margin-bottom:20px;
+}
+.management-role .bottom {
+  margin-bottom: 20px;
+}
+.management-role .el-button--primary {
+  background-color: #5885f7 !important;
+  border-color: #5885f7 !important;
+}
+.management-role .el-button {
+  padding: 4px 20px !important;
+}
+.management-role .block {
+  font-size: 5px;
+  text-align: center;
+  margin-top: 15px;
+}
+</style>

+ 710 - 0
src/views/sys/user.vue

@@ -0,0 +1,710 @@
+<template>
+  <div class="system-user">
+    <!-- 头部细节部分 -->
+      <div class="title">
+        <el-row>
+          <el-col :span="24">
+            <div class="top">
+              <el-input  placeholder="用户名称" class="input-demo" v-model="username"></el-input>
+              <el-input  placeholder="公司名称" class="input-demo" v-model="company"></el-input>
+              <el-input  placeholder="appKey" class="input-demo" v-model="appKey"></el-input>
+            </div>
+          </el-col>
+        </el-row>
+
+         <el-row>
+          <el-col :span="24">
+            <div class="top">
+              <el-button type="success" style="margin-left: 1%;" @click="queryLook">查询</el-button>
+              <el-button type="success" style="margin-left: 1%;" @click="addUserList = true">添加</el-button>
+            </div>
+          </el-col>
+        </el-row>
+
+      </div>
+    <!-- 头部细节部分结束 -->
+    <!-- 表格部分 -->
+      <template>
+        <el-table
+          v-loading="loading"
+          ref="multipleTable"
+          :data="usertable"
+          border
+          tooltip-effect="dark">
+          <el-table-column
+            label="用户名"
+            prop="username"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="appKey"
+            label="appKey"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="company"
+            label="公司名称"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            prop="contactName"
+            label="联系人"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="telephone"
+            label="手机号码"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="roleName"
+            label="角色名称"
+            show-overflow-tooltip>
+          </el-table-column>
+           <el-table-column
+            prop="price"
+            label="单价"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            prop="balance"
+            label="余额"
+            show-overflow-tooltip>
+          </el-table-column>
+          <el-table-column
+            label="状态"
+            show-overflow-tooltip>
+             <template slot-scope="scope">
+              <span v-if="scope.row.status == 1">正常</span>
+              <span v-else-if="scope.row.status == 2" style="color: red">锁定</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="操作"
+            width="320">
+            <template slot-scope="scope" show-overflow-tooltip>
+              <span style="cursor:pointer;" @click="openChange(scope.row)">修改</span>
+              <span style="margin-left: 10px; cursor:pointer;" @click="openisLock(scope.row)">修改状态</span>
+              <!-- userType = 2 的可以充值 -->
+              <span style="margin-left: 10px; cursor:pointer;" @click="openMoney(scope.row.id)">充值</span>
+              <span style="margin-left: 10px; cursor:pointer;" @click="openRole(scope.row.id)">用户添加角色</span>
+              <span style="margin-left: 10px; cursor:pointer; color: red;" @click="Delete(scope.row.id)">删除</span>
+            </template>
+          </el-table-column>
+        </el-table>
+      </template>
+
+    <!-- 分页 -->
+      <div class="block">
+        <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="current"
+        :page-sizes="[6, 8, 10]"
+        :page-size="pagesize"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="total">
+        </el-pagination>
+      </div>
+
+    <!-- 新增用户 -->
+      <el-dialog
+        @close="handleEditDialogClose"
+        :visible.sync="addUserList"
+        style="font-size: 0px;">
+        <div class="tou">用户--添加</div>
+        <div class="line"></div>
+        <el-form
+          label-position="right"
+          label-width="80px"
+          :rules="rules"
+          ref="ruleForm"
+          :model="formUserList">
+          <el-form-item label="用户类型">
+            <el-select v-model="userType" placeholder="用户类型" style="width: 100%">
+              <el-option
+                v-for="item in option"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+
+          <template v-if="this.userType == 1">
+            <el-form-item label="用户名" prop="username">
+              <el-input v-model="formUserList.username" auto-complete="off" placeholder="请输入用户名"></el-input>
+            </el-form-item>
+
+            <el-form-item label="密码" prop="password">
+              <el-input v-model="formUserList.password" auto-complete="off" placeholder="请输入密码"></el-input>
+            </el-form-item>
+
+            <el-form-item label="公司名称" prop="company">
+              <el-input v-model="formUserList.company" auto-complete="off" placeholder="请输入公司名称"></el-input>
+            </el-form-item>
+
+            <el-form-item label="联系人" prop="contactName">
+              <el-input v-model="formUserList.contactName" auto-complete="off" placeholder="请输入密码"></el-input>
+            </el-form-item>
+
+            <el-form-item label="手机号" prop="telephone">
+              <el-input v-model="formUserList.telephone" auto-complete="off" placeholder="请输入手机号"></el-input>
+            </el-form-item>
+          </template>
+
+           <template v-if="this.userType == 2">
+            <el-form-item label="appKey" prop="appKey">
+              <el-input v-model="formList.appKey" auto-complete="off" placeholder="请输入appKey"></el-input>
+            </el-form-item>
+
+            <el-form-item label="公司名称" prop="company">
+              <el-input v-model="formList.company" auto-complete="off" placeholder="请输入公司名称"></el-input>
+            </el-form-item>
+
+            <el-form-item label="联系人" prop="contactName">
+              <el-input v-model="formList.contactName" auto-complete="off" placeholder="请输入密码"></el-input>
+            </el-form-item>
+
+            <el-form-item label="手机号" prop="telephone">
+              <el-input v-model="formList.telephone" auto-complete="off" placeholder="请输入手机号"></el-input>
+            </el-form-item>
+
+            <el-form-item label="单价" prop="price">
+              <el-input v-model="formList.price" auto-complete="off" placeholder="请输入单价"></el-input>
+            </el-form-item>
+          </template>
+
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="addUserList = false" type="info">取 消</el-button>
+          <el-button type="primary" @click="addData('ruleForm')">新 增</el-button>
+        </div>
+      </el-dialog>
+    <!-- 修改用户 -->
+      <el-dialog
+        @close="handleEditDialogClose"
+        :visible.sync="changeUser"
+        style="font-size: 0px;">
+        <div class="tou">用户--修改</div>
+        <div class="line"></div>
+        <el-form
+          label-position="right"
+          label-width="80px"
+          :model="formChangeList">
+
+          <el-form-item label="密码" prop="password">
+            <el-input v-model="formChangeList.password" auto-complete="off" placeholder="请输入密码"></el-input>
+          </el-form-item>
+
+          <el-form-item label="公司名称" prop="company">
+            <el-input v-model="formChangeList.company" auto-complete="off" placeholder="请输入公司名称"></el-input>
+          </el-form-item>
+
+          <el-form-item label="联系人" prop="contactName">
+            <el-input v-model="formChangeList.contactName" auto-complete="off" placeholder="请输入密码"></el-input>
+          </el-form-item>
+
+          <el-form-item label="手机号" prop="telephone">
+            <el-input v-model="formChangeList.telephone" auto-complete="off" placeholder="请输入手机号"></el-input>
+          </el-form-item>
+
+          <el-form-item label="单价" prop="price">
+            <el-input v-model="formChangeList.price" auto-complete="off" placeholder="请输入单价"></el-input>
+          </el-form-item>
+
+          <el-form-item label="用户状态">
+            <el-select v-model="formChangeList.status" placeholder="用户状态" style="width: 100%">
+              <el-option
+                v-for="item in optionone"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="changeUser = false" type="info">取 消</el-button>
+          <el-button type="primary" @click="changeData">修 改</el-button>
+        </div>
+      </el-dialog>
+    <!-- 修改锁定和解锁状态 -->
+      <el-dialog
+        @close="handleEditDialogClose"
+        :visible.sync="changelocks"
+        style="font-size: 0px;">
+        <div class="tou">用户--修改状态</div>
+        <div class="line"></div>
+        <el-form
+          label-position="right"
+          label-width="80px"
+          :model="formStateList">
+          <el-form-item label="状态">
+            <el-select v-model="formStateList.status" placeholder="请选择状态" style="width: 100%">
+              <el-option
+                v-for="item in optionone"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="changelocks = false" type="info">取 消</el-button>
+          <el-button type="primary" @click="changeLock">修 改</el-button>
+        </div>
+      </el-dialog>
+    <!-- 给用户添加角色 -->
+      <el-dialog
+        @close="handleEditDialogClose"
+        :visible.sync="changeRole"
+        style="font-size: 0px;">
+        <div class="tou">用户--添加角色</div>
+        <div class="line"></div>
+        <el-form
+          label-position="right"
+          label-width="80px"
+          :model="formRoList">
+          <el-form-item label="角色">
+            <el-select v-model="formRoList.roleId" placeholder="请选择角色" style="width: 100%">
+              <el-option
+                v-for="item in optiontwo"
+                :key="item.id"
+                :label="item.roleName"
+                :value="item.id">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="changeRole = false" type="info">取 消</el-button>
+          <el-button type="primary" @click="userAddRole">修 改</el-button>
+        </div>
+      </el-dialog>
+    <!-- 充值 -->
+      <el-dialog
+        @close="handleEditDialogClose"
+        :visible.sync="changeMoney"
+        style="font-size: 0px;">
+        <div class="tou">用户--充值</div>
+        <div class="line"></div>
+        <el-form
+          label-position="right"
+          label-width="80px"
+          :model="formMoneyList">
+          <el-form-item label="充值金额">
+            <el-input v-model="formMoneyList.money" auto-complete="off" placeholder="请输入充值金额"></el-input>
+          </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button @click="changeMoney = false" type="info">取 消</el-button>
+          <el-button type="primary" @click="userChangeMoney">修 改</el-button>
+        </div>
+      </el-dialog>
+
+  </div>
+</template>
+
+<script type="text/javascript">
+import axios from 'axios';
+export default{
+  data() {
+    return {
+      loading: true,
+      // rules: {
+      //     userType: [
+      //       { required: true, message: '请选择用户类型', trigger: 'change' }
+      //     ],
+      //     username: [
+      //       { required: true, message: '请输入用户名', trigger: 'blur' },
+      //       { min: 3, max: 15, message: '长度在 3 到 15 个字符', trigger: 'blur' }
+      //     ],
+      //     password: [
+      //       { required: true, message: '请输入密码', trigger: 'blur' },
+      //       { min: 6, max: 16, message: '长度在 6 到 16 个字符', trigger: 'blur' }
+      //     ],
+      //     company: [
+      //       { required: true, message: '请输入公司名称', trigger: 'blur' },
+      //       { min: 2, max: 25, message: '长度在 2 到 25 个字符', trigger: 'blur' }
+      //     ],
+      //     contactName: [
+      //       { required: true, message: '请输入联系人', trigger: 'blur' },
+      //       { min: 2, max: 25, message: '长度在 2 到 25 个字符', trigger: 'blur' }
+      //     ],
+      //     telephone: [
+      //       { required: true, message: '请输入手机号', trigger: 'blur' },
+      //       { min: 11, max: 11, message: '长度在 11 个字符', trigger: 'blur' }
+      //     ],
+      //     price: [
+      //       { required: true, message: '请输入单价', trigger: 'blur' },
+      //       { min: 2, max: 15, message: '长度在 2 到 15 个字符', trigger: 'blur' }
+      //     ],
+
+      // },
+      option: [{
+            value: '1',
+            label: '平台用户'
+        }, {
+            value: '2',
+            label: '接口用户'
+      }],
+      username: '',
+      company: '',
+      appKey: '',
+      usertable: [],
+      roleList: [],
+      formUserList: {
+        "username": "",
+        "appKey": "INTERFACE_USER",
+        "password": "",
+        "contactName": "",
+        "telephone": "",
+        "userType": "1",
+        "company": ""
+      },
+      formList: {
+        "username": "ADMINISTRATOR_USER",
+        "password": "123456",
+        "appKey": "",
+        "contactName": "",
+        "telephone": "",
+        "price": "",
+        "userType": "2",
+        "company": ""
+      },
+      formChangeList: {
+        "id": "",
+        "password": "",
+        "company": "",
+        "contactName": "",
+        "telephone": "",
+        "price": "",
+        "status": ""
+      },
+      formStateList: {
+        "id": "",
+        "status": ""
+      },
+      formRoList: {
+        "userId": "",
+        "roleId": ""
+      },
+      formMoneyList: {
+        "userId": "",
+        "money": ""
+      },
+      optionone: [{
+          value: '1',
+          label: '正常'
+        }, {
+          value: '2',
+          label: '锁定'
+      }],
+      optiontwo: [],
+      current: 1,
+      pagesize: 10,
+      // 总共有多少条数据
+      total: 0,
+      addUserList: false,
+      changeUser: false,
+      changelocks: false,
+      changeRole: false,
+      changeMoney: false
+    }
+  },
+  created() {
+    this.loadData();
+    this.loadRole();
+  },
+  methods: {
+    // 列表展示
+    async loadData() {
+      const response = await this.$http.get(`app/page/users?&current=${this.current}&size=${this.pagesize}`);
+      if (response.data.code === 1) {
+        this.loading = false;
+        this.usertable = response.data.responseData.records;
+        this.total = response.data.responseData.total;
+      }
+    },
+    //获取角色
+    async loadRole() {
+      const response = await this.$http.get(`app/page/roles`);
+      if (response.data.code === 1) {
+        this.optiontwo = response.data.responseData.records;
+      }
+    },
+
+    //查询
+    async queryLook() {
+      const response = await this.$http.get(`app/page/users?&current=${this.current}&size=${this.pagesize}&appKey=${this.appKey}&username=${this.username}&company=${this.company}`);
+      if (response.data.code === 1) {
+        this.loading = false;
+        this.usertable = response.data.responseData.records;
+        this.total = response.data.responseData.total;
+      }
+    },
+    // 新增用户
+    addData(formName) {
+      this.$refs[formName].validate(async (valid) => {
+        if(valid) {
+          if(this.userType == 1) {
+            // console.log(1111111)
+            const response = await this.$http.post(`app/user`, this.formUserList);
+            if(response.data.code === 1) {
+              this.loadData();
+              this.addUserList = false;
+              this.$message({
+                type: 'success',
+                message: '添加成功'
+              });
+            }else {
+              this.$message({
+                type: 'error',
+                message: '添加失败'
+              });
+            }
+          } else if(this.userType == 2) {
+            // console.log(22222)
+            const response = await this.$http.post(`app/user`, this.formList);
+            if(response.data.code === 1) {
+              this.loadData();
+              this.addUserList = false;
+              this.$message({
+                type: 'success',
+                message: '添加成功'
+              });
+            }else {
+              this.$message({
+                type: 'error',
+                message: '添加失败'
+              });
+            }
+          }
+        }else {
+          this.$message.error('请查看是否有选项未填写或填错项');
+          return false;
+        }
+      })
+    },
+    // 打开修改并赋予信息
+    openChange(user) {
+      this.changeUser = true;
+      this.formChangeList.id = user.id;
+      this.formChangeList.password = user.password;
+      this.formChangeList.company = user.company;
+      this.formChangeList.contactName = user.contactName;
+      this.formChangeList.telephone = user.telephone;
+      this.formChangeList.price = user.price;
+      // this.formChangeList.status = user.status;
+    },
+    // 修改用户
+    async changeData() {
+      const response = await this.$http.put(`app/user`, this.formChangeList);
+      if(response.data.code === 1) {
+        this.loadData();
+        this.changeUser = false;
+        this.$message({
+          type: 'success',
+          message: '修改成功'
+        });
+      }else {
+        this.$message({
+          type: 'error',
+          message: '修改失败'
+        });
+      }
+    },
+     // 点击删除按钮
+    Delete(id) {
+      this.$confirm('是否删除该用户', '提示' ,{
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          const response = await this.$http.put(`app/user/${id}`);
+          if(response.data.code === 1) {
+            this.loadData();
+            this.$message({
+              type: 'success',
+              message: '删除成功'
+            });
+          }else {
+            this.$message({
+              type: 'error',
+              message: '删除失败'
+            });
+          }
+        }).catch(() => {
+           this.$message({ type: 'info', message: '已取消删除'});
+      });
+    },
+
+    // 打开修改状态弹框
+    openisLock(user) {
+      this.changelocks = true;
+      this.formStateList.id = user.id;
+    },
+    // 修改用户状态
+    async changeLock() {
+      const response = await this.$http.put(`app/user`, this.formStateList);
+      if(response.data.code === 1) {
+        this.loadData();
+        this.changelocks = false;
+        this.$message({
+          type: 'success',
+          message: '修改成功'
+        });
+      }else {
+        this.$message({
+          type: 'error',
+          message: '修改失败'
+        });
+      }
+    },
+    //打开用户添加角色
+    openRole(id) {
+      this.changeRole= true;
+      this.formRoList.userId = id;
+      // console.log(this.formRoleList.userId);
+    },
+    //用户添加角色
+    async userAddRole() {
+      const response = await this.$http.post(`app/userRolePermission`, this.formRoList);
+      if(response.data.code === 1) {
+        this.loadData();
+        this.changeRole = false;
+        this.$message({
+          type: 'success',
+          message: '添加成功'
+        });
+      }else {
+        this.$message({
+          type: 'error',
+          message: '添加失败'
+        });
+      }
+    },
+    // 充值打开弹框
+    openMoney(id) {
+      this.changeMoney = true;
+      this.formMoneyList.userId = id + '';
+    },
+    //充值
+    async userChangeMoney() {
+      const response = await this.$http.post(`app/recharge`, this.formMoneyList);
+      if(response.data.code === 1) {
+        this.loadData();
+        this.changeMoney = false;
+        this.$message({
+          type: 'success',
+          message: '充值成功'
+        });
+      }else {
+        this.$message({
+          type: 'error',
+          message: '充值失败'
+        });
+      }
+    },
+
+    // 清空表单数据
+    handleEditDialogClose() {
+      for (var key in this.formUserList) {
+        this.formUserList[key] = '';
+      };
+      for (var key in this.formChangeList) {
+        this.formChangeList[key] = '';
+      };
+      for (var key in this.formStateList) {
+        this.formStateList[key] = '';
+      };
+      for (var key in formRoleList) {
+        formRoleList[key] = '';
+      };
+      for (var key in formMoneyList) {
+        formMoneyList[key] = '';
+      };
+
+    },
+    // 分页方法
+    handleSizeChange(val) {
+      this.pagesize = val;
+      if(this.username !== '' || this.company !== '' || this.appKey !== '') {
+        this.queryLook();
+      }else{
+        this.loadData();
+      };
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      this.current = val;
+      if(this.username !== '' || this.company !== '' || this.appKey !== '') {
+        this.queryLook();
+      }else{
+        this.loadData();
+      };
+      console.log(`当前页: ${val}`);
+    },
+
+  }
+};
+</script>
+
+<style>
+.system-user {
+  border: 1px solid #d9d9d9;
+  border-radius: 10px;
+}
+.system-user .title {
+  font-size: 5px;
+  margin-bottom: 20px;
+}
+.system-user .top {
+  padding-top: 20px;
+  padding-left: 20px;
+}
+.system-user .text {
+  display: inline-block;
+  color: #000;
+  font-size: 16px ;
+  margin-left: 1%;
+}
+.system-user .input-demo {
+  display: inline-block;
+  width: 20%;
+  margin-left: 1%;
+}
+.system-user .block {
+  font-size: 5px;
+  text-align: center;
+  margin-top: 25px;
+  margin-bottom: 25px;
+}
+.system-user .el-dialog {
+  width: 60%;
+}
+.system-user .el-dialog__header, .el-dialog__body {
+  padding: 0 20px;
+}
+.system-user .tou {
+  font-size: 20px;
+  height: 30px;
+  line-height: 30px;
+  padding-top: 15px;
+}
+.system-user .line {
+  margin-top: 15px;
+  margin-bottom: 15px;
+  width: 100%;
+  height: 2px;
+  background-color: #d9d9d9;
+}
+.system-user .xinxi {
+  text-align: center;
+  margin: 15px auto;
+  font-size: 18px;
+}
+</style>

+ 0 - 0
static/.gitkeep