diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index 26c173e..0000000
--- a/.babelrc
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "presets": [
- ["env", {
- "modules": false,
- "targets": {
- "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
- }
- }],
- "stage-2"
- ],
- "plugins":["transform-vue-jsx", "transform-runtime"],
- "env": {
- "development":{
- "plugins": ["dynamic-import-node"]
- }
- }
-}
diff --git a/.editorconfig b/.editorconfig
index ea6e20f..3454886 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,4 +1,4 @@
-# http://editorconfig.org
+# https://editorconfig.org
root = true
[*]
diff --git a/.env.development b/.env.development
new file mode 100644
index 0000000..d9a2132
--- /dev/null
+++ b/.env.development
@@ -0,0 +1,8 @@
+ENV = 'development'
+
+# 接口地址
+VUE_APP_BASE_API = 'http://localhost:8000'
+VUE_APP_WS_API = 'ws://localhost:8000'
+
+# 是否启用 babel-plugin-dynamic-import-node插件
+VUE_CLI_BABEL_TRANSPILE_MODULES = true
diff --git a/.env.production b/.env.production
new file mode 100644
index 0000000..3556336
--- /dev/null
+++ b/.env.production
@@ -0,0 +1,5 @@
+ENV = 'production'
+
+# 接口地址
+VUE_APP_BASE_API = 'https://yshopapi.dayouqiantu.cn'
+VUE_APP_WS_API = 'ws://yshopapi.dayouqiantu.cn'
diff --git a/.eslintignore b/.eslintignore
index e3a4037..e6529fc 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,3 +1,4 @@
build/*.js
-config/*.js
src/assets
+public
+dist
diff --git a/.eslintrc.js b/.eslintrc.js
index 0e5c28a..c977505 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -21,7 +21,10 @@ module.exports = {
"allowFirstLine": false
}
}],
+ "vue/singleline-html-element-content-newline": "off",
+ "vue/multiline-html-element-content-newline":"off",
"vue/name-property-casing": ["error", "PascalCase"],
+ "vue/no-v-html": "off",
'accessor-pairs': 2,
'arrow-spacing': [2, {
'before': true,
@@ -44,7 +47,7 @@ module.exports = {
'curly': [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
- 'eqeqeq': [2, 'allow-null'],
+ 'eqeqeq': ["error", "always", {"null": "ignore"}],
'generator-star-spacing': [2, {
'before': true,
'after': true
@@ -73,7 +76,7 @@ module.exports = {
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
- 'no-control-regex': 2,
+ 'no-control-regex': 0,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
@@ -193,4 +196,3 @@ module.exports = {
'array-bracket-spacing': [2, 'never']
}
}
-
diff --git a/.gitignore b/.gitignore
index 571f0a6..78a752d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,8 +4,11 @@ dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
-package-lock.json
-yarn.lock
+**/*.log
+
+tests/**/coverage/
+tests/e2e/reports
+selenium-debug.log
# Editor directories and files
.idea
@@ -14,3 +17,7 @@ yarn.lock
*.ntvs*
*.njsproj
*.sln
+*.local
+
+package-lock.json
+yarn.lock
diff --git a/.postcssrc.js b/.postcssrc.js
deleted file mode 100644
index eee3e92..0000000
--- a/.postcssrc.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// 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": {}
- }
-}
diff --git a/.travis.yml b/.travis.yml
index 16574d9..f4be7a0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,5 @@
language: node_js
-node_js: stable
+node_js: 10
script: npm run test
notifications:
email: false
diff --git a/LICENSE b/LICENSE
index 91e3c25..78a36cb 100644
--- a/LICENSE
+++ b/LICENSE
@@ -176,7 +176,7 @@ recommend that a file or class name and description of purpose be included on
the same "printed page" as the copyright notice for easier identification within
third-party archives.
- Copyright 2018 Elune
+ Copyright 2019 Zheng Jie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -188,4 +188,4 @@ third-party archives.
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
+ limitations under the License.
diff --git a/README.md b/README.md
index 7f2c822..eee5fee 100644
--- a/README.md
+++ b/README.md
@@ -147,6 +147,12 @@ yshop基于当前流行技术组合的前后端分离商城系统: SpringBoot2
- 2.订单新增快递查询
- 1.4.3版本,后台图标更新,后台模块重新拆分,物流快递单独管理,导出最新sql
- 1.4.4版本,新增模板消息通知、H5端商家管理发货修改及其列表时间显示修复
+- yshop1.7 发布更新如下:
+ - 1.后台升級eladmin2.4(前端,后台权限,代码生成器等重构,新增服务器监控等)
+ - 2.修复商品分类一些问题
+ - 3.修复redis缓存问题
+ - 4.修复菜单控制台报error问题
+
#### 反馈交流
diff --git a/babel.config.js b/babel.config.js
new file mode 100644
index 0000000..804632a
--- /dev/null
+++ b/babel.config.js
@@ -0,0 +1,11 @@
+const plugins = ['@vue/babel-plugin-transform-vue-jsx']
+// 生产环境移除console
+if (process.env.NODE_ENV === 'production') {
+ plugins.push('transform-remove-console')
+}
+module.exports = {
+ plugins: plugins,
+ presets: [
+ '@vue/app'
+ ]
+}
diff --git a/build/build.js b/build/build.js
deleted file mode 100644
index 34c71a5..0000000
--- a/build/build.js
+++ /dev/null
@@ -1,67 +0,0 @@
-'use strict'
-require('./check-versions')()
-
-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')
-var connect = require('connect')
-var serveStatic = require('serve-static')
-
-const spinner = ora(
- 'building for ' + process.env.env_config + ' environment...'
-)
-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,
- 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"
- )
- )
-
- if (process.env.npm_config_preview) {
- const port = 9526
- const host = 'http://localhost:' + port
- const basePath = config.build.assetsPublicPath
- const app = connect()
-
- app.use(
- basePath,
- serveStatic('./dist', {
- index: ['index.html', '/']
- })
- )
-
- app.listen(port, function() {
- console.log(
- chalk.green(`> Listening at http://localhost:${port}${basePath}`)
- )
- })
- }
- })
-})
diff --git a/build/check-versions.js b/build/check-versions.js
deleted file mode 100644
index c29c7e7..0000000
--- a/build/check-versions.js
+++ /dev/null
@@ -1,62 +0,0 @@
-'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:'
- )
- )
-
- for (let i = 0; i < warnings.length; i++) {
- const warning = warnings[i]
- console.log(' ' + warning)
- }
-
- process.exit(1)
- }
-}
diff --git a/build/utils.js b/build/utils.js
deleted file mode 100644
index c96d093..0000000
--- a/build/utils.js
+++ /dev/null
@@ -1,108 +0,0 @@
-'use strict'
-const path = require('path')
-const config = require('../config')
-const MiniCssExtractPlugin = require('mini-css-extract-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 = []
-
- // Extract CSS when that option is specified
- // (which is the case during production build)
- if (options.extract) {
- loaders.push(MiniCssExtractPlugin.loader)
- } else {
- loaders.push('vue-style-loader')
- }
-
- loaders.push(cssLoader)
-
- if (options.usePostCSS) {
- loaders.push(postcssLoader)
- }
-
- if (loader) {
- loaders.push({
- loader: loader + '-loader',
- options: Object.assign({}, loaderOptions, {
- sourceMap: options.sourceMap
- })
- })
- }
-
- return loaders
- }
- // https://vue-loader.vuejs.org/en/configurations/extract-css.html
- return {
- css: generateLoaders(),
- postcss: generateLoaders(),
- less: generateLoaders('less'),
- sass: generateLoaders('sass', {
- indentedSyntax: true
- }),
- scss: generateLoaders('sass'),
- stylus: generateLoaders('stylus'),
- styl: generateLoaders('stylus')
- }
-}
-
-// Generate loaders for standalone style files (outside of .vue)
-exports.styleLoaders = function(options) {
- const output = []
- const loaders = exports.cssLoaders(options)
-
- for (const extension in loaders) {
- const loader = loaders[extension]
- output.push({
- test: new RegExp('\\.' + extension + '$'),
- use: loader
- })
- }
-
- return output
-}
-
-exports.createNotifierCallback = () => {
- const notifier = require('node-notifier')
-
- return (severity, errors) => {
- if (severity !== 'error') return
-
- const error = errors[0]
- const filename = error.file && error.file.split('!').pop()
-
- notifier.notify({
- title: packageConfig.name,
- message: severity + ': ' + error.name,
- subtitle: filename || '',
- icon: path.join(__dirname, 'logo.png')
- })
- }
-}
diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js
deleted file mode 100644
index 5496c93..0000000
--- a/build/vue-loader.conf.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict'
-
-module.exports = {
- //You can set the vue-loader configuration by yourself.
-}
diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js
deleted file mode 100644
index cdfb054..0000000
--- a/build/webpack.base.conf.js
+++ /dev/null
@@ -1,122 +0,0 @@
-'use strict'
-const path = require('path')
-const utils = require('./utils')
-const config = require('../config')
-const { VueLoaderPlugin } = require('vue-loader')
-
-const os = require('os');
-const HappyPack = require('happypack');
-const happThreadPool = HappyPack.ThreadPool({size: os.cpus().length});
-
-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 = {
- cache: true,
- context: path.resolve(__dirname, '../'),
- entry:["babel-polyfill","./src/main.js"],
- output: {
- path: config.build.assetsRoot,
- filename: '[name].js',
- publicPath:
- process.env.NODE_ENV === 'production'
- ? config.build.assetsPublicPath
- : config.dev.assetsPublicPath
- },
- resolve: {
- modules: [path.resolve(__dirname, '../node_modules')],
- extensions: ['.js', '.vue', '.json'],
- alias: {
- '@': resolve('src'),
- api: path.resolve(__dirname, '../src/api')
- }
- },
- module: {
- rules: [
- ...(config.dev.useEslint ? [createLintingRule()] : []),
- {
- test: /\.vue$/,
- loader: 'vue-loader',
- options: {
- loaders: {
- js: 'happypack/loader?id=js' // 将loader换成happypack
- }
- }
- },
- {
- test: /\.js$/,
- loader: ['happypack/loader?id=js'], // 将loader换成happypack
- include: [
- resolve('src')
- ], // src是项目开发的目录
- exclude: [path.resolve('../node_modules')] // 不需要编译node_modules下的js
- },
- {
- test: /\.svg$/,
- loader: 'svg-sprite-loader',
- include: [resolve('src/icons')],
- options: {
- symbolId: 'icon-[name]'
- }
- },
- {
- test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
- loader: 'url-loader',
- exclude: [resolve('src/icons')],
- 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]')
- }
- }
- ]
- },
- plugins: [
- new VueLoaderPlugin(),
- new HappyPack({
- id: 'js',
- cache: true,
- loaders: ['babel-loader?cacheDirectory=true'],
- threadPool: happThreadPool
- })
- ],
- 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'
- }
-}
diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js
deleted file mode 100644
index 26a5584..0000000
--- a/build/webpack.dev.conf.js
+++ /dev/null
@@ -1,98 +0,0 @@
-'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 HtmlWebpackPlugin = require('html-webpack-plugin')
-const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
-const portfinder = require('portfinder')
-
-function resolve(dir) {
- return path.join(__dirname, '..', dir)
-}
-
-const HOST = process.env.HOST
-const PORT = process.env.PORT && Number(process.env.PORT)
-
-const devWebpackConfig = merge(baseWebpackConfig, {
- mode: 'development',
- 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: true,
- hot: true,
- 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(),
- // https://github.com/ampedandwired/html-webpack-plugin
- new HtmlWebpackPlugin({
- filename: 'index.html',
- template: 'index.html',
- inject: true,
- favicon: resolve('favicon.ico'),
- title: 'vue-element-admin',
- templateParameters: {
- BASE_URL: config.dev.assetsPublicPath + config.dev.assetsSubDirectory,
- },
- }),
- ]
-})
-
-module.exports = new Promise((resolve, reject) => {
- portfinder.basePort = process.env.PORT || config.dev.port
- portfinder.getPort((err, port) => {
- if (err) {
- reject(err)
- } else {
- // publish the new Port, necessary for e2e tests
- process.env.PORT = port
- // add port to devServer config
- devWebpackConfig.devServer.port = port
-
- // Add FriendlyErrorsPlugin
- devWebpackConfig.plugins.push(
- new FriendlyErrorsPlugin({
- compilationSuccessInfo: {
- messages: [
- `Your application is running here: http://${
- devWebpackConfig.devServer.host
- }:${port}`
- ]
- },
- onErrors: config.dev.notifyOnErrors
- ? utils.createNotifierCallback()
- : undefined
- })
- )
-
- resolve(devWebpackConfig)
- }
- })
-})
diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js
deleted file mode 100644
index 946a134..0000000
--- a/build/webpack.prod.conf.js
+++ /dev/null
@@ -1,188 +0,0 @@
-'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 ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
-const MiniCssExtractPlugin = require('mini-css-extract-plugin')
-const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
-const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
-
-function resolve(dir) {
- return path.join(__dirname, '..', dir)
-}
-
-const env = require('../config/' + process.env.env_config + '.env')
-
-// For NamedChunksPlugin
-const seen = new Set()
-const nameLength = 4
-
-const webpackConfig = merge(baseWebpackConfig, {
- mode: 'production',
- 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:8].js'),
- chunkFilename: utils.assetsPath('js/[name].[chunkhash:8].js')
- },
- plugins: [
- // http://vuejs.github.io/vue-loader/en/workflow/production.html
- new webpack.DefinePlugin({
- 'process.env': env
- }),
- // extract css into its own file
- new MiniCssExtractPlugin({
- filename: utils.assetsPath('css/[name].[contenthash:8].css'),
- chunkFilename: utils.assetsPath('css/[name].[contenthash:8].css')
- }),
- // generate dist index.html with correct asset hash for caching.
- // you can customize output by editing /index.html
- // see https://github.com/ampedandwired/html-webpack-plugin
- new HtmlWebpackPlugin({
- filename: config.build.index,
- template: 'index.html',
- inject: true,
- favicon: resolve('favicon.ico'),
- title: 'vue-element-admin',
- templateParameters: {
- BASE_URL: config.build.assetsPublicPath + config.build.assetsSubDirectory,
- },
- minify: {
- removeComments: true,
- collapseWhitespace: true,
- removeAttributeQuotes: true
- // more options:
- // https://github.com/kangax/html-minifier#options-quick-reference
- }
- // default sort mode uses toposort which cannot handle cyclic deps
- // in certain cases, and in webpack 4, chunk order in HTML doesn't
- // matter anyway
- }),
- new ScriptExtHtmlWebpackPlugin({
- //`runtime` must same as runtimeChunk name. default is `runtime`
- inline: /runtime\..*\.js$/
- }),
- // keep chunk.id stable when chunk has no name
- new webpack.NamedChunksPlugin(chunk => {
- if (chunk.name) {
- return chunk.name
- }
- const modules = Array.from(chunk.modulesIterable)
- if (modules.length > 1) {
- const hash = require('hash-sum')
- const joinedHash = hash(modules.map(m => m.id).join('_'))
- let len = nameLength
- while (seen.has(joinedHash.substr(0, len))) len++
- seen.add(joinedHash.substr(0, len))
- return `chunk-${joinedHash.substr(0, len)}`
- } else {
- return modules[0].id
- }
- }),
- // keep module.id stable when vender modules does not change
- new webpack.HashedModuleIdsPlugin(),
- // copy custom static assets
- new CopyWebpackPlugin([
- {
- from: path.resolve(__dirname, '../static'),
- to: config.build.assetsSubDirectory,
- ignore: ['.*']
- }
- ])
- ],
- optimization: {
- splitChunks: {
- chunks: 'all',
- cacheGroups: {
- libs: {
- name: 'chunk-libs',
- test: /[\\/]node_modules[\\/]/,
- priority: 10,
- chunks: 'initial' // 只打包初始时依赖的第三方
- },
- elementUI: {
- name: 'chunk-elementUI', // 单独将 elementUI 拆包
- priority: 20, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app
- test: /[\\/]node_modules[\\/]element-ui[\\/]/
- },
- commons: {
- name: 'chunk-commons',
- test: resolve('src/components'), // 可自定义拓展你的规则
- minChunks: 3, // 最小公用次数
- priority: 5,
- reuseExistingChunk: true
- }
- }
- },
- runtimeChunk: 'single',
- minimizer: [
- new UglifyJsPlugin({
- uglifyOptions: {
- mangle: {
- safari10: true
- }
- },
- sourceMap: config.build.productionSourceMap,
- cache: true,
- parallel: true
- }),
- // Compress extracted CSS. We are using this plugin so that possible
- // duplicated CSS from different components can be deduped.
- new OptimizeCSSAssetsPlugin()
- ]
- }
-})
-
-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.generateAnalyzerReport || config.build.bundleAnalyzerReport) {
- const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
- .BundleAnalyzerPlugin
-
- if (config.build.bundleAnalyzerReport) {
- webpackConfig.plugins.push(
- new BundleAnalyzerPlugin({
- analyzerPort: 8080,
- generateStatsFile: false
- })
- )
- }
-
- if (config.build.generateAnalyzerReport) {
- webpackConfig.plugins.push(
- new BundleAnalyzerPlugin({
- analyzerMode: 'static',
- reportFilename: 'bundle-report.html',
- openAnalyzer: false
- })
- )
- }
-}
-
-module.exports = webpackConfig
diff --git a/config/dev.env.js b/config/dev.env.js
deleted file mode 100644
index 413a7e8..0000000
--- a/config/dev.env.js
+++ /dev/null
@@ -1,9 +0,0 @@
-'use strict'
-const merge = require('webpack-merge')
-const prodEnv = require('./prod.env')
-
-module.exports = merge(prodEnv, {
- NODE_ENV: '"development"',
- BASE_API: '"http://localhost:8000"'
- //BASE_API: '"https://yshopapi.dayouqiantu.cn"'
-})
diff --git a/config/index.js b/config/index.js
deleted file mode 100644
index 48350f5..0000000
--- a/config/index.js
+++ /dev/null
@@ -1,106 +0,0 @@
-'use strict'
-// Template version: 1.2.6
-const devEnv = require('./dev.env')
-// 获取接口地址
-const base_url = devEnv.BASE_API.replace(/"/g,'')
-const path = require('path')
-module.exports = {
- dev: {
- // Paths
- assetsSubDirectory: 'static',
- assetsPublicPath: '/',
- // 配置代理
- proxyTable: {
- '/auth': {
- // 测试环境
- target: base_url,
- secure: true,
- changeOrigin: true,
- pathRewrite: {
- '^/auth': 'auth'
- }
- },
- '/api': {
- // 测试环境
- target: base_url,
- secure: true,
- changeOrigin: true,
- pathRewrite: {
- '^/api': 'api'
- }
- }
- },
-
- // Various Dev Server settings
- host: 'localhost', // can be overwritten by process.env.HOST
- port: 8013, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
- autoOpenBrowser: true,
- errorOverlay: true,
- notifyOnErrors: false,
- 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-source-map',
-
- // CSS Sourcemaps off by default because relative paths are "buggy"
- // with this option, according to the CSS-Loader README
- // (https://github.com/webpack/css-loader#sourcemaps)
- // In our experience, they generally work as expected,
- // just be aware of this issue when enabling this option.
- cssSourceMap: false
- },
-
- build: {
- // Template for index.html
- index: path.resolve(__dirname, '../dist/index.html'),
-
- // Paths
- assetsRoot: path.resolve(__dirname, '../dist'),
- assetsSubDirectory: 'static',
-
- /**
- * You can set by youself according to actual condition
- * You will need to set this if you plan to deploy your site under a sub path,
- * for example GitHub pages. If you plan to deploy your site to https://foo.github.io/bar/,
- * then assetsPublicPath should be set to "/bar/".
- * In most cases please use '/' !!!
- */
- assetsPublicPath: '/',
-
- /**
- * Source Maps
- */
-
- productionSourceMap: false,
- // 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 || false,
-
- // `npm run build:prod --generate_report`
- generateAnalyzerReport: process.env.npm_config_generate_report || false
- }
-}
diff --git a/config/prod.env.js b/config/prod.env.js
deleted file mode 100644
index 6ba67bb..0000000
--- a/config/prod.env.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict'
-module.exports = {
- NODE_ENV: '"production"',
- BASE_API: '"https://yshopapi.dayouqiantu.cn"'
-}
diff --git a/debug.log b/debug.log
deleted file mode 100644
index b241ab3..0000000
--- a/debug.log
+++ /dev/null
@@ -1 +0,0 @@
-[1110/193651.524:ERROR:crashpad_client_win.cc(491)] CreateProcess: ҳļ̫Сɲ (0x5AF)
diff --git a/index.html b/index.html
deleted file mode 100644
index c6b6210..0000000
--- a/index.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/jest.config.js b/jest.config.js
new file mode 100644
index 0000000..143cdc8
--- /dev/null
+++ b/jest.config.js
@@ -0,0 +1,24 @@
+module.exports = {
+ moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
+ transform: {
+ '^.+\\.vue$': 'vue-jest',
+ '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
+ 'jest-transform-stub',
+ '^.+\\.jsx?$': 'babel-jest'
+ },
+ moduleNameMapper: {
+ '^@/(.*)$': '/src/$1'
+ },
+ snapshotSerializers: ['jest-serializer-vue'],
+ testMatch: [
+ '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
+ ],
+ collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'],
+ coverageDirectory: '/tests/unit/coverage',
+ // 'collectCoverage': true,
+ 'coverageReporters': [
+ 'lcov',
+ 'text-summary'
+ ],
+ testURL: 'http://localhost/'
+}
diff --git a/package.json b/package.json
index 2b8fb1b..148d1ab 100644
--- a/package.json
+++ b/package.json
@@ -1,30 +1,49 @@
{
- "name": "YSHOP",
- "version": "2.2.0",
+ "name": "yshop-web",
+ "version": "2.4.0",
+ "description": "yshop 前端源码",
+ "author": "Zheng Jie",
"license": "Apache-2.0",
- "description": "YSHOP 前端代码",
- "author": "hupeng <610796224@qq.com>",
"scripts": {
- "dev": "cross-env BABEL_ENV=development webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
- "build": "cross-env NODE_ENV=production env_config=prod node build/build.js",
- "lint": "eslint --ext .js,.vue src",
- "test": "npm run lint",
- "precommit": "lint-staged",
- "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
+ "dev": "vue-cli-service serve",
+ "build:prod": "vue-cli-service build",
+ "build:stage": "vue-cli-service build --mode staging",
+ "preview": "node build/index.js --preview",
+ "lint": "eslint --fix --ext .js,.vue src",
+ "test:unit": "jest --clearCache && vue-cli-service test:unit",
+ "svgo": "svgo -f src/assets/icons/svg --config=src/assets/icons/svgo.yml",
+ "new": "plop"
+ },
+ "husky": {
+ "hooks": {
+ "pre-commit": "lint-staged"
+ }
+ },
+ "lint-staged": {
+ "src/**/*.{js,vue}": [
+ "eslint --fix",
+ "git add"
+ ]
},
"repository": {
"type": "git",
- "url": "https://github.com/elunez/eladmin-qd"
+ "url": "https://gitee.com/guchengwuyue/yshopmall"
+ },
+ "bugs": {
+ "url": "https://gitee.com/guchengwuyue/yshopmall/issues"
},
"dependencies": {
- "@riophae/vue-treeselect": "0.0.38",
- "axios": "^0.19.0",
- "clipboard": "1.7.1",
- "codemirror": "^5.38.0",
+ "@riophae/vue-treeselect": "0.1.0",
+ "axios": "0.18.1",
+ "clipboard": "2.0.4",
+ "codemirror": "^5.49.2",
"connect": "3.6.6",
- "echarts": "4.1.0",
+ "echarts": "4.2.1",
+ "echarts-gl": "^1.1.1",
+ "echarts-wordcloud": "^1.1.3",
"element-ui": "^2.12.0",
"file-saver": "1.3.8",
+ "fuse.js": "3.4.4",
"js-cookie": "2.2.0",
"jsencrypt": "^3.0.0-rc.1",
"jszip": "3.1.5",
@@ -32,75 +51,56 @@
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
- "screenfull": "3.3.3",
- "vue": "2.5.17",
+ "qs": "^6.9.1",
+ "screenfull": "4.2.0",
+ "vue": "2.6.10",
"vue-count-to": "1.0.13",
- "vue-router": "3.1.3",
- "vuex": "3.0.1",
+ "vue-cropper": "0.4.9",
+ "vue-highlightjs": "^1.3.3",
+ "vue-router": "3.0.2",
+ "vue-splitpane": "1.0.4",
+ "vuex": "3.1.0",
"wangeditor": ">=3.0.0",
"xlsx": "^0.11.16"
},
"devDependencies": {
- "autoprefixer": "8.5.0",
- "babel-core": "6.26.3",
+ "@babel/core": "7.0.0",
+ "@babel/register": "7.0.0",
+ "@vue/cli-plugin-babel": "3.5.3",
+ "@vue/cli-plugin-eslint": "3.5.1",
+ "@vue/cli-plugin-unit-jest": "3.5.3",
+ "@vue/cli-service": "3.5.3",
+ "@vue/test-utils": "1.0.0-beta.29",
+ "autoprefixer": "^9.5.1",
+ "babel-core": "7.0.0-bridge.0",
"babel-eslint": "8.2.6",
- "babel-helper-vue-jsx-merge-props": "2.0.3",
- "babel-loader": "7.1.5",
- "babel-plugin-dynamic-import-node": "2.0.0",
- "babel-plugin-syntax-jsx": "6.18.0",
- "babel-plugin-transform-runtime": "6.23.0",
- "babel-plugin-transform-vue-jsx": "3.7.0",
- "babel-polyfill": "^6.26.0",
- "babel-preset-env": "1.7.0",
- "babel-preset-stage-2": "6.24.1",
- "chalk": "2.4.1",
- "copy-webpack-plugin": "4.5.2",
- "cross-env": "5.2.0",
- "css-loader": "1.0.0",
- "eslint": "4.19.1",
- "eslint-friendly-formatter": "4.0.1",
- "eslint-loader": "2.0.0",
- "eslint-plugin-vue": "4.7.1",
- "eventsource-polyfill": "0.9.6",
- "file-loader": "1.1.11",
- "friendly-errors-webpack-plugin": "1.7.0",
- "happypack": "^5.0.1",
- "html-webpack-plugin": "4.0.0-alpha",
- "mini-css-extract-plugin": "0.4.1",
- "node-notifier": "5.2.1",
- "node-sass": "^4.7.2",
- "optimize-css-assets-webpack-plugin": "5.0.0",
- "ora": "3.0.0",
- "portfinder": "1.0.16",
- "postcss-import": "12.0.0",
- "postcss-loader": "2.1.6",
- "postcss-url": "7.3.2",
- "rimraf": "2.6.2",
- "sass-loader": "7.0.3",
- "script-ext-html-webpack-plugin": "2.0.1",
+ "babel-jest": "23.6.0",
+ "babel-plugin-transform-remove-console": "^6.9.4",
+ "chalk": "2.4.2",
+ "chokidar": "2.1.5",
+ "connect": "3.6.6",
+ "eslint": "5.15.3",
+ "eslint-plugin-vue": "5.2.2",
+ "html-webpack-plugin": "3.2.0",
+ "husky": "1.3.1",
+ "lint-staged": "8.1.5",
+ "node-sass": "^4.13.0",
+ "plop": "2.3.0",
+ "runjs": "^4.3.2",
+ "sass-loader": "^7.1.0",
+ "script-ext-html-webpack-plugin": "2.1.3",
"script-loader": "0.7.2",
- "semver": "5.5.0",
- "shelljs": "^0.8.3",
- "svg-sprite-loader": "3.8.0",
- "svgo": "1.2.2",
- "uglifyjs-webpack-plugin": "1.2.7",
- "url-loader": "1.0.1",
- "vue-loader": "15.3.0",
- "vue-style-loader": "4.1.2",
- "vue-template-compiler": "2.5.17",
- "webpack": "4.16.5",
- "webpack-bundle-analyzer": "3.3.2",
- "webpack-cli": "3.1.0",
- "webpack-dev-server": "3.3.1",
- "webpack-merge": "4.1.4"
+ "serve-static": "^1.13.2",
+ "svg-sprite-loader": "4.1.3",
+ "svgo": "1.2.0",
+ "vue-template-compiler": "2.6.10"
},
"engines": {
- "node": ">= 6.0.0",
+ "node": ">=8.9",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
- "last 2 versions",
- "not ie <= 8"
+ "last 2 versions"
]
}
diff --git a/plopfile.js b/plopfile.js
new file mode 100644
index 0000000..9f3147e
--- /dev/null
+++ b/plopfile.js
@@ -0,0 +1,7 @@
+const viewGenerator = require('./plop-templates/view/prompt')
+const componentGenerator = require('./plop-templates/component/prompt')
+
+module.exports = function(plop) {
+ plop.setGenerator('view', viewGenerator)
+ plop.setGenerator('component', componentGenerator)
+}
diff --git a/postcss.config.js b/postcss.config.js
new file mode 100644
index 0000000..961986e
--- /dev/null
+++ b/postcss.config.js
@@ -0,0 +1,5 @@
+module.exports = {
+ plugins: {
+ autoprefixer: {}
+ }
+}
diff --git a/favicon.ico b/public/favicon.ico
similarity index 100%
rename from favicon.ico
rename to public/favicon.ico
diff --git a/public/index.html b/public/index.html
new file mode 100644
index 0000000..e918500
--- /dev/null
+++ b/public/index.html
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+ <%= webpackConfig.name %>
+
+
+
+
+
+
diff --git a/src/App.vue b/src/App.vue
index 721d3a3..ec9032c 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/api/data.js b/src/api/data.js
index 7a91ac6..d975d75 100644
--- a/src/api/data.js
+++ b/src/api/data.js
@@ -1,9 +1,17 @@
import request from '@/utils/request'
+import qs from 'qs'
export function initData(url, params) {
return request({
- url: url,
+ url: url + '?' + qs.stringify(params, { indices: false }),
+ method: 'get'
+ })
+}
+
+export function download(url, params) {
+ return request({
+ url: url + '?' + qs.stringify(params, { indices: false }),
method: 'get',
- params
+ responseType: 'blob'
})
}
diff --git a/src/api/generator.js b/src/api/generator.js
deleted file mode 100644
index c9302d6..0000000
--- a/src/api/generator.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import request from '@/utils/request'
-
-export function generator(data, tableName) {
- return request({
- url: 'api/generator?tableName=' + tableName,
- data,
- method: 'post'
- })
-}
diff --git a/src/api/genConfig.js b/src/api/generator/genConfig.js
similarity index 73%
rename from src/api/genConfig.js
rename to src/api/generator/genConfig.js
index 5535d37..e15b200 100644
--- a/src/api/genConfig.js
+++ b/src/api/generator/genConfig.js
@@ -1,8 +1,8 @@
import request from '@/utils/request'
-export function get() {
+export function get(tableName) {
return request({
- url: 'api/genConfig',
+ url: 'api/genConfig/' + tableName,
method: 'get'
})
}
diff --git a/src/api/generator/generator.js b/src/api/generator/generator.js
new file mode 100644
index 0000000..0c49718
--- /dev/null
+++ b/src/api/generator/generator.js
@@ -0,0 +1,33 @@
+import request from '@/utils/request'
+
+export function getAllTable() {
+ return request({
+ url: 'api/generator/tables/all',
+ method: 'get'
+ })
+}
+
+export function generator(tableName, type) {
+ return request({
+ url: 'api/generator/' + tableName + '/' + type,
+ method: 'post',
+ responseType: type === 2 ? 'blob' : ''
+ })
+}
+
+export function save(data) {
+ return request({
+ url: 'api/generator',
+ data,
+ method: 'put'
+ })
+}
+
+export function sync(tables) {
+ return request({
+ url: 'api/generator/sync',
+ method: 'post',
+ data: tables
+ })
+}
+
diff --git a/src/api/log.js b/src/api/log.js
deleted file mode 100644
index d776e7a..0000000
--- a/src/api/log.js
+++ /dev/null
@@ -1,8 +0,0 @@
-import request from '@/utils/request'
-
-export function getErrDetail(id) {
- return request({
- url: 'api/logs/error/' + id,
- method: 'get'
- })
-}
diff --git a/src/api/login.js b/src/api/login.js
index fd55a3b..fe257d2 100644
--- a/src/api/login.js
+++ b/src/api/login.js
@@ -22,7 +22,14 @@ export function getInfo() {
export function getCodeImg() {
return request({
- url: 'auth/vCode',
+ url: 'auth/code',
method: 'get'
})
}
+
+export function logout() {
+ return request({
+ url: 'auth/logout',
+ method: 'delete'
+ })
+}
diff --git a/src/api/redis.js b/src/api/mnt/app.js
similarity index 52%
rename from src/api/redis.js
rename to src/api/mnt/app.js
index b16adc4..2a27054 100644
--- a/src/api/redis.js
+++ b/src/api/mnt/app.js
@@ -2,34 +2,26 @@ import request from '@/utils/request'
export function add(data) {
return request({
- url: 'api/redis',
+ url: 'api/app',
method: 'post',
data
})
}
-export function del(key) {
- const data = {
- key
- }
+export function del(ids) {
return request({
- url: 'api/redis/',
+ url: 'api/app',
method: 'delete',
- data
- })
-}
-
-export function delAll() {
- return request({
- url: 'api/redis/all',
- method: 'delete'
+ data: ids
})
}
export function edit(data) {
return request({
- url: 'api/redis',
+ url: 'api/app',
method: 'put',
data
})
}
+
+export default { add, edit, del }
diff --git a/src/api/mnt/connect.js b/src/api/mnt/connect.js
new file mode 100644
index 0000000..1bbe90b
--- /dev/null
+++ b/src/api/mnt/connect.js
@@ -0,0 +1,17 @@
+import request from '@/utils/request'
+
+export function testDbConnect(data) {
+ return request({
+ url: 'api/database/testConnect',
+ method: 'post',
+ data
+ })
+}
+
+export function testServerConnect(data) {
+ return request({
+ url: 'api/serverDeploy/testConnect',
+ method: 'post',
+ data
+ })
+}
diff --git a/src/api/mnt/database.js b/src/api/mnt/database.js
new file mode 100644
index 0000000..91797fb
--- /dev/null
+++ b/src/api/mnt/database.js
@@ -0,0 +1,35 @@
+import request from '@/utils/request'
+
+export function add(data) {
+ return request({
+ url: 'api/database',
+ method: 'post',
+ data
+ })
+}
+
+export function del(ids) {
+ return request({
+ url: 'api/database',
+ method: 'delete',
+ data: ids
+ })
+}
+
+export function edit(data) {
+ return request({
+ url: 'api/database',
+ method: 'put',
+ data
+ })
+}
+
+export function testDbConnection(data) {
+ return request({
+ url: 'api/database/testConnect',
+ method: 'post',
+ data
+ })
+}
+
+export default { add, edit, del, testDbConnection }
diff --git a/src/api/mnt/deploy.js b/src/api/mnt/deploy.js
new file mode 100644
index 0000000..c1475ea
--- /dev/null
+++ b/src/api/mnt/deploy.js
@@ -0,0 +1,77 @@
+import request from '@/utils/request'
+
+export function add(data) {
+ return request({
+ url: 'api/deploy',
+ method: 'post',
+ data
+ })
+}
+
+export function del(ids) {
+ return request({
+ url: 'api/deploy',
+ method: 'delete',
+ data: ids
+ })
+}
+
+export function edit(data) {
+ return request({
+ url: 'api/deploy',
+ method: 'put',
+ data
+ })
+}
+
+export function getApps() {
+ return request({
+ url: 'api/app',
+ method: 'get'
+ })
+}
+
+export function getServers() {
+ return request({
+ url: 'api/serverDeploy',
+ method: 'get'
+ })
+}
+
+/**
+ * 启动服务
+ * @param data 选中行
+ */
+export function startServer(data) {
+ return request({
+ url: 'api/deploy/startServer',
+ method: 'post',
+ data
+ })
+}
+
+/**
+ * 停止服务
+ * @param data 选中行
+ */
+export function stopServer(data) {
+ return request({
+ url: 'api/deploy/stopServer',
+ method: 'post',
+ data
+ })
+}
+
+/**
+ * 停止服务
+ * @param data 选中行
+ */
+export function serverStatus(data) {
+ return request({
+ url: 'api/deploy/serverStatus',
+ method: 'post',
+ data
+ })
+}
+
+export default { add, edit, del, stopServer, serverStatus, startServer, getServers, getApps }
diff --git a/src/api/mnt/deployHistory.js b/src/api/mnt/deployHistory.js
new file mode 100644
index 0000000..30335e4
--- /dev/null
+++ b/src/api/mnt/deployHistory.js
@@ -0,0 +1,21 @@
+import request from '@/utils/request'
+
+export function del(ids) {
+ return request({
+ url: 'api/deployHistory',
+ method: 'delete',
+ data: ids
+ })
+}
+
+/**
+ * 版本回退
+ * @param data 选中行
+ */
+export function reducte(data) {
+ return request({
+ url: 'api/deploy/serverReduction',
+ method: 'post',
+ data
+ })
+}
diff --git a/src/api/mnt/serverDeploy.js b/src/api/mnt/serverDeploy.js
new file mode 100644
index 0000000..e796114
--- /dev/null
+++ b/src/api/mnt/serverDeploy.js
@@ -0,0 +1,27 @@
+import request from '@/utils/request'
+
+export function add(data) {
+ return request({
+ url: 'api/serverDeploy',
+ method: 'post',
+ data
+ })
+}
+
+export function del(ids) {
+ return request({
+ url: 'api/serverDeploy',
+ method: 'delete',
+ data: ids
+ })
+}
+
+export function edit(data) {
+ return request({
+ url: 'api/serverDeploy',
+ method: 'put',
+ data
+ })
+}
+
+export default { add, edit, del }
diff --git a/src/api/monitor/log.js b/src/api/monitor/log.js
new file mode 100644
index 0000000..13f0d39
--- /dev/null
+++ b/src/api/monitor/log.js
@@ -0,0 +1,22 @@
+import request from '@/utils/request'
+
+export function getErrDetail(id) {
+ return request({
+ url: 'api/logs/error/' + id,
+ method: 'get'
+ })
+}
+
+export function delAllError() {
+ return request({
+ url: 'api/logs/del/error',
+ method: 'delete'
+ })
+}
+
+export function delAllInfo() {
+ return request({
+ url: 'api/logs/del/info',
+ method: 'delete'
+ })
+}
diff --git a/src/api/monitor/online.js b/src/api/monitor/online.js
new file mode 100644
index 0000000..057275b
--- /dev/null
+++ b/src/api/monitor/online.js
@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+export function del(keys) {
+ return request({
+ url: 'auth/online',
+ method: 'delete',
+ data: keys
+ })
+}
diff --git a/src/api/monitor/server.js b/src/api/monitor/server.js
new file mode 100644
index 0000000..2ade356
--- /dev/null
+++ b/src/api/monitor/server.js
@@ -0,0 +1,27 @@
+import request from '@/utils/request'
+
+export function add(data) {
+ return request({
+ url: 'api/server',
+ method: 'post',
+ data
+ })
+}
+
+export function del(ids) {
+ return request({
+ url: 'api/server',
+ method: 'delete',
+ data: ids
+ })
+}
+
+export function edit(data) {
+ return request({
+ url: 'api/server',
+ method: 'put',
+ data
+ })
+}
+
+export default { add, edit, del }
diff --git a/src/api/monitor/visits.js b/src/api/monitor/visits.js
new file mode 100644
index 0000000..147ae7c
--- /dev/null
+++ b/src/api/monitor/visits.js
@@ -0,0 +1,22 @@
+import request from '@/utils/request'
+
+export function count() {
+ return request({
+ url: 'api/visits',
+ method: 'post'
+ })
+}
+
+export function get() {
+ return request({
+ url: 'api/visits',
+ method: 'get'
+ })
+}
+
+export function getChartData() {
+ return request({
+ url: 'api/visits/chartData',
+ method: 'get'
+ })
+}
diff --git a/src/api/picture.js b/src/api/picture.js
deleted file mode 100644
index e3ddd86..0000000
--- a/src/api/picture.js
+++ /dev/null
@@ -1,16 +0,0 @@
-import request from '@/utils/request'
-
-export function del(id) {
- return request({
- url: 'api/pictures/' + id,
- method: 'delete'
- })
-}
-
-export function delAll(ids) {
- return request({
- url: 'api/pictures/',
- method: 'delete',
- data: ids
- })
-}
diff --git a/src/api/code.js b/src/api/system/code.js
similarity index 100%
rename from src/api/code.js
rename to src/api/system/code.js
diff --git a/src/api/dept.js b/src/api/system/dept.js
similarity index 75%
rename from src/api/dept.js
rename to src/api/system/dept.js
index 2ca7b29..59998ba 100644
--- a/src/api/dept.js
+++ b/src/api/system/dept.js
@@ -16,10 +16,11 @@ export function add(data) {
})
}
-export function del(id) {
+export function del(ids) {
return request({
- url: 'api/dept/' + id,
- method: 'delete'
+ url: 'api/dept',
+ method: 'delete',
+ data: ids
})
}
@@ -30,3 +31,5 @@ export function edit(data) {
data
})
}
+
+export default { add, edit, del, getDepts }
diff --git a/src/api/dict.js b/src/api/system/dict.js
similarity index 72%
rename from src/api/dict.js
rename to src/api/system/dict.js
index 7d37a9c..11911cf 100644
--- a/src/api/dict.js
+++ b/src/api/system/dict.js
@@ -1,5 +1,12 @@
import request from '@/utils/request'
+export function getDicts() {
+ return request({
+ url: 'api/dict/all',
+ method: 'get'
+ })
+}
+
export function add(data) {
return request({
url: 'api/dict',
@@ -22,3 +29,5 @@ export function edit(data) {
data
})
}
+
+export default { add, edit, del }
diff --git a/src/api/dictDetail.js b/src/api/system/dictDetail.js
similarity index 95%
rename from src/api/dictDetail.js
rename to src/api/system/dictDetail.js
index b03d1cc..e8dc512 100644
--- a/src/api/dictDetail.js
+++ b/src/api/system/dictDetail.js
@@ -48,3 +48,5 @@ export function edit(data) {
data
})
}
+
+export default { add, edit, del }
diff --git a/src/api/job.js b/src/api/system/job.js
similarity index 79%
rename from src/api/job.js
rename to src/api/system/job.js
index b887eae..2888c05 100644
--- a/src/api/job.js
+++ b/src/api/system/job.js
@@ -21,10 +21,11 @@ export function add(data) {
})
}
-export function del(id) {
+export function del(ids) {
return request({
- url: 'api/job/' + id,
- method: 'delete'
+ url: 'api/job',
+ method: 'delete',
+ data: ids
})
}
@@ -35,3 +36,5 @@ export function edit(data) {
data
})
}
+
+export default { add, edit, del }
diff --git a/src/api/menu.js b/src/api/system/menu.js
similarity index 78%
rename from src/api/menu.js
rename to src/api/system/menu.js
index 52a3737..4e8ac90 100644
--- a/src/api/menu.js
+++ b/src/api/system/menu.js
@@ -1,6 +1,5 @@
import request from '@/utils/request'
-// 获取所有的菜单树
export function getMenusTree() {
return request({
url: 'api/menus/tree',
@@ -23,10 +22,11 @@ export function add(data) {
})
}
-export function del(id) {
+export function del(ids) {
return request({
- url: 'api/menus/' + id,
- method: 'delete'
+ url: 'api/menus',
+ method: 'delete',
+ data: ids
})
}
@@ -37,3 +37,5 @@ export function edit(data) {
data
})
}
+
+export default { add, edit, del, getMenusTree }
diff --git a/src/api/role.js b/src/api/system/role.js
similarity index 78%
rename from src/api/role.js
rename to src/api/system/role.js
index baf5124..1f7bc1e 100644
--- a/src/api/role.js
+++ b/src/api/system/role.js
@@ -30,10 +30,11 @@ export function getLevel() {
})
}
-export function del(id) {
+export function del(ids) {
return request({
- url: 'api/roles/' + id,
- method: 'delete'
+ url: 'api/roles',
+ method: 'delete',
+ data: ids
})
}
@@ -45,14 +46,6 @@ export function edit(data) {
})
}
-export function editPermission(data) {
- return request({
- url: 'api/roles/permission',
- method: 'put',
- data
- })
-}
-
export function editMenu(data) {
return request({
url: 'api/roles/menu',
@@ -60,3 +53,5 @@ export function editMenu(data) {
data
})
}
+
+export default { add, edit, del, get, editMenu, getLevel }
diff --git a/src/api/timing.js b/src/api/system/timing.js
similarity index 77%
rename from src/api/timing.js
rename to src/api/system/timing.js
index cdbfddc..613e15f 100644
--- a/src/api/timing.js
+++ b/src/api/system/timing.js
@@ -8,10 +8,11 @@ export function add(data) {
})
}
-export function del(id) {
+export function del(ids) {
return request({
- url: 'api/jobs/' + id,
- method: 'delete'
+ url: 'api/jobs',
+ method: 'delete',
+ data: ids
})
}
@@ -36,3 +37,5 @@ export function execution(id) {
method: 'put'
})
}
+
+export default { del, updateIsPause, execution, add, edit }
diff --git a/src/api/user.js b/src/api/system/user.js
similarity index 50%
rename from src/api/user.js
rename to src/api/system/user.js
index 49e2777..6cd91a5 100644
--- a/src/api/user.js
+++ b/src/api/system/user.js
@@ -1,4 +1,5 @@
import request from '@/utils/request'
+import { encrypt } from '@/utils/rsaEncrypt'
export function add(data) {
return request({
@@ -7,24 +8,26 @@ export function add(data) {
data
})
}
-export function downloadUser() {
+
+export function del(ids) {
return request({
- url: 'api/users/download',
- method: 'get',
- responseType: 'blob'
+ url: 'api/users',
+ method: 'delete',
+ data: ids
})
}
-export function del(id) {
+export function edit(data) {
return request({
- url: 'api/users/' + id,
- method: 'delete'
+ url: 'api/users',
+ method: 'put',
+ data
})
}
-export function edit(data) {
+export function editUser(data) {
return request({
- url: 'api/users',
+ url: 'api/users/center',
method: 'put',
data
})
@@ -32,8 +35,8 @@ export function edit(data) {
export function updatePass(user) {
const data = {
- oldPass: user.oldPass,
- newPass: user.newPass
+ oldPass: encrypt(user.oldPass),
+ newPass: encrypt(user.newPass)
}
return request({
url: 'api/users/updatePass/',
@@ -42,11 +45,17 @@ export function updatePass(user) {
})
}
-export function updateEmail(code, data) {
+export function updateEmail(form) {
+ const data = {
+ password: encrypt(form.pass),
+ email: form.email
+ }
return request({
- url: 'api/users/updateEmail/' + code,
+ url: 'api/users/updateEmail/' + form.code,
method: 'post',
data
})
}
+export default { add, edit, del }
+
diff --git a/src/api/alipay.js b/src/api/tools/alipay.js
similarity index 100%
rename from src/api/alipay.js
rename to src/api/tools/alipay.js
diff --git a/src/api/email.js b/src/api/tools/email.js
similarity index 100%
rename from src/api/email.js
rename to src/api/tools/email.js
diff --git a/src/api/localStorage.js b/src/api/tools/localStorage.js
similarity index 72%
rename from src/api/localStorage.js
rename to src/api/tools/localStorage.js
index b2e1bdb..63ebe2b 100644
--- a/src/api/localStorage.js
+++ b/src/api/tools/localStorage.js
@@ -8,14 +8,7 @@ export function add(data) {
})
}
-export function del(id) {
- return request({
- url: 'api/localStorage/' + id,
- method: 'delete'
- })
-}
-
-export function delAll(ids) {
+export function del(ids) {
return request({
url: 'api/localStorage/',
method: 'delete',
@@ -30,3 +23,5 @@ export function edit(data) {
data
})
}
+
+export default { add, edit, del }
diff --git a/src/api/tools/picture.js b/src/api/tools/picture.js
new file mode 100644
index 0000000..237d5f5
--- /dev/null
+++ b/src/api/tools/picture.js
@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+export function del(ids) {
+ return request({
+ url: 'api/pictures',
+ method: 'delete',
+ data: ids
+ })
+}
+
+export function sync() {
+ return request({
+ url: 'api/pictures/synchronize',
+ method: 'post'
+ })
+}
+
+export default { del, sync }
diff --git a/src/api/qiniu.js b/src/api/tools/qiniu.js
similarity index 68%
rename from src/api/qiniu.js
rename to src/api/tools/qiniu.js
index d5b979b..6d56771 100644
--- a/src/api/qiniu.js
+++ b/src/api/tools/qiniu.js
@@ -2,26 +2,19 @@ import request from '@/utils/request'
export function get() {
return request({
- url: 'api/qiNiuConfig',
+ url: 'api/qiNiuContent/config',
method: 'get'
})
}
export function update(data) {
return request({
- url: 'api/qiNiuConfig',
+ url: 'api/qiNiuContent/config',
data,
method: 'put'
})
}
-export function del(id) {
- return request({
- url: 'api/qiNiuContent/' + id,
- method: 'delete'
- })
-}
-
export function download(id) {
return request({
url: 'api/qiNiuContent/download/' + id,
@@ -36,10 +29,12 @@ export function sync() {
})
}
-export function delAll(ids) {
+export function del(ids) {
return request({
- url: 'api/qiNiuContent/',
+ url: 'api/qiNiuContent',
method: 'delete',
data: ids
})
}
+
+export default { del, download, sync }
diff --git a/src/api/visits.js b/src/api/visits.js
index 9d04510..ce1165e 100644
--- a/src/api/visits.js
+++ b/src/api/visits.js
@@ -21,7 +21,6 @@ export function getChartData() {
})
}
-
export function gett() {
return request({
url: 'api/data/count',
diff --git a/src/api/yxCache.js b/src/api/yxCache.js
index 1d0e0e5..09e14fa 100644
--- a/src/api/yxCache.js
+++ b/src/api/yxCache.js
@@ -26,6 +26,6 @@ export function edit(data) {
export function get() {
return request({
url: 'api/yxCache',
- method: 'get',
+ method: 'get'
})
}
diff --git a/src/api/yxExpress.js b/src/api/yxExpress.js
index d01e44a..5e7635e 100644
--- a/src/api/yxExpress.js
+++ b/src/api/yxExpress.js
@@ -23,4 +23,3 @@ export function edit(data) {
})
}
-
diff --git a/src/api/permission.js b/src/api/yxStoreBargainUser.js
similarity index 54%
rename from src/api/permission.js
rename to src/api/yxStoreBargainUser.js
index b8683e8..85c2a03 100644
--- a/src/api/permission.js
+++ b/src/api/yxStoreBargainUser.js
@@ -1,16 +1,8 @@
import request from '@/utils/request'
-// 获取所有的权限树
-export function getPermissionTree() {
- return request({
- url: 'api/permissions/tree',
- method: 'get'
- })
-}
-
export function add(data) {
return request({
- url: 'api/permissions',
+ url: 'api/yxStoreBargainUser',
method: 'post',
data
})
@@ -18,14 +10,14 @@ export function add(data) {
export function del(id) {
return request({
- url: 'api/permissions/' + id,
+ url: 'api/yxStoreBargainUser/' + id,
method: 'delete'
})
}
export function edit(data) {
return request({
- url: 'api/permissions',
+ url: 'api/yxStoreBargainUser',
method: 'put',
data
})
diff --git a/src/api/yxStoreCategory.js b/src/api/yxStoreCategory.js
index 6755cfe..60588fb 100644
--- a/src/api/yxStoreCategory.js
+++ b/src/api/yxStoreCategory.js
@@ -30,3 +30,5 @@ export function edit(data) {
data
})
}
+
+export default { add, edit, del, getCates }
diff --git a/src/api/yxStoreOrder.js b/src/api/yxStoreOrder.js
index 70e0116..986ba50 100644
--- a/src/api/yxStoreOrder.js
+++ b/src/api/yxStoreOrder.js
@@ -31,25 +31,9 @@ export function refund(data) {
})
}
-export function editOrder(data) {
- return request({
- url: 'api/yxStoreOrder/edit',
- method: 'post',
- data
- })
-}
-
-export function remark(data) {
- return request({
- url: 'api/yxStoreOrder/remark',
- method: 'post',
- data
- })
-}
-
export function get() {
return request({
url: 'api/yxExpress',
- method: 'get',
+ method: 'get'
})
}
diff --git a/src/api/yxStoreProduct.js b/src/api/yxStoreProduct.js
index 5b8e1ea..8f01cf3 100644
--- a/src/api/yxStoreProduct.js
+++ b/src/api/yxStoreProduct.js
@@ -38,7 +38,7 @@ export function recovery(id) {
})
}
-export function isFormatAttr(id,data) {
+export function isFormatAttr(id, data) {
return request({
url: 'api/yxStoreProduct/isFormatAttr/' + id,
method: 'post',
@@ -46,7 +46,7 @@ export function isFormatAttr(id,data) {
})
}
-export function setAttr(id,data) {
+export function setAttr(id, data) {
return request({
url: 'api/yxStoreProduct/setAttr/' + id,
method: 'post',
@@ -54,19 +54,17 @@ export function setAttr(id,data) {
})
}
-
export function clearAttr(id) {
return request({
url: 'api/yxStoreProduct/clearAttr/' + id,
- method: 'post',
+ method: 'post'
})
}
export function getAttr(id) {
return request({
url: 'api/yxStoreProduct/attr/' + id,
- method: 'get',
+ method: 'get'
})
}
-
diff --git a/src/api/yxStoreSeckill.js b/src/api/yxStoreSeckill.js
index 28fd6dc..38f8b03 100644
--- a/src/api/yxStoreSeckill.js
+++ b/src/api/yxStoreSeckill.js
@@ -1,24 +1,24 @@
-import request from '@/utils/request'
-
-export function add(data) {
- return request({
- url: 'api/yxStoreSeckill',
- method: 'post',
- data
- })
-}
-
-export function del(id) {
- return request({
- url: 'api/yxStoreSeckill/' + id,
- method: 'delete'
- })
-}
-
-export function edit(data) {
- return request({
- url: 'api/yxStoreSeckill',
- method: 'put',
- data
- })
-}
+import request from '@/utils/request'
+
+export function add(data) {
+ return request({
+ url: 'api/yxStoreSeckill',
+ method: 'post',
+ data
+ })
+}
+
+export function del(id) {
+ return request({
+ url: 'api/yxStoreSeckill/' + id,
+ method: 'delete'
+ })
+}
+
+export function edit(data) {
+ return request({
+ url: 'api/yxStoreSeckill',
+ method: 'put',
+ data
+ })
+}
diff --git a/src/api/yxSystemConfig.js b/src/api/yxSystemConfig.js
index f7486a8..0d06a85 100644
--- a/src/api/yxSystemConfig.js
+++ b/src/api/yxSystemConfig.js
@@ -26,7 +26,7 @@ export function edit(data) {
export function get() {
return request({
url: 'api/yxSystemConfig?size=50',
- method: 'get',
+ method: 'get'
})
}
diff --git a/src/api/yxWechatReply.js b/src/api/yxWechatReply.js
index ce6c5eb..e6db3e9 100644
--- a/src/api/yxWechatReply.js
+++ b/src/api/yxWechatReply.js
@@ -26,7 +26,7 @@ export function edit(data) {
export function get() {
return request({
url: 'api/yxWechatReply',
- method: 'get',
+ method: 'get'
})
}
diff --git a/src/api/yxWechatTemplate.js b/src/api/yxWechatTemplate.js
index aa3baec..4935309 100644
--- a/src/api/yxWechatTemplate.js
+++ b/src/api/yxWechatTemplate.js
@@ -26,7 +26,7 @@ export function edit(data) {
export function get() {
return request({
url: 'api/yxWechatTemplate',
- method: 'get',
+ method: 'get'
})
}
diff --git a/src/assets/avatar/avatar.png b/src/assets/avatar/avatar.png
deleted file mode 100644
index e16488e..0000000
Binary files a/src/assets/avatar/avatar.png and /dev/null differ
diff --git a/src/icons/index.js b/src/assets/icons/index.js
similarity index 79%
rename from src/icons/index.js
rename to src/assets/icons/index.js
index d9fe4d8..2c6b309 100644
--- a/src/icons/index.js
+++ b/src/assets/icons/index.js
@@ -1,9 +1,9 @@
import Vue from 'vue'
-import SvgIcon from '@/components/SvgIcon' // svg组件
+import SvgIcon from '@/components/SvgIcon'// svg component
// register globally
Vue.component('svg-icon', SvgIcon)
-const requireAll = requireContext => requireContext.keys().map(requireContext)
const req = require.context('./svg', false, /\.svg$/)
+const requireAll = requireContext => requireContext.keys().map(requireContext)
requireAll(req)
diff --git a/src/icons/svg/Sign.svg b/src/assets/icons/svg/Sign.svg
similarity index 100%
rename from src/icons/svg/Sign.svg
rename to src/assets/icons/svg/Sign.svg
diff --git a/src/icons/svg/Steve-Jobs.svg b/src/assets/icons/svg/Steve-Jobs.svg
similarity index 100%
rename from src/icons/svg/Steve-Jobs.svg
rename to src/assets/icons/svg/Steve-Jobs.svg
diff --git a/src/icons/svg/add.svg b/src/assets/icons/svg/add.svg
similarity index 100%
rename from src/icons/svg/add.svg
rename to src/assets/icons/svg/add.svg
diff --git a/src/icons/svg/alipay.svg b/src/assets/icons/svg/alipay.svg
similarity index 100%
rename from src/icons/svg/alipay.svg
rename to src/assets/icons/svg/alipay.svg
diff --git a/src/icons/svg/anq.svg b/src/assets/icons/svg/anq.svg
similarity index 100%
rename from src/icons/svg/anq.svg
rename to src/assets/icons/svg/anq.svg
diff --git a/src/assets/icons/svg/app.svg b/src/assets/icons/svg/app.svg
new file mode 100644
index 0000000..0796da3
--- /dev/null
+++ b/src/assets/icons/svg/app.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/article.svg b/src/assets/icons/svg/article.svg
similarity index 100%
rename from src/icons/svg/article.svg
rename to src/assets/icons/svg/article.svg
diff --git a/src/assets/icons/svg/backup.svg b/src/assets/icons/svg/backup.svg
new file mode 100644
index 0000000..a3272a4
--- /dev/null
+++ b/src/assets/icons/svg/backup.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/banner.svg b/src/assets/icons/svg/banner.svg
similarity index 100%
rename from src/icons/svg/banner.svg
rename to src/assets/icons/svg/banner.svg
diff --git a/src/icons/svg/bargain.svg b/src/assets/icons/svg/bargain.svg
similarity index 100%
rename from src/icons/svg/bargain.svg
rename to src/assets/icons/svg/bargain.svg
diff --git a/src/icons/svg/button.svg b/src/assets/icons/svg/button.svg
similarity index 100%
rename from src/icons/svg/button.svg
rename to src/assets/icons/svg/button.svg
diff --git a/src/icons/svg/chain.svg b/src/assets/icons/svg/chain.svg
similarity index 100%
rename from src/icons/svg/chain.svg
rename to src/assets/icons/svg/chain.svg
diff --git a/src/assets/icons/svg/chart.svg b/src/assets/icons/svg/chart.svg
new file mode 100644
index 0000000..27728fb
--- /dev/null
+++ b/src/assets/icons/svg/chart.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/codeConsole.svg b/src/assets/icons/svg/codeConsole.svg
similarity index 100%
rename from src/icons/svg/codeConsole.svg
rename to src/assets/icons/svg/codeConsole.svg
diff --git a/src/icons/svg/comment.svg b/src/assets/icons/svg/comment.svg
similarity index 100%
rename from src/icons/svg/comment.svg
rename to src/assets/icons/svg/comment.svg
diff --git a/src/icons/svg/configure.svg b/src/assets/icons/svg/configure.svg
similarity index 100%
rename from src/icons/svg/configure.svg
rename to src/assets/icons/svg/configure.svg
diff --git a/src/icons/svg/coupon.svg b/src/assets/icons/svg/coupon.svg
similarity index 100%
rename from src/icons/svg/coupon.svg
rename to src/assets/icons/svg/coupon.svg
diff --git a/src/icons/svg/coupon2.svg b/src/assets/icons/svg/coupon2.svg
similarity index 100%
rename from src/icons/svg/coupon2.svg
rename to src/assets/icons/svg/coupon2.svg
diff --git a/src/icons/svg/index.svg b/src/assets/icons/svg/dashboard.svg
similarity index 100%
rename from src/icons/svg/index.svg
rename to src/assets/icons/svg/dashboard.svg
diff --git a/src/assets/icons/svg/database.svg b/src/assets/icons/svg/database.svg
new file mode 100644
index 0000000..7fbad9b
--- /dev/null
+++ b/src/assets/icons/svg/database.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/date.svg b/src/assets/icons/svg/date.svg
similarity index 100%
rename from src/icons/svg/date.svg
rename to src/assets/icons/svg/date.svg
diff --git a/src/icons/svg/dengji.svg b/src/assets/icons/svg/dengji.svg
similarity index 100%
rename from src/icons/svg/dengji.svg
rename to src/assets/icons/svg/dengji.svg
diff --git a/src/assets/icons/svg/deploy.svg b/src/assets/icons/svg/deploy.svg
new file mode 100644
index 0000000..f4a1c56
--- /dev/null
+++ b/src/assets/icons/svg/deploy.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/dept.svg b/src/assets/icons/svg/dept.svg
similarity index 100%
rename from src/icons/svg/dept.svg
rename to src/assets/icons/svg/dept.svg
diff --git a/src/icons/svg/dev.svg b/src/assets/icons/svg/dev.svg
similarity index 100%
rename from src/icons/svg/dev.svg
rename to src/assets/icons/svg/dev.svg
diff --git a/src/icons/svg/develop.svg b/src/assets/icons/svg/develop.svg
similarity index 100%
rename from src/icons/svg/develop.svg
rename to src/assets/icons/svg/develop.svg
diff --git a/src/icons/svg/dictionary.svg b/src/assets/icons/svg/dictionary.svg
similarity index 100%
rename from src/icons/svg/dictionary.svg
rename to src/assets/icons/svg/dictionary.svg
diff --git a/src/assets/icons/svg/edit.svg b/src/assets/icons/svg/edit.svg
new file mode 100644
index 0000000..d26101f
--- /dev/null
+++ b/src/assets/icons/svg/edit.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/svg/education.svg b/src/assets/icons/svg/education.svg
new file mode 100644
index 0000000..7bfb01d
--- /dev/null
+++ b/src/assets/icons/svg/education.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/email.svg b/src/assets/icons/svg/email.svg
similarity index 100%
rename from src/icons/svg/email.svg
rename to src/assets/icons/svg/email.svg
diff --git a/src/icons/svg/error.svg b/src/assets/icons/svg/error.svg
similarity index 100%
rename from src/icons/svg/error.svg
rename to src/assets/icons/svg/error.svg
diff --git a/src/assets/icons/svg/exit-fullscreen.svg b/src/assets/icons/svg/exit-fullscreen.svg
new file mode 100644
index 0000000..485c128
--- /dev/null
+++ b/src/assets/icons/svg/exit-fullscreen.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/express.svg b/src/assets/icons/svg/express.svg
similarity index 100%
rename from src/icons/svg/express.svg
rename to src/assets/icons/svg/express.svg
diff --git a/src/icons/svg/fenxiao.svg b/src/assets/icons/svg/fenxiao.svg
similarity index 100%
rename from src/icons/svg/fenxiao.svg
rename to src/assets/icons/svg/fenxiao.svg
diff --git a/src/assets/icons/svg/fullscreen.svg b/src/assets/icons/svg/fullscreen.svg
new file mode 100644
index 0000000..0e86b6f
--- /dev/null
+++ b/src/assets/icons/svg/fullscreen.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/fwb.svg b/src/assets/icons/svg/fwb.svg
similarity index 100%
rename from src/icons/svg/fwb.svg
rename to src/assets/icons/svg/fwb.svg
diff --git a/src/icons/svg/github.svg b/src/assets/icons/svg/github.svg
similarity index 100%
rename from src/icons/svg/github.svg
rename to src/assets/icons/svg/github.svg
diff --git a/src/icons/svg/gonggao.svg b/src/assets/icons/svg/gonggao.svg
similarity index 100%
rename from src/icons/svg/gonggao.svg
rename to src/assets/icons/svg/gonggao.svg
diff --git a/src/icons/svg/ic-yesterday.svg b/src/assets/icons/svg/ic-yesterday.svg
similarity index 100%
rename from src/icons/svg/ic-yesterday.svg
rename to src/assets/icons/svg/ic-yesterday.svg
diff --git a/src/icons/svg/icon.svg b/src/assets/icons/svg/icon.svg
similarity index 100%
rename from src/icons/svg/icon.svg
rename to src/assets/icons/svg/icon.svg
diff --git a/src/icons/svg/image.svg b/src/assets/icons/svg/image.svg
similarity index 100%
rename from src/icons/svg/image.svg
rename to src/assets/icons/svg/image.svg
diff --git a/src/assets/icons/svg/index.svg b/src/assets/icons/svg/index.svg
new file mode 100644
index 0000000..5317d37
--- /dev/null
+++ b/src/assets/icons/svg/index.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/svg/international.svg b/src/assets/icons/svg/international.svg
new file mode 100644
index 0000000..e9b56ee
--- /dev/null
+++ b/src/assets/icons/svg/international.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/ipvisits.svg b/src/assets/icons/svg/ipvisits.svg
similarity index 100%
rename from src/icons/svg/ipvisits.svg
rename to src/assets/icons/svg/ipvisits.svg
diff --git a/src/icons/svg/java.svg b/src/assets/icons/svg/java.svg
similarity index 100%
rename from src/icons/svg/java.svg
rename to src/assets/icons/svg/java.svg
diff --git a/src/assets/icons/svg/link.svg b/src/assets/icons/svg/link.svg
new file mode 100644
index 0000000..48197ba
--- /dev/null
+++ b/src/assets/icons/svg/link.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/list.svg b/src/assets/icons/svg/list.svg
similarity index 100%
rename from src/icons/svg/list.svg
rename to src/assets/icons/svg/list.svg
diff --git a/src/icons/svg/lock.svg b/src/assets/icons/svg/lock.svg
similarity index 100%
rename from src/icons/svg/lock.svg
rename to src/assets/icons/svg/lock.svg
diff --git a/src/icons/svg/log.svg b/src/assets/icons/svg/log.svg
similarity index 100%
rename from src/icons/svg/log.svg
rename to src/assets/icons/svg/log.svg
diff --git a/src/assets/icons/svg/login.svg b/src/assets/icons/svg/login.svg
new file mode 100644
index 0000000..cc5a854
--- /dev/null
+++ b/src/assets/icons/svg/login.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/markdown.svg b/src/assets/icons/svg/markdown.svg
similarity index 100%
rename from src/icons/svg/markdown.svg
rename to src/assets/icons/svg/markdown.svg
diff --git a/src/icons/svg/menu.svg b/src/assets/icons/svg/menu.svg
similarity index 100%
rename from src/icons/svg/menu.svg
rename to src/assets/icons/svg/menu.svg
diff --git a/src/assets/icons/svg/message.svg b/src/assets/icons/svg/message.svg
new file mode 100644
index 0000000..14ca817
--- /dev/null
+++ b/src/assets/icons/svg/message.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/svg/mnt.svg b/src/assets/icons/svg/mnt.svg
new file mode 100644
index 0000000..502a7c0
--- /dev/null
+++ b/src/assets/icons/svg/mnt.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/money.svg b/src/assets/icons/svg/money.svg
similarity index 100%
rename from src/icons/svg/money.svg
rename to src/assets/icons/svg/money.svg
diff --git a/src/icons/svg/monitor.svg b/src/assets/icons/svg/monitor.svg
similarity index 100%
rename from src/icons/svg/monitor.svg
rename to src/assets/icons/svg/monitor.svg
diff --git a/src/icons/svg/monthlyview.svg b/src/assets/icons/svg/monthlyview.svg
similarity index 100%
rename from src/icons/svg/monthlyview.svg
rename to src/assets/icons/svg/monthlyview.svg
diff --git a/src/assets/icons/svg/nested.svg b/src/assets/icons/svg/nested.svg
new file mode 100644
index 0000000..06713a8
--- /dev/null
+++ b/src/assets/icons/svg/nested.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/news.svg b/src/assets/icons/svg/news.svg
similarity index 100%
rename from src/icons/svg/news.svg
rename to src/assets/icons/svg/news.svg
diff --git a/src/icons/svg/order.svg b/src/assets/icons/svg/order.svg
similarity index 100%
rename from src/icons/svg/order.svg
rename to src/assets/icons/svg/order.svg
diff --git a/src/icons/svg/password.svg b/src/assets/icons/svg/password.svg
similarity index 100%
rename from src/icons/svg/password.svg
rename to src/assets/icons/svg/password.svg
diff --git a/src/assets/icons/svg/people.svg b/src/assets/icons/svg/people.svg
new file mode 100644
index 0000000..2bd54ae
--- /dev/null
+++ b/src/assets/icons/svg/people.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/peoples.svg b/src/assets/icons/svg/peoples.svg
similarity index 100%
rename from src/icons/svg/peoples.svg
rename to src/assets/icons/svg/peoples.svg
diff --git a/src/icons/svg/permission.svg b/src/assets/icons/svg/permission.svg
similarity index 100%
rename from src/icons/svg/permission.svg
rename to src/assets/icons/svg/permission.svg
diff --git a/src/icons/svg/phone.svg b/src/assets/icons/svg/phone.svg
similarity index 100%
rename from src/icons/svg/phone.svg
rename to src/assets/icons/svg/phone.svg
diff --git a/src/icons/svg/points.svg b/src/assets/icons/svg/points.svg
similarity index 100%
rename from src/icons/svg/points.svg
rename to src/assets/icons/svg/points.svg
diff --git a/src/icons/svg/pt.svg b/src/assets/icons/svg/pt.svg
similarity index 100%
rename from src/icons/svg/pt.svg
rename to src/assets/icons/svg/pt.svg
diff --git a/src/icons/svg/qiniu.svg b/src/assets/icons/svg/qiniu.svg
similarity index 100%
rename from src/icons/svg/qiniu.svg
rename to src/assets/icons/svg/qiniu.svg
diff --git a/src/icons/svg/redis.svg b/src/assets/icons/svg/redis.svg
similarity index 100%
rename from src/icons/svg/redis.svg
rename to src/assets/icons/svg/redis.svg
diff --git a/src/icons/svg/reply.svg b/src/assets/icons/svg/reply.svg
similarity index 100%
rename from src/icons/svg/reply.svg
rename to src/assets/icons/svg/reply.svg
diff --git a/src/icons/svg/role.svg b/src/assets/icons/svg/role.svg
similarity index 100%
rename from src/icons/svg/role.svg
rename to src/assets/icons/svg/role.svg
diff --git a/src/icons/svg/run.svg b/src/assets/icons/svg/run.svg
similarity index 100%
rename from src/icons/svg/run.svg
rename to src/assets/icons/svg/run.svg
diff --git a/src/icons/svg/running.svg b/src/assets/icons/svg/running.svg
similarity index 100%
rename from src/icons/svg/running.svg
rename to src/assets/icons/svg/running.svg
diff --git a/src/icons/svg/search.svg b/src/assets/icons/svg/search.svg
similarity index 100%
rename from src/icons/svg/search.svg
rename to src/assets/icons/svg/search.svg
diff --git a/src/icons/svg/seckill.svg b/src/assets/icons/svg/seckill.svg
similarity index 100%
rename from src/icons/svg/seckill.svg
rename to src/assets/icons/svg/seckill.svg
diff --git a/src/assets/icons/svg/server.svg b/src/assets/icons/svg/server.svg
new file mode 100644
index 0000000..db6dcdf
--- /dev/null
+++ b/src/assets/icons/svg/server.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/seven.svg b/src/assets/icons/svg/seven.svg
similarity index 100%
rename from src/icons/svg/seven.svg
rename to src/assets/icons/svg/seven.svg
diff --git a/src/icons/svg/shop.svg b/src/assets/icons/svg/shop.svg
similarity index 100%
rename from src/icons/svg/shop.svg
rename to src/assets/icons/svg/shop.svg
diff --git a/src/icons/svg/sign2.svg b/src/assets/icons/svg/sign2.svg
similarity index 100%
rename from src/icons/svg/sign2.svg
rename to src/assets/icons/svg/sign2.svg
diff --git a/src/assets/icons/svg/size.svg b/src/assets/icons/svg/size.svg
new file mode 100644
index 0000000..ddb25b8
--- /dev/null
+++ b/src/assets/icons/svg/size.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/svg/skill.svg b/src/assets/icons/svg/skill.svg
new file mode 100644
index 0000000..a3b7312
--- /dev/null
+++ b/src/assets/icons/svg/skill.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/svg/source.svg b/src/assets/icons/svg/source.svg
new file mode 100644
index 0000000..1c3a038
--- /dev/null
+++ b/src/assets/icons/svg/source.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/sqlMonitor.svg b/src/assets/icons/svg/sqlMonitor.svg
similarity index 100%
rename from src/icons/svg/sqlMonitor.svg
rename to src/assets/icons/svg/sqlMonitor.svg
diff --git a/src/icons/svg/swagger.svg b/src/assets/icons/svg/swagger.svg
similarity index 100%
rename from src/icons/svg/swagger.svg
rename to src/assets/icons/svg/swagger.svg
diff --git a/src/icons/svg/sys-tools.svg b/src/assets/icons/svg/sys-tools.svg
similarity index 100%
rename from src/icons/svg/sys-tools.svg
rename to src/assets/icons/svg/sys-tools.svg
diff --git a/src/icons/svg/system.svg b/src/assets/icons/svg/system.svg
similarity index 100%
rename from src/icons/svg/system.svg
rename to src/assets/icons/svg/system.svg
diff --git a/src/assets/icons/svg/tab.svg b/src/assets/icons/svg/tab.svg
new file mode 100644
index 0000000..b4b48e4
--- /dev/null
+++ b/src/assets/icons/svg/tab.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/task manege.svg b/src/assets/icons/svg/task manege.svg
similarity index 100%
rename from src/icons/svg/task manege.svg
rename to src/assets/icons/svg/task manege.svg
diff --git a/src/icons/svg/temp.svg b/src/assets/icons/svg/temp.svg
similarity index 100%
rename from src/icons/svg/temp.svg
rename to src/assets/icons/svg/temp.svg
diff --git a/src/assets/icons/svg/theme.svg b/src/assets/icons/svg/theme.svg
new file mode 100644
index 0000000..5982a2f
--- /dev/null
+++ b/src/assets/icons/svg/theme.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/timing.svg b/src/assets/icons/svg/timing.svg
similarity index 100%
rename from src/icons/svg/timing.svg
rename to src/assets/icons/svg/timing.svg
diff --git a/src/icons/svg/tixian.svg b/src/assets/icons/svg/tixian.svg
similarity index 100%
rename from src/icons/svg/tixian.svg
rename to src/assets/icons/svg/tixian.svg
diff --git a/src/icons/svg/today.svg b/src/assets/icons/svg/today.svg
similarity index 100%
rename from src/icons/svg/today.svg
rename to src/assets/icons/svg/today.svg
diff --git a/src/icons/svg/tools.svg b/src/assets/icons/svg/tools.svg
similarity index 100%
rename from src/icons/svg/tools.svg
rename to src/assets/icons/svg/tools.svg
diff --git a/src/assets/icons/svg/tree-table.svg b/src/assets/icons/svg/tree-table.svg
new file mode 100644
index 0000000..8aafdb8
--- /dev/null
+++ b/src/assets/icons/svg/tree-table.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/svg/tree.svg b/src/assets/icons/svg/tree.svg
new file mode 100644
index 0000000..dd4b7dd
--- /dev/null
+++ b/src/assets/icons/svg/tree.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/unlock.svg b/src/assets/icons/svg/unlock.svg
similarity index 100%
rename from src/icons/svg/unlock.svg
rename to src/assets/icons/svg/unlock.svg
diff --git a/src/icons/svg/user.svg b/src/assets/icons/svg/user.svg
similarity index 100%
rename from src/icons/svg/user.svg
rename to src/assets/icons/svg/user.svg
diff --git a/src/icons/svg/user1.svg b/src/assets/icons/svg/user1.svg
similarity index 100%
rename from src/icons/svg/user1.svg
rename to src/assets/icons/svg/user1.svg
diff --git a/src/icons/svg/validCode.svg b/src/assets/icons/svg/validCode.svg
similarity index 100%
rename from src/icons/svg/validCode.svg
rename to src/assets/icons/svg/validCode.svg
diff --git a/src/icons/svg/visits.svg b/src/assets/icons/svg/visits.svg
similarity index 100%
rename from src/icons/svg/visits.svg
rename to src/assets/icons/svg/visits.svg
diff --git a/src/assets/icons/svg/web.svg b/src/assets/icons/svg/web.svg
new file mode 100644
index 0000000..9c57415
--- /dev/null
+++ b/src/assets/icons/svg/web.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/svg/wechat.svg b/src/assets/icons/svg/wechat.svg
similarity index 100%
rename from src/icons/svg/wechat.svg
rename to src/assets/icons/svg/wechat.svg
diff --git a/src/icons/svg/weixin.svg b/src/assets/icons/svg/weixin.svg
similarity index 100%
rename from src/icons/svg/weixin.svg
rename to src/assets/icons/svg/weixin.svg
diff --git a/src/icons/svg/wxapp.svg b/src/assets/icons/svg/wxapp.svg
similarity index 100%
rename from src/icons/svg/wxapp.svg
rename to src/assets/icons/svg/wxapp.svg
diff --git a/src/icons/svg/wxpay.svg b/src/assets/icons/svg/wxpay.svg
similarity index 100%
rename from src/icons/svg/wxpay.svg
rename to src/assets/icons/svg/wxpay.svg
diff --git a/src/icons/svg/yingxiao.svg b/src/assets/icons/svg/yingxiao.svg
similarity index 100%
rename from src/icons/svg/yingxiao.svg
rename to src/assets/icons/svg/yingxiao.svg
diff --git a/src/icons/svg/zujian.svg b/src/assets/icons/svg/zujian.svg
similarity index 100%
rename from src/icons/svg/zujian.svg
rename to src/assets/icons/svg/zujian.svg
diff --git a/src/icons/svgo.yml b/src/assets/icons/svgo.yml
similarity index 100%
rename from src/icons/svgo.yml
rename to src/assets/icons/svgo.yml
diff --git a/src/assets/images/avatar.png b/src/assets/images/avatar.png
new file mode 100644
index 0000000..997732a
Binary files /dev/null and b/src/assets/images/avatar.png differ
diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png
new file mode 100644
index 0000000..b7371a5
Binary files /dev/null and b/src/assets/images/logo.png differ
diff --git a/src/assets/logo/logo.png b/src/assets/logo/logo.png
deleted file mode 100644
index 2e91776..0000000
Binary files a/src/assets/logo/logo.png and /dev/null differ
diff --git a/src/assets/styles/btn.scss b/src/assets/styles/btn.scss
new file mode 100644
index 0000000..8f47f2c
--- /dev/null
+++ b/src/assets/styles/btn.scss
@@ -0,0 +1,99 @@
+@import 'variables';
+
+@mixin colorBtn($color) {
+ background: $color;
+
+ &:hover {
+ color: $color;
+
+ &:before,
+ &:after {
+ background: $color;
+ }
+ }
+}
+
+.blue-btn {
+ @include colorBtn($blue)
+}
+
+.light-blue-btn {
+ @include colorBtn($light-blue)
+}
+
+.red-btn {
+ @include colorBtn($red)
+}
+
+.pink-btn {
+ @include colorBtn($pink)
+}
+
+.green-btn {
+ @include colorBtn($green)
+}
+
+.tiffany-btn {
+ @include colorBtn($tiffany)
+}
+
+.yellow-btn {
+ @include colorBtn($yellow)
+}
+
+.pan-btn {
+ font-size: 14px;
+ color: #fff;
+ padding: 14px 36px;
+ border-radius: 8px;
+ border: none;
+ outline: none;
+ transition: 600ms ease all;
+ position: relative;
+ display: inline-block;
+
+ &:hover {
+ background: #fff;
+
+ &:before,
+ &:after {
+ width: 100%;
+ transition: 600ms ease all;
+ }
+ }
+
+ &:before,
+ &:after {
+ content: '';
+ position: absolute;
+ top: 0;
+ right: 0;
+ height: 2px;
+ width: 0;
+ transition: 400ms ease all;
+ }
+
+ &::after {
+ right: inherit;
+ top: inherit;
+ left: 0;
+ bottom: 0;
+ }
+}
+
+.custom-button {
+ display: inline-block;
+ line-height: 1;
+ white-space: nowrap;
+ cursor: pointer;
+ background: #fff;
+ color: #fff;
+ -webkit-appearance: none;
+ text-align: center;
+ box-sizing: border-box;
+ outline: 0;
+ margin: 0;
+ padding: 10px 15px;
+ font-size: 14px;
+ border-radius: 4px;
+}
diff --git a/src/styles/description.scss b/src/assets/styles/description.scss
similarity index 100%
rename from src/styles/description.scss
rename to src/assets/styles/description.scss
diff --git a/src/assets/styles/eladmin.scss b/src/assets/styles/eladmin.scss
new file mode 100644
index 0000000..338cbba
--- /dev/null
+++ b/src/assets/styles/eladmin.scss
@@ -0,0 +1,100 @@
+.head-container {
+ padding-bottom: 10px;
+ .filter-item {
+ display: inline-block;
+ vertical-align: middle;
+ margin: 0 2px 10px 0;
+ input {
+ height: 30.5px;
+ line-height: 30.5px;
+ }
+ }
+ .el-select__caret.el-input__icon.el-icon-arrow-up{
+ line-height: 30.5px;
+ }
+ .date-item {
+ display: inline-block;
+ vertical-align: middle;
+ margin-bottom: 10px;
+ height: 30.5px;
+ width: 223px;
+ }
+}
+.el-avatar {
+ display: inline-block;
+ text-align: center;
+ background: #ccc;
+ color: #fff;
+ white-space: nowrap;
+ position: relative;
+ overflow: hidden;
+ vertical-align: middle;
+ width: 32px;
+ height: 32px;
+ line-height: 32px;
+ border-radius: 16px;
+}
+
+.logo-con{
+ height: 60px;
+ padding: 13px 0 0;
+ img{
+ height: 32px;
+ width: 135px;
+ display: block;
+ //margin: 0 auto;
+ }
+}
+
+#el-login-footer {
+ height: 40px;
+ line-height: 40px;
+ position: fixed;
+ bottom: 0;
+ width: 100%;
+ text-align: center;
+ color: #fff;
+ font-family: Arial, serif;
+ font-size: 12px;
+ letter-spacing: 1px;
+}
+
+#el-main-footer {
+ background: none repeat scroll 0 0 white;
+ border-top: 1px solid #e7eaec;
+ overflow: hidden;
+ padding: 10px 6px 0 6px;
+ height: 33px;
+ font-size: 0.7rem !important;
+ color: #7a8b9a;
+ letter-spacing: 0.8px;
+ font-family: Arial, sans-serif !important;
+ position: fixed;
+ bottom: 0;
+ z-index: 99;
+ width: 100%;
+}
+.eladmin-upload {
+ border: 1px dashed #c0ccda;
+ border-radius: 5px;
+ height: 45px;
+ line-height: 45px;
+ width: 368px;
+}
+.my-blockquote{
+ margin: 0 0 10px;
+ padding: 15px;
+ line-height: 22px;
+ border-left: 5px solid #00437B;
+ border-radius: 0 2px 2px 0;
+ background-color: #f2f2f2;
+}
+.my-code{
+ position: relative;
+ padding: 15px;
+ line-height: 20px;
+ border-left: 5px solid #ddd;
+ color: #333;
+ font-family: Courier New, serif;
+ font-size: 12px
+}
diff --git a/src/assets/styles/element-ui.scss b/src/assets/styles/element-ui.scss
new file mode 100644
index 0000000..8f7881c
--- /dev/null
+++ b/src/assets/styles/element-ui.scss
@@ -0,0 +1,79 @@
+// cover some element-ui styles
+
+.el-breadcrumb__inner,
+.el-breadcrumb__inner a {
+ font-weight: 400 !important;
+}
+
+.el-upload {
+ input[type="file"] {
+ display: none !important;
+ }
+}
+
+.el-upload__input {
+ display: none;
+}
+
+.cell {
+ .el-tag {
+ margin-right: 0;
+ }
+}
+
+.small-padding {
+ .cell {
+ padding-left: 5px;
+ padding-right: 5px;
+ }
+}
+
+.fixed-width {
+ .el-button--mini {
+ padding: 7px 10px;
+ width: 60px;
+ }
+}
+
+.status-col {
+ .cell {
+ padding: 0 10px;
+ text-align: center;
+
+ .el-tag {
+ margin-right: 0;
+ }
+ }
+}
+
+// to fixed https://github.com/ElemeFE/element/issues/2461
+.el-dialog {
+ transform: none;
+ left: 0;
+ position: relative;
+ margin: 0 auto;
+}
+
+// refine element ui upload
+.upload-container {
+ .el-upload {
+ width: 100%;
+
+ .el-upload-dragger {
+ width: 100%;
+ height: 200px;
+ }
+ }
+}
+
+// dropdown
+.el-dropdown-menu {
+ a {
+ display: block
+ }
+}
+
+// fix date-picker ui bug in filter-item
+.el-range-editor.el-input__inner {
+ display: inline-flex !important;
+}
diff --git a/src/styles/element-variables.scss b/src/assets/styles/element-variables.scss
similarity index 90%
rename from src/styles/element-variables.scss
rename to src/assets/styles/element-variables.scss
index 30a0e6b..a4f8c4a 100644
--- a/src/styles/element-variables.scss
+++ b/src/assets/styles/element-variables.scss
@@ -22,7 +22,7 @@ $--table-border:1px solid#dfe6ec;
/* icon font path, required */
$--font-path: '~element-ui/lib/theme-chalk/fonts';
-@import "~element-ui/packages/theme-chalk/src/index";
+@import "../../../node_modules/element-ui/packages/theme-chalk/src/index";
// the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss
new file mode 100644
index 0000000..21fbda1
--- /dev/null
+++ b/src/assets/styles/index.scss
@@ -0,0 +1,182 @@
+@import 'variables';
+@import 'mixin';
+@import 'transition';
+@import 'element-ui';
+@import 'sidebar';
+@import 'btn';
+@import 'eladmin';
+
+body {
+ height: 100%;
+ -moz-osx-font-smoothing: grayscale;
+ -webkit-font-smoothing: antialiased;
+ text-rendering: optimizeLegibility;
+ font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
+}
+
+label {
+ font-weight: 700;
+}
+
+html {
+ height: 100%;
+ box-sizing: border-box;
+}
+
+#app {
+ height: 100%;
+}
+
+*,
+*:before,
+*:after {
+ box-sizing: inherit;
+}
+
+.no-padding {
+ padding: 0 !important;
+}
+
+.padding-content {
+ padding: 4px 0;
+}
+
+a:focus,
+a:active {
+ outline: none;
+}
+
+a,
+a:focus,
+a:hover {
+ cursor: pointer;
+ color: inherit;
+ text-decoration: none;
+}
+
+div:focus {
+ outline: none;
+}
+
+.fr {
+ float: right;
+}
+
+.fl {
+ float: left;
+}
+
+.pr-5 {
+ padding-right: 5px;
+}
+
+.pl-5 {
+ padding-left: 5px;
+}
+
+.block {
+ display: block;
+}
+
+.pointer {
+ cursor: pointer;
+}
+
+.inlineBlock {
+ display: block;
+}
+
+.clearfix {
+ &:after {
+ visibility: hidden;
+ display: block;
+ font-size: 0;
+ content: " ";
+ clear: both;
+ height: 0;
+ }
+}
+
+aside {
+ background: #eef1f6;
+ padding: 8px 24px;
+ margin-bottom: 20px;
+ border-radius: 2px;
+ display: block;
+ line-height: 32px;
+ font-size: 16px;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
+ color: #2c3e50;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+
+ a {
+ color: #337ab7;
+ cursor: pointer;
+
+ &:hover {
+ color: rgb(32, 160, 255);
+ }
+ }
+}
+
+//main-container全局样式
+.app-container {
+ padding: 20px 20px 45px 20px;
+}
+
+.components-container {
+ margin: 30px 50px;
+ position: relative;
+}
+
+.pagination-container {
+ margin-top: 30px;
+}
+
+.text-center {
+ text-align: center
+}
+
+.sub-navbar {
+ height: 50px;
+ line-height: 50px;
+ position: relative;
+ width: 100%;
+ text-align: right;
+ padding-right: 20px;
+ transition: 600ms ease position;
+ background: linear-gradient(90deg, rgba(32, 182, 249, 1) 0%, rgba(32, 182, 249, 1) 0%, rgba(33, 120, 241, 1) 100%, rgba(33, 120, 241, 1) 100%);
+
+ .subtitle {
+ font-size: 20px;
+ color: #fff;
+ }
+
+ &.draft {
+ background: #d0d0d0;
+ }
+
+ &.deleted {
+ background: #d0d0d0;
+ }
+}
+
+.link-type,
+.link-type:focus {
+ color: #337ab7;
+ cursor: pointer;
+
+ &:hover {
+ color: rgb(32, 160, 255);
+ }
+}
+
+//refine vue-multiselect plugin
+.multiselect {
+ line-height: 16px;
+}
+
+.multiselect--active {
+ z-index: 1000 !important;
+}
diff --git a/src/assets/styles/mixin.scss b/src/assets/styles/mixin.scss
new file mode 100644
index 0000000..06fa061
--- /dev/null
+++ b/src/assets/styles/mixin.scss
@@ -0,0 +1,66 @@
+@mixin clearfix {
+ &:after {
+ content: "";
+ display: table;
+ clear: both;
+ }
+}
+
+@mixin scrollBar {
+ &::-webkit-scrollbar-track-piece {
+ background: #d3dce6;
+ }
+
+ &::-webkit-scrollbar {
+ width: 6px;
+ }
+
+ &::-webkit-scrollbar-thumb {
+ background: #99a9bf;
+ border-radius: 20px;
+ }
+}
+
+@mixin relative {
+ position: relative;
+ width: 100%;
+ height: 100%;
+}
+
+@mixin pct($pct) {
+ width: #{$pct};
+ position: relative;
+ margin: 0 auto;
+}
+
+@mixin triangle($width, $height, $color, $direction) {
+ $width: $width/2;
+ $color-border-style: $height solid $color;
+ $transparent-border-style: $width solid transparent;
+ height: 0;
+ width: 0;
+
+ @if $direction==up {
+ border-bottom: $color-border-style;
+ border-left: $transparent-border-style;
+ border-right: $transparent-border-style;
+ }
+
+ @else if $direction==right {
+ border-left: $color-border-style;
+ border-top: $transparent-border-style;
+ border-bottom: $transparent-border-style;
+ }
+
+ @else if $direction==down {
+ border-top: $color-border-style;
+ border-left: $transparent-border-style;
+ border-right: $transparent-border-style;
+ }
+
+ @else if $direction==left {
+ border-right: $color-border-style;
+ border-top: $transparent-border-style;
+ border-bottom: $transparent-border-style;
+ }
+}
diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss
new file mode 100644
index 0000000..17381fc
--- /dev/null
+++ b/src/assets/styles/sidebar.scss
@@ -0,0 +1,209 @@
+#app {
+
+ .main-container {
+ min-height: 100%;
+ transition: margin-left .28s;
+ margin-left: $sideBarWidth;
+ position: relative;
+ }
+
+ .sidebar-container {
+ transition: width 0.28s;
+ width: $sideBarWidth !important;
+ background-color: $menuBg;
+ height: 100%;
+ position: fixed;
+ font-size: 0;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 1001;
+ overflow: hidden;
+
+ // reset element-ui css
+ .horizontal-collapse-transition {
+ transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
+ }
+
+ .scrollbar-wrapper {
+ overflow-x: hidden !important;
+ }
+
+ .el-scrollbar__bar.is-vertical {
+ right: 0;
+ }
+
+ .el-scrollbar {
+ height: 100%;
+ }
+
+ &.has-logo {
+ .el-scrollbar {
+ height: calc(100% - 50px);
+ }
+ }
+
+ .is-horizontal {
+ display: none;
+ }
+
+ a {
+ display: inline-block;
+ width: 100%;
+ overflow: hidden;
+ }
+
+ .svg-icon {
+ margin-right: 16px;
+ }
+
+ .el-menu {
+ border: none;
+ height: 100%;
+ width: 100% !important;
+ }
+
+ // menu hover
+ .submenu-title-noDropdown,
+ .el-submenu__title {
+ &:hover {
+ background-color: $menuHover !important;
+ }
+ }
+
+ .is-active>.el-submenu__title {
+ color: $subMenuActiveText !important;
+ }
+
+ & .nest-menu .el-submenu>.el-submenu__title,
+ & .el-submenu .el-menu-item {
+ min-width: $sideBarWidth !important;
+ background-color: $subMenuBg !important;
+
+ &:hover {
+ background-color: $subMenuHover !important;
+ }
+ }
+ }
+
+ .hideSidebar {
+ .sidebar-container {
+ width: 54px !important;
+ }
+
+ .main-container {
+ margin-left: 54px;
+ }
+
+ .submenu-title-noDropdown {
+ padding: 0 !important;
+ position: relative;
+
+ .el-tooltip {
+ padding: 0 !important;
+
+ .svg-icon {
+ margin-left: 20px;
+ }
+ }
+ }
+
+ .el-submenu {
+ overflow: hidden;
+
+ &>.el-submenu__title {
+ padding: 0 !important;
+
+ .svg-icon {
+ margin-left: 20px;
+ }
+
+ .el-submenu__icon-arrow {
+ display: none;
+ }
+ }
+ }
+
+ .el-menu--collapse {
+ .el-submenu {
+ &>.el-submenu__title {
+ &>span {
+ height: 0;
+ width: 0;
+ overflow: hidden;
+ visibility: hidden;
+ display: inline-block;
+ }
+ }
+ }
+ }
+ }
+
+ .el-menu--collapse .el-menu .el-submenu {
+ min-width: $sideBarWidth !important;
+ }
+
+ // mobile responsive
+ .mobile {
+ .main-container {
+ margin-left: 0;
+ }
+
+ .sidebar-container {
+ transition: transform .28s;
+ width: $sideBarWidth !important;
+ }
+
+ &.hideSidebar {
+ .sidebar-container {
+ pointer-events: none;
+ transition-duration: 0.3s;
+ transform: translate3d(-$sideBarWidth, 0, 0);
+ }
+ }
+ }
+
+ .withoutAnimation {
+
+ .main-container,
+ .sidebar-container {
+ transition: none;
+ }
+ }
+}
+
+// when menu collapsed
+.el-menu--vertical {
+ &>.el-menu {
+ .svg-icon {
+ margin-right: 16px;
+ }
+ }
+
+ .nest-menu .el-submenu>.el-submenu__title,
+ .el-menu-item {
+ &:hover {
+ // you can use $subMenuHover
+ background-color: $menuHover !important;
+ }
+ }
+
+ // the scroll bar appears when the subMenu is too long
+ >.el-menu--popup {
+ max-height: 100vh;
+ overflow-y: auto;
+
+ &::-webkit-scrollbar-track-piece {
+ background: #d3dce6;
+ }
+
+ &::-webkit-scrollbar {
+ width: 6px;
+ }
+
+ &::-webkit-scrollbar-thumb {
+ background: #99a9bf;
+ border-radius: 20px;
+ }
+ }
+}
diff --git a/src/styles/transition.scss b/src/assets/styles/transition.scss
similarity index 87%
rename from src/styles/transition.scss
rename to src/assets/styles/transition.scss
index 8dd9b04..4cb27cc 100644
--- a/src/styles/transition.scss
+++ b/src/assets/styles/transition.scss
@@ -1,6 +1,6 @@
-//globl transition css
+// global transition css
-/*fade*/
+/* fade */
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.28s;
@@ -11,21 +11,23 @@
opacity: 0;
}
-/*fade-transform*/
+/* fade-transform */
.fade-transform-leave-active,
.fade-transform-enter-active {
transition: all .5s;
}
+
.fade-transform-enter {
opacity: 0;
transform: translateX(-30px);
}
+
.fade-transform-leave-to {
opacity: 0;
transform: translateX(30px);
}
-/*fade*/
+/* breadcrumb transition */
.breadcrumb-enter-active,
.breadcrumb-leave-active {
transition: all .5s;
diff --git a/src/styles/variables.scss b/src/assets/styles/variables.scss
similarity index 75%
rename from src/styles/variables.scss
rename to src/assets/styles/variables.scss
index 2130ff5..41de79c 100644
--- a/src/styles/variables.scss
+++ b/src/assets/styles/variables.scss
@@ -1,4 +1,14 @@
-//sidebar
+// base color
+$blue:#324157;
+$light-blue:#3A71A8;
+$red:#C03639;
+$pink: #E65D6E;
+$green: #30B08F;
+$tiffany: #4AB7BD;
+$yellow:#FEC171;
+$panGreen: #30B08F;
+
+// sidebar
$menuText:#bfcbd9;
$menuActiveText:#409EFF;
$subMenuActiveText:#f4f4f5; // https://github.com/ElemeFE/element/issues/12951
@@ -9,9 +19,7 @@ $menuHover:#263445;
$subMenuBg:#1f2d3d;
$subMenuHover:#001528;
-$sideBarWidth: 180px;
-
-$hideSidebarWidth: 38px;
+$sideBarWidth: 205px;
// the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue
index 96b78dc..204ea59 100644
--- a/src/components/Breadcrumb/index.vue
+++ b/src/components/Breadcrumb/index.vue
@@ -1,7 +1,7 @@
-
+
{{ item.meta.title }}
{{ item.meta.title }}
@@ -19,7 +19,11 @@ export default {
}
},
watch: {
- $route() {
+ $route(route) {
+ // if you go to the redirect page, do not update the breadcrumbs
+ if (route.path.startsWith('/redirect/')) {
+ return
+ }
this.getBreadcrumb()
}
},
@@ -28,19 +32,22 @@ export default {
},
methods: {
getBreadcrumb() {
- let matched = this.$route.matched.filter(item => {
- if (item.name) {
- return true
- }
- })
+ // only show routes with meta.title
+ let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
const first = matched[0]
- if (first && first.name !== '首页') {
+
+ if (!this.isDashboard(first)) {
matched = [{ path: '/dashboard', meta: { title: '首页' }}].concat(matched)
}
- if (matched.length >= 4) {
- matched.splice(1, 1)
+
+ this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
+ },
+ isDashboard(route) {
+ const name = route && route.name
+ if (!name) {
+ return false
}
- this.levelList = matched
+ return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase()
},
pathCompile(path) {
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
@@ -60,15 +67,15 @@ export default {
}
-
diff --git a/src/components/Crud/CRUD.operation.vue b/src/components/Crud/CRUD.operation.vue
new file mode 100644
index 0000000..de052b7
--- /dev/null
+++ b/src/components/Crud/CRUD.operation.vue
@@ -0,0 +1,179 @@
+
+
+
+
+
+
+ 新增
+
+
+ 修改
+
+
+ 删除
+
+ 导出
+
+
+
+
+
+
+
+
+
+
+
+ 全选
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
diff --git a/src/components/Crud/Pagination.vue b/src/components/Crud/Pagination.vue
new file mode 100644
index 0000000..d4482fb
--- /dev/null
+++ b/src/components/Crud/Pagination.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
diff --git a/src/components/Crud/RR.operation.vue b/src/components/Crud/RR.operation.vue
new file mode 100644
index 0000000..71453d5
--- /dev/null
+++ b/src/components/Crud/RR.operation.vue
@@ -0,0 +1,22 @@
+
+
+
+ 搜索
+ 重置
+
+
+
diff --git a/src/components/Crud/UD.operation.vue b/src/components/Crud/UD.operation.vue
new file mode 100644
index 0000000..38f3339
--- /dev/null
+++ b/src/components/Crud/UD.operation.vue
@@ -0,0 +1,71 @@
+
+
+
+
+ {{ msg }}
+
+ 取消
+ 确定
+
+
+
+
+
+
diff --git a/src/components/Crud/crud.js b/src/components/Crud/crud.js
new file mode 100644
index 0000000..a07ce92
--- /dev/null
+++ b/src/components/Crud/crud.js
@@ -0,0 +1,773 @@
+import { initData, download } from '@/api/data'
+import { parseTime, downloadFile } from '@/utils/index'
+import Vue from 'vue'
+
+/**
+ * CRUD配置
+ * @author moxun
+ * @param {*} options
+ * @return crud instance.
+ * @example
+ */
+function CRUD(options) {
+ const defaultOptions = {
+ // 标题
+ title: '',
+ // 请求数据的url
+ url: '',
+ // 表格数据
+ data: [],
+ // 选择项
+ selections: [],
+ // 待查询的对象
+ query: {},
+ // 查询数据的参数
+ params: {},
+ // Form 表单
+ form: {},
+ // 重置表单
+ defaultForm: () => {},
+ // 排序规则,默认 id 降序, 支持多字段排序 ['id,desc', 'createTime,asc']
+ sort: ['id,desc'],
+ // 等待时间
+ time: 50,
+ // CRUD Method
+ crudMethod: {
+ add: (form) => {},
+ delete: (id) => {},
+ edit: (form) => {},
+ get: (id) => {}
+ },
+ // 主页操作栏显示哪些按钮
+ optShow: {
+ add: true,
+ edit: true,
+ del: true,
+ download: true
+ },
+ // 自定义一些扩展属性
+ props: {},
+ // 在主页准备
+ queryOnPresenterCreated: true,
+ // 调试开关
+ debug: false
+ }
+ options = mergeOptions(defaultOptions, options)
+ const data = {
+ ...options,
+ // 记录数据状态
+ dataStatus: {},
+ status: {
+ add: CRUD.STATUS.NORMAL,
+ edit: CRUD.STATUS.NORMAL,
+ // 添加或编辑状态
+ get cu() {
+ if (this.add === CRUD.STATUS.NORMAL && this.edit === CRUD.STATUS.NORMAL) {
+ return CRUD.STATUS.NORMAL
+ } else if (this.add === CRUD.STATUS.PREPARED || this.edit === CRUD.STATUS.PREPARED) {
+ return CRUD.STATUS.PREPARED
+ } else if (this.add === CRUD.STATUS.PROCESSING || this.edit === CRUD.STATUS.PROCESSING) {
+ return CRUD.STATUS.PROCESSING
+ }
+ throw new Error('wrong crud\'s cu status')
+ },
+ // 标题
+ get title() {
+ return this.add > CRUD.STATUS.NORMAL ? `新增${crud.title}` : this.edit > CRUD.STATUS.NORMAL ? `编辑${crud.title}` : crud.title
+ }
+ },
+ msg: {
+ submit: '提交成功',
+ add: '新增成功',
+ edit: '编辑成功',
+ del: '删除成功'
+ },
+ page: {
+ // 页码
+ page: 0,
+ // 每页数据条数
+ size: 10,
+ // 总数据条数
+ total: 0
+ },
+ // 整体loading
+ loading: true,
+ // 导出的 Loading
+ downloadLoading: false,
+ // 删除的 Loading
+ delAllLoading: false
+ }
+ const methods = {
+ /**
+ * 通用的提示
+ */
+ submitSuccessNotify() {
+ crud.notify(crud.msg.submit, CRUD.NOTIFICATION_TYPE.SUCCESS)
+ },
+ addSuccessNotify() {
+ crud.notify(crud.msg.add, CRUD.NOTIFICATION_TYPE.SUCCESS)
+ },
+ editSuccessNotify() {
+ crud.notify(crud.msg.edit, CRUD.NOTIFICATION_TYPE.SUCCESS)
+ },
+ delSuccessNotify() {
+ crud.notify(crud.msg.del, CRUD.NOTIFICATION_TYPE.SUCCESS)
+ },
+ // 搜索
+ toQuery() {
+ crud.page.page = 1
+ crud.refresh()
+ },
+ // 刷新
+ refresh() {
+ if (!callVmHook(crud, CRUD.HOOK.beforeRefresh)) {
+ return
+ }
+ return new Promise((resolve, reject) => {
+ crud.loading = true
+ // 请求数据
+ initData(crud.url, crud.getQueryParams()).then(data => {
+ crud.page.total = data.totalElements
+ crud.data = data.content
+ crud.resetDataStatus()
+ // time 毫秒后显示表格
+ setTimeout(() => {
+ crud.loading = false
+ callVmHook(crud, CRUD.HOOK.afterRefresh)
+ }, crud.time)
+ resolve(data)
+ }).catch(err => {
+ crud.loading = false
+ reject(err)
+ })
+ })
+ },
+ /**
+ * 启动添加
+ */
+ toAdd() {
+ if (!(callVmHook(crud, CRUD.HOOK.beforeToAdd, crud.form) && callVmHook(crud, CRUD.HOOK.beforeToCU, crud.form))) {
+ return
+ }
+ crud.status.add = CRUD.STATUS.PREPARED
+ callVmHook(crud, CRUD.HOOK.afterToAdd, crud.form)
+ callVmHook(crud, CRUD.HOOK.afterToCU, crud.form)
+ },
+ /**
+ * 启动编辑
+ * @param {*} data 数据项
+ */
+ toEdit(data) {
+ crud.resetForm(JSON.parse(JSON.stringify(data)))
+ if (!(callVmHook(crud, CRUD.HOOK.beforeToEdit, crud.form) && callVmHook(crud, CRUD.HOOK.beforeToCU, crud.form))) {
+ return
+ }
+ crud.status.edit = CRUD.STATUS.PREPARED
+ crud.getDataStatus(data.id).edit = CRUD.STATUS.PREPARED
+ callVmHook(crud, CRUD.HOOK.afterToEdit, crud.form)
+ callVmHook(crud, CRUD.HOOK.afterToCU, crud.form)
+ },
+ /**
+ * 启动删除
+ * @param {*} data 数据项
+ */
+ toDelete(data) {
+ crud.getDataStatus(data.id).delete = CRUD.STATUS.PREPARED
+ },
+ /**
+ * 取消删除
+ * @param {*} data 数据项
+ */
+ cancelDelete(data) {
+ if (!callVmHook(crud, CRUD.HOOK.beforeDeleteCancel, data)) {
+ return
+ }
+ crud.getDataStatus(data.id).delete = CRUD.STATUS.NORMAL
+ callVmHook(crud, CRUD.HOOK.afterDeleteCancel, data)
+ },
+ /**
+ * 取消新增/编辑
+ */
+ cancelCU() {
+ const addStatus = crud.status.add
+ const editStatus = crud.status.edit
+ if (addStatus === CRUD.STATUS.PREPARED) {
+ if (!callVmHook(crud, CRUD.HOOK.beforeAddCancel, crud.form)) {
+ return
+ }
+ crud.status.add = CRUD.STATUS.NORMAL
+ }
+ if (editStatus === CRUD.STATUS.PREPARED) {
+ if (!callVmHook(crud, CRUD.HOOK.beforeEditCancel, crud.form)) {
+ return
+ }
+ crud.status.edit = CRUD.STATUS.NORMAL
+ crud.getDataStatus(crud.form.id).edit = CRUD.STATUS.NORMAL
+ }
+ crud.resetForm()
+ if (addStatus === CRUD.STATUS.PREPARED) {
+ callVmHook(crud, CRUD.HOOK.afterAddCancel, crud.form)
+ }
+ if (editStatus === CRUD.STATUS.PREPARED) {
+ callVmHook(crud, CRUD.HOOK.afterEditCancel, crud.form)
+ }
+ // 清除表单验证
+ if (crud.findVM('form').$refs['form']) {
+ crud.findVM('form').$refs['form'].clearValidate()
+ }
+ },
+ /**
+ * 提交新增/编辑
+ */
+ submitCU() {
+ if (!callVmHook(crud, CRUD.HOOK.beforeValidateCU)) {
+ return
+ }
+ crud.findVM('form').$refs['form'].validate(valid => {
+ if (!valid) {
+ return
+ }
+ if (!callVmHook(crud, CRUD.HOOK.afterValidateCU)) {
+ return
+ }
+ if (crud.status.add === CRUD.STATUS.PREPARED) {
+ crud.doAdd()
+ } else if (crud.status.edit === CRUD.STATUS.PREPARED) {
+ crud.doEdit()
+ }
+ })
+ },
+ /**
+ * 执行添加
+ */
+ doAdd() {
+ if (!callVmHook(crud, CRUD.HOOK.beforeSubmit)) {
+ return
+ }
+ crud.crudMethod.add(crud.form).then(() => {
+ crud.status.add = CRUD.STATUS.NORMAL
+ crud.resetForm()
+ crud.addSuccessNotify()
+ callVmHook(crud, CRUD.HOOK.afterSubmit)
+ crud.toQuery()
+ }).catch(() => {
+ callVmHook(crud, CRUD.HOOK.afterAddError)
+ })
+ },
+ /**
+ * 执行编辑
+ */
+ doEdit() {
+ if (!callVmHook(crud, CRUD.HOOK.beforeSubmit)) {
+ return
+ }
+ crud.crudMethod.edit(crud.form).then(() => {
+ crud.status.edit = CRUD.STATUS.NORMAL
+ crud.getDataStatus(crud.form.id).edit = CRUD.STATUS.NORMAL
+ crud.editSuccessNotify()
+ crud.resetForm()
+ callVmHook(crud, CRUD.HOOK.afterSubmit)
+ crud.refresh()
+ }).catch(() => {
+ callVmHook(crud, CRUD.HOOK.afterEditError)
+ })
+ },
+ /**
+ * 执行删除
+ * @param {*} data 数据项
+ */
+ doDelete(data) {
+ let delAll = false
+ let dataStatus
+ const ids = []
+ if (data instanceof Array) {
+ delAll = true
+ data.forEach(val => {
+ ids.push(val.id)
+ })
+ } else {
+ ids.push(data.id)
+ dataStatus = crud.getDataStatus(data.id)
+ }
+ if (!callVmHook(crud, CRUD.HOOK.beforeDelete, data)) {
+ return
+ }
+ if (!delAll) {
+ dataStatus.delete = CRUD.STATUS.PROCESSING
+ }
+ return crud.crudMethod.del(ids).then(() => {
+ if (delAll) {
+ crud.delAllLoading = false
+ } else dataStatus.delete = CRUD.STATUS.PREPARED
+ crud.dleChangePage(1)
+ crud.delSuccessNotify()
+ callVmHook(crud, CRUD.HOOK.afterDelete, data)
+ crud.refresh()
+ }).catch(() => {
+ if (delAll) {
+ crud.delAllLoading = false
+ } else dataStatus.delete = CRUD.STATUS.PREPARED
+ })
+ },
+ /**
+ * 通用导出
+ */
+ doExport() {
+ crud.downloadLoading = true
+ download(crud.url + '/download', crud.getQueryParams()).then(result => {
+ downloadFile(result, crud.title + '数据', 'xlsx')
+ crud.downloadLoading = false
+ }).catch(() => {
+ crud.downloadLoading = false
+ })
+ },
+ /**
+ * 获取查询参数
+ */
+ getQueryParams: function() {
+ return {
+ page: crud.page.page - 1,
+ size: crud.page.size,
+ sort: crud.sort,
+ ...crud.query,
+ ...crud.params
+ }
+ },
+ // 当前页改变
+ pageChangeHandler(e) {
+ crud.page.page = e
+ crud.refresh()
+ },
+ // 每页条数改变
+ sizeChangeHandler(e) {
+ crud.page.size = e
+ crud.page.page = 1
+ crud.refresh()
+ },
+ // 预防删除第二页最后一条数据时,或者多选删除第二页的数据时,页码错误导致请求无数据
+ dleChangePage(size) {
+ if (crud.data.length === size && crud.page.page !== 1) {
+ crud.page.page -= 1
+ }
+ },
+ // 选择改变
+ selectionChangeHandler(val) {
+ crud.selections = val
+ },
+ /**
+ * 重置查询参数
+ * @param {Boolean} toQuery 重置后进行查询操作
+ */
+ resetQuery(toQuery = true) {
+ const defaultQuery = JSON.parse(JSON.stringify(crud.defaultQuery))
+ const query = crud.query
+ Object.keys(query).forEach(key => {
+ query[key] = defaultQuery[key]
+ })
+ if (toQuery) {
+ crud.toQuery()
+ }
+ },
+ /**
+ * 重置表单
+ * @param {Array} data 数据
+ */
+ resetForm(data) {
+ const form = data || (typeof crud.defaultForm === 'object' ? JSON.parse(JSON.stringify(crud.defaultForm)) : crud.defaultForm())
+ const crudFrom = crud.form
+ for (const key in form) {
+ if (crudFrom.hasOwnProperty(key)) {
+ crudFrom[key] = form[key]
+ } else {
+ Vue.set(crudFrom, key, form[key])
+ }
+ }
+ },
+ /**
+ * 重置数据状态
+ */
+ resetDataStatus() {
+ const dataStatus = {}
+ function resetStatus(datas) {
+ datas.forEach(e => {
+ dataStatus[e.id] = {
+ delete: 0,
+ edit: 0
+ }
+ if (e.children) {
+ resetStatus(e.children)
+ }
+ })
+ }
+ resetStatus(crud.data)
+ crud.dataStatus = dataStatus
+ },
+ /**
+ * 获取数据状态
+ * @param {Number | String} id 数据项id
+ */
+ getDataStatus(id) {
+ return crud.dataStatus[id]
+ },
+ /**
+ * 用于树形表格多选, 选中所有
+ * @param selection
+ */
+ selectAllChange(selection) {
+ // 如果选中的数目与请求到的数目相同就选中子节点,否则就清空选中
+ if (selection && selection.length === crud.data.length) {
+ selection.forEach(val => {
+ crud.selectChange(selection, val)
+ })
+ } else {
+ crud.findVM('presenter').$refs['table'].clearSelection()
+ }
+ },
+ /**
+ * 用于树形表格多选,单选的封装
+ * @param selection
+ * @param row
+ */
+ selectChange(selection, row) {
+ // 如果selection中存在row代表是选中,否则是取消选中
+ if (selection.find(val => { return val.id === row.id })) {
+ if (row.children) {
+ row.children.forEach(val => {
+ crud.findVM('presenter').$refs['table'].toggleRowSelection(val, true)
+ selection.push(val)
+ if (val.children) {
+ crud.selectChange(selection, val)
+ }
+ })
+ }
+ } else {
+ crud.toggleRowSelection(selection, row)
+ }
+ },
+ /**
+ * 切换选中状态
+ * @param selection
+ * @param data
+ */
+ toggleRowSelection(selection, data) {
+ if (data.children) {
+ data.children.forEach(val => {
+ crud.findVM('presenter').$refs['table'].toggleRowSelection(val, false)
+ if (val.children) {
+ crud.toggleRowSelection(selection, val)
+ }
+ })
+ }
+ },
+ findVM(type) {
+ return crud.vms.find(vm => vm && vm.type === type).vm
+ },
+ notify(title, type = CRUD.NOTIFICATION_TYPE.INFO) {
+ crud.vms[0].vm.$notify({
+ title,
+ type,
+ duration: 2500
+ })
+ },
+ updateProp(name, value) {
+ Vue.set(crud.props, name, value)
+ }
+ }
+ const crud = Object.assign({}, data)
+ // 可观测化
+ Vue.observable(crud)
+ // 附加方法
+ Object.assign(crud, methods)
+ // 记录初始默认的查询参数,后续重置查询时使用
+ Object.assign(crud, {
+ defaultQuery: JSON.parse(JSON.stringify(data.query)),
+ // 预留4位存储:组件 主页、头部、分页、表单,调试查看也方便找
+ vms: Array(4),
+ /**
+ * 注册组件实例
+ * @param {String} type 类型
+ * @param {*} vm 组件实例
+ * @param {Number} index 该参数内部使用
+ */
+ registerVM(type, vm, index = -1) {
+ const vmObj = {
+ type,
+ vm: vm
+ }
+ if (index < 0) {
+ this.vms.push(vmObj)
+ return
+ }
+ this.vms.length = Math.max(this.vms.length, index)
+ this.vms.splice(index, 1, vmObj)
+ },
+ /**
+ * 取消注册组件实例
+ * @param {*} vm 组件实例
+ */
+ unregisterVM(vm) {
+ this.vms.splice(this.vms.findIndex(e => e && e.vm === vm), 1)
+ }
+ })
+ // 冻结处理,需要扩展数据的话,使用crud.updateProp(name, value),以crud.props.name形式访问,这个是响应式的,可以做数据绑定
+ Object.freeze(crud)
+ return crud
+}
+
+// hook VM
+function callVmHook(crud, hook) {
+ if (crud.debug) {
+ console.log('callVmHook: ' + hook)
+ }
+ let ret = true
+ const nargs = [crud]
+ for (let i = 2; i < arguments.length; ++i) {
+ nargs.push(arguments[i])
+ }
+ // 有些组件扮演了多个角色,调用钩子时,需要去重
+ const vmSet = new Set()
+ crud.vms.forEach(vm => vm && vmSet.add(vm.vm))
+ vmSet.forEach(vm => {
+ if (vm[hook]) {
+ ret = vm[hook].apply(vm, nargs) !== false && ret
+ }
+ })
+ return ret
+}
+
+function mergeOptions(src, opts) {
+ const optsRet = {
+ ...src
+ }
+ for (const key in src) {
+ if (opts.hasOwnProperty(key)) {
+ optsRet[key] = opts[key]
+ }
+ }
+ return optsRet
+}
+
+/**
+ * crud主页
+ */
+function presenter(crud) {
+ function obColumns(columns) {
+ return {
+ visible(col) {
+ return !columns || !columns[col] ? true : columns[col].visible
+ }
+ }
+ }
+ return {
+ inject: ['crud'],
+ beforeCreate() {
+ // 由于initInjections在initProvide之前执行,如果该组件自己就需要crud,需要在initInjections前准备好crud
+ this._provided = {
+ crud,
+ 'crud.query': crud.query,
+ 'crud.page': crud.page,
+ 'crud.form': crud.form
+ }
+ },
+ data() {
+ return {
+ searchToggle: true,
+ columns: obColumns()
+ }
+ },
+ methods: {
+ parseTime
+ },
+ created() {
+ this.crud.registerVM('presenter', this, 0)
+ if (crud.queryOnPresenterCreated) {
+ crud.toQuery()
+ }
+ },
+ beforeDestroy() {
+ this.crud.unregisterVM(this)
+ },
+ mounted() {
+ const columns = {}
+ this.$refs.table.columns.forEach(e => {
+ if (!e.property || e.type !== 'default') {
+ return
+ }
+ columns[e.property] = {
+ label: e.label,
+ visible: true
+ }
+ })
+ this.columns = obColumns(columns)
+ this.crud.updateProp('tableColumns', columns)
+ }
+ }
+}
+
+/**
+ * 头部
+ */
+function header() {
+ return {
+ inject: {
+ crud: {
+ from: 'crud'
+ },
+ query: {
+ from: 'crud.query'
+ }
+ },
+ created() {
+ this.crud.registerVM('header', this, 1)
+ },
+ beforeDestroy() {
+ this.crud.unregisterVM(this)
+ }
+ }
+}
+
+/**
+ * 分页
+ */
+function pagination() {
+ return {
+ inject: {
+ crud: {
+ from: 'crud'
+ },
+ page: {
+ from: 'crud.page'
+ }
+ },
+ created() {
+ this.crud.registerVM('pagination', this, 2)
+ },
+ beforeDestroy() {
+ this.crud.unregisterVM(this)
+ }
+ }
+}
+
+/**
+ * 表单
+ */
+function form(defaultForm) {
+ return {
+ inject: {
+ crud: {
+ from: 'crud'
+ },
+ form: {
+ from: 'crud.form'
+ }
+ },
+ created() {
+ this.crud.registerVM('form', this, 3)
+ this.crud.defaultForm = defaultForm
+ this.crud.resetForm()
+ },
+ beforeDestroy() {
+ this.crud.unregisterVM(this)
+ }
+ }
+}
+
+/**
+ * crud
+ */
+function crud(options = {}) {
+ const defaultOptions = {
+ type: undefined
+ }
+ options = mergeOptions(defaultOptions, options)
+ return {
+ inject: {
+ crud: {
+ from: 'crud'
+ }
+ },
+ created() {
+ this.crud.registerVM(options.type, this)
+ },
+ beforeDestroy() {
+ this.crud.unregisterVM(this)
+ }
+ }
+}
+
+/**
+ * CRUD钩子
+ */
+CRUD.HOOK = {
+ /** 刷新 - 之前 */
+ beforeRefresh: 'beforeCrudRefresh',
+ /** 刷新 - 之后 */
+ afterRefresh: 'afterCrudRefresh',
+ /** 删除 - 之前 */
+ beforeDelete: 'beforeCrudDelete',
+ /** 删除 - 之后 */
+ afterDelete: 'afterCrudDelete',
+ /** 删除取消 - 之前 */
+ beforeDeleteCancel: 'beforeCrudDeleteCancel',
+ /** 删除取消 - 之后 */
+ afterDeleteCancel: 'afterCrudDeleteCancel',
+ /** 新建 - 之前 */
+ beforeToAdd: 'beforeCrudToAdd',
+ /** 新建 - 之后 */
+ afterToAdd: 'afterCrudToAdd',
+ /** 编辑 - 之前 */
+ beforeToEdit: 'beforeCrudToEdit',
+ /** 编辑 - 之后 */
+ afterToEdit: 'afterCrudToEdit',
+ /** 开始 "新建/编辑" - 之前 */
+ beforeToCU: 'beforeCrudToCU',
+ /** 开始 "新建/编辑" - 之后 */
+ afterToCU: 'afterCrudToCU',
+ /** "新建/编辑" 验证 - 之前 */
+ beforeValidateCU: 'beforeCrudValidateCU',
+ /** "新建/编辑" 验证 - 之后 */
+ afterValidateCU: 'afterCrudValidateCU',
+ /** 添加取消 - 之前 */
+ beforeAddCancel: 'beforeCrudAddCancel',
+ /** 添加取消 - 之后 */
+ afterAddCancel: 'afterCrudAddCancel',
+ /** 编辑取消 - 之前 */
+ beforeEditCancel: 'beforeCrudEditCancel',
+ /** 编辑取消 - 之后 */
+ afterEditCancel: 'afterCrudEditCancel',
+ /** 提交 - 之前 */
+ beforeSubmit: 'beforeCrudSubmitCU',
+ /** 提交 - 之后 */
+ afterSubmit: 'afterCrudSubmitCU',
+ afterAddError: 'afterCrudAddError',
+ afterEditError: 'afterCrudEditError'
+}
+
+/**
+ * CRUD状态
+ */
+CRUD.STATUS = {
+ NORMAL: 0,
+ PREPARED: 1,
+ PROCESSING: 2
+}
+
+/**
+ * CRUD通知类型
+ */
+CRUD.NOTIFICATION_TYPE = {
+ SUCCESS: 'success',
+ WARNING: 'warning',
+ INFO: 'info',
+ ERROR: 'error'
+}
+
+export default CRUD
+
+export {
+ presenter,
+ header,
+ form,
+ pagination,
+ crud
+}
diff --git a/src/components/Dict/Dict.js b/src/components/Dict/Dict.js
new file mode 100644
index 0000000..48554de
--- /dev/null
+++ b/src/components/Dict/Dict.js
@@ -0,0 +1,29 @@
+import Vue from 'vue'
+import { get as getDictDetail } from '@/api/system/dictDetail'
+
+export default class Dict {
+ constructor(dict) {
+ this.dict = dict
+ }
+
+ async init(names, completeCallback) {
+ if (names === undefined || name === null) {
+ throw new Error('need Dict names')
+ }
+ const ps = []
+ names.forEach(n => {
+ Vue.set(this.dict.dict, n, {})
+ Vue.set(this.dict.label, n, {})
+ Vue.set(this.dict, n, [])
+ ps.push(getDictDetail(n).then(data => {
+ this.dict[n].splice(0, 0, ...data.content)
+ data.content.forEach(d => {
+ Vue.set(this.dict.dict[n], d.value, d)
+ Vue.set(this.dict.label[n], d.value, d.label)
+ })
+ }))
+ })
+ await Promise.all(ps)
+ completeCallback()
+ }
+}
diff --git a/src/components/Dict/index.js b/src/components/Dict/index.js
new file mode 100644
index 0000000..0952f43
--- /dev/null
+++ b/src/components/Dict/index.js
@@ -0,0 +1,29 @@
+import Dict from './Dict'
+
+const install = function(Vue) {
+ Vue.mixin({
+ data() {
+ if (this.$options.dicts instanceof Array) {
+ const dict = {
+ dict: {},
+ label: {}
+ }
+ return {
+ dict
+ }
+ }
+ return {}
+ },
+ created() {
+ if (this.$options.dicts instanceof Array) {
+ new Dict(this.dict).init(this.$options.dicts, () => {
+ this.$nextTick(() => {
+ this.$emit('dictReady')
+ })
+ })
+ }
+ }
+ })
+}
+
+export default { install }
diff --git a/src/components/Echarts/BarChart.vue b/src/components/Echarts/BarChart.vue
new file mode 100644
index 0000000..fa265ef
--- /dev/null
+++ b/src/components/Echarts/BarChart.vue
@@ -0,0 +1,106 @@
+
+
+
+
+
diff --git a/src/components/Echarts/Category.vue b/src/components/Echarts/Category.vue
new file mode 100644
index 0000000..5859114
--- /dev/null
+++ b/src/components/Echarts/Category.vue
@@ -0,0 +1,438 @@
+
+
+
+
+
diff --git a/src/components/Echarts/Funnel.vue b/src/components/Echarts/Funnel.vue
new file mode 100644
index 0000000..380b373
--- /dev/null
+++ b/src/components/Echarts/Funnel.vue
@@ -0,0 +1,120 @@
+
+
+
+
+
diff --git a/src/components/Echarts/Gauge.vue b/src/components/Echarts/Gauge.vue
new file mode 100644
index 0000000..40ce775
--- /dev/null
+++ b/src/components/Echarts/Gauge.vue
@@ -0,0 +1,74 @@
+
+
+
+
+
diff --git a/src/components/Echarts/Graph.vue b/src/components/Echarts/Graph.vue
new file mode 100644
index 0000000..a5a88b3
--- /dev/null
+++ b/src/components/Echarts/Graph.vue
@@ -0,0 +1,101 @@
+
+
+
+
+
diff --git a/src/components/Echarts/HeatMap.vue b/src/components/Echarts/HeatMap.vue
new file mode 100644
index 0000000..6606278
--- /dev/null
+++ b/src/components/Echarts/HeatMap.vue
@@ -0,0 +1,105 @@
+
+
+
+
+
diff --git a/src/components/Echarts/Line3D.vue b/src/components/Echarts/Line3D.vue
new file mode 100644
index 0000000..c3f16f6
--- /dev/null
+++ b/src/components/Echarts/Line3D.vue
@@ -0,0 +1,96 @@
+
+
+
+
+
diff --git a/src/components/Echarts/PieChart.vue b/src/components/Echarts/PieChart.vue
new file mode 100644
index 0000000..ff1bc52
--- /dev/null
+++ b/src/components/Echarts/PieChart.vue
@@ -0,0 +1,84 @@
+
+
+
+
+
diff --git a/src/components/Echarts/Point.vue b/src/components/Echarts/Point.vue
new file mode 100644
index 0000000..5a6c777
--- /dev/null
+++ b/src/components/Echarts/Point.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
diff --git a/src/components/Echarts/RadarChart.vue b/src/components/Echarts/RadarChart.vue
new file mode 100644
index 0000000..de70e52
--- /dev/null
+++ b/src/components/Echarts/RadarChart.vue
@@ -0,0 +1,120 @@
+
+
+
+
+
diff --git a/src/components/Echarts/Rich.vue b/src/components/Echarts/Rich.vue
new file mode 100644
index 0000000..1cf6bf2
--- /dev/null
+++ b/src/components/Echarts/Rich.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
diff --git a/src/components/Echarts/Sankey.vue b/src/components/Echarts/Sankey.vue
new file mode 100644
index 0000000..49968c4
--- /dev/null
+++ b/src/components/Echarts/Sankey.vue
@@ -0,0 +1,100 @@
+
+
+
+
+
diff --git a/src/components/Echarts/Scatter.vue b/src/components/Echarts/Scatter.vue
new file mode 100644
index 0000000..b776efb
--- /dev/null
+++ b/src/components/Echarts/Scatter.vue
@@ -0,0 +1,143 @@
+
+
+
+
+
diff --git a/src/components/Echarts/Sunburst.vue b/src/components/Echarts/Sunburst.vue
new file mode 100644
index 0000000..fafc1a8
--- /dev/null
+++ b/src/components/Echarts/Sunburst.vue
@@ -0,0 +1,107 @@
+
+
+
+
+
diff --git a/src/components/Echarts/ThemeRiver.vue b/src/components/Echarts/ThemeRiver.vue
new file mode 100644
index 0000000..967fc05
--- /dev/null
+++ b/src/components/Echarts/ThemeRiver.vue
@@ -0,0 +1,148 @@
+
+
+
+
+
diff --git a/src/components/Echarts/WordCloud.vue b/src/components/Echarts/WordCloud.vue
new file mode 100644
index 0000000..415f2a8
--- /dev/null
+++ b/src/components/Echarts/WordCloud.vue
@@ -0,0 +1,192 @@
+
+
+
+
+
diff --git a/src/components/Github/index.vue b/src/components/Github/index.vue
new file mode 100644
index 0000000..2e1ad59
--- /dev/null
+++ b/src/components/Github/index.vue
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue
index e4cf00a..368b002 100644
--- a/src/components/Hamburger/index.vue
+++ b/src/components/Hamburger/index.vue
@@ -1,16 +1,13 @@
-
+
@@ -23,10 +20,11 @@ export default {
isActive: {
type: Boolean,
default: false
- },
- toggleClick: {
- type: Function,
- default: null
+ }
+ },
+ methods: {
+ toggleClick() {
+ this.$emit('toggleClick')
}
}
}
@@ -34,14 +32,13 @@ export default {
diff --git a/src/components/HeaderSearch/index.vue b/src/components/HeaderSearch/index.vue
new file mode 100644
index 0000000..be9b177
--- /dev/null
+++ b/src/components/HeaderSearch/index.vue
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+
diff --git a/src/components/IconSelect/index.vue b/src/components/IconSelect/index.vue
index 719b3bc..0611dc5 100644
--- a/src/components/IconSelect/index.vue
+++ b/src/components/IconSelect/index.vue
@@ -2,7 +2,7 @@
-
+
diff --git a/src/components/IconSelect/requireIcons.js b/src/components/IconSelect/requireIcons.js
index 83a3395..99e5c54 100644
--- a/src/components/IconSelect/requireIcons.js
+++ b/src/components/IconSelect/requireIcons.js
@@ -1,5 +1,5 @@
-const req = require.context('../../icons/svg', false, /\.svg$/)
+const req = require.context('../../assets/icons/svg', false, /\.svg$/)
const requireAll = requireContext => requireContext.keys()
const re = /\.\/(.*)\.svg/
diff --git a/src/components/JavaEdit/index.vue b/src/components/JavaEdit/index.vue
new file mode 100644
index 0000000..c703829
--- /dev/null
+++ b/src/components/JavaEdit/index.vue
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue
new file mode 100644
index 0000000..c815e13
--- /dev/null
+++ b/src/components/Pagination/index.vue
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
diff --git a/src/components/PanThumb/index.vue b/src/components/PanThumb/index.vue
index ec549f4..de6940a 100644
--- a/src/components/PanThumb/index.vue
+++ b/src/components/PanThumb/index.vue
@@ -2,7 +2,7 @@
diff --git a/src/components/RightPanel/index.vue b/src/components/RightPanel/index.vue
index 6d46d57..b65ecec 100644
--- a/src/components/RightPanel/index.vue
+++ b/src/components/RightPanel/index.vue
@@ -2,10 +2,6 @@
-
-
-
-
@@ -31,24 +27,17 @@ export default {
computed: {
show: {
get() {
- return this.$store.state.settings.showRightPanel
+ return this.$store.state.settings.showSettings
},
set(val) {
- this.$store.dispatch('changeSetting', {
- key: 'showRightPanel',
+ this.$store.dispatch('settings/changeSetting', {
+ key: 'showSettings',
value: val
})
}
},
- theme: {
- get() {
- return this.$store.state.settings.theme
- }
- },
- settingBtn: {
- get() {
- return this.$store.state.settings.settingBtn
- }
+ theme() {
+ return this.$store.state.settings.theme
}
},
watch: {
@@ -65,6 +54,7 @@ export default {
},
mounted() {
this.insertToBody()
+ this.addEventClick()
},
beforeDestroy() {
const elx = this.$refs.rightPanel
@@ -91,75 +81,69 @@ export default {
diff --git a/src/components/Screenfull/index.vue b/src/components/Screenfull/index.vue
index 4cdcb56..260c90d 100644
--- a/src/components/Screenfull/index.vue
+++ b/src/components/Screenfull/index.vue
@@ -1,29 +1,6 @@
@@ -32,25 +9,17 @@ import screenfull from 'screenfull'
export default {
name: 'Screenfull',
- props: {
- width: {
- type: Number,
- default: 22
- },
- height: {
- type: Number,
- default: 22
- },
- fill: {
- type: String,
- default: '#48576a'
- }
- },
data() {
return {
isFullscreen: false
}
},
+ mounted() {
+ this.init()
+ },
+ beforeDestroy() {
+ this.destroy()
+ },
methods: {
click() {
if (!screenfull.enabled) {
@@ -61,6 +30,19 @@ export default {
return false
}
screenfull.toggle()
+ },
+ change() {
+ this.isFullscreen = screenfull.isFullscreen
+ },
+ init() {
+ if (screenfull.enabled) {
+ screenfull.on('change', this.change)
+ }
+ },
+ destroy() {
+ if (screenfull.enabled) {
+ screenfull.off('change', this.change)
+ }
}
}
}
diff --git a/src/components/SizeSelect/index.vue b/src/components/SizeSelect/index.vue
new file mode 100644
index 0000000..e490dce
--- /dev/null
+++ b/src/components/SizeSelect/index.vue
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+ {{
+ item.label }}
+
+
+
+
+
+
diff --git a/src/components/SvgIcon/index.vue b/src/components/SvgIcon/index.vue
index 12a1f58..9a3318e 100644
--- a/src/components/SvgIcon/index.vue
+++ b/src/components/SvgIcon/index.vue
@@ -1,10 +1,14 @@
-
-
-
diff --git a/src/components/ThemePicker/index.vue b/src/components/ThemePicker/index.vue
new file mode 100644
index 0000000..ecc6d28
--- /dev/null
+++ b/src/components/ThemePicker/index.vue
@@ -0,0 +1,175 @@
+
+
+
+
+
+
+
diff --git a/src/components/TreeTable/index.vue b/src/components/TreeTable/index.vue
index a48765c..b62fd5a 100644
--- a/src/components/TreeTable/index.vue
+++ b/src/components/TreeTable/index.vue
@@ -2,10 +2,10 @@
-
+
-
-
+
+
{{ scope.$index }}
@@ -14,15 +14,16 @@
-
+
-
-
+
+
+ 22222
{{ scope.row[column.value] }}
-
+
@@ -69,11 +70,14 @@ export default {
showRow: function(row) {
const show = (row.row.parent ? (row.row.parent._expanded && row.row.parent._show) : true)
row.row._show = show
- return show ? 'animation:treeTableShow 1s;-webkit-animation:treeTableShow 1s;' : 'display:none;'
+ return show ? '' : 'display:none;'
+ //return show ? 'animation:treeTableShow 1s;-webkit-animation:treeTableShow 1s;' : 'display:none;'
},
// 切换下级是否展开
toggleExpanded: function(trIndex) {
+ console.log(trIndex)
const record = this.formatData[trIndex]
+ console.log(record._expanded)
record._expanded = !record._expanded
},
// 图标显示
diff --git a/src/components/YamlEdit/index.vue b/src/components/YamlEdit/index.vue
index b84bff9..83778f4 100644
--- a/src/components/YamlEdit/index.vue
+++ b/src/components/YamlEdit/index.vue
@@ -1,6 +1,6 @@
-
+
@@ -9,7 +9,7 @@ import CodeMirror from 'codemirror'
import 'codemirror/lib/codemirror.css'
// 替换主题这里需修改名称
import 'codemirror/theme/idea.css'
-require('codemirror/mode/yaml/yaml.js')
+import 'codemirror/mode/yaml/yaml'
export default {
props: {
value: {
diff --git a/src/components/file-upload/index.vue b/src/components/file-upload/index.vue
deleted file mode 100644
index 5c8883c..0000000
--- a/src/components/file-upload/index.vue
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
- 点击上传
-
-
-
-
-
-
-
diff --git a/src/components/iframe/index.vue b/src/components/iframe/index.vue
index f8fa4a8..9f395a3 100644
--- a/src/components/iframe/index.vue
+++ b/src/components/iframe/index.vue
@@ -1,6 +1,6 @@
-
+
- .hasTagsView {
- .app-main {
- min-height: calc(100vh - 84px);
- }
-
- .fixed-header+.app-main {
- padding-top: 85px;
- }
+
-
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index d8a074b..9100591 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -1,18 +1,31 @@
-
-
+
+
+
+
+
diff --git a/src/views/components/Editor.vue b/src/views/components/Editor.vue
index 477150a..68ff3e4 100644
--- a/src/views/components/Editor.vue
+++ b/src/views/components/Editor.vue
@@ -1,7 +1,6 @@
@@ -24,7 +23,7 @@ export default {
data() {
return {
headers: {
- 'Authorization': 'Bearer ' + getToken()
+ 'Authorization': getToken()
},
info: null,
editor: null
@@ -38,11 +37,11 @@ export default {
watch: {
value: function(val) {
this.editor.txt.html(val)
- //this.editor.txt.html(val)
+ // this.editor.txt.html(val)
}
},
mounted() {
- //console.log(222)
+ // console.log(222)
console.log(this.value)
this.editor = new E(this.$refs.editor)
this.editor.customConfig.uploadImgShowBase64 = true // 使用 base64 保存图片
diff --git a/src/views/components/IconSelect.vue b/src/views/components/IconSelect.vue
deleted file mode 100644
index 88e1102..0000000
--- a/src/views/components/IconSelect.vue
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
- 使用教程参考 Documentation
-
-
-
-
-
- {{ generateIconCode(item) }}
-
-
-
- {{ item }}
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/components/MarkDown.vue b/src/views/components/MarkDown.vue
index da96b98..ed734a5 100644
--- a/src/views/components/MarkDown.vue
+++ b/src/views/components/MarkDown.vue
@@ -2,24 +2,21 @@
Markdown 基于
- mavonEditor
+ MavonEditor
+ ,图片上传使用 SM.MS
-
+
+
+
diff --git a/src/views/components/icons/svg-icons.js b/src/views/components/icons/svg-icons.js
new file mode 100644
index 0000000..724cd8e
--- /dev/null
+++ b/src/views/components/icons/svg-icons.js
@@ -0,0 +1,10 @@
+const req = require.context('../../../assets/icons/svg', false, /\.svg$/)
+const requireAll = requireContext => requireContext.keys()
+
+const re = /\.\/(.*)\.svg/
+
+const svgIcons = requireAll(req).map(i => {
+ return i.match(re)[1]
+})
+
+export default svgIcons
diff --git a/src/views/dashboard/BarChart.vue b/src/views/dashboard/BarChart.vue
index 5062a09..e42f16f 100644
--- a/src/views/dashboard/BarChart.vue
+++ b/src/views/dashboard/BarChart.vue
@@ -1,5 +1,5 @@
-
+
-
+
+
diff --git a/src/views/generator/generator.vue b/src/views/generator/generator.vue
deleted file mode 100644
index 3b185ec..0000000
--- a/src/views/generator/generator.vue
+++ /dev/null
@@ -1,182 +0,0 @@
-
-
-
生成代码
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ scope.$index + 1 }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 是
- 否
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/generator/index.vue b/src/views/generator/index.vue
index fd6eb43..a0d022b 100644
--- a/src/views/generator/index.vue
+++ b/src/views/generator/index.vue
@@ -2,102 +2,110 @@
-
-
搜索
+
+
+
+
+
+
+ 同步
+
+
-
-
-
- {{ scope.$index + 1 }}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
{{ parseTime(scope.row.createTime) }}
-
+
-
+
+
+ 预览
+
+
+ 下载
+
+
+ 编辑
+
+
+ 生成
-
+
diff --git a/src/views/home.vue b/src/views/home.vue
index f6e6e41..1b662ad 100644
--- a/src/views/home.vue
+++ b/src/views/home.vue
@@ -1,21 +1,21 @@
-
-
+
+
@@ -34,9 +34,10 @@ import BarChart from './dashboard/BarChart'
import { count } from '@/api/visits'
/**
- * 记录访问,只有页面刷新或者第一次加载才会记录
- */
-count().then(res => {})
+ * 记录访问,只有页面刷新或者第一次加载才会记录
+ */
+count().then(res => {
+})
export default {
name: 'Dashboard',
@@ -45,7 +46,8 @@ export default {
PanelGroupT,
LineChart,
PieChart,
- BarChart },
+ BarChart
+ },
computed: {
...mapGetters([
'roles'
@@ -58,6 +60,7 @@ export default {
.dashboard-editor-container {
padding: 18px 22px 22px 22px;
background-color: rgb(240, 242, 245);
+
.chart-wrapper {
background: #fff;
padding: 16px 16px 0;
diff --git a/src/views/login.vue b/src/views/login.vue
index 0652d85..95b946d 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -1,26 +1,30 @@
- YSHOP 后台管理系统
+
+ YSHOP后台管理系统
+
-
+
-
+
-
+
- 记住我
+
+ 记住我
+
登 录
@@ -30,7 +34,7 @@
@@ -39,7 +43,7 @@
+
+
diff --git a/src/views/mnt/database/execute.vue b/src/views/mnt/database/execute.vue
new file mode 100644
index 0000000..94622fc
--- /dev/null
+++ b/src/views/mnt/database/execute.vue
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+ 将文件拖到此处,或
+ 点击上传
+
+ 上传后,系统会自动执行SQL脚本
+
+
+
+
+
+
+
+
+
diff --git a/src/views/mnt/database/index.vue b/src/views/mnt/database/index.vue
new file mode 100644
index 0000000..c5fb4dd
--- /dev/null
+++ b/src/views/mnt/database/index.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+
+
+
+
+ 执行脚本
+
+
+
+
+
+
+
+
+
+
+
+
+ 测试
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.createTime) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/mnt/deploy/deploy.vue b/src/views/mnt/deploy/deploy.vue
new file mode 100644
index 0000000..4a411b4
--- /dev/null
+++ b/src/views/mnt/deploy/deploy.vue
@@ -0,0 +1,190 @@
+
+
+
+
+
+
+ 将文件拖到此处,或
+ 点击上传
+
+ 多个应用上传文件名称为all.zip,数据库更新脚本扩展名为.sql,上传成功后系统自动部署系统。
+
+
+
+
+
+
+
+
+
diff --git a/src/views/mnt/deploy/index.vue b/src/views/mnt/deploy/index.vue
new file mode 100644
index 0000000..0f0762e
--- /dev/null
+++ b/src/views/mnt/deploy/index.vue
@@ -0,0 +1,232 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 系统还原
+
+ 状态查询
+
+ 启动
+
+ 停止
+
+ 一键部署
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.createTime) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/mnt/deploy/sysRestore.vue b/src/views/mnt/deploy/sysRestore.vue
new file mode 100644
index 0000000..46b568d
--- /dev/null
+++ b/src/views/mnt/deploy/sysRestore.vue
@@ -0,0 +1,120 @@
+
+
+
+
+
+ 搜索
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.deployDate) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/mnt/deployHistory/index.vue b/src/views/mnt/deployHistory/index.vue
new file mode 100644
index 0000000..21397fa
--- /dev/null
+++ b/src/views/mnt/deployHistory/index.vue
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.deployDate) }}
+
+
+
+
+
+ 确定删除本条数据吗?
+
+ 取消
+ 确定
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/mnt/server/index.vue b/src/views/mnt/server/index.vue
new file mode 100644
index 0000000..dab6dc5
--- /dev/null
+++ b/src/views/mnt/server/index.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 测试连接
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.createTime) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/monitor/log/errorLog.vue b/src/views/monitor/log/errorLog.vue
index e32bdab..630b770 100644
--- a/src/views/monitor/log/errorLog.vue
+++ b/src/views/monitor/log/errorLog.vue
@@ -1,81 +1,138 @@
-
+
+
+
+
+ 清空
+ v-if="columns.visible('username')"
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+ {{ props.row.method }}
+
+
+ {{ props.row.params }}
+
+
+
+
+
+
+
+
+
+
{{ parseTime(scope.row.createTime) }}
-
+
查看详情
-
-
- {{ errorInfo }}
-
+
+
-
+
diff --git a/src/views/monitor/log/index.vue b/src/views/monitor/log/index.vue
index f265300..f5b68bc 100644
--- a/src/views/monitor/log/index.vue
+++ b/src/views/monitor/log/index.vue
@@ -1,66 +1,117 @@
-
+
+
+
+
+ 清空
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+ {{ props.row.method }}
+
+
+ {{ props.row.params }}
+
+
+
+
+
+
+
+
+
+
{{ scope.row.time }}ms
{{ scope.row.time }}ms
{{ scope.row.time }}ms
-
+
{{ parseTime(scope.row.createTime) }}
-
+
-
diff --git a/src/views/monitor/log/mlog.vue b/src/views/monitor/log/mlog.vue
index 3996f7c..a3bbbbd 100644
--- a/src/views/monitor/log/mlog.vue
+++ b/src/views/monitor/log/mlog.vue
@@ -25,7 +25,7 @@
diff --git a/src/views/monitor/online/index.vue b/src/views/monitor/online/index.vue
new file mode 100644
index 0000000..cb735b6
--- /dev/null
+++ b/src/views/monitor/online/index.vue
@@ -0,0 +1,129 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.loginTime) }}
+
+
+
+
+
+ 确定强制退出该用户吗?
+
+ 取消
+ 确定
+
+ 强退
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/monitor/redis/index.vue b/src/views/monitor/redis/index.vue
deleted file mode 100644
index 7f0766f..0000000
--- a/src/views/monitor/redis/index.vue
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
-
-
-
-
-
-
- {{ scope.$index + 1 }}
-
-
-
-
-
-
- {{ scope.row.value }}
-
-
-
-
-
-
- 确定删除本条数据吗?
-
- 取消
- 确定
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/monitor/server/index.vue b/src/views/monitor/server/index.vue
new file mode 100644
index 0000000..6e3c461
--- /dev/null
+++ b/src/views/monitor/server/index.vue
@@ -0,0 +1,193 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ formatMem(scope.row) }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ formatDisk(scope.row) }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ formatSwap(scope.row) }}
+
+
+
+
+
+
+
+
+
+
+
+ v-if="columns.visible('name')"
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/monitor/sql/index.vue b/src/views/monitor/sql/index.vue
index da7e83a..0ed9034 100644
--- a/src/views/monitor/sql/index.vue
+++ b/src/views/monitor/sql/index.vue
@@ -1,9 +1,9 @@
-
+
diff --git a/src/views/shop/express/form.vue b/src/views/shop/express/form.vue
index 86ac229..a4b0ca2 100644
--- a/src/views/shop/express/form.vue
+++ b/src/views/shop/express/form.vue
@@ -2,13 +2,13 @@
-
+
-
-
+
+
-
-
+
+
-
+
-
-
-
-
+
+
+
+
-
+
+ width="180"
+ >
确定删除本条数据吗?
取消
确定
-
+
@@ -45,13 +47,14 @@
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
- @current-change="pageChange"/>
+ @current-change="pageChange"
+ />
@@ -424,7 +426,6 @@ export default {
display: block;
}
-
.demo-upload-cover{
display: block;
position: absolute;
diff --git a/src/views/shop/goods/form.vue b/src/views/shop/goods/form.vue
index 361a8e9..2fe602b 100644
--- a/src/views/shop/goods/form.vue
+++ b/src/views/shop/goods/form.vue
@@ -4,71 +4,71 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
是
否
-
+
是
否
-
+
是
否
-
+
是
否
-
+
是
否
@@ -76,10 +76,10 @@
是
否
-
+
-
+
@@ -91,7 +91,7 @@
diff --git a/src/views/shop/order/edit.vue b/src/views/shop/order/edit.vue
deleted file mode 100644
index b95882d..0000000
--- a/src/views/shop/order/edit.vue
+++ /dev/null
@@ -1,196 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/shop/order/form-bak.vue b/src/views/shop/order/form-bak.vue
index 2f64856..6db8a9f 100644
--- a/src/views/shop/order/form-bak.vue
+++ b/src/views/shop/order/form-bak.vue
@@ -1,155 +1,155 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+