作者 shenhailong

完善水电系统前端操作

要显示太多修改。

为保证性能只显示 58 of 58+ 个文件。

{
"presets": ["es2015", "stage-2"],
"plugins": ["transform-runtime","transform-vue-jsx"],
"presets": [
"es2015",
"stage-2"
],
"plugins": [
"transform-runtime",
"transform-vue-jsx"
],
"comments": false
}
... ...
... ... @@ -19,6 +19,5 @@ module.exports = {
"plugins": [
"vue"
],
"rules": {
}
"rules": {}
};
\ No newline at end of file
... ...
... ... @@ -14,22 +14,22 @@ var spinner = ora('building for production...')
spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, function (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')
webpack(webpackConfig, function (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')
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'
))
})
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'
))
})
})
... ...
... ... @@ -2,47 +2,48 @@ var chalk = require('chalk')
var semver = require('semver')
var packageConfig = require('../package.json')
var shell = require('shelljs')
function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
function exec(cmd) {
return require('child_process').execSync(cmd).toString().trim()
}
var versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
},
{
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
})
versionRequirements.push({
name: 'npm',
currentVersion: exec('npm --version'),
versionRequirement: packageConfig.engines.npm
})
}
module.exports = function () {
var warnings = []
for (var i = 0; i < versionRequirements.length; i++) {
var mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
var warnings = []
for (var i = 0; i < versionRequirements.length; i++) {
var mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
}
}
}
if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (var i = 0; i < warnings.length; i++) {
var warning = warnings[i]
console.log(' ' + warning)
if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (var i = 0; i < warnings.length; i++) {
var warning = warnings[i]
console.log(' ' + warning)
}
console.log()
process.exit(1)
}
console.log()
process.exit(1)
}
}
... ...
... ... @@ -3,7 +3,7 @@ require('eventsource-polyfill')
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
hotClient.subscribe(function (event) {
if (event.action === 'reload') {
window.location.reload()
}
if (event.action === 'reload') {
window.location.reload()
}
})
... ...
... ... @@ -2,7 +2,7 @@ require('./check-versions')()
var config = require('../config')
if (!process.env.NODE_ENV) {
process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
}
var opn = require('opn')
... ... @@ -24,28 +24,29 @@ var app = express()
var compiler = webpack(webpackConfig)
var devMiddleware = require('webpack-dev-middleware')(compiler, {
publicPath: webpackConfig.output.publicPath,
quiet: true
publicPath: webpackConfig.output.publicPath,
quiet: true
})
var hotMiddleware = require('webpack-hot-middleware')(compiler, {
log: () => {}
log: () => {
}
})
// force page reload when html-webpack-plugin template changes
compiler.plugin('compilation', function (compilation) {
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
hotMiddleware.publish({ action: 'reload' })
cb()
})
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
hotMiddleware.publish({action: 'reload'})
cb()
})
})
// proxy api requests
Object.keys(proxyTable).forEach(function (context) {
var options = proxyTable[context]
if (typeof options === 'string') {
options = { target: options }
}
app.use(proxyMiddleware(options.filter || context, options))
var options = proxyTable[context]
if (typeof options === 'string') {
options = {target: options}
}
app.use(proxyMiddleware(options.filter || context, options))
})
// handle fallback for HTML5 history API
... ... @@ -66,24 +67,24 @@ var uri = 'http://localhost:' + port
var _resolve
var readyPromise = new Promise(resolve => {
_resolve = resolve
_resolve = resolve
})
console.log('> Starting dev server...')
devMiddleware.waitUntilValid(() => {
console.log('> Listening at ' + uri + '\n')
// when env is testing, don't need open it
if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
opn(uri)
}
_resolve()
console.log('> Listening at ' + uri + '\n')
// when env is testing, don't need open it
if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
opn(uri)
}
_resolve()
})
var server = app.listen(port)
module.exports = {
ready: readyPromise,
close: () => {
server.close()
}
ready: readyPromise,
close: () => {
server.close()
}
}
... ...
... ... @@ -3,70 +3,70 @@ var config = require('../config')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
exports.assetsPath = function (_path) {
var assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
var assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function (options) {
options = options || {}
options = options || {}
var cssLoader = {
loader: 'css-loader',
options: {
minimize: process.env.NODE_ENV === 'production',
sourceMap: options.sourceMap
var cssLoader = {
loader: 'css-loader',
options: {
minimize: process.env.NODE_ENV === 'production',
sourceMap: options.sourceMap
}
}
}
// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
var loaders = [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
// generate loader string to be used with extract text plugin
function generateLoaders(loader, loaderOptions) {
var loaders = [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader',
publicPath: '../../'
})
} else {
return ['vue-style-loader'].concat(loaders)
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader',
publicPath: '../../'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
}
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
// 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) {
var output = []
var loaders = exports.cssLoaders(options)
for (var extension in loaders) {
var loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
var output = []
var loaders = exports.cssLoaders(options)
for (var extension in loaders) {
var loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
}
... ...
... ... @@ -3,10 +3,10 @@ var config = require('../config')
var isProduction = process.env.NODE_ENV === 'production'
module.exports = {
loaders: utils.cssLoaders({
sourceMap: isProduction
? config.build.productionSourceMap
: config.dev.cssSourceMap,
extract: isProduction
})
loaders: utils.cssLoaders({
sourceMap: isProduction
? config.build.productionSourceMap
: config.dev.cssSourceMap,
extract: isProduction
})
}
... ...
... ... @@ -2,76 +2,76 @@ var path = require('path')
var utils = require('./utils')
var config = require('../config')
var vueLoaderConfig = require('./vue-loader.conf')
var webpack=require('webpack')
var webpack = require('webpack')
function resolve(dir) {
return path.join(__dirname, '..', dir)
return path.join(__dirname, '..', dir)
}
module.exports = {
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
'scss_vars': '@/styles/vars.scss'
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
'scss_vars': '@/styles/vars.scss'
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
},
{
test: /\.js$/i,
loader: 'babel-loader',
include: [
resolve('src'),
resolve('test'),
resolve('node_modules/element-ui/src'),
resolve('node_modules/element-ui/packages')
],
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
},
{
test: /\.js$/i,
loader: 'babel-loader',
include: [
resolve('src'),
resolve('test'),
resolve('node_modules/element-ui/src'),
resolve('node_modules/element-ui/packages')
],
}
]
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"windows.jQuery": "jquery"
})
]
},
plugins: [
new webpack.ProvidePlugin({
$:"jquery",
jQuery:"jquery",
"windows.jQuery":"jquery"
})
]
}
... ...
... ... @@ -8,29 +8,29 @@ var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach(function (name) {
baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
})
module.exports = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
},
// cheap-module-eval-source-map is faster for development
devtool: '#cheap-module-eval-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': config.dev.env
}),
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
favicon:'static/favicon.ico',
inject: true
}),
new FriendlyErrorsPlugin()
]
module: {
rules: utils.styleLoaders({sourceMap: config.dev.cssSourceMap})
},
// cheap-module-eval-source-map is faster for development
devtool: '#cheap-module-eval-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': config.dev.env
}),
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
favicon: 'static/favicon.ico',
inject: true
}),
new FriendlyErrorsPlugin()
]
})
... ...
... ... @@ -12,110 +12,110 @@ var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
var env = config.build.env
var webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true
})
},
devtool: config.build.productionSourceMap ? '#source-map' : false,
output: {
publicPath: './',
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
sourceMap: true
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css')
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: {
safe: true
}
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module, count) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['vendor']
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true
})
},
devtool: config.build.productionSourceMap ? '#source-map' : false,
output: {
publicPath: './',
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
sourceMap: true
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css')
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: {
safe: true
}
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module, count) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['vendor']
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
var CompressionWebpackPlugin = require('compression-webpack-plugin')
var 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
})
)
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.bundleAnalyzerReport) {
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig
... ...
... ... @@ -2,5 +2,5 @@ var merge = require('webpack-merge')
var prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
NODE_ENV: '"development"'
})
... ...
... ... @@ -2,46 +2,46 @@
var path = require('path')
module.exports = {
build: {
env: require('./prod.env'),
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: './',
productionSourceMap: true,
// 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
},
dev: {
env: require('./dev.env'),
port: 8001,
autoOpenBrowser: true,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/api':{
target: 'http://192.168.1.53:12343',//设置你调用的接口域名和端口号 别忘了加http
// target: 'http://192.168.43.78:12343',//设置你调用的接口域名和端口号 别忘了加http
changeOrigin: true,
pathRewrite: {
'^/api/': '/'//这里理解成用‘/api’代替target里面的地址,后面组件中我们掉接口时直接用api代替 比如我要调用'http://40.00.100.100:3002/user/add',直接写‘/api/user/add’即可
}
}
build: {
env: require('./prod.env'),
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: './',
productionSourceMap: true,
// 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
},
// 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
}
dev: {
env: require('./dev.env'),
port: 8001,
autoOpenBrowser: true,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/api': {
target: 'http://192.168.1.53:12343',//设置你调用的接口域名和端口号 别忘了加http
// target: 'http://192.168.43.78:12343',//设置你调用的接口域名和端口号 别忘了加http
changeOrigin: true,
pathRewrite: {
'^/api/': '/'//这里理解成用‘/api’代替target里面的地址,后面组件中我们掉接口时直接用api代替 比如我要调用'http://40.00.100.100:3002/user/add',直接写‘/api/user/add’即可
}
}
},
// 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
}
}
... ...
module.exports = {
NODE_ENV: '"production"'
NODE_ENV: '"production"'
}
... ...
... ... @@ -2,16 +2,16 @@
<html>
<head>
<meta charset="utf-8">
<title>郑州机场集团水电缴费平台</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<meta charset="utf-8">
<title>郑州机场集团水电缴费平台</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<div id="app">
<div id="app">
</div>
<!-- built files will be auto injected -->
</div>
<!-- built files will be auto injected -->
</body>
</html>
\ No newline at end of file
... ...
<template>
<div id="app">
<transition name="fade" mode="out-in">
<router-view></router-view>
</transition>
</div>
<div id="app">
<transition name="fade" mode="out-in">
<router-view></router-view>
</transition>
</div>
</template>
<script>
export default {
name: 'app',
components: {
}
}
export default {
name: 'app',
components: {}
}
</script>
<style lang="scss">
body {
margin: 0px;
padding: 0px;
/*background: url(assets/bg1.jpg) center !important;
background-size: cover;*/
// background: #1F2D3D;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
font-size: 14px;
-webkit-font-smoothing: antialiased;
}
body {
margin: 0px;
padding: 0px;
/*background: url(assets/bg1.jpg) center !important;
background-size: cover;*/
// background: #1F2D3D;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
font-size: 14px;
-webkit-font-smoothing: antialiased;
}
#app {
position: absolute;
top: 0px;
bottom: 0px;
width: 100%;
}
#app {
position: absolute;
top: 0px;
bottom: 0px;
width: 100%;
}
.el-submenu [class^=fa] {
vertical-align: baseline;
margin-right: 10px;
}
.el-submenu [class^=fa] {
vertical-align: baseline;
margin-right: 10px;
}
.el-menu-item [class^=fa] {
vertical-align: baseline;
margin-right: 10px;
}
.el-menu-item [class^=fa] {
vertical-align: baseline;
margin-right: 10px;
}
.toolbar {
background: #f2f2f2;
padding: 10px;
//border:1px solid #dfe6ec;
margin: 10px 0px;
.el-form-item {
margin-bottom: 10px;
}
}
.toolbar {
background: #f2f2f2;
padding: 10px;
//border:1px solid #dfe6ec;
margin: 10px 0px;
.fade-enter-active,
.fade-leave-active {
transition: all .2s ease;
}
.el-form-item {
margin-bottom: 10px;
}
}
.fade-enter,
.fade-leave-active {
opacity: 0;
}
.fade-enter-active,
.fade-leave-active {
transition: all .2s ease;
}
.fade-enter,
.fade-leave-active {
opacity: 0;
}
</style>
\ No newline at end of file
... ...
... ... @@ -5,54 +5,70 @@ import qs from 'qs'
Vue.prototype.$http = axios;
export const getuserMenus = params => { return axios.get(`/perm/userMenus`, { params: params }); };
export const getUserList = params => { return axios.get(`/hqpt-user-center/user/list`, { params: params }); };
export const getUserListPage = params => { return axios({
method: 'GET',
url: `/user/list`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
// withCredentials: true
}) };
export const removeUser = params => { return axios({
method: 'DELETE',
url: `/user/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const batchRemoveUser = params => { return axios.get(`/user/batchremove`, { params: params }); };
export const editUser = params => { return axios({
method: 'PUT',
url: `/user/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const addUser = params => { return axios({
method: 'POST',
url: `/user/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const setUserRole = params => { return axios({
method: 'PUT',
url: `/user/roleset`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const getuserMenus = params => {
return axios.get(`/perm/userMenus`, {params: params});
};
export const getUserList = params => {
return axios.get(`/hqpt-user-center/user/list`, {params: params});
};
export const getUserListPage = params => {
return axios({
method: 'GET',
url: `/user/list`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
// withCredentials: true
})
};
export const removeUser = params => {
return axios({
method: 'DELETE',
url: `/user/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const batchRemoveUser = params => {
return axios.get(`/user/batchremove`, {params: params});
};
export const editUser = params => {
return axios({
method: 'PUT',
url: `/user/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const addUser = params => {
return axios({
method: 'POST',
url: `/user/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const setUserRole = params => {
return axios({
method: 'PUT',
url: `/user/roleset`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
\ No newline at end of file
... ...
import request from '@/utils/request'
export function fetchList(query) {
return request({
url: '/article/list',
method: 'get',
params: query
})
return request({
url: '/article/list',
method: 'get',
params: query
})
}
export function fetchArticle(id) {
return request({
url: '/article/detail',
method: 'get',
params: { id }
})
return request({
url: '/article/detail',
method: 'get',
params: {id}
})
}
export function fetchPv(pv) {
return request({
url: '/article/pv',
method: 'get',
params: { pv }
})
return request({
url: '/article/pv',
method: 'get',
params: {pv}
})
}
export function createArticle(data) {
return request({
url: '/article/create',
method: 'post',
data
})
return request({
url: '/article/create',
method: 'post',
data
})
}
export function updateArticle(data) {
return request({
url: '/article/update',
method: 'post',
data
})
return request({
url: '/article/update',
method: 'post',
data
})
}
... ...
const loginuserInfo = JSON.parse(sessionStorage.getItem('user'));
export default loginuserInfo;
\ No newline at end of file
export default loginuserInfo;
\ No newline at end of file
... ...
... ... @@ -3,35 +3,45 @@ import axios from 'axios'
let base = '/hqpt-user-center/company';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
//批量删除
export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); };
export const edit = params => { return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const add = params => { return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const batchRemove = params => {
return axios.get(`${base}/batchremove`, {params: params});
};
export const edit = params => {
return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const add = params => {
return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
\ No newline at end of file
... ...
... ... @@ -3,35 +3,45 @@ import axios from 'axios'
let base = '/cloud-user-center/department';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
//批量删除
export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); };
export const edit = params => { return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const add = params => { return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const batchRemove = params => {
return axios.get(`${base}/batchremove`, {params: params});
};
export const edit = params => {
return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const add = params => {
return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
\ No newline at end of file
... ...
... ... @@ -2,26 +2,45 @@ import axios from 'axios'
let base = 'empt-location/order';
export const getOrder = params => { return axios.get(`${base}/list`, { params: params }); };
export const getOrder = params => {
return axios.get(`${base}/list`, {params: params});
};
export const addOrder=params=>{return http.post(`${base}/add`, params);};
export const addOrder = params => {
return http.post(`${base}/add`, params);
};
// export const ediOrder=params=>{return http.put(`${base}/edi`, params);};
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const ediOrder = params => { return axios({
method: 'PUT',
url: `${base}/edi`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const ediOrder = params => {
return axios({
method: 'PUT',
url: `${base}/edi`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const defeatedOrder = params =>{
return axios({
method: 'POST',
url: `${base}/defeatedOrder`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
\ No newline at end of file
... ...
... ... @@ -2,4 +2,6 @@ import axios from 'axios'
let base = 'empt-location/eeInfo';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
\ No newline at end of file
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
\ No newline at end of file
... ...
... ... @@ -3,62 +3,78 @@ import axios from 'axios'
let base = 'empt-location/electricity_meter';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
//批量删除
export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); };
export const batchRemove = params => {
return axios.get(`${base}/batchremove`, {params: params});
};
export const edit = params => { return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const edit = params => {
return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const add = params => { return axios({
method: 'POST',
url: `${base}/add`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const add = params => {
return axios({
method: 'POST',
url: `${base}/add`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const electricityInfo = params => { return axios({
method: 'POST',
url: `${base}/getEnergyInfoForRealTime`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const electricityInfo = params => {
return axios({
method: 'POST',
url: `${base}/getEnergyInfoForRealTime`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const getEEModel = params => { return axios({
method: 'POST',
url: `${base}/getEEModel`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const getEEModel = params => {
return axios({
method: 'POST',
url: `${base}/getEEModel`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const update = params => { return axios({
method: 'PUT',
url: `${base}/update`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const update = params => {
return axios({
method: 'PUT',
url: `${base}/update`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
\ No newline at end of file
... ...
... ... @@ -3,44 +3,56 @@ import axios from 'axios'
let base = 'empt-location/location';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
//批量删除
export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); };
export const edit = params => { return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const add = params => { return axios({
method: 'POST',
url: `${base}/add`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const update = params => { return axios({
method: 'PUT',
url: `${base}/update`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const batchRemove = params => {
return axios.get(`${base}/batchremove`, {params: params});
};
export const edit = params => {
return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const add = params => {
return axios({
method: 'POST',
url: `${base}/add`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const update = params => {
return axios({
method: 'PUT',
url: `${base}/update`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
\ No newline at end of file
... ...
... ... @@ -3,53 +3,67 @@ import axios from 'axios'
let base = 'empt-location/userPayOrder';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
//批量删除
export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); };
export const edit = params => { return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const add = params => { return axios({
method: 'POST',
url: `${base}/add`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const qrCode = params => { return axios({
method: 'POST',
url: `${base}/qrCode`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const update = params => { return axios({
method: 'PUT',
url: `${base}/update`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const batchRemove = params => {
return axios.get(`${base}/batchremove`, {params: params});
};
export const edit = params => {
return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const add = params => {
return axios({
method: 'POST',
url: `${base}/add`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const qrCode = params => {
return axios({
method: 'POST',
url: `${base}/qrCode`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const update = params => {
return axios({
method: 'PUT',
url: `${base}/update`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
\ No newline at end of file
... ...
... ... @@ -3,55 +3,71 @@ import axios from 'axios'
let base = 'empt-location/water_meter';
export const getList = params => { return axios.get(`${base}/selectAll`, { params: params }); };
export const getList = params => {
return axios.get(`${base}/selectAll`, {params: params});
};
export const waterMeterAll = params => { return axios.get(`${base}/waterMeterAll`, { params: params }); };
export const waterMeterAll = params => {
return axios.get(`${base}/waterMeterAll`, {params: params});
};
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
//批量删除
export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); };
export const edit = params => { return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const add = params => { return axios({
method: 'POST',
url: `${base}/add`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const findRealTime = params => { return axios({
method: 'POST',
url: `${base}/findRealTime`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const update = params => { return axios({
method: 'PUT',
url: `${base}/update`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const batchRemove = params => {
return axios.get(`${base}/batchremove`, {params: params});
};
export const edit = params => {
return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const add = params => {
return axios({
method: 'POST',
url: `${base}/add`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const findRealTime = params => {
return axios({
method: 'POST',
url: `${base}/findRealTime`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const update = params => {
return axios({
method: 'PUT',
url: `${base}/update`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
\ No newline at end of file
... ...
... ... @@ -3,35 +3,45 @@ import axios from 'axios'
let base = '/hqpt-user-center/group';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
//批量删除
export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); };
export const edit = params => { return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const add = params => { return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const batchRemove = params => {
return axios.get(`${base}/batchremove`, {params: params});
};
export const edit = params => {
return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const add = params => {
return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
\ No newline at end of file
... ...
... ... @@ -17,13 +17,13 @@ export default {
return axios({
method: 'GET',
url: url,
params: params,
params: params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});
},
put(url, params){
put(url, params) {
return axios({
method: 'PUT',
url: url,
... ... @@ -33,7 +33,7 @@ export default {
}
})
},
del: (url,params) => {
del: (url, params) => {
return axios({
method: 'DELETE',
url: url,
... ... @@ -43,7 +43,7 @@ export default {
}
})
},
login: data =>{
login: data => {
return axios({
method: 'POST', // 请求协议
url: 'cloud-user-center/login', // 请求的地址
... ...
... ... @@ -3,44 +3,56 @@ import axios from 'axios'
let base = 'hqpt-process/job';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
//批量删除
export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); };
export const edit = params => { return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const add = params => { return axios({
method: 'POST',
url: `${base}/add`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const startJob = params => { return axios({
method: 'PUT',
url: `${base}/start`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const batchRemove = params => {
return axios.get(`${base}/batchremove`, {params: params});
};
export const edit = params => {
return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const add = params => {
return axios({
method: 'POST',
url: `${base}/add`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const startJob = params => {
return axios({
method: 'PUT',
url: `${base}/start`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
\ No newline at end of file
... ...
... ... @@ -3,4 +3,6 @@ import axios from 'axios'
let base = '/cloud-user-center/system/log';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
\ No newline at end of file
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
\ No newline at end of file
... ...
... ... @@ -3,35 +3,45 @@ import axios from 'axios'
let base = '/cloud-user-center/perm';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
//批量删除
export const batchRemove = params => { return axios.get(`${base}/user/batchremove`, { params: params }); };
export const edit = params => { return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const add = params => { return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const batchRemove = params => {
return axios.get(`${base}/user/batchremove`, {params: params});
};
export const edit = params => {
return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const add = params => {
return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
\ No newline at end of file
... ...
... ... @@ -3,47 +3,59 @@ import axios from 'axios'
let base = 'hqpt-process/process';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
//批量删除
export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); };
export const edit = params => { return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const add = params => { return axios({
method: 'POST',
url: `${base}/add`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const updateRolePerm = params => { return axios({
method: 'PUT',
url: `${base}/permSet`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const batchRemove = params => {
return axios.get(`${base}/batchremove`, {params: params});
};
export const edit = params => {
return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const add = params => {
return axios({
method: 'POST',
url: `${base}/add`,
params: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const updateRolePerm = params => {
return axios({
method: 'PUT',
url: `${base}/permSet`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const vacationTypeOptions = [
{
... ...
... ... @@ -3,44 +3,56 @@ import axios from 'axios'
let base = '/cloud-user-center/role';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
//批量删除
export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); };
export const edit = params => { return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const add = params => { return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const updateRolePerm = params => { return axios({
method: 'PUT',
url: `${base}/permSet`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const batchRemove = params => {
return axios.get(`${base}/batchremove`, {params: params});
};
export const edit = params => {
return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const add = params => {
return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const updateRolePerm = params => {
return axios({
method: 'PUT',
url: `${base}/permSet`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
\ No newline at end of file
... ...
... ... @@ -3,9 +3,9 @@ let setIntervalWesocketPush = null
/**建立连接 */
export function createSocket() {
var socketUrl="http://localhost:10003/imserver";
// var socketUrl="http://218.28.199.138:10003/imserver";
socketUrl=socketUrl.replace("https","ws").replace("http","ws");
// var socketUrl="http://localhost:10003/imserver";
var socketUrl = "http://218.28.199.138:10003/imserver";
socketUrl = socketUrl.replace("https", "ws").replace("http", "ws");
console.log(socketUrl);
if (!Socket) {
... ... @@ -19,16 +19,19 @@ export function createSocket() {
console.log('websocket已连接')
}
}
/**打开WS之后发送心跳 */
export function onopenWS() {
sendPing() //发送心跳
}
/**连接失败重连 */
export function onerrorWS() {
clearInterval(setIntervalWesocketPush)
Socket.close()
createSocket() //重连
}
/**WS数据接收统一处理 */
export function onmessageWS(e) {
console.log(e.data);
... ... @@ -38,6 +41,7 @@ export function onmessageWS(e) {
}
}))
}
/**发送数据
* @param eventType
*/
... ... @@ -58,11 +62,13 @@ export function sendWSPush(eventTypeArr) {
}, 3000)
}
}
/**关闭WS */
export function oncloseWS() {
clearInterval(setIntervalWesocketPush)
console.log('websocket已断开')
}
/**发送心跳 */
export function sendPing() {
Socket.send('ping')
... ...
... ... @@ -3,36 +3,45 @@ import axios from 'axios'
let base = '/hqpt-user-center/come_car';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
//批量删除
export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); };
export const edit = params => { return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const add = params => { return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const batchRemove = params => {
return axios.get(`${base}/batchremove`, {params: params});
};
export const edit = params => {
return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const add = params => {
return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
\ No newline at end of file
... ...
... ... @@ -3,36 +3,45 @@ import axios from 'axios'
let base = '/hqpt-user-center/key';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
//批量删除
export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); };
export const edit = params => { return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const add = params => { return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const batchRemove = params => {
return axios.get(`${base}/batchremove`, {params: params});
};
export const edit = params => {
return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const add = params => {
return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
\ No newline at end of file
... ...
... ... @@ -3,36 +3,45 @@ import axios from 'axios'
let base = '/hqpt-user-center/maintain';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
//批量删除
export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); };
export const edit = params => { return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const add = params => { return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const batchRemove = params => {
return axios.get(`${base}/batchremove`, {params: params});
};
export const edit = params => {
return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const add = params => {
return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
\ No newline at end of file
... ...
... ... @@ -3,36 +3,45 @@ import axios from 'axios'
let base = '/hqpt-user-center/on_duty';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
//批量删除
export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); };
export const edit = params => { return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const add = params => { return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const batchRemove = params => {
return axios.get(`${base}/batchremove`, {params: params});
};
export const edit = params => {
return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const add = params => {
return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
\ No newline at end of file
... ...
... ... @@ -3,36 +3,45 @@ import axios from 'axios'
let base = '/hqpt-user-center/inspection';
export const getList = params => { return axios.get(`${base}/list`, { params: params }); };
export const remove = params => { return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const getList = params => {
return axios.get(`${base}/list`, {params: params});
};
export const remove = params => {
return axios({
method: 'DELETE',
url: `${base}/del`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
//批量删除
export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); };
export const edit = params => { return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
export const add = params => { return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})};
\ No newline at end of file
export const batchRemove = params => {
return axios.get(`${base}/batchremove`, {params: params});
};
export const edit = params => {
return axios({
method: 'PUT',
url: `${base}/edit`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
export const add = params => {
return axios({
method: 'POST',
url: `${base}/add`,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
};
\ No newline at end of file
... ...
export const checkNull = params => {
if (params!=null && !params && typeof(params)!="undefined"){
if (params != null && !params && typeof (params) != "undefined") {
return true;
}else {
} else {
return false;
}
};
... ...
import http from './http.js'
let baseUrl = '/cloud-user-center/user'
export const getUserList = params => { return http.get(`${baseUrl}/list`, params); };
export const getUserList = params => {
return http.get(`${baseUrl}/list`, params);
};
export const getUserListPage = params => { return http.get(`/user/list`,params) };
export const getUserListPage = params => {
return http.get(`/user/list`, params)
};
export const removeUser = params => { return http.del(`${baseUrl}/del`,params)};
export const removeUser = params => {
return http.del(`${baseUrl}/del`, params)
};
export const batchRemoveUser = params => { return http.del(`${baseUrl}/batchremove`, { params: params }); };
export const batchRemoveUser = params => {
return http.del(`${baseUrl}/batchremove`, {params: params});
};
export const editPass = params => { return http.put(`${baseUrl}/password`,params)};
export const editPass = params => {
return http.put(`${baseUrl}/password`, params)
};
export const editUser = params => { return http.put(`${baseUrl}/edit`,params)};
export const editUser = params => {
return http.put(`${baseUrl}/edit`, params)
};
export const addUser = params => { return http.post(`${baseUrl}/add`,params)};
export const addUser = params => {
return http.post(`${baseUrl}/add`, params)
};
export const setUserRole = params => { return http.put(`${baseUrl}/roleset`,params)};
export const setUserRole = params => {
return http.put(`${baseUrl}/roleset`, params)
};
export const resetToken = params => { return http.put(`${baseUrl}/resetToken`,params)};
\ No newline at end of file
export const resetToken = params => {
return http.put(`${baseUrl}/resetToken`, params)
};
\ No newline at end of file
... ...
... ... @@ -4,7 +4,7 @@ var DEFAULT_PATTERN = 'yyyy-MM-dd';
* 根据数组 元素的“值” 来删除或者获取数据
* 使用方法arrList.splice(arrList.contains('c'),1)
*/
Array.prototype.contains = function(obj) {
Array.prototype.contains = function (obj) {
var i = this.length;
while (i--) {
if (this[i] === obj) {
... ... @@ -16,7 +16,9 @@ Array.prototype.contains = function(obj) {
function padding(s, len) {
len = len - (s + '').length;
for (var i = 0; i < len; i++) { s = '0' + s; }
for (var i = 0; i < len; i++) {
s = '0' + s;
}
return s;
}
... ... @@ -38,13 +40,20 @@ export default {
pattern = pattern || DEFAULT_PATTERN;
return pattern.replace(SIGN_REGEXP, function ($0) {
switch ($0.charAt(0)) {
case 'y': return padding(date.getFullYear(), $0.length);
case 'M': return padding(date.getMonth() + 1, $0.length);
case 'd': return padding(date.getDate(), $0.length);
case 'w': return date.getDay() + 1;
case 'h': return padding(date.getHours(), $0.length);
case 'm': return padding(date.getMinutes(), $0.length);
case 's': return padding(date.getSeconds(), $0.length);
case 'y':
return padding(date.getFullYear(), $0.length);
case 'M':
return padding(date.getMonth() + 1, $0.length);
case 'd':
return padding(date.getDate(), $0.length);
case 'w':
return date.getDay() + 1;
case 'h':
return padding(date.getHours(), $0.length);
case 'm':
return padding(date.getMinutes(), $0.length);
case 's':
return padding(date.getSeconds(), $0.length);
}
});
},
... ... @@ -57,12 +66,24 @@ export default {
var _int = parseInt(matchs2[i]);
var sign = matchs1[i];
switch (sign.charAt(0)) {
case 'y': _date.setFullYear(_int); break;
case 'M': _date.setMonth(_int - 1); break;
case 'd': _date.setDate(_int); break;
case 'h': _date.setHours(_int); break;
case 'm': _date.setMinutes(_int); break;
case 's': _date.setSeconds(_int); break;
case 'y':
_date.setFullYear(_int);
break;
case 'M':
_date.setMonth(_int - 1);
break;
case 'd':
_date.setDate(_int);
break;
case 'h':
_date.setHours(_int);
break;
case 'm':
_date.setMinutes(_int);
break;
case 's':
_date.setSeconds(_int);
break;
}
}
return _date;
... ... @@ -72,9 +93,9 @@ export default {
},
checkNull: params => {
if (params!==null && typeof(params)!="undefined"){
if (params !== null && typeof (params) != "undefined") {
return true;
}else {
} else {
return false;
}
}
... ...
<template>
<div :class="{'hidden':hidden}" class="pagination-container">
<el-pagination
:background="background"
:current-page.sync="currentPage"
:page-size.sync="pageSize"
:layout="layout"
:page-sizes="pageSizes"
:total="total"
v-bind="$attrs"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
<div :class="{'hidden':hidden}" class="pagination-container">
<el-pagination
:background="background"
:current-page.sync="currentPage"
:page-size.sync="pageSize"
:layout="layout"
:page-sizes="pageSizes"
:total="total"
v-bind="$attrs"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</template>
<script>
import { scrollTo } from '@/utils/scrollTo'
import {scrollTo} from '@/utils/scrollTo'
export default {
name: 'Pagination',
props: {
total: {
required: true,
type: Number
},
page: {
type: Number,
default: 1
},
limit: {
type: Number,
default: 20
},
pageSizes: {
type: Array,
default() {
return [10, 20, 30, 50]
}
},
layout: {
type: String,
default: 'total, sizes, prev, pager, next, jumper'
},
background: {
type: Boolean,
default: true
},
autoScroll: {
type: Boolean,
default: true
},
hidden: {
type: Boolean,
default: false
export default {
name: 'Pagination',
props: {
total: {
required: true,
type: Number
},
page: {
type: Number,
default: 1
},
limit: {
type: Number,
default: 20
},
pageSizes: {
type: Array,
default() {
return [10, 20, 30, 50]
}
},
layout: {
type: String,
default: 'total, sizes, prev, pager, next, jumper'
},
background: {
type: Boolean,
default: true
},
autoScroll: {
type: Boolean,
default: true
},
hidden: {
type: Boolean,
default: false
}
},
computed: {
currentPage: {
get() {
return this.page
},
set(val) {
this.$emit('update:page', val)
}
},
pageSize: {
get() {
return this.limit
},
set(val) {
this.$emit('update:limit', val)
}
}
},
methods: {
handleSizeChange(val) {
this.$emit('pagination', {page: this.currentPage, limit: val})
if (this.autoScroll) {
scrollTo(0, 800)
}
},
handleCurrentChange(val) {
this.$emit('pagination', {page: val, limit: this.pageSize})
if (this.autoScroll) {
scrollTo(0, 800)
}
}
}
}
},
computed: {
currentPage: {
get() {
return this.page
},
set(val) {
this.$emit('update:page', val)
}
},
pageSize: {
get() {
return this.limit
},
set(val) {
this.$emit('update:limit', val)
}
}
},
methods: {
handleSizeChange(val) {
this.$emit('pagination', { page: this.currentPage, limit: val })
if (this.autoScroll) {
scrollTo(0, 800)
}
},
handleCurrentChange(val) {
this.$emit('pagination', { page: val, limit: this.pageSize })
if (this.autoScroll) {
scrollTo(0, 800)
}
}
}
}
</script>
<style scoped>
.pagination-container {
background: #fff;
padding: 32px 16px;
}
.pagination-container.hidden {
display: none;
}
.pagination-container {
background: #fff;
padding: 32px 16px;
}
.pagination-container.hidden {
display: none;
}
</style>
... ...
/**
* @Author: jianglei
* @Date: 2017-10-12 12:06:49
*/
* @Author: jianglei
* @Date: 2017-10-12 12:06:49
*/
'use strict'
import Vue from 'vue'
export default function treeToArray(data, expandAll, parent = null, level = null) {
let tmp = []
Array.from(data).forEach(function(record) {
if (record._expanded === undefined) {
Vue.set(record, '_expanded', expandAll)
}
let _level = 1
if (level !== undefined && level !== null) {
_level = level + 1
}
Vue.set(record, '_level', _level)
// 如果有父元素
if (parent) {
Vue.set(record, 'parent', parent)
}
tmp.push(record)
if (record.children && record.children.length > 0) {
const children = treeToArray(record.children, expandAll, record, _level)
tmp = tmp.concat(children)
}
})
return tmp
let tmp = []
Array.from(data).forEach(function (record) {
if (record._expanded === undefined) {
Vue.set(record, '_expanded', expandAll)
}
let _level = 1
if (level !== undefined && level !== null) {
_level = level + 1
}
Vue.set(record, '_level', _level)
// 如果有父元素
if (parent) {
Vue.set(record, 'parent', parent)
}
tmp.push(record)
if (record.children && record.children.length > 0) {
const children = treeToArray(record.children, expandAll, record, _level)
tmp = tmp.concat(children)
}
})
return tmp
}
... ...
<template>
<el-table :data="formatData" :row-style="showRow" v-bind="$attrs">
<el-table-column type="selection" width="30" align="center"/>
<el-table-column v-if="columns.length===0" width="30" align="center">
<template slot-scope="scope">
<span v-for="space in scope.row._level" :key="space" class="ms-tree-space"/>
<span v-if="iconShow(0,scope.row)" class="tree-ctrl" @click="toggleExpanded(scope.$index)">
<el-table :data="formatData" :row-style="showRow" v-bind="$attrs">
<el-table-column type="selection" width="30" align="center"/>
<el-table-column v-if="columns.length===0" width="30" align="center">
<template slot-scope="scope">
<span v-for="space in scope.row._level" :key="space" class="ms-tree-space"/>
<span v-if="iconShow(0,scope.row)" class="tree-ctrl" @click="toggleExpanded(scope.$index)">
<i v-if="!scope.row._expanded" class="el-icon-plus"/>
<i v-else class="el-icon-minus"/>
</span>
<!--{{ scope.$index }}-->
</template>
</el-table-column>
<el-table-column v-for="(column, index) in columns" v-else :key="column.value" :label="column.text" :width="column.width">
<template slot-scope="scope">
<!-- Todo -->
<!-- eslint-disable-next-line vue/no-confusing-v-for-v-if -->
<span v-for="space in scope.row._level" v-if="index === 0" :key="space" class="ms-tree-space"/>
<span v-if="iconShow(index,scope.row)" class="tree-ctrl" @click="toggleExpanded(scope.$index)">
<!--{{ scope.$index }}-->
</template>
</el-table-column>
<el-table-column v-for="(column, index) in columns" v-else :key="column.value" :label="column.text"
:width="column.width">
<template slot-scope="scope">
<!-- Todo -->
<!-- eslint-disable-next-line vue/no-confusing-v-for-v-if -->
<span v-for="space in scope.row._level" v-if="index === 0" :key="space" class="ms-tree-space"/>
<span v-if="iconShow(index,scope.row)" class="tree-ctrl" @click="toggleExpanded(scope.$index)">
<i v-if="!scope.row._expanded" class="el-icon-plus"/>
<i v-else class="el-icon-minus"/>
</span>
{{ scope.row[column.value] }}
</template>
</el-table-column>
<slot/>
</el-table>
{{ scope.row[column.value] }}
</template>
</el-table-column>
<slot/>
</el-table>
</template>
<script>
/**
Auth: Lei.j1ang
Created: 2018/1/19-13:59
*/
import treeToArray from './eval.js'
export default {
name: 'TreeTable',
props: {
/* eslint-disable */
data: {
type: [Array, Object],
required: true
},
columns: {
type: Array,
default: () => []
},
evalFunc: Function,
evalArgs: Array,
expandAll: {
type: Boolean,
default: true
}
},
computed: {
// 格式化数据源
formatData: function() {
let tmp
if (!Array.isArray(this.data)) {
tmp = [this.data]
} else {
tmp = this.data
}
const func = this.evalFunc || treeToArray
const args = this.evalArgs ? Array.concat([tmp, this.expandAll], this.evalArgs) : [tmp, this.expandAll]
return func.apply(null, args)
}
},
methods: {
showRow: function(row) {
this.data
const show = (row.parent ? (row.parent._expanded && row.parent._show) : true)
/**
Auth: Lei.j1ang
Created: 2018/1/19-13:59
*/
import treeToArray from './eval.js'
export default {
name: 'TreeTable',
props: {
/* eslint-disable */
data: {
type: [Array, Object],
required: true
},
columns: {
type: Array,
default: () => []
},
evalFunc: Function,
evalArgs: Array,
expandAll: {
type: Boolean,
default: true
}
},
computed: {
// 格式化数据源
formatData: function () {
let tmp
if (!Array.isArray(this.data)) {
tmp = [this.data]
} else {
tmp = this.data
}
const func = this.evalFunc || treeToArray
const args = this.evalArgs ? Array.concat([tmp, this.expandAll], this.evalArgs) : [tmp, this.expandAll]
return func.apply(null, args)
}
},
methods: {
showRow: function (row) {
this.data
const show = (row.parent ? (row.parent._expanded && row.parent._show) : true)
// const show = (row.row.parent ? (row.row.parent._expanded && row.row.parent._show) : true)
// row.row._show = show
row._show = show
return show ? 'animation:treeTableShow 1s;-webkit-animation:treeTableShow 1s;' : 'display:none;'
},
// 切换下级是否展开
toggleExpanded: function(trIndex) {
const record = this.formatData[trIndex]
record._expanded = !record._expanded
},
// 图标显示
iconShow(index, record) {
return (index === 0 && record.children && record.children.length > 0)
row._show = show
return show ? 'animation:treeTableShow 1s;-webkit-animation:treeTableShow 1s;' : 'display:none;'
},
// 切换下级是否展开
toggleExpanded: function (trIndex) {
const record = this.formatData[trIndex]
record._expanded = !record._expanded
},
// 图标显示
iconShow(index, record) {
return (index === 0 && record.children && record.children.length > 0)
}
}
}
}
}
</script>
<style rel="stylesheet/css">
@keyframes treeTableShow {
from {opacity: 0;}
to {opacity: 1;}
}
@-webkit-keyframes treeTableShow {
from {opacity: 0;}
to {opacity: 1;}
}
@keyframes treeTableShow {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@-webkit-keyframes treeTableShow {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
</style>
<style lang="scss" rel="stylesheet/scss" scoped>
$color-blue: #2196F3;
$space-width: 18px;
.ms-tree-space {
position: relative;
top: 1px;
display: inline-block;
font-style: normal;
font-weight: 400;
line-height: 1;
width: $space-width;
height: 14px;
&::before {
content: ""
$color-blue: #2196F3;
$space-width: 18px;
.ms-tree-space {
position: relative;
top: 1px;
display: inline-block;
font-style: normal;
font-weight: 400;
line-height: 1;
width: $space-width;
height: 14px;
&::before {
content: ""
}
}
.processContainer {
width: 100%;
height: 100%;
}
}
.processContainer{
width: 100%;
height: 100%;
}
table td {
line-height: 26px;
}
.tree-ctrl{
position: relative;
cursor: pointer;
color: $color-blue;
margin-left: -$space-width;
}
table td {
line-height: 26px;
}
.tree-ctrl {
position: relative;
cursor: pointer;
color: $color-blue;
margin-left: -$space-width;
}
</style>
... ...
// Inspired by https://github.com/Inndy/vue-clipboard2
const Clipboard = require('clipboard')
if (!Clipboard) {
throw new Error('you should npm install `clipboard` --save at first ')
throw new Error('you should npm install `clipboard` --save at first ')
}
export default {
bind(el, binding) {
if (binding.arg === 'success') {
el._v_clipboard_success = binding.value
} else if (binding.arg === 'error') {
el._v_clipboard_error = binding.value
} else {
const clipboard = new Clipboard(el, {
text() { return binding.value },
action() { return binding.arg === 'cut' ? 'cut' : 'copy' }
})
clipboard.on('success', e => {
const callback = el._v_clipboard_success
callback && callback(e) // eslint-disable-line
})
clipboard.on('error', e => {
const callback = el._v_clipboard_error
callback && callback(e) // eslint-disable-line
})
el._v_clipboard = clipboard
bind(el, binding) {
if (binding.arg === 'success') {
el._v_clipboard_success = binding.value
} else if (binding.arg === 'error') {
el._v_clipboard_error = binding.value
} else {
const clipboard = new Clipboard(el, {
text() {
return binding.value
},
action() {
return binding.arg === 'cut' ? 'cut' : 'copy'
}
})
clipboard.on('success', e => {
const callback = el._v_clipboard_success
callback && callback(e) // eslint-disable-line
})
clipboard.on('error', e => {
const callback = el._v_clipboard_error
callback && callback(e) // eslint-disable-line
})
el._v_clipboard = clipboard
}
},
update(el, binding) {
if (binding.arg === 'success') {
el._v_clipboard_success = binding.value
} else if (binding.arg === 'error') {
el._v_clipboard_error = binding.value
} else {
el._v_clipboard.text = function () {
return binding.value
}
el._v_clipboard.action = function () {
return binding.arg === 'cut' ? 'cut' : 'copy'
}
}
},
unbind(el, binding) {
if (binding.arg === 'success') {
delete el._v_clipboard_success
} else if (binding.arg === 'error') {
delete el._v_clipboard_error
} else {
el._v_clipboard.destroy()
delete el._v_clipboard
}
}
},
update(el, binding) {
if (binding.arg === 'success') {
el._v_clipboard_success = binding.value
} else if (binding.arg === 'error') {
el._v_clipboard_error = binding.value
} else {
el._v_clipboard.text = function() { return binding.value }
el._v_clipboard.action = function() { return binding.arg === 'cut' ? 'cut' : 'copy' }
}
},
unbind(el, binding) {
if (binding.arg === 'success') {
delete el._v_clipboard_success
} else if (binding.arg === 'error') {
delete el._v_clipboard_error
} else {
el._v_clipboard.destroy()
delete el._v_clipboard
}
}
}
... ...
import Clipboard from './clipboard'
const install = function(Vue) {
Vue.directive('Clipboard', Clipboard)
const install = function (Vue) {
Vue.directive('Clipboard', Clipboard)
}
if (window.Vue) {
window.clipboard = Clipboard
Vue.use(install); // eslint-disable-line
window.clipboard = Clipboard
Vue.use(install); // eslint-disable-line
}
Clipboard.install = install
... ...
export default{
bind(el, binding, vnode) {
const dialogHeaderEl = el.querySelector('.el-dialog__header')
const dragDom = el.querySelector('.el-dialog')
dialogHeaderEl.style.cssText += ';cursor:move;'
dragDom.style.cssText += ';top:0px;'
export default {
bind(el, binding, vnode) {
const dialogHeaderEl = el.querySelector('.el-dialog__header')
const dragDom = el.querySelector('.el-dialog')
dialogHeaderEl.style.cssText += ';cursor:move;'
dragDom.style.cssText += ';top:0px;'
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
const getStyle = (function() {
if (window.document.currentStyle) {
return (dom, attr) => dom.currentStyle[attr]
} else {
return (dom, attr) => getComputedStyle(dom, false)[attr]
}
})()
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
const getStyle = (function () {
if (window.document.currentStyle) {
return (dom, attr) => dom.currentStyle[attr]
} else {
return (dom, attr) => getComputedStyle(dom, false)[attr]
}
})()
dialogHeaderEl.onmousedown = (e) => {
// 鼠标按下,计算当前元素距离可视区的距离
const disX = e.clientX - dialogHeaderEl.offsetLeft
const disY = e.clientY - dialogHeaderEl.offsetTop
dialogHeaderEl.onmousedown = (e) => {
// 鼠标按下,计算当前元素距离可视区的距离
const disX = e.clientX - dialogHeaderEl.offsetLeft
const disY = e.clientY - dialogHeaderEl.offsetTop
const dragDomWidth = dragDom.offsetWidth
const dragDomHeight = dragDom.offsetHeight
const dragDomWidth = dragDom.offsetWidth
const dragDomHeight = dragDom.offsetHeight
const screenWidth = document.body.clientWidth
const screenHeight = document.body.clientHeight
const screenWidth = document.body.clientWidth
const screenHeight = document.body.clientHeight
const minDragDomLeft = dragDom.offsetLeft
const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth
const minDragDomLeft = dragDom.offsetLeft
const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth
const minDragDomTop = dragDom.offsetTop
const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomHeight
const minDragDomTop = dragDom.offsetTop
const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomHeight
// 获取到的值带px 正则匹配替换
let styL = getStyle(dragDom, 'left')
let styT = getStyle(dragDom, 'top')
// 获取到的值带px 正则匹配替换
let styL = getStyle(dragDom, 'left')
let styT = getStyle(dragDom, 'top')
if (styL.includes('%')) {
styL = +document.body.clientWidth * (+styL.replace(/\%/g, '') / 100)
styT = +document.body.clientHeight * (+styT.replace(/\%/g, '') / 100)
} else {
styL = +styL.replace(/\px/g, '')
styT = +styT.replace(/\px/g, '')
}
if (styL.includes('%')) {
styL = +document.body.clientWidth * (+styL.replace(/\%/g, '') / 100)
styT = +document.body.clientHeight * (+styT.replace(/\%/g, '') / 100)
} else {
styL = +styL.replace(/\px/g, '')
styT = +styT.replace(/\px/g, '')
}
document.onmousemove = function(e) {
// 通过事件委托,计算移动的距离
let left = e.clientX - disX
let top = e.clientY - disY
document.onmousemove = function (e) {
// 通过事件委托,计算移动的距离
let left = e.clientX - disX
let top = e.clientY - disY
// 边界处理
if (-(left) > minDragDomLeft) {
left = -minDragDomLeft
} else if (left > maxDragDomLeft) {
left = maxDragDomLeft
}
// 边界处理
if (-(left) > minDragDomLeft) {
left = -minDragDomLeft
} else if (left > maxDragDomLeft) {
left = maxDragDomLeft
}
if (-(top) > minDragDomTop) {
top = -minDragDomTop
} else if (top > maxDragDomTop) {
top = maxDragDomTop
}
if (-(top) > minDragDomTop) {
top = -minDragDomTop
} else if (top > maxDragDomTop) {
top = maxDragDomTop
}
// 移动当前元素
dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`
// 移动当前元素
dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`
// emit onDrag event
vnode.child.$emit('dragDialog')
}
// emit onDrag event
vnode.child.$emit('dragDialog')
}
document.onmouseup = function(e) {
document.onmousemove = null
document.onmouseup = null
}
document.onmouseup = function (e) {
document.onmousemove = null
document.onmouseup = null
}
}
}
}
}
... ...
import drag from './drag'
const install = function(Vue) {
Vue.directive('el-drag-dialog', drag)
const install = function (Vue) {
Vue.directive('el-drag-dialog', drag)
}
if (window.Vue) {
window['el-drag-dialog'] = drag
Vue.use(install); // eslint-disable-line
window['el-drag-dialog'] = drag
Vue.use(install); // eslint-disable-line
}
drag.install = install
... ...
import permission from './permission'
const install = function(Vue) {
Vue.directive('permission', permission)
const install = function (Vue) {
Vue.directive('permission', permission)
}
if (window.Vue) {
window['permission'] = permission
Vue.use(install); // eslint-disable-line
window['permission'] = permission
Vue.use(install); // eslint-disable-line
}
permission.install = install
... ...
import store from '@/store'
export default{
inserted(el, binding, vnode) {
const { value } = binding
const roles = store.getters && store.getters.roles
export default {
inserted(el, binding, vnode) {
const {value} = binding
const roles = store.getters && store.getters.roles
if (value && value instanceof Array && value.length > 0) {
const permissionRoles = value
if (value && value instanceof Array && value.length > 0) {
const permissionRoles = value
const hasPermission = roles.some(role => {
return permissionRoles.includes(role)
})
const hasPermission = roles.some(role => {
return permissionRoles.includes(role)
})
if (!hasPermission) {
el.parentNode && el.parentNode.removeChild(el)
}
} else {
throw new Error(`need roles! Like v-permission="['admin','editor']"`)
if (!hasPermission) {
el.parentNode && el.parentNode.removeChild(el)
}
} else {
throw new Error(`need roles! Like v-permission="['admin','editor']"`)
}
}
}
}
... ...
const vueSticky = {}
let listenAction
vueSticky.install = Vue => {
Vue.directive('sticky', {
inserted(el, binding) {
const params = binding.value || {}
const stickyTop = params.stickyTop || 0
const zIndex = params.zIndex || 1000
const elStyle = el.style
Vue.directive('sticky', {
inserted(el, binding) {
const params = binding.value || {}
const stickyTop = params.stickyTop || 0
const zIndex = params.zIndex || 1000
const elStyle = el.style
elStyle.position = '-webkit-sticky'
elStyle.position = 'sticky'
// if the browser support css sticky(Currently Safari, Firefox and Chrome Canary)
// if (~elStyle.position.indexOf('sticky')) {
// elStyle.top = `${stickyTop}px`;
// elStyle.zIndex = zIndex;
// return
// }
const elHeight = el.getBoundingClientRect().height
const elWidth = el.getBoundingClientRect().width
elStyle.cssText = `top: ${stickyTop}px; z-index: ${zIndex}`
elStyle.position = '-webkit-sticky'
elStyle.position = 'sticky'
// if the browser support css sticky(Currently Safari, Firefox and Chrome Canary)
// if (~elStyle.position.indexOf('sticky')) {
// elStyle.top = `${stickyTop}px`;
// elStyle.zIndex = zIndex;
// return
// }
const elHeight = el.getBoundingClientRect().height
const elWidth = el.getBoundingClientRect().width
elStyle.cssText = `top: ${stickyTop}px; z-index: ${zIndex}`
const parentElm = el.parentNode || document.documentElement
const placeholder = document.createElement('div')
placeholder.style.display = 'none'
placeholder.style.width = `${elWidth}px`
placeholder.style.height = `${elHeight}px`
parentElm.insertBefore(placeholder, el)
const parentElm = el.parentNode || document.documentElement
const placeholder = document.createElement('div')
placeholder.style.display = 'none'
placeholder.style.width = `${elWidth}px`
placeholder.style.height = `${elHeight}px`
parentElm.insertBefore(placeholder, el)
let active = false
let active = false
const getScroll = (target, top) => {
const prop = top ? 'pageYOffset' : 'pageXOffset'
const method = top ? 'scrollTop' : 'scrollLeft'
let ret = target[prop]
if (typeof ret !== 'number') {
ret = window.document.documentElement[method]
}
return ret
}
const getScroll = (target, top) => {
const prop = top ? 'pageYOffset' : 'pageXOffset'
const method = top ? 'scrollTop' : 'scrollLeft'
let ret = target[prop]
if (typeof ret !== 'number') {
ret = window.document.documentElement[method]
}
return ret
}
const sticky = () => {
if (active) {
return
}
if (!elStyle.height) {
elStyle.height = `${el.offsetHeight}px`
}
const sticky = () => {
if (active) {
return
}
if (!elStyle.height) {
elStyle.height = `${el.offsetHeight}px`
}
elStyle.position = 'fixed'
elStyle.width = `${elWidth}px`
placeholder.style.display = 'inline-block'
active = true
}
elStyle.position = 'fixed'
elStyle.width = `${elWidth}px`
placeholder.style.display = 'inline-block'
active = true
}
const reset = () => {
if (!active) {
return
}
const reset = () => {
if (!active) {
return
}
elStyle.position = ''
placeholder.style.display = 'none'
active = false
}
elStyle.position = ''
placeholder.style.display = 'none'
active = false
}
const check = () => {
const scrollTop = getScroll(window, true)
const offsetTop = el.getBoundingClientRect().top
if (offsetTop < stickyTop) {
sticky()
} else {
if (scrollTop < elHeight + stickyTop) {
reset()
}
}
}
listenAction = () => {
check()
}
const check = () => {
const scrollTop = getScroll(window, true)
const offsetTop = el.getBoundingClientRect().top
if (offsetTop < stickyTop) {
sticky()
} else {
if (scrollTop < elHeight + stickyTop) {
reset()
}
}
}
listenAction = () => {
check()
}
window.addEventListener('scroll', listenAction)
},
window.addEventListener('scroll', listenAction)
},
unbind() {
window.removeEventListener('scroll', listenAction)
}
})
unbind() {
window.removeEventListener('scroll', listenAction)
}
})
}
export default vueSticky
... ...
import waves from './waves'
const install = function(Vue) {
Vue.directive('waves', waves)
const install = function (Vue) {
Vue.directive('waves', waves)
}
if (window.Vue) {
window.waves = waves
Vue.use(install); // eslint-disable-line
window.waves = waves
Vue.use(install); // eslint-disable-line
}
waves.install = install
... ...
import './waves.css'
export default{
bind(el, binding) {
el.addEventListener('click', e => {
const customOpts = Object.assign({}, binding.value)
const opts = Object.assign({
ele: el, // 波纹作用元素
type: 'hit', // hit 点击位置扩散 center中心点扩展
color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色
}, customOpts)
const target = opts.ele
if (target) {
target.style.position = 'relative'
target.style.overflow = 'hidden'
const rect = target.getBoundingClientRect()
let ripple = target.querySelector('.waves-ripple')
if (!ripple) {
ripple = document.createElement('span')
ripple.className = 'waves-ripple'
ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px'
target.appendChild(ripple)
} else {
ripple.className = 'waves-ripple'
}
switch (opts.type) {
case 'center':
ripple.style.top = (rect.height / 2 - ripple.offsetHeight / 2) + 'px'
ripple.style.left = (rect.width / 2 - ripple.offsetWidth / 2) + 'px'
break
default:
ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.documentElement.scrollTop || document.body.scrollTop) + 'px'
ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.documentElement.scrollLeft || document.body.scrollLeft) + 'px'
}
ripple.style.backgroundColor = opts.color
ripple.className = 'waves-ripple z-active'
return false
}
}, false)
}
export default {
bind(el, binding) {
el.addEventListener('click', e => {
const customOpts = Object.assign({}, binding.value)
const opts = Object.assign({
ele: el, // 波纹作用元素
type: 'hit', // hit 点击位置扩散 center中心点扩展
color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色
}, customOpts)
const target = opts.ele
if (target) {
target.style.position = 'relative'
target.style.overflow = 'hidden'
const rect = target.getBoundingClientRect()
let ripple = target.querySelector('.waves-ripple')
if (!ripple) {
ripple = document.createElement('span')
ripple.className = 'waves-ripple'
ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px'
target.appendChild(ripple)
} else {
ripple.className = 'waves-ripple'
}
switch (opts.type) {
case 'center':
ripple.style.top = (rect.height / 2 - ripple.offsetHeight / 2) + 'px'
ripple.style.left = (rect.width / 2 - ripple.offsetWidth / 2) + 'px'
break
default:
ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.documentElement.scrollTop || document.body.scrollTop) + 'px'
ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.documentElement.scrollLeft || document.body.scrollLeft) + 'px'
}
ripple.style.backgroundColor = opts.color
ripple.className = 'waves-ripple z-active'
return false
}
}, false)
}
}
... ...
export default {
route: {
dashboard: 'Dashboard',
introduction: 'Introduction',
documentation: 'Documentation',
guide: 'Guide',
permission: 'Permission',
pagePermission: 'Page Permission',
directivePermission: 'Directive Permission',
icons: 'Icons',
components: 'Components',
componentIndex: 'Introduction',
tinymce: 'Tinymce',
markdown: 'Markdown',
jsonEditor: 'JSON Editor',
dndList: 'Dnd List',
splitPane: 'SplitPane',
avatarUpload: 'Avatar Upload',
dropzone: 'Dropzone',
sticky: 'Sticky',
countTo: 'CountTo',
componentMixin: 'Mixin',
backToTop: 'BackToTop',
dragDialog: 'Drag Dialog',
dragSelect: 'Drag Select',
dragKanban: 'Drag Kanban',
charts: 'Charts',
keyboardChart: 'Keyboard Chart',
lineChart: 'Line Chart',
mixChart: 'Mix Chart',
example: 'Example',
nested: 'Nested Routes',
menu1: 'Menu 1',
'menu1-1': 'Menu 1-1',
'menu1-2': 'Menu 1-2',
'menu1-2-1': 'Menu 1-2-1',
'menu1-2-2': 'Menu 1-2-2',
'menu1-3': 'Menu 1-3',
menu2: 'Menu 2',
Table: 'Table',
dynamicTable: 'Dynamic Table',
dragTable: 'Drag Table',
inlineEditTable: 'Inline Edit',
complexTable: 'Complex Table',
treeTable: 'Tree Table',
customTreeTable: 'Custom TreeTable',
tab: 'Tab',
form: 'Form',
createArticle: 'Create Article',
editArticle: 'Edit Article',
articleList: 'Article List',
errorPages: 'Error Pages',
page401: '401',
page404: '404',
errorLog: 'Error Log',
excel: 'Excel',
exportExcel: 'Export Excel',
selectExcel: 'Export Selected',
uploadExcel: 'Upload Excel',
zip: 'Zip',
pdf: 'PDF',
exportZip: 'Export Zip',
theme: 'Theme',
clipboardDemo: 'Clipboard',
i18n: 'I18n',
externalLink: 'External Link'
},
navbar: {
logOut: 'Log Out',
dashboard: 'Dashboard',
github: 'Github',
theme: 'Theme',
size: 'Global Size'
},
login: {
title: 'Login Form',
logIn: 'Log in',
username: 'Username',
password: 'Password',
any: 'any',
thirdparty: 'Or connect with',
thirdpartyTips: 'Can not be simulated on local, so please combine you own business simulation! ! !'
},
documentation: {
documentation: 'Documentation',
github: 'Github Repository'
},
permission: {
roles: 'Your roles',
switchRoles: 'Switch roles',
tips: 'In some cases it is not suitable to use v-permission, such as element Tab component or el-table-column and other asynchronous rendering dom cases which can only be achieved by manually setting the v-if.'
},
guide: {
description: 'The guide page is useful for some people who entered the project for the first time. You can briefly introduce the features of the project. Demo is based on ',
button: 'Show Guide'
},
components: {
documentation: 'Documentation',
tinymceTips: 'Rich text editor is a core part of management system, but at the same time is a place with lots of problems. In the process of selecting rich texts, I also walked a lot of detours. The common rich text editors in the market are basically used, and the finally chose Tinymce. See documentation for more detailed rich text editor comparisons and introductions.',
dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/Dropzone.',
stickyTips: 'when the page is scrolled to the preset position will be sticky on the top.',
backToTopTips1: 'When the page is scrolled to the specified position, the Back to Top button appears in the lower right corner',
backToTopTips2: 'You can customize the style of the button, show / hide, height of appearance, height of the return. If you need a text prompt, you can use element-ui el-tooltip elements externally',
imageUploadTips: 'Since I was using only the vue@1 version, and it is not compatible with mockjs at the moment, I modified it myself, and if you are going to use it, it is better to use official version.'
},
table: {
dynamicTips1: 'Fixed header, sorted by header order',
dynamicTips2: 'Not fixed header, sorted by click order',
dragTips1: 'The default order',
dragTips2: 'The after dragging order',
title: 'Title',
importance: 'Imp',
type: 'Type',
remark: 'Remark',
search: 'Search',
add: 'Add',
export: 'Export',
reviewer: 'reviewer',
id: 'ID',
date: 'Date',
author: 'Author',
readings: 'Readings',
status: 'Status',
actions: 'Actions',
edit: 'Edit',
publish: 'Publish',
draft: 'Draft',
delete: 'Delete',
cancel: 'Cancel',
confirm: 'Confirm'
},
errorLog: {
tips: 'Please click the bug icon in the upper right corner',
description: 'Now the management system are basically the form of the spa, it enhances the user experience, but it also increases the possibility of page problems, a small negligence may lead to the entire page deadlock. Fortunately Vue provides a way to catch handling exceptions, where you can handle errors or report exceptions.',
documentation: 'Document introduction'
},
excel: {
export: 'Export',
selectedExport: 'Export Selected Items',
placeholder: 'Please enter the file name(default excel-list)'
},
zip: {
export: 'Export',
placeholder: 'Please enter the file name(default file)'
},
pdf: {
tips: 'Here we use window.print() to implement the feature of downloading pdf.'
},
theme: {
change: 'Change Theme',
documentation: 'Theme documentation',
tips: 'Tips: It is different from the theme-pick on the navbar is two different skinning methods, each with different application scenarios. Refer to the documentation for details.'
},
tagsView: {
refresh: 'Refresh',
close: 'Close',
closeOthers: 'Close Others',
closeAll: 'Close All'
}
route: {
dashboard: 'Dashboard',
introduction: 'Introduction',
documentation: 'Documentation',
guide: 'Guide',
permission: 'Permission',
pagePermission: 'Page Permission',
directivePermission: 'Directive Permission',
icons: 'Icons',
components: 'Components',
componentIndex: 'Introduction',
tinymce: 'Tinymce',
markdown: 'Markdown',
jsonEditor: 'JSON Editor',
dndList: 'Dnd List',
splitPane: 'SplitPane',
avatarUpload: 'Avatar Upload',
dropzone: 'Dropzone',
sticky: 'Sticky',
countTo: 'CountTo',
componentMixin: 'Mixin',
backToTop: 'BackToTop',
dragDialog: 'Drag Dialog',
dragSelect: 'Drag Select',
dragKanban: 'Drag Kanban',
charts: 'Charts',
keyboardChart: 'Keyboard Chart',
lineChart: 'Line Chart',
mixChart: 'Mix Chart',
example: 'Example',
nested: 'Nested Routes',
menu1: 'Menu 1',
'menu1-1': 'Menu 1-1',
'menu1-2': 'Menu 1-2',
'menu1-2-1': 'Menu 1-2-1',
'menu1-2-2': 'Menu 1-2-2',
'menu1-3': 'Menu 1-3',
menu2: 'Menu 2',
Table: 'Table',
dynamicTable: 'Dynamic Table',
dragTable: 'Drag Table',
inlineEditTable: 'Inline Edit',
complexTable: 'Complex Table',
treeTable: 'Tree Table',
customTreeTable: 'Custom TreeTable',
tab: 'Tab',
form: 'Form',
createArticle: 'Create Article',
editArticle: 'Edit Article',
articleList: 'Article List',
errorPages: 'Error Pages',
page401: '401',
page404: '404',
errorLog: 'Error Log',
excel: 'Excel',
exportExcel: 'Export Excel',
selectExcel: 'Export Selected',
uploadExcel: 'Upload Excel',
zip: 'Zip',
pdf: 'PDF',
exportZip: 'Export Zip',
theme: 'Theme',
clipboardDemo: 'Clipboard',
i18n: 'I18n',
externalLink: 'External Link'
},
navbar: {
logOut: 'Log Out',
dashboard: 'Dashboard',
github: 'Github',
theme: 'Theme',
size: 'Global Size'
},
login: {
title: 'Login Form',
logIn: 'Log in',
username: 'Username',
password: 'Password',
any: 'any',
thirdparty: 'Or connect with',
thirdpartyTips: 'Can not be simulated on local, so please combine you own business simulation! ! !'
},
documentation: {
documentation: 'Documentation',
github: 'Github Repository'
},
permission: {
roles: 'Your roles',
switchRoles: 'Switch roles',
tips: 'In some cases it is not suitable to use v-permission, such as element Tab component or el-table-column and other asynchronous rendering dom cases which can only be achieved by manually setting the v-if.'
},
guide: {
description: 'The guide page is useful for some people who entered the project for the first time. You can briefly introduce the features of the project. Demo is based on ',
button: 'Show Guide'
},
components: {
documentation: 'Documentation',
tinymceTips: 'Rich text editor is a core part of management system, but at the same time is a place with lots of problems. In the process of selecting rich texts, I also walked a lot of detours. The common rich text editors in the market are basically used, and the finally chose Tinymce. See documentation for more detailed rich text editor comparisons and introductions.',
dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/Dropzone.',
stickyTips: 'when the page is scrolled to the preset position will be sticky on the top.',
backToTopTips1: 'When the page is scrolled to the specified position, the Back to Top button appears in the lower right corner',
backToTopTips2: 'You can customize the style of the button, show / hide, height of appearance, height of the return. If you need a text prompt, you can use element-ui el-tooltip elements externally',
imageUploadTips: 'Since I was using only the vue@1 version, and it is not compatible with mockjs at the moment, I modified it myself, and if you are going to use it, it is better to use official version.'
},
table: {
dynamicTips1: 'Fixed header, sorted by header order',
dynamicTips2: 'Not fixed header, sorted by click order',
dragTips1: 'The default order',
dragTips2: 'The after dragging order',
title: 'Title',
importance: 'Imp',
type: 'Type',
remark: 'Remark',
search: 'Search',
add: 'Add',
export: 'Export',
reviewer: 'reviewer',
id: 'ID',
date: 'Date',
author: 'Author',
readings: 'Readings',
status: 'Status',
actions: 'Actions',
edit: 'Edit',
publish: 'Publish',
draft: 'Draft',
delete: 'Delete',
cancel: 'Cancel',
confirm: 'Confirm'
},
errorLog: {
tips: 'Please click the bug icon in the upper right corner',
description: 'Now the management system are basically the form of the spa, it enhances the user experience, but it also increases the possibility of page problems, a small negligence may lead to the entire page deadlock. Fortunately Vue provides a way to catch handling exceptions, where you can handle errors or report exceptions.',
documentation: 'Document introduction'
},
excel: {
export: 'Export',
selectedExport: 'Export Selected Items',
placeholder: 'Please enter the file name(default excel-list)'
},
zip: {
export: 'Export',
placeholder: 'Please enter the file name(default file)'
},
pdf: {
tips: 'Here we use window.print() to implement the feature of downloading pdf.'
},
theme: {
change: 'Change Theme',
documentation: 'Theme documentation',
tips: 'Tips: It is different from the theme-pick on the navbar is two different skinning methods, each with different application scenarios. Refer to the documentation for details.'
},
tagsView: {
refresh: 'Refresh',
close: 'Close',
closeOthers: 'Close Others',
closeAll: 'Close All'
}
}
... ...
export default {
route: {
dashboard: 'Panel de control',
introduction: 'Introducción',
documentation: 'Documentación',
guide: 'Guía',
permission: 'Permisos',
pagePermission: 'Permisos de la página',
directivePermission: 'Permisos de la directiva',
icons: 'Iconos',
components: 'Componentes',
componentIndex: 'Introducción',
tinymce: 'Tinymce',
markdown: 'Markdown',
jsonEditor: 'Editor JSON',
dndList: 'Lista Dnd',
splitPane: 'Panel dividido',
avatarUpload: 'Subir avatar',
dropzone: 'Subir ficheros',
sticky: 'Sticky',
countTo: 'CountTo',
componentMixin: 'Mixin',
backToTop: 'Ir arriba',
dragDialog: 'Drag Dialog',
dragSelect: 'Drag Select',
dragKanban: 'Drag Kanban',
charts: 'Gráficos',
keyboardChart: 'Keyboard Chart',
lineChart: 'Gráfico de líneas',
mixChart: 'Mix Chart',
example: 'Ejemplo',
nested: 'Rutas anidadass',
menu1: 'Menu 1',
'menu1-1': 'Menu 1-1',
'menu1-2': 'Menu 1-2',
'menu1-2-1': 'Menu 1-2-1',
'menu1-2-2': 'Menu 1-2-2',
'menu1-3': 'Menu 1-3',
menu2: 'Menu 2',
Table: 'Tabla',
dynamicTable: 'Tabla dinámica',
dragTable: 'Arrastrar tabla',
inlineEditTable: 'Editor',
complexTable: 'Complex Table',
treeTable: 'Tree Table',
customTreeTable: 'Custom TreeTable',
tab: 'Pestaña',
form: 'Formulario',
createArticle: 'Crear artículo',
editArticle: 'Editar artículo',
articleList: 'Listado de artículos',
errorPages: 'Páginas de error',
page401: '401',
page404: '404',
errorLog: 'Registro de errores',
excel: 'Excel',
exportExcel: 'Exportar a Excel',
selectExcel: 'Export seleccionado',
uploadExcel: 'Subir Excel',
zip: 'Zip',
pdf: 'PDF',
exportZip: 'Exportar a Zip',
theme: 'Tema',
clipboardDemo: 'Clipboard',
i18n: 'I18n',
externalLink: 'Enlace externo'
},
navbar: {
logOut: 'Salir',
dashboard: 'Panel de control',
github: 'Github',
theme: 'Tema',
size: 'Tamaño global'
},
login: {
title: 'Formulario de acceso',
logIn: 'Acceso',
username: 'Usuario',
password: 'Contraseña',
any: 'nada',
thirdparty: 'Conectar con',
thirdpartyTips: 'No se puede simular en local, así que combine su propia simulación de negocios. ! !'
},
documentation: {
documentation: 'Documentación',
github: 'Repositorio Github'
},
permission: {
roles: 'Tus permisos',
switchRoles: 'Cambiar permisos',
tips: 'In some cases it is not suitable to use v-permission, such as element Tab component or el-table-column and other asynchronous rendering dom cases which can only be achieved by manually setting the v-if.'
},
guide: {
description: 'The guide page is useful for some people who entered the project for the first time. You can briefly introduce the features of the project. Demo is based on ',
button: 'Ver guía'
},
components: {
documentation: 'Documentación',
tinymceTips: 'Rich text editor is a core part of management system, but at the same time is a place with lots of problems. In the process of selecting rich texts, I also walked a lot of detours. The common rich text editors in the market are basically used, and the finally chose Tinymce. See documentation for more detailed rich text editor comparisons and introductions.',
dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/Dropzone.',
stickyTips: 'when the page is scrolled to the preset position will be sticky on the top.',
backToTopTips1: 'When the page is scrolled to the specified position, the Back to Top button appears in the lower right corner',
backToTopTips2: 'You can customize the style of the button, show / hide, height of appearance, height of the return. If you need a text prompt, you can use element-ui el-tooltip elements externally',
imageUploadTips: 'Since I was using only the vue@1 version, and it is not compatible with mockjs at the moment, I modified it myself, and if you are going to use it, it is better to use official version.'
},
table: {
dynamicTips1: 'Fixed header, sorted by header order',
dynamicTips2: 'Not fixed header, sorted by click order',
dragTips1: 'Orden por defecto',
dragTips2: 'The after dragging order',
title: 'Título',
importance: 'Importancia',
type: 'Tipo',
remark: 'Remark',
search: 'Buscar',
add: 'Añadir',
export: 'Exportar',
reviewer: 'reviewer',
id: 'ID',
date: 'Fecha',
author: 'Autor',
readings: 'Lector',
status: 'Estado',
actions: 'Acciones',
edit: 'Editar',
publish: 'Publicar',
draft: 'Draft',
delete: 'Eliminar',
cancel: 'Cancelar',
confirm: 'Confirmar'
},
errorLog: {
tips: 'Please click the bug icon in the upper right corner',
description: 'Now the management system are basically the form of the spa, it enhances the user experience, but it also increases the possibility of page problems, a small negligence may lead to the entire page deadlock. Fortunately Vue provides a way to catch handling exceptions, where you can handle errors or report exceptions.',
documentation: 'Documento de introducción'
},
excel: {
export: 'Exportar',
selectedExport: 'Exportar seleccionados',
placeholder: 'Por favor escribe un nombre de fichero'
},
zip: {
export: 'Exportar',
placeholder: 'Por favor escribe un nombre de fichero'
},
pdf: {
tips: 'Here we use window.print() to implement the feature of downloading pdf.'
},
theme: {
change: 'Cambiar tema',
documentation: 'Documentación del tema',
tips: 'Tips: It is different from the theme-pick on the navbar is two different skinning methods, each with different application scenarios. Refer to the documentation for details.'
},
tagsView: {
refresh: 'Actualizar',
close: 'Cerrar',
closeOthers: 'Cerrar otros',
closeAll: 'Cerrar todos'
}
route: {
dashboard: 'Panel de control',
introduction: 'Introducción',
documentation: 'Documentación',
guide: 'Guía',
permission: 'Permisos',
pagePermission: 'Permisos de la página',
directivePermission: 'Permisos de la directiva',
icons: 'Iconos',
components: 'Componentes',
componentIndex: 'Introducción',
tinymce: 'Tinymce',
markdown: 'Markdown',
jsonEditor: 'Editor JSON',
dndList: 'Lista Dnd',
splitPane: 'Panel dividido',
avatarUpload: 'Subir avatar',
dropzone: 'Subir ficheros',
sticky: 'Sticky',
countTo: 'CountTo',
componentMixin: 'Mixin',
backToTop: 'Ir arriba',
dragDialog: 'Drag Dialog',
dragSelect: 'Drag Select',
dragKanban: 'Drag Kanban',
charts: 'Gráficos',
keyboardChart: 'Keyboard Chart',
lineChart: 'Gráfico de líneas',
mixChart: 'Mix Chart',
example: 'Ejemplo',
nested: 'Rutas anidadass',
menu1: 'Menu 1',
'menu1-1': 'Menu 1-1',
'menu1-2': 'Menu 1-2',
'menu1-2-1': 'Menu 1-2-1',
'menu1-2-2': 'Menu 1-2-2',
'menu1-3': 'Menu 1-3',
menu2: 'Menu 2',
Table: 'Tabla',
dynamicTable: 'Tabla dinámica',
dragTable: 'Arrastrar tabla',
inlineEditTable: 'Editor',
complexTable: 'Complex Table',
treeTable: 'Tree Table',
customTreeTable: 'Custom TreeTable',
tab: 'Pestaña',
form: 'Formulario',
createArticle: 'Crear artículo',
editArticle: 'Editar artículo',
articleList: 'Listado de artículos',
errorPages: 'Páginas de error',
page401: '401',
page404: '404',
errorLog: 'Registro de errores',
excel: 'Excel',
exportExcel: 'Exportar a Excel',
selectExcel: 'Export seleccionado',
uploadExcel: 'Subir Excel',
zip: 'Zip',
pdf: 'PDF',
exportZip: 'Exportar a Zip',
theme: 'Tema',
clipboardDemo: 'Clipboard',
i18n: 'I18n',
externalLink: 'Enlace externo'
},
navbar: {
logOut: 'Salir',
dashboard: 'Panel de control',
github: 'Github',
theme: 'Tema',
size: 'Tamaño global'
},
login: {
title: 'Formulario de acceso',
logIn: 'Acceso',
username: 'Usuario',
password: 'Contraseña',
any: 'nada',
thirdparty: 'Conectar con',
thirdpartyTips: 'No se puede simular en local, así que combine su propia simulación de negocios. ! !'
},
documentation: {
documentation: 'Documentación',
github: 'Repositorio Github'
},
permission: {
roles: 'Tus permisos',
switchRoles: 'Cambiar permisos',
tips: 'In some cases it is not suitable to use v-permission, such as element Tab component or el-table-column and other asynchronous rendering dom cases which can only be achieved by manually setting the v-if.'
},
guide: {
description: 'The guide page is useful for some people who entered the project for the first time. You can briefly introduce the features of the project. Demo is based on ',
button: 'Ver guía'
},
components: {
documentation: 'Documentación',
tinymceTips: 'Rich text editor is a core part of management system, but at the same time is a place with lots of problems. In the process of selecting rich texts, I also walked a lot of detours. The common rich text editors in the market are basically used, and the finally chose Tinymce. See documentation for more detailed rich text editor comparisons and introductions.',
dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/Dropzone.',
stickyTips: 'when the page is scrolled to the preset position will be sticky on the top.',
backToTopTips1: 'When the page is scrolled to the specified position, the Back to Top button appears in the lower right corner',
backToTopTips2: 'You can customize the style of the button, show / hide, height of appearance, height of the return. If you need a text prompt, you can use element-ui el-tooltip elements externally',
imageUploadTips: 'Since I was using only the vue@1 version, and it is not compatible with mockjs at the moment, I modified it myself, and if you are going to use it, it is better to use official version.'
},
table: {
dynamicTips1: 'Fixed header, sorted by header order',
dynamicTips2: 'Not fixed header, sorted by click order',
dragTips1: 'Orden por defecto',
dragTips2: 'The after dragging order',
title: 'Título',
importance: 'Importancia',
type: 'Tipo',
remark: 'Remark',
search: 'Buscar',
add: 'Añadir',
export: 'Exportar',
reviewer: 'reviewer',
id: 'ID',
date: 'Fecha',
author: 'Autor',
readings: 'Lector',
status: 'Estado',
actions: 'Acciones',
edit: 'Editar',
publish: 'Publicar',
draft: 'Draft',
delete: 'Eliminar',
cancel: 'Cancelar',
confirm: 'Confirmar'
},
errorLog: {
tips: 'Please click the bug icon in the upper right corner',
description: 'Now the management system are basically the form of the spa, it enhances the user experience, but it also increases the possibility of page problems, a small negligence may lead to the entire page deadlock. Fortunately Vue provides a way to catch handling exceptions, where you can handle errors or report exceptions.',
documentation: 'Documento de introducción'
},
excel: {
export: 'Exportar',
selectedExport: 'Exportar seleccionados',
placeholder: 'Por favor escribe un nombre de fichero'
},
zip: {
export: 'Exportar',
placeholder: 'Por favor escribe un nombre de fichero'
},
pdf: {
tips: 'Here we use window.print() to implement the feature of downloading pdf.'
},
theme: {
change: 'Cambiar tema',
documentation: 'Documentación del tema',
tips: 'Tips: It is different from the theme-pick on the navbar is two different skinning methods, each with different application scenarios. Refer to the documentation for details.'
},
tagsView: {
refresh: 'Actualizar',
close: 'Cerrar',
closeOthers: 'Cerrar otros',
closeAll: 'Cerrar todos'
}
}
... ...
... ... @@ -11,26 +11,26 @@ import esLocale from './es'
Vue.use(VueI18n)
const messages = {
en: {
...enLocale,
...elementEnLocale
},
zh: {
...zhLocale,
...elementZhLocale
},
es: {
...esLocale,
...elementEsLocale
}
en: {
...enLocale,
...elementEnLocale
},
zh: {
...zhLocale,
...elementZhLocale
},
es: {
...esLocale,
...elementEsLocale
}
}
const i18n = new VueI18n({
// set locale
// options: en | zh | es
locale: Cookies.get('language') || 'en',
// set locale messages
messages
// set locale
// options: en | zh | es
locale: Cookies.get('language') || 'en',
// set locale messages
messages
})
export default i18n
... ...