@ -0,0 +1,18 @@
|
||||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
"modules": false,
|
||||
"targets": {
|
||||
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
|
||||
}
|
||||
}],
|
||||
"stage-2"
|
||||
],
|
||||
"plugins": ["transform-vue-jsx", "transform-runtime"],
|
||||
"env": {
|
||||
"test": {
|
||||
"presets": ["env", "stage-2"],
|
||||
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
@ -0,0 +1,5 @@
|
||||
/build/
|
||||
/config/
|
||||
/dist/
|
||||
/*.js
|
||||
/test/unit/coverage/
|
@ -0,0 +1,30 @@
|
||||
// https://eslint.org/docs/user-guide/configuring
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
parserOptions: {
|
||||
parser: 'babel-eslint'
|
||||
},
|
||||
env: {
|
||||
browser: true,
|
||||
jquery:true
|
||||
},
|
||||
extends: [
|
||||
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
|
||||
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
|
||||
'plugin:vue/essential',
|
||||
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
|
||||
// 'standard'
|
||||
],
|
||||
// required to lint *.vue files
|
||||
plugins: [
|
||||
'vue'
|
||||
],
|
||||
// add your custom rules here
|
||||
rules: {
|
||||
// allow async-await
|
||||
'generator-star-spacing': 'off',
|
||||
// allow debugger during development
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
/dist/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
/test/unit/coverage/
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
@ -0,0 +1,10 @@
|
||||
// https://github.com/michael-ciniawsky/postcss-load-config
|
||||
|
||||
module.exports = {
|
||||
"plugins": {
|
||||
"postcss-import": {},
|
||||
"postcss-url": {},
|
||||
// to edit target browsers: use "browserslist" field in package.json
|
||||
"autoprefixer": {}
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
# smsvp
|
||||
|
||||
> A Vue.js project
|
||||
|
||||
## Build Setup
|
||||
|
||||
``` bash
|
||||
# install dependencies
|
||||
npm install
|
||||
|
||||
# serve with hot reload at localhost:8080
|
||||
npm run dev
|
||||
|
||||
# build for production with minification
|
||||
npm run build
|
||||
|
||||
# build for production and view the bundle analyzer report
|
||||
npm run build --report
|
||||
|
||||
# run unit tests
|
||||
npm run unit
|
||||
|
||||
# run all tests
|
||||
npm test
|
||||
```
|
||||
|
||||
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
|
@ -0,0 +1,41 @@
|
||||
'use strict'
|
||||
require('./check-versions')()
|
||||
|
||||
process.env.NODE_ENV = 'production'
|
||||
|
||||
const ora = require('ora')
|
||||
const rm = require('rimraf')
|
||||
const path = require('path')
|
||||
const chalk = require('chalk')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const webpackConfig = require('./webpack.prod.conf')
|
||||
|
||||
const spinner = ora('building for production...')
|
||||
spinner.start()
|
||||
|
||||
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
||||
if (err) throw err
|
||||
webpack(webpackConfig, (err, stats) => {
|
||||
spinner.stop()
|
||||
if (err) throw err
|
||||
process.stdout.write(stats.toString({
|
||||
colors: true,
|
||||
modules: false,
|
||||
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
|
||||
chunks: false,
|
||||
chunkModules: false
|
||||
}) + '\n\n')
|
||||
|
||||
if (stats.hasErrors()) {
|
||||
console.log(chalk.red(' Build failed with errors.\n'))
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
console.log(chalk.cyan(' Build complete.\n'))
|
||||
console.log(chalk.yellow(
|
||||
' Tip: built files are meant to be served over an HTTP server.\n' +
|
||||
' Opening index.html over file:// won\'t work.\n'
|
||||
))
|
||||
})
|
||||
})
|
@ -0,0 +1,54 @@
|
||||
'use strict'
|
||||
const chalk = require('chalk')
|
||||
const semver = require('semver')
|
||||
const packageConfig = require('../package.json')
|
||||
const shell = require('shelljs')
|
||||
|
||||
function exec (cmd) {
|
||||
return require('child_process').execSync(cmd).toString().trim()
|
||||
}
|
||||
|
||||
const versionRequirements = [
|
||||
{
|
||||
name: 'node',
|
||||
currentVersion: semver.clean(process.version),
|
||||
versionRequirement: packageConfig.engines.node
|
||||
}
|
||||
]
|
||||
|
||||
if (shell.which('npm')) {
|
||||
versionRequirements.push({
|
||||
name: 'npm',
|
||||
currentVersion: exec('npm --version'),
|
||||
versionRequirement: packageConfig.engines.npm
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = function () {
|
||||
const warnings = []
|
||||
|
||||
for (let i = 0; i < versionRequirements.length; i++) {
|
||||
const mod = versionRequirements[i]
|
||||
|
||||
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
|
||||
warnings.push(mod.name + ': ' +
|
||||
chalk.red(mod.currentVersion) + ' should be ' +
|
||||
chalk.green(mod.versionRequirement)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (warnings.length) {
|
||||
console.log('')
|
||||
console.log(chalk.yellow('To use this template, you must update following to modules:'))
|
||||
console.log()
|
||||
|
||||
for (let i = 0; i < warnings.length; i++) {
|
||||
const warning = warnings[i]
|
||||
console.log(' ' + warning)
|
||||
}
|
||||
|
||||
console.log()
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 6.7 KiB |
@ -0,0 +1,102 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const config = require('../config')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const packageConfig = require('../package.json')
|
||||
|
||||
exports.assetsPath = function (_path) {
|
||||
const assetsSubDirectory = process.env.NODE_ENV === 'production'
|
||||
? config.build.assetsSubDirectory
|
||||
: config.dev.assetsSubDirectory
|
||||
|
||||
return path.posix.join(assetsSubDirectory, _path)
|
||||
}
|
||||
|
||||
exports.cssLoaders = function (options) {
|
||||
options = options || {}
|
||||
|
||||
const cssLoader = {
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
sourceMap: options.sourceMap
|
||||
}
|
||||
}
|
||||
|
||||
const postcssLoader = {
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
sourceMap: options.sourceMap
|
||||
}
|
||||
}
|
||||
|
||||
// generate loader string to be used with extract text plugin
|
||||
function generateLoaders (loader, loaderOptions) {
|
||||
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
|
||||
|
||||
if (loader) {
|
||||
loaders.push({
|
||||
loader: loader + '-loader',
|
||||
options: Object.assign({}, loaderOptions, {
|
||||
sourceMap: options.sourceMap
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// Extract CSS when that option is specified
|
||||
// (which is the case during production build)
|
||||
if (options.extract) {
|
||||
return ExtractTextPlugin.extract({
|
||||
use: loaders,
|
||||
fallback: 'vue-style-loader',
|
||||
publicPath: '../../'
|
||||
})
|
||||
} else {
|
||||
return ['vue-style-loader'].concat(loaders)
|
||||
}
|
||||
}
|
||||
|
||||
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
|
||||
return {
|
||||
css: generateLoaders(),
|
||||
postcss: generateLoaders(),
|
||||
less: generateLoaders('less'),
|
||||
sass: generateLoaders('sass', { indentedSyntax: true }),
|
||||
scss: generateLoaders('sass'),
|
||||
stylus: generateLoaders('stylus'),
|
||||
styl: generateLoaders('stylus')
|
||||
}
|
||||
}
|
||||
|
||||
// Generate loaders for standalone style files (outside of .vue)
|
||||
exports.styleLoaders = function (options) {
|
||||
const output = []
|
||||
const loaders = exports.cssLoaders(options)
|
||||
|
||||
for (const extension in loaders) {
|
||||
const loader = loaders[extension]
|
||||
output.push({
|
||||
test: new RegExp('\\.' + extension + '$'),
|
||||
use: loader
|
||||
})
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
exports.createNotifierCallback = () => {
|
||||
const notifier = require('node-notifier')
|
||||
|
||||
return (severity, errors) => {
|
||||
if (severity !== 'error') return
|
||||
|
||||
const error = errors[0]
|
||||
const filename = error.file && error.file.split('!').pop()
|
||||
|
||||
notifier.notify({
|
||||
title: packageConfig.name,
|
||||
message: severity + ': ' + error.name,
|
||||
subtitle: filename || '',
|
||||
icon: path.join(__dirname, 'logo.png')
|
||||
})
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
'use strict'
|
||||
const utils = require('./utils')
|
||||
const config = require('../config')
|
||||
const isProduction = process.env.NODE_ENV === 'production'
|
||||
const sourceMapEnabled = isProduction
|
||||
? config.build.productionSourceMap
|
||||
: config.dev.cssSourceMap
|
||||
|
||||
module.exports = {
|
||||
loaders: utils.cssLoaders({
|
||||
sourceMap: sourceMapEnabled,
|
||||
extract: isProduction
|
||||
}),
|
||||
cssSourceMap: sourceMapEnabled,
|
||||
cacheBusting: config.dev.cacheBusting,
|
||||
transformToRequire: {
|
||||
video: ['src', 'poster'],
|
||||
source: 'src',
|
||||
img: 'src',
|
||||
image: 'xlink:href'
|
||||
}
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const utils = require('./utils')
|
||||
const config = require('../config')
|
||||
const vueLoaderConfig = require('./vue-loader.conf')
|
||||
|
||||
function resolve (dir) {
|
||||
return path.join(__dirname, '..', dir)
|
||||
}
|
||||
|
||||
const createLintingRule = () => ({
|
||||
test: /\.(js|vue)$/,
|
||||
loader: 'eslint-loader',
|
||||
enforce: 'pre',
|
||||
include: [resolve('src'), resolve('test')],
|
||||
options: {
|
||||
formatter: require('eslint-friendly-formatter'),
|
||||
emitWarning: !config.dev.showEslintErrorsInOverlay
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = {
|
||||
context: path.resolve(__dirname, '../'),
|
||||
entry: {
|
||||
app: './src/main.js'
|
||||
},
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: '[name].js',
|
||||
publicPath: process.env.NODE_ENV === 'production'
|
||||
? config.build.assetsPublicPath
|
||||
: config.dev.assetsPublicPath
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.vue', '.json'],
|
||||
alias: {
|
||||
'vue$': 'vue/dist/vue.esm.js',
|
||||
'@': resolve('src'),
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
...(config.dev.useEslint ? [createLintingRule()] : []),
|
||||
{
|
||||
test: /\.vue$/,
|
||||
loader: 'vue-loader',
|
||||
options: vueLoaderConfig
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('img/[name].[hash:7].[ext]')
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('media/[name].[hash:7].[ext]')
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
node: {
|
||||
// prevent webpack from injecting useless setImmediate polyfill because Vue
|
||||
// source contains it (although only uses it if it's native).
|
||||
setImmediate: false,
|
||||
// prevent webpack from injecting mocks to Node native modules
|
||||
// that does not make sense for the client
|
||||
dgram: 'empty',
|
||||
fs: 'empty',
|
||||
net: 'empty',
|
||||
tls: 'empty',
|
||||
child_process: 'empty'
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
'use strict'
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const merge = require('webpack-merge')
|
||||
const path = require('path')
|
||||
const baseWebpackConfig = require('./webpack.base.conf')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
|
||||
const portfinder = require('portfinder')
|
||||
|
||||
const HOST = process.env.HOST
|
||||
const PORT = process.env.PORT && Number(process.env.PORT)
|
||||
|
||||
const devWebpackConfig = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
|
||||
},
|
||||
// cheap-module-eval-source-map is faster for development
|
||||
devtool: config.dev.devtool,
|
||||
|
||||
// these devServer options should be customized in /config/index.js
|
||||
devServer: {
|
||||
clientLogLevel: 'warning',
|
||||
historyApiFallback: {
|
||||
rewrites: [
|
||||
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
|
||||
],
|
||||
},
|
||||
hot: true,
|
||||
contentBase: false, // since we use CopyWebpackPlugin.
|
||||
compress: true,
|
||||
host: HOST || config.dev.host,
|
||||
port: PORT || config.dev.port,
|
||||
open: config.dev.autoOpenBrowser,
|
||||
overlay: config.dev.errorOverlay
|
||||
? { warnings: false, errors: true }
|
||||
: false,
|
||||
publicPath: config.dev.assetsPublicPath,
|
||||
proxy: config.dev.proxyTable,
|
||||
quiet: true, // necessary for FriendlyErrorsPlugin
|
||||
watchOptions: {
|
||||
poll: config.dev.poll,
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': require('../config/dev.env')
|
||||
}),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
// https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: 'index.html',
|
||||
inject: true
|
||||
}),
|
||||
// copy custom static assets
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.dev.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
}
|
||||
])
|
||||
]
|
||||
})
|
||||
|
||||
module.exports = new Promise((resolve, reject) => {
|
||||
portfinder.basePort = process.env.PORT || config.dev.port
|
||||
portfinder.getPort((err, port) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
// publish the new Port, necessary for e2e tests
|
||||
process.env.PORT = port
|
||||
// add port to devServer config
|
||||
devWebpackConfig.devServer.port = port
|
||||
|
||||
// Add FriendlyErrorsPlugin
|
||||
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
|
||||
compilationSuccessInfo: {
|
||||
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
|
||||
},
|
||||
onErrors: config.dev.notifyOnErrors
|
||||
? utils.createNotifierCallback()
|
||||
: undefined
|
||||
}))
|
||||
|
||||
resolve(devWebpackConfig)
|
||||
}
|
||||
})
|
||||
})
|
@ -0,0 +1,150 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const merge = require('webpack-merge')
|
||||
const baseWebpackConfig = require('./webpack.base.conf')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||
|
||||
const env = process.env.NODE_ENV === 'testing'
|
||||
? require('../config/test.env')
|
||||
: require('../config/prod.env')
|
||||
|
||||
const webpackConfig = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
extract: true,
|
||||
usePostCSS: true
|
||||
})
|
||||
},
|
||||
devtool: config.build.productionSourceMap ? config.build.devtool : false,
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: utils.assetsPath('js/[name].[chunkhash].js'),
|
||||
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js'),
|
||||
publicPath: process.env.NODE_ENV === 'production' ? './' +config.build.assetsPublicPath : './' + config.dev.assetsPublicPath
|
||||
},
|
||||
plugins: [
|
||||
// http://vuejs.github.io/vue-loader/en/workflow/production.html
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': env
|
||||
}),
|
||||
new UglifyJsPlugin({
|
||||
uglifyOptions: {
|
||||
compress: {
|
||||
warnings: false
|
||||
}
|
||||
},
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
parallel: true
|
||||
}),
|
||||
// extract css into its own file
|
||||
new ExtractTextPlugin({
|
||||
filename: utils.assetsPath('css/[name].[contenthash].css'),
|
||||
// Setting the following option to `false` will not extract CSS from codesplit chunks.
|
||||
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
|
||||
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
|
||||
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
|
||||
allChunks: true,
|
||||
}),
|
||||
// Compress extracted CSS. We are using this plugin so that possible
|
||||
// duplicated CSS from different components can be deduped.
|
||||
new OptimizeCSSPlugin({
|
||||
cssProcessorOptions: config.build.productionSourceMap
|
||||
? { safe: true, map: { inline: false } }
|
||||
: { safe: true }
|
||||
}),
|
||||
// generate dist index.html with correct asset hash for caching.
|
||||
// you can customize output by editing /index.html
|
||||
// see https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: process.env.NODE_ENV === 'testing'
|
||||
? 'index.html'
|
||||
: config.build.index,
|
||||
template: 'index.html',
|
||||
inject: true,
|
||||
minify: {
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true
|
||||
// more options:
|
||||
// https://github.com/kangax/html-minifier#options-quick-reference
|
||||
},
|
||||
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
|
||||
chunksSortMode: 'dependency'
|
||||
}),
|
||||
// keep module.id stable when vendor modules does not change
|
||||
new webpack.HashedModuleIdsPlugin(),
|
||||
// enable scope hoisting
|
||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||
// split vendor js into its own file
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'vendor',
|
||||
minChunks (module) {
|
||||
// any required modules inside node_modules are extracted to vendor
|
||||
return (
|
||||
module.resource &&
|
||||
/\.js$/.test(module.resource) &&
|
||||
module.resource.indexOf(
|
||||
path.join(__dirname, '../node_modules')
|
||||
) === 0
|
||||
)
|
||||
}
|
||||
}),
|
||||
// extract webpack runtime and module manifest to its own file in order to
|
||||
// prevent vendor hash from being updated whenever app bundle is updated
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'manifest',
|
||||
minChunks: Infinity
|
||||
}),
|
||||
// This instance extracts shared chunks from code splitted chunks and bundles them
|
||||
// in a separate chunk, similar to the vendor chunk
|
||||
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'app',
|
||||
async: 'vendor-async',
|
||||
children: true,
|
||||
minChunks: 3
|
||||
}),
|
||||
|
||||
// copy custom static assets
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.build.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
}
|
||||
])
|
||||
]
|
||||
})
|
||||
|
||||
if (config.build.productionGzip) {
|
||||
const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
||||
|
||||
webpackConfig.plugins.push(
|
||||
new CompressionWebpackPlugin({
|
||||
asset: '[path].gz[query]',
|
||||
algorithm: 'gzip',
|
||||
test: new RegExp(
|
||||
'\\.(' +
|
||||
config.build.productionGzipExtensions.join('|') +
|
||||
')$'
|
||||
),
|
||||
threshold: 10240,
|
||||
minRatio: 0.8
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
if (config.build.bundleAnalyzerReport) {
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
||||
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
|
||||
}
|
||||
|
||||
module.exports = webpackConfig
|
@ -0,0 +1,41 @@
|
||||
'use strict'
|
||||
require('./check-versions')()
|
||||
|
||||
process.env.NODE_ENV = 'production'
|
||||
|
||||
const ora = require('ora')
|
||||
const rm = require('rimraf')
|
||||
const path = require('path')
|
||||
const chalk = require('chalk')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const webpackConfig = require('./webpack.prod.conf')
|
||||
|
||||
const spinner = ora('building for production...')
|
||||
spinner.start()
|
||||
|
||||
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
||||
if (err) throw err
|
||||
webpack(webpackConfig, (err, stats) => {
|
||||
spinner.stop()
|
||||
if (err) throw err
|
||||
process.stdout.write(stats.toString({
|
||||
colors: true,
|
||||
modules: false,
|
||||
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
|
||||
chunks: false,
|
||||
chunkModules: false
|
||||
}) + '\n\n')
|
||||
|
||||
if (stats.hasErrors()) {
|
||||
console.log(chalk.red(' Build failed with errors.\n'))
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
console.log(chalk.cyan(' Build complete.\n'))
|
||||
console.log(chalk.yellow(
|
||||
' Tip: built files are meant to be served over an HTTP server.\n' +
|
||||
' Opening index.html over file:// won\'t work.\n'
|
||||
))
|
||||
})
|
||||
})
|
@ -0,0 +1,54 @@
|
||||
'use strict'
|
||||
const chalk = require('chalk')
|
||||
const semver = require('semver')
|
||||
const packageConfig = require('../package.json')
|
||||
const shell = require('shelljs')
|
||||
|
||||
function exec (cmd) {
|
||||
return require('child_process').execSync(cmd).toString().trim()
|
||||
}
|
||||
|
||||
const versionRequirements = [
|
||||
{
|
||||
name: 'node',
|
||||
currentVersion: semver.clean(process.version),
|
||||
versionRequirement: packageConfig.engines.node
|
||||
}
|
||||
]
|
||||
|
||||
if (shell.which('npm')) {
|
||||
versionRequirements.push({
|
||||
name: 'npm',
|
||||
currentVersion: exec('npm --version'),
|
||||
versionRequirement: packageConfig.engines.npm
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = function () {
|
||||
const warnings = []
|
||||
|
||||
for (let i = 0; i < versionRequirements.length; i++) {
|
||||
const mod = versionRequirements[i]
|
||||
|
||||
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
|
||||
warnings.push(mod.name + ': ' +
|
||||
chalk.red(mod.currentVersion) + ' should be ' +
|
||||
chalk.green(mod.versionRequirement)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (warnings.length) {
|
||||
console.log('')
|
||||
console.log(chalk.yellow('To use this template, you must update following to modules:'))
|
||||
console.log()
|
||||
|
||||
for (let i = 0; i < warnings.length; i++) {
|
||||
const warning = warnings[i]
|
||||
console.log(' ' + warning)
|
||||
}
|
||||
|
||||
console.log()
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 6.7 KiB |
@ -0,0 +1,101 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const config = require('../config')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const packageConfig = require('../package.json')
|
||||
|
||||
exports.assetsPath = function (_path) {
|
||||
const assetsSubDirectory = process.env.NODE_ENV === 'production'
|
||||
? config.build.assetsSubDirectory
|
||||
: config.dev.assetsSubDirectory
|
||||
|
||||
return path.posix.join(assetsSubDirectory, _path)
|
||||
}
|
||||
|
||||
exports.cssLoaders = function (options) {
|
||||
options = options || {}
|
||||
|
||||
const cssLoader = {
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
sourceMap: options.sourceMap
|
||||
}
|
||||
}
|
||||
|
||||
const postcssLoader = {
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
sourceMap: options.sourceMap
|
||||
}
|
||||
}
|
||||
|
||||
// generate loader string to be used with extract text plugin
|
||||
function generateLoaders (loader, loaderOptions) {
|
||||
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
|
||||
|
||||
if (loader) {
|
||||
loaders.push({
|
||||
loader: loader + '-loader',
|
||||
options: Object.assign({}, loaderOptions, {
|
||||
sourceMap: options.sourceMap
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// Extract CSS when that option is specified
|
||||
// (which is the case during production build)
|
||||
if (options.extract) {
|
||||
return ExtractTextPlugin.extract({
|
||||
use: loaders,
|
||||
fallback: 'vue-style-loader'
|
||||
})
|
||||
} else {
|
||||
return ['vue-style-loader'].concat(loaders)
|
||||
}
|
||||
}
|
||||
|
||||
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
|
||||
return {
|
||||
css: generateLoaders(),
|
||||
postcss: generateLoaders(),
|
||||
less: generateLoaders('less'),
|
||||
sass: generateLoaders('sass', { indentedSyntax: true }),
|
||||
scss: generateLoaders('sass'),
|
||||
stylus: generateLoaders('stylus'),
|
||||
styl: generateLoaders('stylus')
|
||||
}
|
||||
}
|
||||
|
||||
// Generate loaders for standalone style files (outside of .vue)
|
||||
exports.styleLoaders = function (options) {
|
||||
const output = []
|
||||
const loaders = exports.cssLoaders(options)
|
||||
|
||||
for (const extension in loaders) {
|
||||
const loader = loaders[extension]
|
||||
output.push({
|
||||
test: new RegExp('\\.' + extension + '$'),
|
||||
use: loader
|
||||
})
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
exports.createNotifierCallback = () => {
|
||||
const notifier = require('node-notifier')
|
||||
|
||||
return (severity, errors) => {
|
||||
if (severity !== 'error') return
|
||||
|
||||
const error = errors[0]
|
||||
const filename = error.file && error.file.split('!').pop()
|
||||
|
||||
notifier.notify({
|
||||
title: packageConfig.name,
|
||||
message: severity + ': ' + error.name,
|
||||
subtitle: filename || '',
|
||||
icon: path.join(__dirname, 'logo.png')
|
||||
})
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
'use strict'
|
||||
const utils = require('./utils')
|
||||
const config = require('../config')
|
||||
const isProduction = process.env.NODE_ENV === 'production'
|
||||
const sourceMapEnabled = isProduction
|
||||
? config.build.productionSourceMap
|
||||
: config.dev.cssSourceMap
|
||||
|
||||
module.exports = {
|
||||
loaders: utils.cssLoaders({
|
||||
sourceMap: sourceMapEnabled,
|
||||
extract: isProduction
|
||||
}),
|
||||
cssSourceMap: sourceMapEnabled,
|
||||
cacheBusting: config.dev.cacheBusting,
|
||||
transformToRequire: {
|
||||
video: ['src', 'poster'],
|
||||
source: 'src',
|
||||
img: 'src',
|
||||
image: 'xlink:href'
|
||||
}
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const utils = require('./utils')
|
||||
const config = require('../config')
|
||||
const vueLoaderConfig = require('./vue-loader.conf')
|
||||
var webpack = require('webpack')
|
||||
|
||||
function resolve (dir) {
|
||||
return path.join(__dirname, '..', dir)
|
||||
}
|
||||
|
||||
const createLintingRule = () => ({
|
||||
test: /\.(js|vue)$/,
|
||||
loader: 'eslint-loader',
|
||||
enforce: 'pre',
|
||||
include: [resolve('src'), resolve('test')],
|
||||
options: {
|
||||
formatter: require('eslint-friendly-formatter'),
|
||||
emitWarning: !config.dev.showEslintErrorsInOverlay
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
new webpack.ProvidePlugin({
|
||||
$: "jquery",
|
||||
jQuery: "jquery"
|
||||
}),
|
||||
],
|
||||
// $函数会自动添加到当前模块的上下文,无需显示声明
|
||||
context: path.resolve(__dirname, '../'),
|
||||
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'),
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
...(config.dev.useEslint ? [createLintingRule()] : []),
|
||||
{
|
||||
test: /\.vue$/,
|
||||
loader: 'vue-loader',
|
||||
options: vueLoaderConfig
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('img/[name].[hash:7].[ext]')
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('media/[name].[hash:7].[ext]')
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
node: {
|
||||
// prevent webpack from injecting useless setImmediate polyfill because Vue
|
||||
// source contains it (although only uses it if it's native).
|
||||
setImmediate: false,
|
||||
// prevent webpack from injecting mocks to Node native modules
|
||||
// that does not make sense for the client
|
||||
dgram: 'empty',
|
||||
fs: 'empty',
|
||||
net: 'empty',
|
||||
tls: 'empty',
|
||||
child_process: 'empty'
|
||||
},
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
'use strict'
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const merge = require('webpack-merge')
|
||||
const path = require('path')
|
||||
const baseWebpackConfig = require('./webpack.base.conf')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
|
||||
const portfinder = require('portfinder')
|
||||
|
||||
const HOST = process.env.HOST
|
||||
const PORT = process.env.PORT && Number(process.env.PORT)
|
||||
|
||||
const devWebpackConfig = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
|
||||
},
|
||||
// cheap-module-eval-source-map is faster for development
|
||||
devtool: config.dev.devtool,
|
||||
|
||||
// these devServer options should be customized in /config/index.js
|
||||
devServer: {
|
||||
clientLogLevel: 'warning',
|
||||
historyApiFallback: {
|
||||
rewrites: [
|
||||
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
|
||||
],
|
||||
},
|
||||
hot: true,
|
||||
contentBase: false, // since we use CopyWebpackPlugin.
|
||||
compress: true,
|
||||
host: HOST || config.dev.host,
|
||||
port: PORT || config.dev.port,
|
||||
open: config.dev.autoOpenBrowser,
|
||||
overlay: config.dev.errorOverlay
|
||||
? { warnings: false, errors: true }
|
||||
: false,
|
||||
publicPath: config.dev.assetsPublicPath,
|
||||
proxy: config.dev.proxyTable,
|
||||
quiet: true, // necessary for FriendlyErrorsPlugin
|
||||
watchOptions: {
|
||||
poll: config.dev.poll,
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': require('../config/dev.env')
|
||||
}),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
// https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: 'index.html',
|
||||
inject: true
|
||||
}),
|
||||
// copy custom static assets
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.dev.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
}
|
||||
])
|
||||
]
|
||||
})
|
||||
|
||||
module.exports = new Promise((resolve, reject) => {
|
||||
portfinder.basePort = process.env.PORT || config.dev.port
|
||||
portfinder.getPort((err, port) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
// publish the new Port, necessary for e2e tests
|
||||
process.env.PORT = port
|
||||
// add port to devServer config
|
||||
devWebpackConfig.devServer.port = port
|
||||
|
||||
// Add FriendlyErrorsPlugin
|
||||
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
|
||||
compilationSuccessInfo: {
|
||||
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
|
||||
},
|
||||
onErrors: config.dev.notifyOnErrors
|
||||
? utils.createNotifierCallback()
|
||||
: undefined
|
||||
}))
|
||||
|
||||
resolve(devWebpackConfig)
|
||||
}
|
||||
})
|
||||
})
|
@ -0,0 +1,150 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const merge = require('webpack-merge')
|
||||
const baseWebpackConfig = require('./webpack.base.conf')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||
|
||||
const env = process.env.NODE_ENV === 'testing'
|
||||
? require('../config/test.env')
|
||||
: require('../config/prod.env')
|
||||
|
||||
const webpackConfig = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
extract: true,
|
||||
usePostCSS: true
|
||||
})
|
||||
},
|
||||
devtool: config.build.productionSourceMap ? config.build.devtool : false,
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: utils.assetsPath('js/[name].[chunkhash].js'),
|
||||
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js'),
|
||||
publicPath: process.env.NODE_ENV === 'production' ? './' +config.build.assetsPublicPath : './' + config.dev.assetsPublicPath
|
||||
},
|
||||
plugins: [
|
||||
// http://vuejs.github.io/vue-loader/en/workflow/production.html
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': env
|
||||
}),
|
||||
new UglifyJsPlugin({
|
||||
uglifyOptions: {
|
||||
compress: {
|
||||
warnings: false
|
||||
}
|
||||
},
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
parallel: true
|
||||
}),
|
||||
// extract css into its own file
|
||||
new ExtractTextPlugin({
|
||||
filename: utils.assetsPath('css/[name].[contenthash].css'),
|
||||
// Setting the following option to `false` will not extract CSS from codesplit chunks.
|
||||
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
|
||||
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
|
||||
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
|
||||
allChunks: true,
|
||||
}),
|
||||
// Compress extracted CSS. We are using this plugin so that possible
|
||||
// duplicated CSS from different components can be deduped.
|
||||
new OptimizeCSSPlugin({
|
||||
cssProcessorOptions: config.build.productionSourceMap
|
||||
? { safe: true, map: { inline: false } }
|
||||
: { safe: true }
|
||||
}),
|
||||
// generate dist index.html with correct asset hash for caching.
|
||||
// you can customize output by editing /index.html
|
||||
// see https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: process.env.NODE_ENV === 'testing'
|
||||
? 'index.html'
|
||||
: config.build.index,
|
||||
template: 'index.html',
|
||||
inject: true,
|
||||
minify: {
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true
|
||||
// more options:
|
||||
// https://github.com/kangax/html-minifier#options-quick-reference
|
||||
},
|
||||
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
|
||||
chunksSortMode: 'dependency'
|
||||
}),
|
||||
// keep module.id stable when vendor modules does not change
|
||||
new webpack.HashedModuleIdsPlugin(),
|
||||
// enable scope hoisting
|
||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||
// split vendor js into its own file
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'vendor',
|
||||
minChunks (module) {
|
||||
// any required modules inside node_modules are extracted to vendor
|
||||
return (
|
||||
module.resource &&
|
||||
/\.js$/.test(module.resource) &&
|
||||
module.resource.indexOf(
|
||||
path.join(__dirname, '../node_modules')
|
||||
) === 0
|
||||
)
|
||||
}
|
||||
}),
|
||||
// extract webpack runtime and module manifest to its own file in order to
|
||||
// prevent vendor hash from being updated whenever app bundle is updated
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'manifest',
|
||||
minChunks: Infinity
|
||||
}),
|
||||
// This instance extracts shared chunks from code splitted chunks and bundles them
|
||||
// in a separate chunk, similar to the vendor chunk
|
||||
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'app',
|
||||
async: 'vendor-async',
|
||||
children: true,
|
||||
minChunks: 3
|
||||
}),
|
||||
|
||||
// copy custom static assets
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.build.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
}
|
||||
])
|
||||
]
|
||||
})
|
||||
|
||||
if (config.build.productionGzip) {
|
||||
const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
||||
|
||||
webpackConfig.plugins.push(
|
||||
new CompressionWebpackPlugin({
|
||||
asset: '[path].gz[query]',
|
||||
algorithm: 'gzip',
|
||||
test: new RegExp(
|
||||
'\\.(' +
|
||||
config.build.productionGzipExtensions.join('|') +
|
||||
')$'
|
||||
),
|
||||
threshold: 10240,
|
||||
minRatio: 0.8
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
if (config.build.bundleAnalyzerReport) {
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
||||
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
|
||||
}
|
||||
|
||||
module.exports = webpackConfig
|
@ -0,0 +1,7 @@
|
||||
'use strict'
|
||||
const merge = require('webpack-merge')
|
||||
const prodEnv = require('./prod.env')
|
||||
|
||||
module.exports = merge(prodEnv, {
|
||||
NODE_ENV: '"development"'
|
||||
})
|
@ -0,0 +1,76 @@
|
||||
'use strict'
|
||||
// Template version: 1.3.1
|
||||
// see http://vuejs-templates.github.io/webpack for documentation.
|
||||
|
||||
const path = require('path')
|
||||
|
||||
module.exports = {
|
||||
dev: {
|
||||
|
||||
// Paths
|
||||
assetsSubDirectory: 'static',
|
||||
assetsPublicPath: '/',
|
||||
proxyTable: {},
|
||||
|
||||
// Various Dev Server settings
|
||||
host: 'localhost', // can be overwritten by process.env.HOST
|
||||
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||
autoOpenBrowser: false,
|
||||
errorOverlay: true,
|
||||
notifyOnErrors: true,
|
||||
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
|
||||
|
||||
// Use Eslint Loader?
|
||||
// If true, your code will be linted during bundling and
|
||||
// linting errors and warnings will be shown in the console.
|
||||
useEslint: true,
|
||||
// If true, eslint errors and warnings will also be shown in the error overlay
|
||||
// in the browser.
|
||||
showEslintErrorsInOverlay: false,
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
// https://webpack.js.org/configuration/devtool/#development
|
||||
devtool: 'cheap-module-eval-source-map',
|
||||
|
||||
// If you have problems debugging vue-files in devtools,
|
||||
// set this to false - it *may* help
|
||||
// https://vue-loader.vuejs.org/en/options.html#cachebusting
|
||||
cacheBusting: true,
|
||||
|
||||
cssSourceMap: true
|
||||
},
|
||||
|
||||
build: {
|
||||
// Template for index.html
|
||||
index: path.resolve(__dirname, '../dist/index.html'),
|
||||
|
||||
// Paths
|
||||
assetsRoot: path.resolve(__dirname, '../dist'),
|
||||
assetsSubDirectory: 'static',
|
||||
assetsPublicPath: '/',
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
productionSourceMap: true,
|
||||
// https://webpack.js.org/configuration/devtool/#production
|
||||
devtool: '#source-map',
|
||||
|
||||
// Gzip off by default as many popular static hosts such as
|
||||
// Surge or Netlify already gzip all static assets for you.
|
||||
// Before setting to `true`, make sure to:
|
||||
// npm install --save-dev compression-webpack-plugin
|
||||
productionGzip: false,
|
||||
productionGzipExtensions: ['js', 'css'],
|
||||
|
||||
// Run the build command with an extra argument to
|
||||
// View the bundle analyzer report after build finishes:
|
||||
// `npm run build --report`
|
||||
// Set to `true` or `false` to always turn it on or off
|
||||
bundleAnalyzerReport: process.env.npm_config_report
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
'use strict'
|
||||
module.exports = {
|
||||
NODE_ENV: '"production"'
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
'use strict'
|
||||
const merge = require('webpack-merge')
|
||||
const devEnv = require('./dev.env')
|
||||
|
||||
module.exports = merge(devEnv, {
|
||||
NODE_ENV: '"testing"'
|
||||
})
|
@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<title>DG35-D微量闪点仪</title>
|
||||
<script src="./static/js/jquery.js"></script>
|
||||
<link href="./static/plugins/jquery-ui/jquery-ui.min.css" rel="stylesheet" />
|
||||
<link href="./static/plugins/jquery-ui/jquery-ui.min.css" rel="stylesheet" />
|
||||
<link href="./static/plugins/virtualkeyboard/virtualkeyboard.css" rel="stylesheet" />
|
||||
<!-- <script src="./static/plugins/virtualkeyboard/virtualkeyboard.js"></script> -->
|
||||
<!-- <link href="./static/js/virtualkeyboard/virtualkeyboard.css" rel="stylesheet" /> -->
|
||||
<script src="./static/js/virtualkeyboard/virtualkeyboard.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
||||
<style>
|
||||
html,body{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0px;
|
||||
padding:0px
|
||||
}
|
||||
</style>
|
@ -0,0 +1,202 @@
|
||||
{
|
||||
root: 'D:\\VueSmsvp\\VueSmsvp',
|
||||
registry: 'https://registry.npmmirror.com',
|
||||
pkgs: [
|
||||
{
|
||||
name: 'node-sass',
|
||||
version: '4.14',
|
||||
type: 'range',
|
||||
alias: undefined,
|
||||
arg: [Result]
|
||||
}
|
||||
],
|
||||
production: false,
|
||||
cacheStrict: false,
|
||||
cacheDir: 'C:\\Users\\49912\\.npminstall_tarball',
|
||||
env: {
|
||||
npm_config_registry: 'https://registry.npmmirror.com',
|
||||
npm_config_argv: '{"remain":[],"cooked":["--fix-bug-versions","--china","--userconfig=C:\\\\Users\\\\49912\\\\.cnpmrc","--disturl=https://cdn.npmmirror.com/binaries/node","--registry=https://registry.npmmirror.com","node-sass@4.14","--save"],"original":["--fix-bug-versions","--china","--userconfig=C:\\\\Users\\\\49912\\\\.cnpmrc","--disturl=https://cdn.npmmirror.com/binaries/node","--registry=https://registry.npmmirror.com","node-sass@4.14","--save"]}',
|
||||
npm_config_user_agent: 'npminstall/7.9.0 npm/? node/v16.18.1 win32 x64',
|
||||
npm_config_cache: 'C:\\Users\\49912\\.npminstall_tarball',
|
||||
NODE: 'C:\\Program Files\\nodejs\\node.exe',
|
||||
npm_node_execpath: 'C:\\Program Files\\nodejs\\node.exe',
|
||||
npm_execpath: 'D:\\soft\\nvm\\v16.18.1\\node_modules\\cnpm\\node_modules\\npminstall\\bin\\install.js',
|
||||
npm_config_userconfig: 'C:\\Users\\49912\\.cnpmrc',
|
||||
npm_config_disturl: 'https://cdn.npmmirror.com/binaries/node',
|
||||
npm_config_r: 'https://registry.npmmirror.com',
|
||||
COREPACK_NPM_REGISTRY: 'https://registry.npmmirror.com',
|
||||
NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
|
||||
NVM_NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
|
||||
PHANTOMJS_CDNURL: 'https://cdn.npmmirror.com/binaries/phantomjs',
|
||||
CHROMEDRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/chromedriver',
|
||||
OPERADRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/operadriver',
|
||||
CYPRESS_DOWNLOAD_PATH_TEMPLATE: 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip',
|
||||
ELECTRON_MIRROR: 'https://cdn.npmmirror.com/binaries/electron/',
|
||||
ELECTRON_BUILDER_BINARIES_MIRROR: 'https://cdn.npmmirror.com/binaries/electron-builder-binaries/',
|
||||
SASS_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-sass',
|
||||
SWC_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-swc',
|
||||
NWJS_URLBASE: 'https://cdn.npmmirror.com/binaries/nwjs/v',
|
||||
PUPPETEER_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
|
||||
PUPPETEER_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
|
||||
PLAYWRIGHT_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/playwright',
|
||||
SENTRYCLI_CDNURL: 'https://cdn.npmmirror.com/binaries/sentry-cli',
|
||||
SAUCECTL_INSTALL_BINARY_MIRROR: 'https://cdn.npmmirror.com/binaries/saucectl',
|
||||
RE2_DOWNLOAD_MIRROR: 'https://cdn.npmmirror.com/binaries/node-re2',
|
||||
RE2_DOWNLOAD_SKIP_PATH: 'true',
|
||||
PRISMA_ENGINES_MIRROR: 'https://cdn.npmmirror.com/binaries/prisma',
|
||||
npm_config_better_sqlite3_binary_host: 'https://cdn.npmmirror.com/binaries/better-sqlite3',
|
||||
npm_config_keytar_binary_host: 'https://cdn.npmmirror.com/binaries/keytar',
|
||||
npm_config_sharp_binary_host: 'https://cdn.npmmirror.com/binaries/sharp',
|
||||
npm_config_sharp_libvips_binary_host: 'https://cdn.npmmirror.com/binaries/sharp-libvips',
|
||||
npm_config_robotjs_binary_host: 'https://cdn.npmmirror.com/binaries/robotjs',
|
||||
npm_rootpath: 'D:\\VueSmsvp\\VueSmsvp',
|
||||
INIT_CWD: 'D:\\VueSmsvp\\VueSmsvp'
|
||||
},
|
||||
binaryMirrors: {
|
||||
ENVS: {
|
||||
COREPACK_NPM_REGISTRY: 'https://registry.npmmirror.com',
|
||||
NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
|
||||
NVM_NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
|
||||
PHANTOMJS_CDNURL: 'https://cdn.npmmirror.com/binaries/phantomjs',
|
||||
CHROMEDRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/chromedriver',
|
||||
OPERADRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/operadriver',
|
||||
CYPRESS_DOWNLOAD_PATH_TEMPLATE: 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip',
|
||||
ELECTRON_MIRROR: 'https://cdn.npmmirror.com/binaries/electron/',
|
||||
ELECTRON_BUILDER_BINARIES_MIRROR: 'https://cdn.npmmirror.com/binaries/electron-builder-binaries/',
|
||||
SASS_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-sass',
|
||||
SWC_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-swc',
|
||||
NWJS_URLBASE: 'https://cdn.npmmirror.com/binaries/nwjs/v',
|
||||
PUPPETEER_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
|
||||
PUPPETEER_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
|
||||
PLAYWRIGHT_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/playwright',
|
||||
SENTRYCLI_CDNURL: 'https://cdn.npmmirror.com/binaries/sentry-cli',
|
||||
SAUCECTL_INSTALL_BINARY_MIRROR: 'https://cdn.npmmirror.com/binaries/saucectl',
|
||||
RE2_DOWNLOAD_MIRROR: 'https://cdn.npmmirror.com/binaries/node-re2',
|
||||
RE2_DOWNLOAD_SKIP_PATH: 'true',
|
||||
PRISMA_ENGINES_MIRROR: 'https://cdn.npmmirror.com/binaries/prisma',
|
||||
npm_config_better_sqlite3_binary_host: 'https://cdn.npmmirror.com/binaries/better-sqlite3',
|
||||
npm_config_keytar_binary_host: 'https://cdn.npmmirror.com/binaries/keytar',
|
||||
npm_config_sharp_binary_host: 'https://cdn.npmmirror.com/binaries/sharp',
|
||||
npm_config_sharp_libvips_binary_host: 'https://cdn.npmmirror.com/binaries/sharp-libvips',
|
||||
npm_config_robotjs_binary_host: 'https://cdn.npmmirror.com/binaries/robotjs'
|
||||
},
|
||||
'@ali/s2': { host: 'https://cdn.npmmirror.com/binaries/looksgood-s2' },
|
||||
sharp: { replaceHostFiles: [Array], replaceHostMap: [Object] },
|
||||
'@tensorflow/tfjs-node': {
|
||||
replaceHostFiles: [Array],
|
||||
replaceHostRegExpMap: [Object],
|
||||
replaceHostMap: [Object]
|
||||
},
|
||||
cypress: {
|
||||
host: 'https://cdn.npmmirror.com/binaries/cypress',
|
||||
newPlatforms: [Object]
|
||||
},
|
||||
'utf-8-validate': {
|
||||
host: 'https://cdn.npmmirror.com/binaries/utf-8-validate/v{version}'
|
||||
},
|
||||
xprofiler: {
|
||||
remote_path: './xprofiler/v{version}/',
|
||||
host: 'https://cdn.npmmirror.com/binaries'
|
||||
},
|
||||
leveldown: { host: 'https://cdn.npmmirror.com/binaries/leveldown/v{version}' },
|
||||
couchbase: { host: 'https://cdn.npmmirror.com/binaries/couchbase/v{version}' },
|
||||
gl: { host: 'https://cdn.npmmirror.com/binaries/gl/v{version}' },
|
||||
sqlite3: {
|
||||
host: 'https://cdn.npmmirror.com/binaries/sqlite3',
|
||||
remote_path: 'v{version}'
|
||||
},
|
||||
'@journeyapps/sqlcipher': { host: 'https://cdn.npmmirror.com/binaries' },
|
||||
grpc: {
|
||||
host: 'https://cdn.npmmirror.com/binaries',
|
||||
remote_path: '{name}/v{version}'
|
||||
},
|
||||
'grpc-tools': { host: 'https://cdn.npmmirror.com/binaries' },
|
||||
wrtc: {
|
||||
host: 'https://cdn.npmmirror.com/binaries',
|
||||
remote_path: '{name}/v{version}'
|
||||
},
|
||||
fsevents: { host: 'https://cdn.npmmirror.com/binaries/fsevents' },
|
||||
nodejieba: { host: 'https://cdn.npmmirror.com/binaries/nodejieba' },
|
||||
canvas: { host: 'https://cdn.npmmirror.com/binaries/canvas' },
|
||||
'skia-canvas': { host: 'https://cdn.npmmirror.com/binaries/skia-canvas' },
|
||||
'flow-bin': {
|
||||
replaceHost: 'https://github.com/facebook/flow/releases/download/v',
|
||||
host: 'https://cdn.npmmirror.com/binaries/flow/v'
|
||||
},
|
||||
'jpegtran-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/jpegtran-bin'
|
||||
},
|
||||
'cwebp-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/cwebp-bin'
|
||||
},
|
||||
'zopflipng-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/zopflipng-bin'
|
||||
},
|
||||
'optipng-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/optipng-bin'
|
||||
},
|
||||
mozjpeg: {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/mozjpeg-bin'
|
||||
},
|
||||
gifsicle: {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/gifsicle-bin'
|
||||
},
|
||||
'pngquant-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/pngquant-bin',
|
||||
replaceHostMap: [Object]
|
||||
},
|
||||
'pngcrush-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/pngcrush-bin'
|
||||
},
|
||||
'jpeg-recompress-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/jpeg-recompress-bin'
|
||||
},
|
||||
'advpng-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/advpng-bin'
|
||||
},
|
||||
'pngout-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/pngout-bin'
|
||||
},
|
||||
'jpegoptim-bin': {
|
||||
replaceHost: [Array],
|
||||
host: 'https://cdn.npmmirror.com/binaries/jpegoptim-bin'
|
||||
},
|
||||
argon2: { host: 'https://cdn.npmmirror.com/binaries/argon2' },
|
||||
'ali-zeromq': { host: 'https://cdn.npmmirror.com/binaries/ali-zeromq' },
|
||||
'ali-usb_ctl': { host: 'https://cdn.npmmirror.com/binaries/ali-usb_ctl' },
|
||||
'gdal-async': { host: 'https://cdn.npmmirror.com/binaries/node-gdal-async' }
|
||||
},
|
||||
forbiddenLicenses: null,
|
||||
flatten: false,
|
||||
proxy: undefined,
|
||||
prune: false,
|
||||
disableFallbackStore: false,
|
||||
workspacesMap: Map(0) {},
|
||||
enableWorkspace: false,
|
||||
workspaceRoot: 'D:\\VueSmsvp\\VueSmsvp',
|
||||
isWorkspaceRoot: true,
|
||||
isWorkspacePackage: false,
|
||||
offline: false,
|
||||
strictSSL: true,
|
||||
ignoreScripts: false,
|
||||
foregroundScripts: false,
|
||||
ignoreOptionalDependencies: false,
|
||||
detail: false,
|
||||
forceLinkLatest: false,
|
||||
trace: false,
|
||||
engineStrict: false,
|
||||
registryOnly: false,
|
||||
client: false,
|
||||
autoFixVersion: [Function: autoFixVersion]
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
{
|
||||
"name": "smsvp",
|
||||
"version": "1.0.0",
|
||||
"description": "A Vue.js project",
|
||||
"author": "cxw <1056036578@qq.com>",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
|
||||
"start": "npm run dev",
|
||||
"unit": "jest --config test/unit/jest.conf.js --coverage",
|
||||
"test": "npm run unit",
|
||||
"lint": "eslint --ext .js,.vue src test/unit",
|
||||
"build": "node build/build.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.27.2",
|
||||
"echarts": "^5.4.1",
|
||||
"element-ui": "^2.15.9",
|
||||
"highcharts": "^10.2.0",
|
||||
"highcharts-vue": "^1.4.0",
|
||||
"jquery": "^3.6.1",
|
||||
"js-md5": "^0.7.3",
|
||||
"qs": "^6.11.2",
|
||||
"socket.io-client": "^2.3.1",
|
||||
"vue": "^2.5.2",
|
||||
"vue-router": "^3.0.1",
|
||||
"vue-socket.io": "^3.0.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^7.1.2",
|
||||
"babel-core": "^6.22.1",
|
||||
"babel-eslint": "^8.2.1",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
||||
"babel-jest": "^21.0.2",
|
||||
"babel-loader": "^7.1.1",
|
||||
"babel-plugin-dynamic-import-node": "^1.2.0",
|
||||
"babel-plugin-syntax-jsx": "^6.18.0",
|
||||
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
|
||||
"babel-plugin-transform-runtime": "^6.22.0",
|
||||
"babel-plugin-transform-vue-jsx": "^3.5.0",
|
||||
"babel-preset-env": "^1.3.2",
|
||||
"babel-preset-stage-2": "^6.22.0",
|
||||
"chalk": "^2.0.1",
|
||||
"copy-webpack-plugin": "^4.0.1",
|
||||
"css-loader": "^0.28.11",
|
||||
"eslint": "^4.15.0",
|
||||
"eslint-config-standard": "^10.2.1",
|
||||
"eslint-friendly-formatter": "^3.0.0",
|
||||
"eslint-loader": "^1.7.1",
|
||||
"eslint-plugin-import": "^2.7.0",
|
||||
"eslint-plugin-node": "^5.2.0",
|
||||
"eslint-plugin-promise": "^3.4.0",
|
||||
"eslint-plugin-standard": "^3.0.1",
|
||||
"eslint-plugin-vue": "^4.0.0",
|
||||
"extract-text-webpack-plugin": "^3.0.0",
|
||||
"file-loader": "^1.1.4",
|
||||
"friendly-errors-webpack-plugin": "^1.6.1",
|
||||
"html-webpack-plugin": "^2.30.1",
|
||||
"jest": "^22.0.4",
|
||||
"jest-serializer-vue": "^0.3.0",
|
||||
"less": "^3.9.0",
|
||||
"less-loader": "^4.1.0",
|
||||
"node-notifier": "^5.1.2",
|
||||
"optimize-css-assets-webpack-plugin": "^3.2.0",
|
||||
"ora": "^1.2.0",
|
||||
"portfinder": "^1.0.13",
|
||||
"postcss-import": "^11.0.0",
|
||||
"postcss-loader": "^2.0.8",
|
||||
"postcss-url": "^7.2.1",
|
||||
"rimraf": "^2.6.0",
|
||||
"semver": "^5.3.0",
|
||||
"shelljs": "^0.7.6",
|
||||
"style-loader": "^3.3.3",
|
||||
"uglifyjs-webpack-plugin": "^1.1.1",
|
||||
"url-loader": "^0.5.8",
|
||||
"vue-jest": "^1.0.2",
|
||||
"vue-loader": "^13.3.0",
|
||||
"vue-style-loader": "^3.1.2",
|
||||
"vue-template-compiler": "^2.5.2",
|
||||
"webpack": "^3.6.0",
|
||||
"webpack-bundle-analyzer": "^2.9.0",
|
||||
"webpack-dev-server": "^2.9.1",
|
||||
"webpack-merge": "^4.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.0.0",
|
||||
"npm": ">= 3.0.0"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not ie <= 8"
|
||||
]
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<router-view/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'App',
|
||||
created:function(){
|
||||
sessionStorage.CurrentIP = '127.0.0.1';
|
||||
sessionStorage.CurrentHttpAddress = "http:///127.0.0.1:5555";
|
||||
},
|
||||
mounted: function () {
|
||||
window.$('body').virtualkeyboard();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#app {
|
||||
font-family: 'Avenir', Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
/* text-align: center;
|
||||
color: #2c3e50; */
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
</style>
|
@ -0,0 +1,221 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function userLogin(query) {
|
||||
return request({
|
||||
url: '/user/login',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getUserList(query) {
|
||||
return request({
|
||||
url: '/getUserList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function saveUser(query) {
|
||||
return request({
|
||||
url: '/saveUser',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getUserInfo(query) {
|
||||
return request({
|
||||
url: '/getUserInfo',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function updateUserPassword(query) {
|
||||
return request({
|
||||
url: '/updateUserPassword',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getExperimentList(query) {
|
||||
return request({
|
||||
url: '/getExperimentList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getExperimentInfo(query) {
|
||||
return request({
|
||||
url: '/getExperimentInfo',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteExperiment(query) {
|
||||
return request({
|
||||
url: '/deleteExperiment',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function exportReport(query) {
|
||||
return request({
|
||||
url: '/exportReport',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function insertExperiment(query) {
|
||||
return request({
|
||||
url: '/insertExperiment',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function insertExperimentStep(query) {
|
||||
return request({
|
||||
url: '/insertExperimentStep',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function stopExperimentStep(query) {
|
||||
return request({
|
||||
url: '/stopExperimentStep',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function updateExperiment(query) {
|
||||
return request({
|
||||
url: '/updateExperiment',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function openF1() {
|
||||
return request({
|
||||
url: '/openF1',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function closeF1() {
|
||||
return request({
|
||||
url: '/closeF1',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function openF3() {
|
||||
return request({
|
||||
url: '/openF3',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function closeF3() {
|
||||
return request({
|
||||
url: '/closeF3',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function openLight() {
|
||||
return request({
|
||||
url: '/openLight',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function closeLight() {
|
||||
return request({
|
||||
url: '/closeLight',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function startCotrolTemp() {
|
||||
return request({
|
||||
url: '/startCotrolTemp',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function stopTuoqi() {
|
||||
return request({
|
||||
url: '/stopTuoqi',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function okTemp() {
|
||||
return request({
|
||||
url: '/okTemp',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function nextTemp() {
|
||||
return request({
|
||||
url: '/nextTemp',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function controlPress() {
|
||||
return request({
|
||||
url: '/controlPress',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function closeWarn() {
|
||||
return request({
|
||||
url: '/closeWarn',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function switchAutoControl(query) {
|
||||
return request({
|
||||
url: '/switchAutoControl',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function setControlValue(query) {
|
||||
return request({
|
||||
url: '/setControlValue',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function openF4() {
|
||||
return request({
|
||||
url: '/openF4',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function closeF4() {
|
||||
return request({
|
||||
url: '/closeF4',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
import request from '@/utils/request'
|
||||
import Qs from 'qs'
|
||||
|
||||
//打开仓门
|
||||
export function instrumentClean(data) {
|
||||
return request({
|
||||
url: '/experiment/instrument_clean',
|
||||
method: 'post',
|
||||
data: Qs.stringify(data)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,21 @@
|
||||
import request from '@/utils/request'
|
||||
import Qs from 'qs'
|
||||
|
||||
//打开仓门
|
||||
export function openDoor(data) {
|
||||
return request({
|
||||
url: '/experiment/open_barn_door',
|
||||
method: 'post',
|
||||
data: Qs.stringify(data)
|
||||
})
|
||||
}
|
||||
//关闭仓门
|
||||
export function colseDoor(data) {
|
||||
return request({
|
||||
url: '/experiment/colse_barn_door',
|
||||
method: 'post',
|
||||
data: Qs.stringify(data)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
import request from '@/utils/request'
|
||||
import Qs from 'qs'
|
||||
//获取用户信息
|
||||
// export function getUserInfo(data) {
|
||||
// return request({
|
||||
// url: '/user/get_user_info',
|
||||
// method: 'post',
|
||||
// data: Qs.stringify(data)
|
||||
// })
|
||||
// }
|
||||
|
||||
// 获取数据报表列表
|
||||
export function getExperimentList(data) {
|
||||
return request({
|
||||
url: '/experiment/get_experiment_list',
|
||||
method: 'post',
|
||||
data: Qs.stringify(data)
|
||||
})
|
||||
}
|
||||
|
||||
// 导出数据报表列表
|
||||
export function exportReportList(data) {
|
||||
return request({
|
||||
url: '/experiment/export_experiment_data',
|
||||
method: 'post',
|
||||
data: Qs.stringify(data)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,32 @@
|
||||
import request from '@/utils/request'
|
||||
import Qs from 'qs'
|
||||
|
||||
//系统设置初始化参数
|
||||
export function initParams(data) {
|
||||
return request({
|
||||
url: '/parameter/determination_standard_setting',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8'
|
||||
},
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获取初始化数据
|
||||
export function getInitParams(data) {
|
||||
return request({
|
||||
url: '/parameter/get_standard_setting',
|
||||
method: 'post',
|
||||
data: Qs.stringify(data)
|
||||
})
|
||||
}
|
||||
//设置系统是时间
|
||||
export function setTime(data) {
|
||||
return request({
|
||||
url: '/parameter/time_setting_win',
|
||||
method: 'post',
|
||||
data: Qs.stringify(data)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
import Qs from 'qs'
|
||||
//取样(新增实验
|
||||
// export function addExperiment(data) {
|
||||
// return request({
|
||||
// url: '/experiment/insert_experiment',
|
||||
// method: 'post',
|
||||
// data: data
|
||||
// })
|
||||
// }
|
||||
//新增实验
|
||||
export function addExperiment(data) {
|
||||
return request({
|
||||
url: '/experiment/insert_experiment',
|
||||
method: 'post',
|
||||
data: Qs.stringify(data)
|
||||
})
|
||||
}
|
||||
//开始实验
|
||||
export function startExperiment(data) {
|
||||
return request({
|
||||
url: '/experiment/start_experiment',
|
||||
method: 'post',
|
||||
data: Qs.stringify(data)
|
||||
})
|
||||
}
|
||||
//导出数据
|
||||
export function exportData(data) {
|
||||
return request({
|
||||
url: '/experiment/export_experiment_data',
|
||||
method: 'post',
|
||||
data: Qs.stringify(data)
|
||||
})
|
||||
}
|
||||
//删除数据
|
||||
export function deleteData(data) {
|
||||
return request({
|
||||
url: '/experiment/delete_experiment',
|
||||
method: 'post',
|
||||
data: Qs.stringify(data)
|
||||
})
|
||||
}
|
||||
|
||||
//实验结果
|
||||
export function resultData(data) {
|
||||
return request({
|
||||
url: '/experiment/result_experiment',
|
||||
method: 'post',
|
||||
data: Qs.stringify(data)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,35 @@
|
||||
import request from '@/utils/request'
|
||||
import Qs from 'qs'
|
||||
//获取用户信息
|
||||
export function getUserInfo(data) {
|
||||
return request({
|
||||
url: '/user/get_user_info',
|
||||
method: 'post',
|
||||
data: Qs.stringify(data)
|
||||
})
|
||||
}
|
||||
// 删除用户信息
|
||||
export function deleteUserInfo(data) {
|
||||
return request({
|
||||
url: '/user/delete_user',
|
||||
method: 'post',
|
||||
data: Qs.stringify(data)
|
||||
})
|
||||
}
|
||||
// 获取用户列表接口
|
||||
export function getUserList(data) {
|
||||
return request({
|
||||
url: '/user/get_user_list',
|
||||
method: 'post',
|
||||
data: Qs.stringify(data)
|
||||
})
|
||||
}
|
||||
//新增和修改用户信息接口
|
||||
export function saveUser(data) {
|
||||
return request({
|
||||
url: '/user/save_user',
|
||||
method: 'post',
|
||||
data: Qs.stringify(data)
|
||||
})
|
||||
}
|
||||
|
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 9.6 KiB |
After Width: | Height: | Size: 765 B |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 656 B |
After Width: | Height: | Size: 124 KiB |
After Width: | Height: | Size: 170 KiB |
After Width: | Height: | Size: 161 KiB |
After Width: | Height: | Size: 975 B |
After Width: | Height: | Size: 161 KiB |
After Width: | Height: | Size: 465 B |
After Width: | Height: | Size: 170 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 560 B |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 1.5 MiB |
After Width: | Height: | Size: 7.7 MiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 8.0 MiB |
After Width: | Height: | Size: 3.1 MiB |
After Width: | Height: | Size: 8.9 MiB |
After Width: | Height: | Size: 4.8 MiB |
After Width: | Height: | Size: 1.7 MiB |
After Width: | Height: | Size: 609 B |
After Width: | Height: | Size: 563 B |
@ -0,0 +1,255 @@
|
||||
<template>
|
||||
<div class="headerbox">
|
||||
<div class="headerleft">
|
||||
<img class='img' src="@/assets/header/logo-red.png" alt="">
|
||||
<div class="title">DG35-D微量闪点仪</div>
|
||||
</div>
|
||||
<div class="headerright">
|
||||
<!-- <img src="../../static/icon/wifi.png" style="height:20px;width:22px" alt=""> -->
|
||||
<div class="date">{{nowDate}}</div>
|
||||
<div style="display: flex;align-items: center;justify-content: flex-end;">
|
||||
|
||||
<!-- <img v-if="role==1" src="../../static/icon/管理员头像.png" style="height:20px;width:20px;padding-right: 4px;" alt="">
|
||||
<img v-else src="../../static/icon/普通用户头像.png" style="height:20px;width:20px;padding-right: 4px;" alt=""> -->
|
||||
<!-- <el-dropdown trigger="click" szie="medium" @command="handleCommand">
|
||||
<span class="el-dropdown-link">
|
||||
{{user}}<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="changepassword">修改密码</el-dropdown-item>
|
||||
<el-dropdown-item command="logout" divided>注销登录</el-dropdown-item>
|
||||
<el-dropdown-item command="quit" divided>关闭程序</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown> -->
|
||||
<img v-if="$route.name=='Home'||step=='4'" src="@/assets/header/down.png" alt="" @click="handOpen">
|
||||
<el-dropdown trigger="click" size="medium" @command="handleCommand">
|
||||
<span class="el-dropdown-link">
|
||||
<img src="@/assets/header/menu.png" alt="">
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown" class="downMenu">
|
||||
<el-dropdown-item command="dataReport">
|
||||
<img class='downImg' src="@/assets/home/数据报告.png" alt="">
|
||||
数据报告
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="system" divided>
|
||||
<img class='downImg' src="@/assets/home/系统设置.png" alt="">
|
||||
系统设置
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="userMange" divided>
|
||||
<img class='downImg' src="@/assets/home/用户管理.png" alt="">
|
||||
用户管理</el-dropdown-item>
|
||||
<el-dropdown-item command="logout" divided>
|
||||
<img class='downImg' src="@/assets/home/退出登录.png" alt="">
|
||||
退出登录</el-dropdown-item>
|
||||
<el-dropdown-item command="quit" divided>
|
||||
<img class='downImg' src="@/assets/home/关机.png" alt="">关机</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { P_SysControl } from '../main'
|
||||
import {getDate} from '@/utils/common.js'
|
||||
import {openDoor,colseDoor} from '@/api/home.js'
|
||||
export default {
|
||||
name: 'Headers',
|
||||
props:['user','role'],
|
||||
data(){
|
||||
return {
|
||||
step:'1',
|
||||
nowDate: "",
|
||||
nowTime: "",
|
||||
nowWeek: "",
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
// this.step=this.$store.getters.step;
|
||||
// console.log(this.$router,'路由4',this.$store.getters.step)
|
||||
},
|
||||
methods: {
|
||||
getTime(){
|
||||
const currentDate = new Date();
|
||||
const year = currentDate.getFullYear();
|
||||
const month = String(currentDate.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(currentDate.getDate()).padStart(2, '0');
|
||||
const hours = String(currentDate.getHours()).padStart(2, '0');
|
||||
const minutes = String(currentDate.getMinutes()).padStart(2, '0');
|
||||
|
||||
const formattedDateTime = `${year}/${month}/${day} ${hours}:${minutes}`;
|
||||
console.log(formattedDateTime,'时间格式');
|
||||
},
|
||||
quit(){
|
||||
var that =this
|
||||
this.$confirm('您确定要退出程序吗!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
center: true
|
||||
}).then(() => {
|
||||
P_SysControl.closeForm();
|
||||
})
|
||||
},
|
||||
handleCommand(command){
|
||||
switch (command) {
|
||||
case 'dataReport':
|
||||
this.$router.push('/reportlist');
|
||||
break
|
||||
case 'system':
|
||||
this.$router.push('/setSystem');
|
||||
break
|
||||
case 'userMange':
|
||||
this.$router.push('/userlist');
|
||||
break
|
||||
case 'logout':
|
||||
this.$router.push('/');
|
||||
break
|
||||
case 'quit':
|
||||
this.quit()
|
||||
break
|
||||
}
|
||||
|
||||
},
|
||||
currentTime() {
|
||||
setInterval(this.getDate, 500);
|
||||
},
|
||||
getDate() {
|
||||
var _this = this;
|
||||
let yy = new Date().getFullYear();
|
||||
let mm = new Date().getMonth() + 1< 10? "0" +(new Date().getMonth() + 1):new Date().getMonth() + 1;
|
||||
let dd = new Date().getDate()< 10? "0" +new Date().getDate():new Date().getDate();
|
||||
let week = new Date().getDay();
|
||||
let hh = new Date().getHours();
|
||||
let ms =
|
||||
new Date().getSeconds() < 10
|
||||
? "0" + new Date().getSeconds()
|
||||
: new Date().getSeconds();
|
||||
let mf =
|
||||
new Date().getMinutes() < 10
|
||||
? "0" + new Date().getMinutes()
|
||||
: new Date().getMinutes();
|
||||
if (week == 1) {
|
||||
this.nowWeek = "周一";
|
||||
} else if (week == 2) {
|
||||
this.nowWeek = "周二";
|
||||
} else if (week == 3) {
|
||||
this.nowWeek = "周三";
|
||||
} else if (week == 4) {
|
||||
this.nowWeek = "周四";
|
||||
} else if (week == 5) {
|
||||
this.nowWeek = "周五";
|
||||
} else if (week == 6) {
|
||||
this.nowWeek = "周六";
|
||||
} else {
|
||||
this.nowWeek = "周日";
|
||||
}
|
||||
_this.nowDate=yy+ "/"+mm + "/" + dd + " "+' '+hh + ":" + mf;
|
||||
},
|
||||
handOpen(){
|
||||
console.log('打开1')
|
||||
openDoor().then(res=>{
|
||||
console.log(res,'打开仓门')
|
||||
})
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.getDate) {
|
||||
console.log("销毁定时器");
|
||||
clearInterval(this.getDate);
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.headerbox{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: white;
|
||||
padding-left: 1%;
|
||||
padding-right: 1%;
|
||||
border-radius: 0px 0px 0px 0px;
|
||||
opacity: 1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.headerleft{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.title{
|
||||
width: 220px;
|
||||
height: 46px;
|
||||
margin-left:18px;
|
||||
font-size: 24px;
|
||||
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
color: rgba(0,0,0,0.9000);
|
||||
line-height: 46px;
|
||||
}
|
||||
|
||||
.headerright{
|
||||
width:350px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.el-dropdown-link{
|
||||
width: 48px;
|
||||
height: 21px;
|
||||
font-size: 16px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.9);
|
||||
line-height: 0px;
|
||||
}
|
||||
.date{
|
||||
height: 24px;
|
||||
font-size: 16px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: #C3C3C3;
|
||||
line-height: 24px;
|
||||
margin-left:50px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.el-dropdown-menu__item{
|
||||
width: 240px;
|
||||
height: 68px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 0px 0px 0px 0px;
|
||||
opacity: 1;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
display: flex;
|
||||
font-size:24px;
|
||||
color:#666;
|
||||
.downImg{
|
||||
width:28px;
|
||||
height:28px;
|
||||
margin:20px;
|
||||
}
|
||||
}
|
||||
.el-dropdown-menu__item--divided:before{
|
||||
width: 240px;
|
||||
height: 68px;
|
||||
background: #FFFFFF;
|
||||
background:red;
|
||||
border-radius: 0px 0px 0px 0px;
|
||||
opacity: 1;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
display: flex;
|
||||
content: none;
|
||||
|
||||
}
|
||||
</style>
|
@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<div class="mainbody">
|
||||
<router-view @send_user ="getuserdata" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Views',
|
||||
methods:{
|
||||
getuserdata(res){
|
||||
var that =this
|
||||
that.$emit('user_header',res)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.mainbody{
|
||||
height: 100%;
|
||||
width:100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,58 @@
|
||||
// The Vue build version to load with the `import` command
|
||||
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
|
||||
import Vue from 'vue'
|
||||
import App from './App'
|
||||
import Element from 'element-ui';
|
||||
import 'element-ui/lib/theme-chalk/index.css';
|
||||
import HighchartsVue from 'highcharts-vue'
|
||||
import md5 from 'js-md5';
|
||||
import $ from 'jquery'
|
||||
import VueSocketIO from 'vue-socket.io';
|
||||
import SocketIO from "socket.io-client";
|
||||
import QWebChannel from '../src/utils/qwebchannel-js'
|
||||
import router from './router'
|
||||
// import store from './store';
|
||||
// import "../static/js/virtualkeyboard/virtualkeyboard.css"
|
||||
// import "../static/js/virtualkeyboard/virtualkeyboard.js"
|
||||
export var P_SysControl = null;
|
||||
try{
|
||||
new QWebChannel(qt.webChannelTransport, function (channel) {
|
||||
P_SysControl = channel.objects.P_SysControl;
|
||||
|
||||
})
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
|
||||
// Vue.use(new VueSocketIO({
|
||||
// connection: SocketIO("http://127.0.0.1:5555/temp", {
|
||||
// autoConnect: true // 自动连接
|
||||
// }),
|
||||
// extraHeaders: { "Access-Control-Allow-Origin": "*" }
|
||||
// }));
|
||||
Vue.use(new VueSocketIO({
|
||||
connection: SocketIO("http://192.168.101.50:5001", {
|
||||
autoConnect: true // 自动连接
|
||||
}),
|
||||
extraHeaders: { "Access-Control-Allow-Origin": "*" }
|
||||
}));
|
||||
|
||||
|
||||
Vue.prototype.$md5 = md5;
|
||||
Vue.use(HighchartsVue)
|
||||
Vue.use(Element, { size: 'small', zIndex: 3000 });
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
/* eslint-disable no-new */
|
||||
new Vue({
|
||||
el: '#app',
|
||||
router,
|
||||
// store,
|
||||
components: { App },
|
||||
template: '<App/>',
|
||||
mounted: function () {
|
||||
window.vue = this;
|
||||
}
|
||||
|
||||
})
|
@ -0,0 +1,259 @@
|
||||
<template>
|
||||
<div class="adduserbox">
|
||||
<!-- <div class="usertop">
|
||||
<div class="row" @click="go('userlist')">
|
||||
<i class="el-icon-arrow-left"></i>
|
||||
<span>{{title}}</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="usertop"><span>{{title}}</span></div>
|
||||
<div class="card">
|
||||
<!-- <p class="P3">{{p3}}</p> -->
|
||||
<div class="pinput">
|
||||
<span class="label">用户名</span>
|
||||
<el-input class="numkeyboard" v-model="name" placeholder="请输入" ></el-input>
|
||||
</div>
|
||||
<!-- <div class="pinput">
|
||||
<span>账号</span>
|
||||
<el-input class="numkeyboard" v-model="user" placeholder="请输入" show-password></el-input>
|
||||
</div>
|
||||
<div class="pinput">
|
||||
<span>性别</span>
|
||||
<el-select v-model="sex" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div> -->
|
||||
<div class="pinput">
|
||||
<span class="label">角色</span>
|
||||
<el-select v-model="role" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="pinput">
|
||||
<span class="label">手机号</span>
|
||||
<el-input class="numkeyboard" v-model="phone" placeholder="请输入" ></el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<button class="Back" @click="go('userlist')">返回</button>
|
||||
<button class="Save" @click="AddUser">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
saveUser,getUserInfo
|
||||
} from '@/api/user'
|
||||
|
||||
export default {
|
||||
name: 'ChangePassword',
|
||||
data(){
|
||||
return {
|
||||
options: [{
|
||||
value: '1',
|
||||
label: '男'
|
||||
}, {
|
||||
value: '0',
|
||||
label: '女'
|
||||
}],
|
||||
options1: [{
|
||||
value: 1,
|
||||
label: '管理员'
|
||||
}, {
|
||||
value: 2,
|
||||
label: '普通用户'
|
||||
}],
|
||||
title:'新增用户',
|
||||
p3:"请填写用户信息",
|
||||
name:'',
|
||||
user:'',
|
||||
sex:'1',
|
||||
role:'2',
|
||||
phone:'',
|
||||
userId:null
|
||||
}
|
||||
},
|
||||
created(){
|
||||
let userId =this.$route.query.userId
|
||||
console.log(userId,'用户id')
|
||||
if (userId !=null&&userId !=undefined){
|
||||
this.userId =userId
|
||||
this.title ='编辑用户'
|
||||
this.p3 ='编辑用户信息'
|
||||
this.getuserinfo()
|
||||
}else{
|
||||
this.title ='添加用户',
|
||||
this.name='',
|
||||
this.role=null,
|
||||
this.phone=''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
go(res){
|
||||
switch (res) {
|
||||
case 'userlist':
|
||||
this.$router.push('/userlist');
|
||||
break
|
||||
}
|
||||
},
|
||||
getuserinfo(){
|
||||
var that =this
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '获取用户数据...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
getUserInfo({user_id: this.userId}).then(response => {
|
||||
console.log(response.data)
|
||||
loading.close()
|
||||
if(response.data.status ==1){
|
||||
that.$message.error(data.message);
|
||||
}else{
|
||||
that.name =response.data.data.user_name
|
||||
// that.user =response.data.data.user_name
|
||||
// that.sex =Number(response.data.data.user_sex)
|
||||
that.role =Number(response.data.data.user_role)
|
||||
that.phone =response.data.data.user_phone
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
loading.close()
|
||||
that.$message.error(error.message);
|
||||
})
|
||||
},
|
||||
AddUser(){
|
||||
var that =this
|
||||
if (that.name == "") {
|
||||
that.$message({
|
||||
message: '用户姓名不能为空',
|
||||
type: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '保存用户数据...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
let data={
|
||||
user_id:this.userId,
|
||||
user_name:this.name,
|
||||
user_role:this.role,
|
||||
user_phone:this.phone,
|
||||
}
|
||||
saveUser(data).then(response => {
|
||||
console.log(response.data)
|
||||
loading.close()
|
||||
if(response.data.status ==1){
|
||||
that.$message.error(data.message);
|
||||
}else{
|
||||
that.go('userlist')
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
loading.close()
|
||||
that.$message.error(error.message);
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
/* 搜索框样式修改 */
|
||||
.adduserbox .el-input__inner {
|
||||
width:460px;
|
||||
height: 68px ;
|
||||
font-size: 28px;
|
||||
color: #242424;
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
.adduserbox{
|
||||
height: 100%;
|
||||
width:100%;
|
||||
.usertop{
|
||||
height:40px;
|
||||
font-size:40px;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
margin:36px 0 0;
|
||||
}
|
||||
.card {
|
||||
width:580px;
|
||||
margin:73px auto;
|
||||
.pinput{
|
||||
display: flex;
|
||||
margin-top:40px;
|
||||
.el-input{
|
||||
width: 460px;;
|
||||
}
|
||||
.label{
|
||||
display: block;
|
||||
width:90px;
|
||||
height:68px;
|
||||
line-height:68px;
|
||||
text-align: left;
|
||||
font-size: 28px;
|
||||
color: #3A3A3A;
|
||||
}
|
||||
}
|
||||
}
|
||||
.footer{
|
||||
width: 1024px;
|
||||
padding:0 40px;
|
||||
height: 120px;
|
||||
// background: #FFFFFF;
|
||||
// box-shadow: 0px -3px 6px 1px rgba(0,0,0,0.16);
|
||||
// border-radius: 0px 0px 0px 0px;
|
||||
display:flex;
|
||||
justify-content: space-between;
|
||||
padding-top:12px;
|
||||
.Back{
|
||||
width: 208px;
|
||||
height: 84px;
|
||||
// background: linear-gradient(180deg, #FFFFFF 0%, #ECECEC 100%);
|
||||
// box-shadow: 0px 3px 6px 1px rgba(0,0,0,0.16);
|
||||
border-radius: 8px 8px 8px 8px;
|
||||
font-size: 36px;
|
||||
line-height:84px;
|
||||
border:0;
|
||||
color: #3A3A3A;
|
||||
}
|
||||
.Save{
|
||||
width: 208px;
|
||||
height: 84px;
|
||||
background: linear-gradient(180deg, #FF7B83 0%, #850006 100%);
|
||||
box-shadow: 0px 3px 6px 1px rgba(0,0,0,0.4);
|
||||
border-radius: 8px 8px 8px 8px;
|
||||
font-size: 36px;
|
||||
line-height:84px;
|
||||
border:0;
|
||||
color: #fff
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</style>
|
@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<div style="height:100%;width:100%">
|
||||
<img style="height:100%;width:100%" :src="'http://127.0.0.1:5555/camera_img/'" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
export default {
|
||||
name: 'Camera',
|
||||
data(){
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
created(){
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
@ -0,0 +1,217 @@
|
||||
<template>
|
||||
<div style="height:100%;width: 100%;">
|
||||
<div class="changetop">
|
||||
<div class="row" @click="go('home')">
|
||||
<i class="el-icon-arrow-left"></i>
|
||||
<span>修改密码</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
</div>
|
||||
</div>
|
||||
<div style="width:100%;justify-content: center;display: flex;align-items: center;height: 90%;">
|
||||
<div class="changebox">
|
||||
<div class="card">
|
||||
<p class="P2">修改密码</p>
|
||||
<div class="pin">
|
||||
<span style="width:36px !important">旧密码</span>
|
||||
<el-input class="numkeyboard" v-model="oldpassword" placeholder="请输入" show-password></el-input>
|
||||
</div>
|
||||
<div class="pin">
|
||||
<span style="width:36px !important">新密码</span>
|
||||
<el-input class="numkeyboard" v-model="newpassword" placeholder="请输入" show-password></el-input>
|
||||
</div>
|
||||
<div class="pin">
|
||||
<span>确认密码</span>
|
||||
<el-input class="numkeyboard" v-model="checkpassword" placeholder="请输入" show-password></el-input>
|
||||
</div>
|
||||
<div>
|
||||
<button class="Back" @click="go('home')">返回</button>
|
||||
<button class="Save" @click="SavePassword">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<script type="text/javascript" src="../utils/md5.js"></script>
|
||||
<script>
|
||||
import {
|
||||
updateUserPassword
|
||||
} from '@/api/api'
|
||||
|
||||
export default {
|
||||
name: 'ChangePassword',
|
||||
data(){
|
||||
return {
|
||||
oldpassword:'',
|
||||
newpassword:'',
|
||||
checkpassword:'',
|
||||
user_pwd:'',
|
||||
userId:''
|
||||
}
|
||||
},
|
||||
created(){
|
||||
var userInfo = JSON.parse(sessionStorage.LoginUser);
|
||||
this.user_pwd =userInfo.user_pwd
|
||||
this.userId =userInfo.user_id
|
||||
},
|
||||
methods: {
|
||||
go(res){
|
||||
switch (res) {
|
||||
case 'home':
|
||||
this.$router.push('/home');
|
||||
break
|
||||
}
|
||||
},
|
||||
SavePassword(){
|
||||
var that =this
|
||||
if(that.oldpassword =='' || that.newpassword ==''){
|
||||
that.$message({
|
||||
message: '请填写完整',
|
||||
type: 'warning'
|
||||
});
|
||||
return
|
||||
}
|
||||
if (that.newpassword != that.checkpassword) {
|
||||
that.$message({
|
||||
message: '确认密码不一致',
|
||||
type: 'warning'
|
||||
});
|
||||
return
|
||||
}
|
||||
if (that.$md5(that.oldpassword) != that.user_pwd) {
|
||||
that.$message({
|
||||
message: '原密码错误',
|
||||
type: 'warning'
|
||||
});
|
||||
return
|
||||
}
|
||||
const loading = that.$loading({
|
||||
lock: true,
|
||||
text: '更新用户密码...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
updateUserPassword({ userId: that.userId,userPwd:that.newpassword}).then(response => {
|
||||
console.log(response.data)
|
||||
var data=[]
|
||||
data =response.data
|
||||
if(data.status ==0){
|
||||
that.$message.error(data.message);
|
||||
}else{
|
||||
this.$router.push('/');
|
||||
}
|
||||
loading.close()
|
||||
})
|
||||
.catch(error => {
|
||||
loading.close()
|
||||
that.$message.error(error.message);
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.row{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.row >span{
|
||||
width: 96px;
|
||||
height: 31px;
|
||||
font-size: 24px;
|
||||
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
color: rgba(0,0,0,0.9);
|
||||
line-height: 31px;
|
||||
}
|
||||
.changetop{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 10%;
|
||||
}
|
||||
.changebox{
|
||||
width: 440px;
|
||||
height: 440px;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 3px 6px 1px rgba(0,0,0,0.1600);
|
||||
border-radius: 12px 12px 12px 12px;
|
||||
opacity: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 80%;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
}
|
||||
.pin{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-size: 14px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.6);
|
||||
}
|
||||
.P2{
|
||||
width: 64px;
|
||||
height: 21px;
|
||||
font-size: 16px;
|
||||
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
color: rgba(0,0,0,0.6000);
|
||||
line-height: 0px;
|
||||
}
|
||||
.el-input{
|
||||
width: 315px;
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
opacity: 1;
|
||||
border: 1px solid #DCDFE6;
|
||||
}
|
||||
.pin>span{
|
||||
width: 48px;
|
||||
height: 16px;
|
||||
font-size: 12px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.6);
|
||||
line-height: 0px;
|
||||
}
|
||||
.Save{
|
||||
width: 94px;
|
||||
height: 36px;
|
||||
background: #165DFF;
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
opacity: 1;
|
||||
font-size: 14px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
line-height: 0px;
|
||||
border:1px solid #F3F3F3;;
|
||||
}
|
||||
.Back{
|
||||
width: 94px;
|
||||
height: 36px;
|
||||
background: white;
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
opacity: 1;
|
||||
font-size: 14px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.6000);
|
||||
line-height: 0px;
|
||||
border:1px solid #F3F3F3;;
|
||||
}
|
||||
|
||||
</style>
|
@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<div class="homebox">
|
||||
<div class="homecard">
|
||||
<div class="homeleft" @click="go('shiyan')"></div>
|
||||
<div class="homeright" @click="go('clean')"></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Home",
|
||||
methods: {
|
||||
go(res) {
|
||||
switch (res) {
|
||||
case "clean":
|
||||
this.$router.push("/clean");
|
||||
break;
|
||||
case "shiyan":
|
||||
this.$router.push("/shiyan");
|
||||
break;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.homebox {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.homecard {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
height: 688px;
|
||||
width: 1024px;
|
||||
// background:red;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding-bottom: 60px;
|
||||
.homeleft {
|
||||
width: 340px;
|
||||
height: 440px;
|
||||
margin-right:30px;
|
||||
background: linear-gradient(
|
||||
136deg,
|
||||
rgba(255, 255, 255, 0.63) 0%,
|
||||
rgba(254, 254, 254, 0.95) 23%,
|
||||
rgba(255, 255, 255, 0.58) 100%
|
||||
);
|
||||
box-shadow: inset 4px 4px 16px 1px rgba(255, 255, 255, 0.8);
|
||||
border-radius: 20px 20px 20px 20px;
|
||||
opacity: 1;
|
||||
background-image: url("../assets/home/test.png");
|
||||
background-size: 100%;
|
||||
}
|
||||
.homeright {
|
||||
width: 340px;
|
||||
height: 440px;
|
||||
background: linear-gradient(
|
||||
136deg,
|
||||
#ffffff 0%,
|
||||
rgba(254, 254, 254, 0.7) 7%,
|
||||
rgba(255, 255, 255, 0.58) 100%
|
||||
);
|
||||
box-shadow: inset 4px 4px 16px 1px rgba(255, 255, 255, 0.8);
|
||||
border-radius: 20px 20px 20px 20px;
|
||||
opacity: 1;
|
||||
background-image: url("../assets/home/instrument.png");
|
||||
background-size: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<el-container class="container">
|
||||
<el-header class="header">
|
||||
<headers :user="user" :role="role"></headers>
|
||||
</el-header>
|
||||
<el-main class="main" >
|
||||
<views @user_header="getData"></views>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'App',
|
||||
components:{
|
||||
Headers: () => import('../components/Headers'),
|
||||
Views: () => import('../components/Views'),
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
user:'请登录',
|
||||
role:0
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
getData(res){
|
||||
this.user =res.real_name
|
||||
this.role =res.user_role
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#app {
|
||||
font-family: 'Avenir', Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: center;
|
||||
color: #2c3e50;
|
||||
}
|
||||
.container{
|
||||
display: flex;
|
||||
height: 100%;
|
||||
width:100%;
|
||||
flex-direction: column;
|
||||
}
|
||||
.header{
|
||||
height: 80px !important;
|
||||
width: 100%;
|
||||
padding: 0px;
|
||||
background: red;
|
||||
}
|
||||
.main{
|
||||
height:688px;
|
||||
width: 100%;
|
||||
background-image: url('../assets/home/bg.png');
|
||||
background-size:cover;
|
||||
}
|
||||
.el-header{
|
||||
padding:0px
|
||||
}
|
||||
</style>
|
@ -0,0 +1,159 @@
|
||||
<template>
|
||||
<div class="loginbox">
|
||||
<!-- <div class="left_card">
|
||||
<img style="height:100%;width:100%" src="../../static/icon/登录配图.png" alt="">
|
||||
</div> -->
|
||||
<div class="contain">
|
||||
<div style="display: flex; flex-direction: column">
|
||||
<span class="title">用户名</span>
|
||||
<el-input
|
||||
class="numkeyboard"
|
||||
size="medium"
|
||||
v-model="username"
|
||||
placeholder="请输入用户名"
|
||||
></el-input>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column; margin-top: 10px">
|
||||
<span class="title">密码</span>
|
||||
<el-input
|
||||
class="numkeyboard"
|
||||
size="medium"
|
||||
v-model="password"
|
||||
placeholder="请输入密码"
|
||||
show-password
|
||||
></el-input>
|
||||
</div>
|
||||
<el-row>
|
||||
<button @click="Login" class="Btlogin">登录</button>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="footer">
|
||||
COPYRIGHT © 2022 杭州研一智控科技有限公司 版权所有
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { userLogin } from "@/api/api";
|
||||
|
||||
export default {
|
||||
name: "Login",
|
||||
data() {
|
||||
return {
|
||||
username: "admin",
|
||||
password: "123456",
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
go(res) {
|
||||
switch (res) {
|
||||
case "home":
|
||||
this.$router.push("/home");
|
||||
break;
|
||||
}
|
||||
},
|
||||
Login() {
|
||||
var that = this;
|
||||
if (that.username == "" || that.password == "") {
|
||||
that.$message({
|
||||
message: "请填写账号,密码",
|
||||
type: "warning",
|
||||
});
|
||||
} else {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: "登陆中...",
|
||||
spinner: "el-icon-loading",
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
});
|
||||
userLogin({ user_name: this.username, password: this.password })
|
||||
.then((response) => {
|
||||
console.log(response.data);
|
||||
let data = response.data;
|
||||
if (data.status == 1) {
|
||||
that.$message.error(data.message);
|
||||
} else {
|
||||
if (data.data.is_enabled == 1) {
|
||||
sessionStorage.LoginUser = JSON.stringify(data.data);
|
||||
this.$emit("send_user", data.data);
|
||||
that.go("home");
|
||||
} else {
|
||||
that.$message.error("账户禁用");
|
||||
}
|
||||
}
|
||||
loading.close();
|
||||
})
|
||||
.catch((error) => {
|
||||
loading.close();
|
||||
that.$message.error(error.message);
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped >
|
||||
.loginbox {
|
||||
width: 1024px;
|
||||
height: 658px;
|
||||
box-shadow: 24px 24px 24px 1px rgba(14, 66, 210, 0.08);
|
||||
border-radius: 8px 8px 8px 8px;
|
||||
padding-top:128px;
|
||||
.contain {
|
||||
width:480px;
|
||||
margin:0 auto;
|
||||
// margin:128px auto 0;
|
||||
text-align: left;
|
||||
.title{
|
||||
font-size:28px;
|
||||
margin-bottom:15px;
|
||||
color:#666666;
|
||||
}
|
||||
.numkeyboard{
|
||||
width:480px;
|
||||
.el-input__inner{
|
||||
height:80px !important;
|
||||
}
|
||||
|
||||
}
|
||||
.Btlogin{
|
||||
width:480px;
|
||||
height: 100px;
|
||||
border:0;
|
||||
background: linear-gradient(180deg, #FF7B83 0%, #850006 100%);
|
||||
box-shadow: 0px 3px 6px 1px rgba(0,0,0,0.4);
|
||||
border-radius: 8px 8px 8px 8px;
|
||||
opacity: 1;
|
||||
font-size: 40px;
|
||||
color: #FFFFFF;
|
||||
margin-top:50px;
|
||||
}
|
||||
}
|
||||
.footer{
|
||||
margin:62px auto 0;
|
||||
width: 630px;
|
||||
height: 31px;
|
||||
font-size: 24px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: #C3C3C3;
|
||||
line-height: 36px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
<style>
|
||||
.loginbox .el-input--medium .el-input__inner {
|
||||
width: 480px;
|
||||
height: 80px;
|
||||
background: #FFFFFF;
|
||||
box-shadow: inset 0px 3px 6px 1px rgba(0,0,0,0.16);
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
opacity: 1;
|
||||
border: 1px solid #DCDCDC;
|
||||
font-size: 32px;
|
||||
font-weight: 400;
|
||||
color: #3A3A3A;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,363 @@
|
||||
<template>
|
||||
<div class="reportbox">
|
||||
<div class="reporttop">
|
||||
<div class="row" @click="go('reportlist')">
|
||||
<i class="el-icon-arrow-left"></i>
|
||||
<span>试验信息</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-button size="middle" style="margin-left: 10px;" @click="del">删除</el-button>
|
||||
<el-button size="middle" style="margin-left: 10px;" type="primary" icon="el-icon-upload2" @click="exreport">导出当前报表</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class='reportcard1'>
|
||||
<div style="width: 34%;display: flex;flex-direction: column;justify-content: space-between;">
|
||||
<div style="height: 38%;width: 100%;box-shadow: 4px 4px 8px 1px rgba(0,0,0,0.08);border-radius: 8px 8px 8px 8px;opacity: 1;">
|
||||
<el-card :body-style="{ padding: '0px' }" style="height:100%">
|
||||
<div slot="header" class="clearfix infoheader">
|
||||
<span>样品名称:{{item.material_name}}</span>
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="textitem" style="height:70%">
|
||||
<li>试验编号:{{item.experiment_code}}</li>
|
||||
<li>温度点:{{item.control_temp_list}}℃</li>
|
||||
</div>
|
||||
<div style="margin:0px 20px 20px 20px;padding-top:20px;border-top: 1px solid #EBEEF5;">
|
||||
<div class="clearfix cardfooter">
|
||||
<div style="align-items: center;display: flex;">
|
||||
<img style="width: 20px;height: 20px;background: #FFECEC;opacity: 1;border-radius: 50%;margin-right: 10px;" src="../../static/icon/普通用户头像.png" alt="">
|
||||
<span>{{item.experiment_user_name}}</span>
|
||||
</div>
|
||||
<time class="time">{{item.end_time}}</time>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
<div style="background-color:white;height: 58%;width: 100%;box-shadow: 4px 4px 8px 1px rgba(0,0,0,0.08);border-radius: 8px 8px 8px 8px;opacity: 1;">
|
||||
<div style="height:18%;display: flex;align-items: center;padding-left:20px;padding-right: 20px;">
|
||||
<p>更多试验</p>
|
||||
</div>
|
||||
<div style="height:100%;max-height:82%;overflow:auto;">
|
||||
<div v-for="(item, key, index) in data" :key="index" style="width:100%;" @click="go('reportinfo',item)">
|
||||
<el-card :body-style="{ padding: '0px' }" shadow="never" style="border:0px !important">
|
||||
<div style="margin:0px 20px 20px 20px;border-bottom: 1px solid #EBEEF5;height: 40px;">
|
||||
<div class="bottom clearfix">
|
||||
<span>{{item.material_name}}</span>
|
||||
<div style="display:flex">
|
||||
<img style="width: 20px;height: 20px;background: #FFECEC;opacity: 1;border-radius: 50%;margin-right: 10px;" src="../../static/icon/普通用户头像.png" alt="">
|
||||
<span>{{item.experiment_user_name}}</span>
|
||||
</div>
|
||||
<time class="time">{{item.end_time}}</time>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="background:white;height: 100%;width: 65%;opacity: 1;box-shadow: 4px 4px 8px 1px rgba(0,0,0,0.08);border-radius: 8px 8px 8px 8px;">
|
||||
<div style="height:10%;display: flex;align-items: center;padding-left:20px;padding-right: 20px;">
|
||||
<p>结果记录</p>
|
||||
</div>
|
||||
<div class='resulttable'>
|
||||
<el-table :header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
ref="table"
|
||||
:row-style="{height: '64px'}"
|
||||
:header-row-style="{height:'64px'}"
|
||||
:data="tableData"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="mb"
|
||||
label="目标温度(℃)"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sy"
|
||||
label="水浴温度(℃)">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="yl"
|
||||
label="压力值(pa)">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="ym"
|
||||
label="液面像素差(mm)">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getExperimentInfo,
|
||||
getExperimentList,
|
||||
deleteExperiment,
|
||||
exportReport
|
||||
} from '@/api/api'
|
||||
|
||||
export default {
|
||||
name: 'ReportInfo',
|
||||
data() {
|
||||
return {
|
||||
data:[],
|
||||
item:[],
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
created(){
|
||||
let item =this.$route.query.item
|
||||
this.item =item
|
||||
this.get_List()
|
||||
this.get_List2()
|
||||
},
|
||||
methods: {
|
||||
go(res,value){
|
||||
switch (res) {
|
||||
case 'reportlist':
|
||||
this.$router.push('/reportlist');
|
||||
break
|
||||
case 'reportinfo':
|
||||
this.item =value
|
||||
this.get_List()
|
||||
break
|
||||
}
|
||||
},
|
||||
del(){
|
||||
var that =this
|
||||
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
center: true
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '删除数据...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
deleteExperiment({ experiment_id: this.item.experiment_id}).then(response => {
|
||||
console.log(response.data)
|
||||
let data=[]
|
||||
data =response.data
|
||||
if(data.status ==0){
|
||||
that.$message.error(data.message);
|
||||
}else{
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
that.go('reportlist')
|
||||
}
|
||||
loading.close()
|
||||
})
|
||||
.catch(error => {
|
||||
loading.close()
|
||||
that.$message.error(error.message);
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
});
|
||||
});
|
||||
},
|
||||
exreport(){
|
||||
var that =this
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '导出报表...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
exportReport({ experiment_id: this.item.experiment_id}).then(response => {
|
||||
console.log(response.data)
|
||||
let data=[]
|
||||
data =response.data
|
||||
if(data.status ==0){
|
||||
that.$message.error(data.message);
|
||||
}else{
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '导出成功!'
|
||||
});
|
||||
}
|
||||
loading.close()
|
||||
})
|
||||
.catch(error => {
|
||||
loading.close()
|
||||
that.$message.error(error.message);
|
||||
})
|
||||
},
|
||||
get_List(){
|
||||
var that =this
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '获取详细数据...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
getExperimentInfo({ experiment_id: this.item.experiment_id}).then(response => {
|
||||
console.log(response.data)
|
||||
let data=[]
|
||||
data =response.data
|
||||
if(data.status ==0){
|
||||
that.$message.error(data.message);
|
||||
}else{
|
||||
let datalist =[]
|
||||
for (var i=0;i<data.data[1].length;i++){
|
||||
let re=JSON.parse(data.data[2][3 * i +3])
|
||||
for (var n=0;n<re.length;n++){
|
||||
let temp ={"mb":re[n][5],"sy":re[n][2],'yl':re[n][3],'ym':re[n][6]}
|
||||
datalist.push(temp)
|
||||
}
|
||||
}
|
||||
that.tableData =datalist
|
||||
}
|
||||
loading.close()
|
||||
})
|
||||
.catch(error => {
|
||||
loading.close()
|
||||
that.$message.error(error.message);
|
||||
})
|
||||
},
|
||||
get_List2(){
|
||||
var that =this
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '获取历史数据列表...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
getExperimentList({ searchValue: ''}).then(response => {
|
||||
console.log(response.data)
|
||||
let data=[]
|
||||
data =response.data
|
||||
if(data.status ==0){
|
||||
that.$message.error(data.message);
|
||||
}else{
|
||||
that.data =data.data
|
||||
}
|
||||
loading.close()
|
||||
})
|
||||
.catch(error => {
|
||||
loading.close()
|
||||
that.$message.error(error.message);
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.reportbox{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.reporttop{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 10%;
|
||||
}
|
||||
.reportcard1{
|
||||
height: 85%;
|
||||
max-height:85%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.row{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.row >span{
|
||||
width: 96px;
|
||||
height: 31px;
|
||||
font-size: 24px;
|
||||
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
color: rgba(0,0,0,0.9);
|
||||
line-height: 31px;
|
||||
}
|
||||
.resulttable{
|
||||
height: 90%;
|
||||
background-color: white;
|
||||
max-height:100%;
|
||||
overflow:auto;
|
||||
padding-left:20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
p{
|
||||
font-size: 20px;
|
||||
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
color: rgba(0,0,0,0.6);
|
||||
line-height: 0px;
|
||||
}
|
||||
.el-card__header{
|
||||
border: 0px;
|
||||
height: 20%;
|
||||
}
|
||||
.el-card__body{
|
||||
height: 80%;
|
||||
}
|
||||
.clearfix{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.infoheader{
|
||||
width: 152px;
|
||||
height: 26px;
|
||||
font-size: 20px;
|
||||
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
color: rgba(0,0,0,0.6);
|
||||
}
|
||||
li{
|
||||
width: 316px;
|
||||
height: 21px;
|
||||
font-size: 16px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.6);
|
||||
text-align: start;
|
||||
padding-top: 10px;
|
||||
}
|
||||
.cardfooter{
|
||||
height: 21px;
|
||||
font-size: 16px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.9);
|
||||
}
|
||||
.time{
|
||||
font-size: 14px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.4);
|
||||
}
|
||||
.textitem{
|
||||
font-size: 24px;
|
||||
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
color: rgba(0,0,0,0.6);
|
||||
padding-left: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,42 @@
|
||||
<template>
|
||||
<div class="reportbox2">
|
||||
<div class="reporttop">
|
||||
<span >数据详情</span>
|
||||
</div>
|
||||
<fourStep :isShow="isShow"></fourStep>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import fourStep from './components/fourStep.vue';
|
||||
|
||||
export default {
|
||||
name: 'ReportInfo',
|
||||
components:{
|
||||
fourStep
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShow:false
|
||||
}
|
||||
},
|
||||
created(){
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="less">
|
||||
.reportbox2{
|
||||
.reporttop{
|
||||
height:70px;
|
||||
font-size: 40px;
|
||||
font-weight: bold;
|
||||
color: #3A3A3A;
|
||||
text-align: center;
|
||||
padding-top:14px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,317 @@
|
||||
<template>
|
||||
<div class="reportList">
|
||||
<div class="usertop">
|
||||
<el-date-picker
|
||||
@change="get_List"
|
||||
v-model="value2"
|
||||
value-format="yyyy-MM"
|
||||
type="month"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
<span class="title">数据报表</span>
|
||||
<el-select v-model="standard" clearable placeholder="请选择" class="custom-select">
|
||||
<el-option
|
||||
@change="get_List"
|
||||
v-for="item in standards"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="usertable">
|
||||
<el-input
|
||||
class="numkeyboard"
|
||||
v-model="searchValue"
|
||||
size="middle"
|
||||
@blur="get_List"
|
||||
placeholder="搜索用户"
|
||||
></el-input>
|
||||
<el-table
|
||||
class="table"
|
||||
:header-cell-style="{ background: '#eef1f6', color: '#606266' }"
|
||||
:row-style="{ height: '64px' }"
|
||||
:header-row-style="{ height: '64px' }"
|
||||
ref="table"
|
||||
:data="tableData"
|
||||
height="385"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
class="checkbox-column"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_name" label="名称" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="flash_point_value" label="温度"> </el-table-column>
|
||||
<el-table-column prop="determination_standard" label="标准" width="280"> </el-table-column>
|
||||
<el-table-column prop="create_time" label="时间" width="280"> </el-table-column>
|
||||
</el-table>
|
||||
<div class="footer">
|
||||
<div class="goBack" @click="handBack">返回</div>
|
||||
<el-pagination
|
||||
class="pagination"
|
||||
background
|
||||
v-model="params.page"
|
||||
@current-change="get_List"
|
||||
layout="total,prev, pager, next"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
<div class="add" @click="handExport">导出</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getExperimentList,exportReportList } from "@/api/report";
|
||||
|
||||
export default {
|
||||
name: "Login",
|
||||
data() {
|
||||
return {
|
||||
total:0,
|
||||
selectValue:'',
|
||||
value2: '',
|
||||
params:{
|
||||
page:1,
|
||||
page_size:10
|
||||
},
|
||||
standard:'ASTM D6450(1ml)',
|
||||
standards:[
|
||||
{
|
||||
value:'ASTM D6450(1ml)',
|
||||
label:'ASTM D6450(1ml)'
|
||||
},
|
||||
{
|
||||
value:'ASTM D7094(2ml)',
|
||||
label:'ASTM D7094(2ml)'
|
||||
},
|
||||
{
|
||||
value:'SH/T 0768(1ml)',
|
||||
label:'SH/T 0768(1ml)'
|
||||
},
|
||||
],
|
||||
searchValue: "",
|
||||
tableData: [
|
||||
],
|
||||
multipleSelection: []
|
||||
};
|
||||
},
|
||||
created: function () {
|
||||
this.get_List();
|
||||
},
|
||||
methods: {
|
||||
get_List() {
|
||||
var that = this;
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: "获取数据报表...",
|
||||
spinner: "el-icon-loading",
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
});
|
||||
let data={
|
||||
searchValue: this.searchValue,
|
||||
choose_date:this.value2,
|
||||
determination_standard:this.standard,
|
||||
page:this.params.page,
|
||||
page_size:this.params.page_size
|
||||
}
|
||||
getExperimentList(data)
|
||||
.then((response) => {
|
||||
if (data.status == 1) {
|
||||
that.$message.error(data.message);
|
||||
} else {
|
||||
console.log(response.data,'返回数据2')
|
||||
that.tableData=response.data.data.data
|
||||
this.total=response.data.data.total_records
|
||||
// that.changedata(data.data);
|
||||
}
|
||||
loading.close();
|
||||
})
|
||||
.catch((error) => {
|
||||
loading.close();
|
||||
that.$message.error(error.message);
|
||||
});
|
||||
},
|
||||
handBack(){
|
||||
window.history.go('-1')
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
// this.multipleSelection = val;
|
||||
this.multipleSelection=[];
|
||||
this.multipleSelection=val.map(item=>item.experiment_id)
|
||||
console.log(this.multipleSelection,'选中参数',val)
|
||||
},
|
||||
handExport(){
|
||||
let data={
|
||||
experiment_id:this.multipleSelection
|
||||
}
|
||||
exportReportList(data).then(response=>{
|
||||
console.log(response,'导出成功')
|
||||
})
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
/* //复选框的大小 */
|
||||
.checkbox-column .cell {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
.reportList .el-checkbox__inner{
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
.reportList .el-checkbox__inner::after{
|
||||
height: 14px;
|
||||
left: 10px;
|
||||
}
|
||||
/* 表头修改 */
|
||||
.usertop{
|
||||
/* margin-top:14px; */
|
||||
}
|
||||
.reportList .el-input__icon{
|
||||
font-size: 30px !important;
|
||||
line-height:82px;
|
||||
}
|
||||
.reportList .el-input__inner{
|
||||
font-size: 24px;
|
||||
color: #3A3A3A;
|
||||
|
||||
}
|
||||
.reportList .el-date-editor .el-input__inner,.el-select .el-input__inner{
|
||||
border:0;
|
||||
background:none;
|
||||
}
|
||||
.el-select-dropdown__item{
|
||||
height: 68px;
|
||||
font-size: 28px;
|
||||
color: #3A3A3A;
|
||||
line-height: 34px;
|
||||
}
|
||||
.el-month-table{
|
||||
font-size: 20px;
|
||||
}
|
||||
/* 搜索框样式修改 */
|
||||
.reportList .el-input__inner {
|
||||
text-indent: 20px;
|
||||
height: 80px !important;
|
||||
}
|
||||
/* 表格样式修改 */
|
||||
.reportList .el-table__header .el-table__cell{
|
||||
font-weight: 400;
|
||||
background: #F3F3F3
|
||||
}
|
||||
.reportList .el-table .el-table__cell{
|
||||
font-size: 24px;
|
||||
color: #3A3A3A;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.custom-select .el-input .el-input__inner,
|
||||
.custom-select .el-input .el-input__inner:hover,
|
||||
.custom-select .el-input .el-input__inner:focus {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
/* .custom-select .el-input .el-select__caret {
|
||||
display: none;
|
||||
} */
|
||||
/* 分页 */
|
||||
.reportList .el-pagination .el-pagination__total{
|
||||
font-size:24px;
|
||||
line-height:40px;
|
||||
}
|
||||
.reportList .el-pagination .btn-prev,.reportList .el-pagination .btn-next{
|
||||
width:40px;
|
||||
height:40px;
|
||||
}
|
||||
.reportList .el-pager li{
|
||||
width:40px;
|
||||
height:40px;
|
||||
margin:0 10px !important;
|
||||
line-height: 40px;
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
|
||||
.reportList {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.numkeyboard {
|
||||
width: 944px;
|
||||
height: 80px;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
|
||||
.el-input__inner {
|
||||
height: 80px !important;
|
||||
}
|
||||
}
|
||||
.usertop {
|
||||
height: 95px;
|
||||
font-size: 40px;
|
||||
font-weight: bold;
|
||||
color: #3a3a3a;
|
||||
line-height: 91px;
|
||||
padding:0 40px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.usertable {
|
||||
margin: 0 auto;
|
||||
.table{
|
||||
width:944px;
|
||||
margin: 20px auto 0;
|
||||
.img{
|
||||
width:58px;
|
||||
height:58px
|
||||
}
|
||||
}
|
||||
.footer{
|
||||
width: 1024px;
|
||||
padding:0 40px;
|
||||
height: 120px;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px -3px 6px 1px rgba(0,0,0,0.16);
|
||||
border-radius: 0px 0px 0px 0px;
|
||||
display:flex;
|
||||
justify-content: space-between;
|
||||
padding-top:12px;
|
||||
.pagination{
|
||||
margin-top:30px;
|
||||
}
|
||||
.goBack{
|
||||
width: 208px;
|
||||
height: 84px;
|
||||
background: linear-gradient(180deg, #FFFFFF 0%, #ECECEC 100%);
|
||||
box-shadow: 0px 3px 6px 1px rgba(0,0,0,0.16);
|
||||
border-radius: 8px 8px 8px 8px;
|
||||
font-size: 36px;
|
||||
line-height:84px;
|
||||
color: #3A3A3A;
|
||||
text-align: center;
|
||||
}
|
||||
.add{
|
||||
width: 208px;
|
||||
height: 84px;
|
||||
background: linear-gradient(180deg, #59CC74 0%, #10922F 100%);
|
||||
box-shadow: 0px 3px 6px 1px rgba(0,0,0,0.4);
|
||||
border-radius: 8px 8px 8px 8px;
|
||||
font-size: 36px;
|
||||
line-height:84px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
@ -0,0 +1,218 @@
|
||||
<template>
|
||||
<div class="reportbox">
|
||||
<div class="reporttop">
|
||||
<div class="row" @click="go('home','')">
|
||||
<i class="el-icon-arrow-left"></i>
|
||||
<span>报表数据</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-date-picker
|
||||
size="middle"
|
||||
v-model="date"
|
||||
type="date"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
<el-input class="numkeyboard" size="middle" style="margin-left: 10px;" v-model="searchValue" placeholder="搜索样品编号,试验编号,试验人"></el-input>
|
||||
<el-button size="middle" style="margin-left: 10px;" type="primary" icon="el-icon-search" @click="get_List">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class='reportcard'>
|
||||
<div style="display: grid; width: 100%;grid-template-columns: repeat(auto-fill, 289px);grid-gap: 22px;justify-content: center;">
|
||||
<div v-for="(item, key, index) in data" :key="index" style="width:100%;" @click="go('reportinfo',item)">
|
||||
<el-card :body-style="{ padding: '0px' }">
|
||||
<div slot="header" class="clearfix cardheader">
|
||||
<span>试验编号:{{item.experiment_code}}</span>
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="textitem">
|
||||
{{item.material_name}}
|
||||
</div>
|
||||
<div style="margin:0px 20px 20px 20px;padding-top:20px;border-top: 1px solid #EBEEF5;">
|
||||
<div class="clearfix cardfooter">
|
||||
<div style="align-items: center;display: flex;justify-content: center;">
|
||||
<img style="width: 20px;height: 20px;background: #FFECEC;opacity: 1;border-radius: 50%;margin-right: 10px;" src="../../static/icon/普通用户头像.png" alt="">
|
||||
<!-- <img style="width: 20px;height: 20px;background: #FFECEC;opacity: 1;border-radius: 50%;margin-right: 10px;" src="../../static/icon/管理员头像.png" alt=""></img> -->
|
||||
<span>{{item.experiment_user_name}}</span>
|
||||
</div>
|
||||
<time class="time">{{item.end_time}}</time>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getExperimentList,
|
||||
} from '@/api/api'
|
||||
|
||||
export default {
|
||||
name: 'ReportList',
|
||||
data() {
|
||||
return {
|
||||
searchValue:"",
|
||||
data:[],
|
||||
date:''
|
||||
}
|
||||
},
|
||||
created:function(){
|
||||
this.get_List()
|
||||
},
|
||||
methods: {
|
||||
go(res,value){
|
||||
switch (res) {
|
||||
case 'home':
|
||||
this.$router.push('/home');
|
||||
break
|
||||
case 'reportinfo':
|
||||
console.log(value,'122')
|
||||
this.$router.push({path:'/reportinfo',query:{item:value}});
|
||||
break
|
||||
}
|
||||
},
|
||||
get_List(){
|
||||
var that =this
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '获取历史数据列表...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
getExperimentList({ searchValue: this.searchValue}).then(response => {
|
||||
console.log(response.data)
|
||||
let data=[]
|
||||
data =response.data
|
||||
if(data.status ==0){
|
||||
that.$message.error(data.message);
|
||||
}else{
|
||||
that.data =data.data
|
||||
}
|
||||
loading.close()
|
||||
})
|
||||
.catch(error => {
|
||||
loading.close()
|
||||
that.$message.error(error.message);
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.reportbox{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.reporttop{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 10%;
|
||||
}
|
||||
.reportcard{
|
||||
height: 80%;
|
||||
max-height:80%;
|
||||
overflow:auto;
|
||||
}
|
||||
|
||||
.cardbox{
|
||||
width: 100%;
|
||||
height: 172px;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 4px 4px 8px 1px rgba(0,0,0,0.08);
|
||||
border-radius: 8px 8px 8px 8px;
|
||||
opacity: 1;
|
||||
}
|
||||
.row{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.row >span{
|
||||
width: 96px;
|
||||
height: 31px;
|
||||
font-size: 24px;
|
||||
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
color: rgba(0,0,0,0.9);
|
||||
line-height: 31px;
|
||||
}
|
||||
.el-input{
|
||||
width: 312px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
opacity: 1;
|
||||
border: 1px solid #DCDFE6;
|
||||
}
|
||||
.el-button--primary {
|
||||
background: #165DFF !important;
|
||||
border-color: #165DFF !important;
|
||||
}
|
||||
.el-button--primary:hover {
|
||||
background: #165DFF !important;
|
||||
border-color: #165DFF !important;
|
||||
color: #FFF !important;
|
||||
opacity: 0.8;
|
||||
}
|
||||
.el-button--default {
|
||||
background: #FFFFFF !important;
|
||||
border-color: #E4E7ED !important;
|
||||
color: #165DFF !important;
|
||||
}
|
||||
.el-button--default:hover {
|
||||
background: #fff !important;
|
||||
border-color: #E4E7ED !important;
|
||||
color: #165DFF !important;
|
||||
opacity: 0.8;
|
||||
}
|
||||
.box-card {
|
||||
width: 480px;
|
||||
}
|
||||
.clearfix{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.cardheader{
|
||||
width: 134px;
|
||||
height: 19px;
|
||||
font-size: 14px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.6);
|
||||
line-height: 20px;
|
||||
}
|
||||
.cardfooter{
|
||||
height: 21px;
|
||||
font-size: 16px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.9);
|
||||
}
|
||||
.time{
|
||||
font-size: 14px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: rgba(0,0,0,0.4);
|
||||
height: 21px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.textitem{
|
||||
height: 60px;
|
||||
font-size: 24px;
|
||||
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
color: rgba(0,0,0,0.6);
|
||||
line-height: 60px;
|
||||
}
|
||||
.el-card__header{
|
||||
border: 0px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,335 @@
|
||||
<template>
|
||||
<div class="userbox">
|
||||
<!-- <div class="usertop">
|
||||
<div class="row" @click="go('home')">
|
||||
<i class="el-icon-arrow-left"></i>
|
||||
<span>用户管理</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-input class="numkeyboard" v-model="searchValue" size="middle" placeholder="搜索用户..."></el-input>
|
||||
<el-button style="margin-left: 10px;" type="primary" size="middle" icon="el-icon-search" @click="get_List">搜索</el-button>
|
||||
<el-button size="middle" icon="el-icon-plus" @click="go('add')">新增用户</el-button>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="usertop">
|
||||
<span class="title">用户管理</span>
|
||||
</div>
|
||||
|
||||
<div class="usertable">
|
||||
<el-input
|
||||
class="numkeyboard"
|
||||
v-model="searchValue"
|
||||
@input="handSearch"
|
||||
size="middle"
|
||||
placeholder="搜索用户"
|
||||
></el-input>
|
||||
<el-table
|
||||
class="table"
|
||||
:header-cell-style="{ background: '#eef1f6', color: '#606266' }"
|
||||
:row-style="{ height: '64px' }"
|
||||
:header-row-style="{ height: '64px' }"
|
||||
ref="table"
|
||||
:data="tableData"
|
||||
height="385"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="user_name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="user_sex" label="性别"> </el-table-column>
|
||||
<el-table-column prop="user_role" label="角色"> </el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<img
|
||||
src="@/assets/userManage/edit.png"
|
||||
class="img"
|
||||
@click="handleEdit(scope.$index, scope.row)"
|
||||
alt=""
|
||||
/>
|
||||
<img
|
||||
src="@/assets/userManage/delete.png"
|
||||
class="img"
|
||||
@click="handleDelete(scope.$index, scope.row)"
|
||||
alt=""
|
||||
/>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="footer">
|
||||
<div class="goBack" @click="handBack">返回</div>
|
||||
<el-pagination
|
||||
class="pagination"
|
||||
background
|
||||
v-model="params.page"
|
||||
@current-change="get_List"
|
||||
layout="total,prev, pager, next"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
<div class="add" @click="handAdd">新增用户</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserList,deleteUserInfo } from "@/api/user";
|
||||
|
||||
export default {
|
||||
name: "Login",
|
||||
data() {
|
||||
return {
|
||||
searchValue: "",
|
||||
total:0,
|
||||
params:{
|
||||
page:1,
|
||||
page_size:10
|
||||
},
|
||||
tableData: [
|
||||
// {
|
||||
// user_name:'王二小',
|
||||
// user_sex:1,
|
||||
// user_role:1
|
||||
// }
|
||||
],
|
||||
};
|
||||
},
|
||||
created: function () {
|
||||
this.get_List();
|
||||
},
|
||||
methods: {
|
||||
go(res) {
|
||||
switch (res) {
|
||||
case "add":
|
||||
this.$router.push("/adduser?userId=" + "0");
|
||||
break;
|
||||
case "home":
|
||||
this.$router.push("/home");
|
||||
break;
|
||||
}
|
||||
},
|
||||
changedata(data) {
|
||||
var that = this;
|
||||
data.forEach((item) => {
|
||||
if (item.user_sex === 1) {
|
||||
item.user_sex = "男";
|
||||
} else {
|
||||
item.user_sex = "女";
|
||||
}
|
||||
if (item.user_role === 1) {
|
||||
item.user_role = "管理员";
|
||||
} else {
|
||||
item.user_role = "普通用户";
|
||||
}
|
||||
});
|
||||
that.tableData = data;
|
||||
},
|
||||
get_List() {
|
||||
var that = this;
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: "获取用户列表...",
|
||||
spinner: "el-icon-loading",
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
});
|
||||
let data={
|
||||
search_value: this.searchValue,
|
||||
user_id:JSON.parse(sessionStorage.LoginUser).user_id,
|
||||
page:this.params.page,
|
||||
page_size:10
|
||||
|
||||
}
|
||||
getUserList(data)
|
||||
.then((response) => {
|
||||
console.log(response.data.data,'用户列表2',this.tableData);
|
||||
that.changedata(response.data.data.data);
|
||||
that.total=response.data.data.total_records;
|
||||
loading.close();
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
loading.close();
|
||||
that.$message.error(error.message);
|
||||
});
|
||||
},
|
||||
handleEdit(index, res) {
|
||||
this.$router.push("/adduser?userId=" + res.user_id);
|
||||
},
|
||||
handBack(){
|
||||
console.log('返回')
|
||||
window.history.go('-1')
|
||||
},
|
||||
handAdd(){
|
||||
this.$router.push("/adduser");
|
||||
},
|
||||
handleDelete(index,row){
|
||||
console.log(index,'参数',row)
|
||||
var that = this;
|
||||
this.$confirm('您确定要退出程序吗!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
center: true
|
||||
}).then(() => {
|
||||
let data={
|
||||
user_id:row.user_id,
|
||||
}
|
||||
deleteUserInfo(data)
|
||||
.then((response) => {
|
||||
that.$message.success('删除成功');
|
||||
that.get_List()
|
||||
console.log(response.data,'删除');
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
that.$message.error(error.message);
|
||||
});
|
||||
})
|
||||
|
||||
},
|
||||
handSearch(){
|
||||
get_List()
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
/* 搜索框样式修改 */
|
||||
.userbox .el-input__inner {
|
||||
height: 80px !important;
|
||||
}
|
||||
/* 表格样式修改 */
|
||||
.userbox .el-table__header .el-table__cell{
|
||||
font-weight: 400;
|
||||
background: #F3F3F3
|
||||
}
|
||||
.userbox .el-table .el-table__cell{
|
||||
font-size: 24px;
|
||||
color: #3A3A3A;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
.userbox {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.numkeyboard {
|
||||
width: 944px;
|
||||
height: 80px;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
|
||||
.el-input__inner {
|
||||
height: 80px !important;
|
||||
}
|
||||
}
|
||||
.usertop {
|
||||
height: 95px;
|
||||
text-align: center;
|
||||
font-size: 40px;
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #3a3a3a;
|
||||
line-height: 91px;
|
||||
text-align: center;
|
||||
}
|
||||
.usertable {
|
||||
margin: 0 auto;
|
||||
.table{
|
||||
width:944px;
|
||||
margin: 0 auto;
|
||||
.img{
|
||||
width:58px;
|
||||
height:58px
|
||||
}
|
||||
}
|
||||
.footer{
|
||||
width: 1024px;
|
||||
padding:0 40px;
|
||||
height: 120px;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px -3px 6px 1px rgba(0,0,0,0.16);
|
||||
border-radius: 0px 0px 0px 0px;
|
||||
display:flex;
|
||||
justify-content: space-between;
|
||||
padding-top:12px;
|
||||
.pagination{
|
||||
margin-top:30px;
|
||||
}
|
||||
.goBack{
|
||||
width: 208px;
|
||||
height: 84px;
|
||||
background: linear-gradient(180deg, #FFFFFF 0%, #ECECEC 100%);
|
||||
box-shadow: 0px 3px 6px 1px rgba(0,0,0,0.16);
|
||||
border-radius: 8px 8px 8px 8px;
|
||||
font-size: 36px;
|
||||
line-height:84px;
|
||||
color: #3A3A3A;
|
||||
text-align: center;
|
||||
}
|
||||
.add{
|
||||
width: 208px;
|
||||
height: 84px;
|
||||
background: linear-gradient(180deg, #FF7B83 0%, #850006 100%);
|
||||
box-shadow: 0px 3px 6px 1px rgba(0,0,0,0.4);
|
||||
border-radius: 8px 8px 8px 8px;
|
||||
font-size: 36px;
|
||||
line-height:84px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.row > span {
|
||||
width: 96px;
|
||||
height: 31px;
|
||||
font-size: 24px;
|
||||
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
color: rgba(0, 0, 0, 0.9);
|
||||
line-height: 31px;
|
||||
}
|
||||
.el-input {
|
||||
width: 312px;
|
||||
background: #ffffff;
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
opacity: 1;
|
||||
border: 1px solid #dcdfe6;
|
||||
}
|
||||
.el-button--primary {
|
||||
background: #165dff !important;
|
||||
border-color: #165dff !important;
|
||||
}
|
||||
.el-button--primary:hover {
|
||||
background: #165dff !important;
|
||||
border-color: #165dff !important;
|
||||
color: #fff !important;
|
||||
opacity: 0.8;
|
||||
}
|
||||
.el-button--default {
|
||||
background: #ffffff !important;
|
||||
border-color: #e4e7ed !important;
|
||||
color: #165dff !important;
|
||||
}
|
||||
.el-button--default:hover {
|
||||
background: #fff !important;
|
||||
border-color: #e4e7ed !important;
|
||||
color: #165dff !important;
|
||||
opacity: 0.8;
|
||||
}
|
||||
.el-table .cell {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<div class="userbox">
|
||||
<div class="usertop">
|
||||
<span class="title">自动清除</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div v-if="step=='1'" class="step">
|
||||
<img class='img' style="height:164;width:164px" src="@/assets/clean/step1-ongoing.png" alt="">
|
||||
<span class="sharp"></span>
|
||||
<img class='img' style="height:164;width:164px" src="@/assets/clean/step2-ready.png" alt="">
|
||||
<span class="sharp"></span>
|
||||
<img class='img' style="height:164;width:164px" src="@/assets/clean/step3-ready.png" alt="">
|
||||
<span class="sharp"></span>
|
||||
<img class='img' style="height:164;width:164px" src="@/assets/clean/step4-ready.png" alt="">
|
||||
</div>
|
||||
<div v-if="step=='2'" class="step">
|
||||
<img class='img' style="height:164;width:164px" src="@/assets/clean/step1-done.png" alt="">
|
||||
<span class="sharp"></span>
|
||||
<img class='img' style="height:164;width:164px" src="@/assets/clean/step2-ongoing.png" alt="">
|
||||
<span class="sharp"></span>
|
||||
<img class='img' style="height:164;width:164px" src="@/assets/clean/step3-ready.png" alt="">
|
||||
<span class="sharp"></span>
|
||||
<img class='img' style="height:164;width:164px" src="@/assets/clean/step4-ready.png" alt="">
|
||||
</div>
|
||||
<div v-if="step=='3'" class="step">
|
||||
<img class='img' style="height:164;width:164px" src="@/assets/clean/step1-done.png" alt="">
|
||||
<span class="sharp"></span>
|
||||
<img class='img' style="height:164;width:164px" src="@/assets/clean/step2-done.png" alt="">
|
||||
<span class="sharp"></span>
|
||||
<img class='img' style="height:164;width:164px" src="@/assets/clean/step3-ongoing.png" alt="">
|
||||
<span class="sharp"></span>
|
||||
<img class='img' style="height:164;width:164px" src="@/assets/clean/step4-ready.png" alt="">
|
||||
</div>
|
||||
<div v-if="step=='4'" class="step">
|
||||
<img class='img' style="height:164;width:164px" src="@/assets/clean/step1-done.png" alt="">
|
||||
<span class="sharp"></span>
|
||||
<img class='img' style="height:164;width:164px" src="@/assets/clean/step2-done.png" alt="">
|
||||
<span class="sharp"></span>
|
||||
<img class='img' style="height:164;width:164px" src="@/assets/clean/step3-done.png" alt="">
|
||||
<span class="sharp"></span>
|
||||
<img class='img' style="height:164;width:164px" src="@/assets/clean/step4-done.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer" v-if="step=='4'">
|
||||
<div class="goBack" @click="goBack">返回</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserList } from "@/api/api";
|
||||
|
||||
export default {
|
||||
name: "Login",
|
||||
data() {
|
||||
return {
|
||||
step:'1'
|
||||
};
|
||||
},
|
||||
created: function () {
|
||||
|
||||
},
|
||||
sockets: {
|
||||
process_clean:function(data){
|
||||
console.log('process_clean',data)
|
||||
this.step=data.clean_step
|
||||
|
||||
},
|
||||
connect: function() {
|
||||
console.log("自动清洗socket连接成功2");
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
goBack(){
|
||||
// window.history.go('-1')
|
||||
// console.log('返回上一级')
|
||||
this.$router.push('/home')
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.userbox {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.usertop {
|
||||
height: 95px;
|
||||
text-align: center;
|
||||
font-size: 40px;
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #3a3a3a;
|
||||
line-height: 91px;
|
||||
text-align: center;
|
||||
}
|
||||
.content{
|
||||
.step{
|
||||
width:1024px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
text-align: center;
|
||||
margin:156px auto 0;
|
||||
padding:0 60px;
|
||||
}
|
||||
|
||||
.img{
|
||||
width:164px;
|
||||
height:164px;
|
||||
}
|
||||
.sharp{
|
||||
margin-top:73px;
|
||||
display: inline-block;
|
||||
width:0;
|
||||
height: 0;
|
||||
border-top: 10px solid transparent; /* 控制三角形高度 */
|
||||
border-bottom: 10px solid transparent; /* 控制三角形高度 */
|
||||
border-left: 10px solid #000; /* 控制三角形宽度和颜色 */
|
||||
}
|
||||
}
|
||||
.footer{
|
||||
width: 1024px;
|
||||
padding:0 40px;
|
||||
height: 120px;
|
||||
// background: #FFFFFF;
|
||||
// box-shadow: 0px -3px 6px 1px rgba(0,0,0,0.16);
|
||||
// border-radius: 0px 0px 0px 0px;
|
||||
display:flex;
|
||||
justify-content: space-between;
|
||||
padding-top:150px;
|
||||
.goBack{
|
||||
width: 208px;
|
||||
height: 84px;
|
||||
background: linear-gradient(180deg, #FFFFFF 0%, #ECECEC 100%);
|
||||
box-shadow: 0px 3px 6px 1px rgba(0,0,0,0.16);
|
||||
border-radius: 8px 8px 8px 8px;
|
||||
font-size: 36px;
|
||||
line-height:84px;
|
||||
color: #3A3A3A;
|
||||
text-align: center;
|
||||
margin:0 auto;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|