main
nz618 2 years ago
commit 1cb1e6de15

@ -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'
}
}

15
.gitignore vendored

@ -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)
}
}

Binary file not shown.

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)
}
}

Binary file not shown.

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]
}

37226
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -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"
]
}

Binary file not shown.

@ -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)
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

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,205 @@
<template>
<div class="userbox">
<div class="usertop">
<span class="title">清洁仪器</span>
</div>
<div class="content">
<div class="item">
<span class="tag">01</span>
<div class="step">取出样品杯用纸巾吸走样品杯的样品</div>
</div>
<div class="border" style="display:flex;height:35px;width:32px;text-align: center;">
<span style="width: 0px;height: 33px;border: 1px dashed #DC8589;display: block;margin:0 auto;"></span>
</div>
<div class="item">
<span class="tag">02</span>
<div class="step">用纸巾擦干净加热盖粘性物质用黄铜刷清扫</div>
</div>
<div class="border" style="display:flex;height:35px;width:32px;text-align: center;">
<span style="width: 0px;height: 33px;border: 1px dashed #DC8589;display: block;margin:0 auto;"></span>
</div>
<div class="item">
<span class="tag">03</span>
<div class="step">使用甲苯丙酮等无腐蚀性溶剂来清洗样品杯和盖子</div>
</div>
<div class="border" style="display:flex;height:35px;width:32px;text-align: center;">
<span style="width: 0px;height: 33px;border: 1px dashed #DC8589;display: block;margin:0 auto;"></span>
</div>
<div class="item">
<span class="tag">04</span>
<div class="step">将样品杯放回仪器舱内</div>
</div>
<div class="border" style="display:flex;height:35px;width:32px;text-align: center;">
<span style="width: 0px;height: 33px;border: 1px dashed #DC8589;display: block;margin:0 auto;"></span>
</div>
<div class="item">
<span class="tag">05</span>
<div class="step">点击下方自动清除来清除电极上的剩余物</div>
</div>
</div>
<div class="footer">
<div class="goBack" @click="goBack"></div>
<div class="add" @click="handAuto"></div>
</div>
</div>
</template>
<script>
import { instrumentClean } from "@/api/clean";
import { getUserList } from "@/api/api";
export default {
name: "Login",
data() {
return {
};
},
created: function () {
},
methods: {
goBack(){
window.history.go('-1')
console.log('返回上一级')
},
handAuto(){
instrumentClean().then(res=>{
console.log(res,'自动清洗参数')
this.$router.push('/autoClean')
})
}
},
};
</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{
width:650px;
height:485px;
margin: 50px auto 0;
.item{
// margin-bottom:35px;
display: flex;
.tag{
width: 32px;
height: 33px;
background: #C33E45;
box-shadow: inset 0px 3px 6px 1px rgba(0,0,0,0.4);
font-size:18px;
color:#fff;
text-align: center;
line-height:32px;
border-radius: 50%;
margin-right:12px;
}
.step{
font-size:24px;
color: #3A3A3A;
line-height: 35px;
}
}
}
.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,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,693 @@
<template>
<div class="SetSystem">
<div class="usertop">
<span class="title">系统设置</span>
<!-- <el-date-picker
v-model="dateTime"
type="date"
placeholder="选择日期">
</el-date-picker> -->
</div>
<div class="content">
<el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<div class="card cardOne">
<div class="title">时间</div>
<span class="subtitle">自动设置时间</span>
<el-switch v-model="ruleForm.delivery"></el-switch>
<div class="subtitle" style="margin:36px 0 28px ">手动设置日期和时间</div>
<el-row :gutter="10">
<el-col :span="9">
<div class="subtitle">日期</div>
<el-date-picker
v-model="dateTime"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-col>
<el-col :span="9">
<div class="subtitle">时间</div>
<el-time-picker
arrow-control
value-format="hh:mm:ss"
v-model="timeTime"
placeholder="选择时间">
</el-time-picker>
</el-col>
<el-col :span="2">
<div class="button" @click="handTime"></div>
</el-col>
</el-row>
</div>
<div class="card cardTwo">
<div class="title">压力</div>
<div class="item">
<div>
<span class="subtitle">自动设置时间</span>
<el-switch v-model="ruleForm.delivery"></el-switch>
</div>
<div class="subtitle">闪点检测压力阈值 20Kpa</div>
</div>
</div>
<div class="card cardThree">
<div class="title">升温速率</div>
<div class="item">
<div class="subtitle" style="margin-bottom:10px;">ASTM_D6450t:</div>
<el-row :gutter="30">
<el-radio-group v-model="ruleForm.radio1" @change="changeRadio('升温速率',ruleForm.radio1,'ASTM_D6450',ruleForm.input1)">
<el-col :span="12">
<el-radio :label="3">2.5±0.3/min</el-radio>
</el-col>
<el-col :span="12">
<el-radio :label="6">5.5±0.5/min</el-radio>
</el-col>
<el-col :span="12">
<el-radio :label="9">
<el-input placeholder="请输入内容" type="number" v-model="ruleForm.input1" @blur="changeRadio('升温速率',ruleForm.radio1,'ASTM_D6450',ruleForm.input1)">
<template slot="append">/min</template>
</el-input>
</el-radio>
</el-col>
</el-radio-group>
</el-row>
</div>
<div class="item">
<div class="subtitle" style="margin-bottom:10px;">ASTM_D7094</div>
<el-row :gutter="30">
<el-radio-group v-model="ruleForm.radio2" @change="changeRadio('升温速率',ruleForm.radio2,'ASTM_D7094',ruleForm.input2)">
<el-col :span="12">
<el-radio :label="3">2.5±0.3/min</el-radio>
</el-col>
<el-col :span="12">
<el-radio :label="6">5.5±0.5/min</el-radio>
</el-col>
<el-col :span="12">
<el-radio :label="9">
<el-input placeholder="请输入内容" v-model="ruleForm.input2" @blur="changeRadio('升温速率',ruleForm.radio2,'ASTM_D7094',ruleForm.input2)">
<template slot="append">/min</template>
</el-input>
</el-radio>
</el-col>
</el-radio-group>
</el-row>
</div>
<div class="item">
<div class="subtitle" style="margin-bottom:10px;">SH/T0768:</div>
<el-row :gutter="30">
<el-radio-group v-model="ruleForm.radio3" @change="changeRadio('升温速率',ruleForm.radio3,'SH/T0768',ruleForm.input3)">
<el-col :span="12">
<el-radio :label="3">2.5±0.3/min</el-radio>
</el-col>
<el-col :span="12">
<el-radio :label="6">5.5±0.5/min</el-radio>
</el-col>
<el-col :span="12">
<el-radio :label="9">
<el-input placeholder="请输入内容" v-model="ruleForm.input3" @blur="changeRadio('升温速率',ruleForm.radio3,'SH/T0768',ruleForm.input3)">
<template slot="append">/min</template>
</el-input>
</el-radio>
</el-col>
</el-radio-group>
</el-row>
</div>
</div>
<div class="card cardFour">
<div class="title">点火间隔</div>
<div class="item">
<div class="subtitle" style="margin-bottom:10px;">ASTM_D6450:</div>
<el-row :gutter="30">
<el-radio-group v-model="ruleForm.radio4" @change="changeRadio('点火间隔',ruleForm.radio4,'ASTM_D6450',ruleForm.input4)">
<el-col :span="12">
<el-radio :label="3">1</el-radio>
</el-col>
<el-col :span="12">
<el-radio :label="6">5</el-radio>
</el-col>
<el-col :span="12">
<el-radio :label="9">
<el-input placeholder="请输入内容" v-model="ruleForm.input4" @blur="changeRadio('点火间隔',ruleForm.radio4,'ASTM_D6450',ruleForm.input4)">
<template slot="append">/</template>
</el-input>
</el-radio>
</el-col>
</el-radio-group>
</el-row>
</div>
<div class="item">
<div class="subtitle" style="margin-bottom:10px;">ASTM_D7094</div>
<el-row :gutter="30">
<el-radio-group v-model="ruleForm.radio5" @change="changeRadio('点火间隔',ruleForm.radio5,'ASTM_D7094',ruleForm.input5)">
<el-col :span="12">
<el-radio :label="3">1</el-radio>
</el-col>
<el-col :span="12">
<el-radio :label="6">5</el-radio>
</el-col>
<el-col :span="12">
<el-radio :label="9">
<el-input placeholder="请输入内容" v-model="ruleForm.input5" @blur="changeRadio('点火间隔',ruleForm.radio5,'ASTM_D7094',ruleForm.input5)">
<template slot="append">/</template>
</el-input>
</el-radio>
</el-col>
</el-radio-group>
</el-row>
</div>
<div class="item">
<div class="subtitle" style="margin-bottom:10px;">SH/T0768:</div>
<el-row :gutter="30">
<el-radio-group v-model="ruleForm.radio6" @change="changeRadio('点火间隔',ruleForm.radio6,'SH/T0768',ruleForm.input6)">
<el-col :span="12">
<el-radio :label="3">1/</el-radio>
</el-col>
<el-col :span="12">
<el-radio :label="6">5/</el-radio>
</el-col>
<el-col :span="12">
<el-radio :label="9">
<el-input placeholder="请输入内容" v-model="ruleForm.input6" @blur="changeRadio('点火间隔',ruleForm.radio6,'SH/T0768',ruleForm.input6)">
<template slot="append">/</template>
</el-input>
</el-radio>
</el-col>
</el-radio-group>
</el-row>
</div>
</div>
</el-form>
</div>
<div class="footer">
<div class="goBack" @click="handBack"></div>
<div class="add" @click="handInit"></div>
</div>
</div>
</template>
<script>
import { initParams,getInitParams,setTime } from "@/api/setSystem";
import Qs from 'qs'
export default {
name: "Login",
data() {
return {
ruleForm:{
delivery:1,
radio1:3,
radio2:3,
radio3:3,
radio4:3,
radio5:3,
radio6:3,
input1:'',
input2:'',
input3:'',
input4:'',
input5:'',
input6:'',
},
dateTime: '',
timeTime: '',
params:{
"ASTM_D6450":{
'standard_id':null,
'heating_rate':2.5,
'heating_rate_fluctuate':0.3,
'heating_rate_custom':0,
'fire_interval':1,
'fire_rate_custom':0,
},
"ASTM_D7094": {
'standard_id':null,
'heating_rate':2.5,
'heating_rate_fluctuate':0.3,
'heating_rate_custom':0,
'fire_interval':1,
'fire_rate_custom':0,
},
"SH/T0768": {
'standard_id':null,
'heating_rate':5.5,
'heating_rate_fluctuate':0.5,
'heating_rate_custom':0,
'fire_interval':5,
'fire_rate_custom':0,
}
},
initResult:[
{
standard_id:null
},
{
standard_id:null
},
{
standard_id:null
}
]
}
},
created: function () {
this.getInit()
},
methods: {
async getInit(){
this.initResult=[]
await getInitParams().then(res=>{
console.log(res,'初始化成功')
this.initResult=res.data.data
})
console.log(this.initResult,'初始化数据')
// let result={
// "ASTM_D6450": {
// "standard_id": "dddd",
// "heating_rate": 2.5,
// "heating_rate_fluctuate": 0.3,
// "heating_rate_custom": false,
// "fire_interval": 1,
// "fire_rate_custom": false
// },
// "ASTM_D7094": {
// "standard_id": "eeeeeeeeee",
// "heating_rate": 2.5,
// "heating_rate_fluctuate": 0.3,
// "heating_rate_custom": false,
// "fire_interval": 1,
// "fire_rate_custom": false
// },
// "SH/T0768": {
// "standard_id": "fffffffffffff",
// "heating_rate":5.5,
// "heating_rate_fluctuate": 0.3,
// "heating_rate_custom": false,
// "fire_interval": 5,
// "fire_rate_custom": false
// }
// }
//
if(this.initResult[0].heating_rate_custom=="1"){
this.ruleForm.radio1=9
this.ruleForm.input1=this.initResult[0].heating_rate;
this.params['ASTM_D6450'].standard_id=this.initResult[0].standard_id
}else{
this.params['ASTM_D6450'].standard_id=this.initResult[0].standard_id
if(this.initResult[0].heating_rate=='2.5'){
this.ruleForm.radio1=3
}else{
this.ruleForm.radio1=6
}
}
if(this.initResult[1].heating_rate_custom=="1"){
this.ruleForm.radio2=9
this.params['ASTM_D7094'].standard_id=this.initResult[1].standard_id
this.ruleForm.input2=this.initResult[1].heating_rate
}else{
this.params['ASTM_D7094'].standard_id=this.initResult[1].standard_id
if(this.initResult[1].heating_rate=='2.5'){
this.ruleForm.radio2=3
}else{
this.ruleForm.radio2=6
}
}
if(this.initResult[2].heating_rate_custom=="1"){
this.params['SH/T0768'].standard_id=this.initResult[2].standard_id
this.ruleForm.radio3=9
this.ruleForm.input3=this.initResult[2].heating_rate
}else{
this.params['SH/T0768'].standard_id=this.initResult[2].standard_id
if(this.initResult[2].heating_rate=='2.5'){
this.ruleForm.radio3=3
}else{
this.ruleForm.radio3=6
}
}
//
if(this.initResult[0].fire_rate_custom=='1'){
this.params['ASTM_D6450'].standard_id=this.initResult[0].standard_id
this.ruleForm.radio4=9
this.ruleForm.input4=this.initResult[0].fire_interval
}else{
this.params['ASTM_D6450'].standard_id=this.initResult[0].standard_id
if(this.initResult[0].fire_interval=='1'){
this.ruleForm.radio4=3
}else{
this.ruleForm.radio4=6
}
}
if(this.initResult[1].fire_rate_custom=='1'){
this.params['ASTM_D7094'].standard_id=this.initResult[1].standard_id
this.ruleForm.radio5=9
this.ruleForm.input5=this.initResult[1].fire_interval
}else{
this.params['ASTM_D7094'].standard_id=this.initResult[1].standard_id
if(this.initResult[1].fire_interval=='1'){
this.ruleForm.radio5=3
}else{
this.ruleForm.radio5=6
}
}
if(this.initResult[2].fire_rate_custom=='1'){
this.params['SH/T0768'].standard_id=this.initResult[2].standard_id
this.ruleForm.radio6=9
this.ruleForm.input6=this.initResult[2].fire_interval
}else{
this.params['SH/T0768'].standard_id=this.initResult[2].standard_id
if(this.initResult[2].fire_interval=='1'){
this.ruleForm.radio6=3
}else{
this.ruleForm.radio6=6
}
}
},
handBack(){
window.history.go('-1')
},
changeRadio(title,value,temp,input){
if(title=='升温速率'){
if(value=='3'){
this.params[temp].heating_rate=2.5;
this.params[temp].heating_rate_fluctuate=0.3;
this.params[temp].heating_rate_custom=0;
}else if(value=='6'){
this.params[temp].heating_rate=5.5;
this.params[temp].heating_rate_fluctuate=0.5;
this.params[temp].heating_rate_custom=0;
}else{
this.params[temp].heating_rate=input;
this.params[temp].heating_rate_custom=1;
}
}else{
if(value=='3'){
this.params[temp].fire_interval=1;
// this.params[temp].heating_rate_fluctuate=0.3;
this.params[temp].fire_rate_custom=0;
}else if(value=='6'){
this.params[temp].fire_interval=5;
// this.params[temp].heating_rate_fluctuate=0.5;
this.params[temp].fire_rate_custom=0;
}else{
this.params[temp].fire_interval=input;
this.params[temp].fire_rate_custom=1;
}
}
console.log(this.params,'改变',title,value,temp,input)
},
handInit(){
if(this.ruleForm.radio1=='9'){
if(this.ruleForm.input1== null && this.ruleForm.input1== ""){
return this.$message.warning('升温速率 ASTM_D6450自定义值不能为空')
}
if(isNaN(this.ruleForm.input1)){
return this.$message.warning('升温速率 ASTM_D6450自定义值不能非数值')
}
}
initParams(this.params).then(res=>{
console.log(res,'初始化成功')
})
},
handTime(){
let data={
date:this.dateTime,
time:this.timeTime
}
console.log(data,'时间')
setTime(data).then(res=>{
console.log('测试',res)
})
}
},
};
</script>
<style lang="less">
.SetSystem .el-switch__core{
width: 80px !important;
height: 40px;
border-radius:20px;
}
.SetSystem .el-switch.is-checked .el-switch__core::after{
margin-left: -38px;
}
.SetSystem .el-switch__core:after{
width: 36px;
height: 36px
}
/* //日期 */
.SetSystem .el-date-editor{
width: 308px;
height: 68px;
margin:12px 44px 0 0;
}
.SetSystem .el-date-editor .el-input__inner{
width: 308px;
height: 68px;
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 #DCDFE6;
font-size: 28px;
color: #3A3A3A;
padding-left:50px;
}
.SetSystem .el-input__icon{
font-size: 28px;
color: #3A3A3A;
line-height: 68px;
margin-left:10px;
}
.SetSystem .el-radio{
margin:12px 43px 0 0;
height:68px;
width:420px;
}
.el-radio__label{
color: #3A3A3A;
font-size: 28px;
}
.SetSystem .el-radio__inner{
margin-top:-6px;
width:25px;
height:25px;
}
.SetSystem .el-input--small .el-input__inner{
width: 325px;
height: 68px;
background: #FFFFFF;
border-radius: 4px 0 0 4px;
opacity: 1;
border: 1px solid #DCDFE6;
border-right:0;
font-size: 28px;
}
.SetSystem .el-input-group__append, .SetSystem .el-input-group__prepend{
border-left:0;
background: #FFFFFF;
border-radius: 0 4px 4px 0;
font-size: 28px;
color:'#C3C3C3'
}
// .el-form-item__content {
// width: 440px;
// .el-input__inner {
// height: 68px;
// background: #ffffff;
// border-radius: 4px 0 0 4px;
// opacity: 1;
// border: 1px solid #dcdcdc;
// font-size: 28px;
// color: #3a3a3a;
// }
// .rightBorder .el-input__inner {
// border-right: 0;
// }
// .flash {
// width: 220px;
// }
// .el-input-group__append,
// .el-input-group__prepend {
// background: #ffffff;
// border: 1px solid #dcdcdc;
// border-left: 0;
// color: #c3c3c3;
// font-size: 28px;
// }
// }
</style>
<style scoped lang="less">
.SetSystem {
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{
height:480px;
overflow: auto;
.card{
width: 944px;
margin:0 auto;
background: #F6F6F6;
box-shadow: inset 0px 3px 6px 1px #FFFFFF;
border-radius: 8px 8px 8px 8px;
opacity: 1;
border: 1px solid #DCDCDC;
// padding:20px 0;
font-size: 24px;
color: #666666;
.title{
font-size: 28px;
font-weight: bold;
color: #3A3A3A;
}
}
.cardOne{
height: 348px;
padding:20px;
.button{
width: 200px;
height: 68px;
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: 28px;
color: #51A8FF;
text-align: center;
line-height: 68px;
margin-top:42px;
}
.title{
margin-bottom:32px;
}
}
.cardTwo{
margin-top:20px;
.title{
padding:20px;
}
.item{
padding:20px;
border-top:1px solid #E4E4E4;
padding-right:150px;
display: flex;
justify-content: space-between;
}
}
.cardThree,.cardFour{
margin-top:20px;
.title{
padding:20px;
}
.item{
padding:20px;
border-top:1px solid #E4E4E4;
}
}
}
.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>

File diff suppressed because it is too large Load Diff

@ -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>

@ -0,0 +1,403 @@
<template>
<div class="fitstStep">
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-position="top"
>
<el-row :gutter="40">
<el-col :span="12">
<el-form-item label="测定标准" prop="determination_standard">
<el-select
v-model="ruleForm.determination_standard"
placeholder="请选择测定标准"
style="width: 100%"
>
<el-option v-for='item in standards' :key='item.value' :label='item.label' :value='item.value'/>
<!-- <el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option> -->
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="预期闪点" prop="expected_flash_point">
<el-input v-model="ruleForm.expected_flash_point" class="flash rightBorder">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6" >
<div class="set" @click="handSet"></div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="温度选择" prop="temperature_selection">
<el-select
v-model="ruleForm.temperature_selection"
placeholder="请选择温度"
style="width: 100%"
>
<el-option v-for='item in temps' :key='item.value' :label='item.label' :value='item.value'/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="初始温度" prop="initial_temperature_set">
<el-input
class="rightBorder"
v-model="ruleForm.initial_temperature_set"
placeholder="≤预期闪点-18℃"
>
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="样品名称" prop="material_name">
<el-input v-model="ruleForm.material_name" placeholder="≤预期闪点-18℃">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="最终温度" prop="final_temperature_set">
<el-input
class="rightBorder"
v-model="ruleForm.final_temperature_set"
placeholder="≤预期闪点-18℃"
>
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="样品编号" prop="material_code">
<el-input v-model="ruleForm.material_code" placeholder="≤预期闪点-18℃">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<div class="goBack" @click="handBack"></div>
</el-col>
<el-col :span="6">
<div class="sampling" @click="handTake('ruleForm')"></div>
</el-col>
</el-row>
</el-form>
<div class="model" v-show="isShow">
<span class="icon">!</span>
<div class="dec">请确定您已连接好制冷装置</div>
<div class="tip">请确定连接好制冷装置再继续</div>
<div class="bottom">
<div class="cancel button" @click="handCancel"></div>
<div class="continue button" @click="handContinue"></div>
</div>
</div>
</div>
</template>
<script>
import { addExperiment } from "@/api/step";
import { getInitParams } from "@/api/setSystem";
export default {
data() {
return {
isShow:false,
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)'
// },
],
temps:[
{
value:'高温测定(100~420℃)',
label:'高温测定(100~420℃)'
},
{
value:'低温测试(-25~100℃)',
label:'低温测试(-25~100℃)'
},
],
ruleForm: {
determination_standard: "",
temperature_selection:'高温测定(100~420℃)',
expected_flash_point:'78.6',
initial_temperature_set:'',
material_name:'',
final_temperature_set:'',
material_code:'',
user_id:JSON.parse(sessionStorage.LoginUser).user_id
},
rules: {
determination_standard:[
{ required: true, message: '该项不能为空', trigger: 'blur' },
],
temperature_selection:[
{ required: true, message: '该项不能为空', trigger: 'blur' },
],
material_name:[
{ required: true, message: '该项不能为空', trigger: 'blur' },
],
material_code:[
{ required: true, message: '该项不能为空', trigger: 'blur' },
],
},
};
},
watch:{
ruleForm:{
handler(newVal) {
if (newVal) {
console.log(this.ruleForm,'温度改变')
if(this.ruleForm.temperature_selection=='低温测试(-25~100℃)'){
this.isShow=true;
}else{
this.isShow=false;
}
}
},
deep:true,
immediate: true,
},
},
mounted(){
this.getInit()
},
methods: {
getInit(){
getInitParams().then(res=>{
console.log(res.data.data,'初始化数据11')
if(res.data.data.length>0){
res.data.data.map(item=>{
this.standards.push({
value:item.determination_standard,
label:item.determination_standard,
})
})
}else{
this.$message.warning('请初始化测定标准参数')
}
console.log(this.standards,'初始化数据22')
// this.initResult=res.data.data
})
},
handSet() {
console.log('设置1')
this.ruleForm.expected_flash_point='未知'
},
handCancel(){
console.log('取消')
this.ruleForm.temperature_selection='高温测定(100~420℃)'
this.isShow=false
},
handContinue(){
this.isShow=false
this.ruleForm.temperature_selection='低温测试(-25~100℃)'
},
handBack(){
window.history.go('-1')
console.log('111')
},
handTake(formName){
console.log('222',this.ruleForm,)
this.$refs[formName].validate((valid) => {
if (valid) {
addExperiment(this.ruleForm).then(res=>{
console.log(res.data,'测试44',res.data.status)
if(res.data.status==0){
console.log('测试8877',res.data.data)
localStorage.setItem('experiment_info',JSON.stringify(res.data.data))
console.log(JSON.parse(localStorage.getItem('experiment_info')),'获取')
this.$emit('next')
}
})
}
})
}
},
};
</script>
<style lang="less" >
.el-select-dropdown__item{
height: 68px;
background: #F6F6F6;
border-radius: 0px 0px 0px 0px;
opacity: 1;
font-size: 28px;
border:2px solid #E4E4E4;
line-height: 68px;
}
.fitstStep {
.el-form {
margin-top: 28px;
padding: 0 40px;
//label
.el-form-item__label {
padding: 0;
font-size: 24px;
color: #666666;
margin-bottom: 12px;
}
//
.el-form-item__content {
// width: 440px;
.el-input__inner {
height: 68px;
background: #ffffff;
border-radius: 4px 0 0 4px;
opacity: 1;
border: 1px solid #dcdcdc;
font-size: 28px;
color: #3a3a3a;
}
.rightBorder .el-input__inner {
border-right: 0;
}
.flash {
width: 220px;
}
.el-input-group__append,
.el-input-group__prepend {
background: #ffffff;
border: 1px solid #dcdcdc;
border-left: 0;
color: #c3c3c3;
font-size: 28px;
}
}
.set {
width: 220px;
height: 68px;
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;
margin-top: 44px;
font-size: 28px;
color: #51a8ff;
text-align: center;
line-height: 68px;
}
.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-top: 36px;
}
.sampling {
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;
margin-top: 36px;
}
}
.footer{
width: 1024px;
height: 40px;
background: #3A3A3A;
border-radius: 0px 0px 0px 0px;
opacity: 0.18;
text-align: center;
span{
z-index:99;
font-size: 24px;
color: red;
line-height: 40px;
}
}
.model{
position: fixed;
top:116px;
left:286px;
width:440px;
height:534px;
box-shadow: 0px 3px 6px 1px rgba(0,0,0,0.16);
border-radius: 8px 8px 8px 8px;
background:#fff;
.icon{
display:block ;
border-radius: 50%;
margin:80px auto 0;
width: 94px;
height: 94px;
background: linear-gradient(180deg, #FFB300 0%, #FF7D00 100%);
font-size: 80px;
color:#fff;
text-align: center;
}
.dec{
margin:70px auto 0;
font-size: 28px;
font-weight: bold;
color: #3A3A3A;
text-align: center;
}
.tip{
margin:32px auto 0;
font-size: 24px;
font-weight: 400;
color: #C3C3C3;
text-align: center;
}
.bottom{
margin-top:64px;
display: flex;
justify-content: center;
text-align: center;
width:100%;
height:70px;
.button{
width: 136px;
height: 68px;
box-shadow: 0px 3px 6px 1px rgba(0,0,0,0.16);
border-radius: 8px 8px 8px 8px;
font-size: 28px;
}
.cancel{
background: linear-gradient(180deg, #FFFFFF 0%, #ECECEC 100%);
color: #3A3A3A;
margin-right:12px;
line-height:68px;
}
.continue{
background: linear-gradient(180deg, #FF7B83 0%, #850006 100%);
color: #fff;
line-height:68px;
}
}
}
}
</style>

@ -0,0 +1,291 @@
<template>
<div class="fourStep">
<div class="header">
<span class="left">校准闪点</span>
<span class="right">{{ nowDate }}</span>
</div>
<div class="echarts" >
<div class="top">
<div class="title">{{flash_point_value}}</div>
<div class="subTitle">{{material_name}}</div>
</div>
<div id="main" style="width: 100%; height: 400px"></div>
<div class="info">
<div v-for="(item,index) in items" :key="index" class="item">
<div class="label">{{ item.label }}</div>
<div class="value">{{ item.value }}</div>
</div>
</div>
</div>
<div class="bottom">
<div class="button goBack" @click="handBack"></div>
<div class="button delete" @click="handDelete"></div>
<div class="button export" @click="handExport"></div>
<div class="button instrument" v-if="isShow" @click="handClean"></div>
</div>
</div>
</template>
<script>
import * as echarts from "echarts";
import router from '../../router';
import { exportReportList } from "@/api/report";
import { deleteData,resultData } from "@/api/step";
export default {
props:{
isShow:{
type:Boolean,
default:true
}
},
data() {
return {
flash_point_value:'',
material_name:'',
nowDate: "",
items:[
{
label:'执行标准',
value:'ASTM D6450'
},
{
label:'初始温度',
value:'60.6℃'
},
{
label:'最终温度',
value:'ASTM D6450'
},
{
label:'精密度适用范围',
value:'60.6℃'
},
{
label:'点火前气压',
value:'60.6℃'
},
{
label:'环境大气压',
value:'ASTM D6450'
},
{
label:'瞬间增压',
value:'60.6℃'
},
],
xData:[],
yData:[],
};
},
mounted() {
this.currentTime();
this.getInitData();
},
methods: {
async getInitData (){
console.log('获取初始数据')
let data={
experiment_id:JSON.parse(localStorage.getItem('experiment_info')).experiment_id
}
var that=this;
await resultData(data).then(response=>{
console.log(response,'结果',response.data.data)
that.xData=response.data.data.chart_data_temp,
that.yData=response.data.data.chart_data_pressure
that.items[0].value=response.data.data.determination_standard;
that.items[2].value=response.data.data.final_temperature_set;
that.items[1].value=response.data.data.initial_temperature_set;
that.items[6].value=response.data.data.instant_adding_pressure;
that.items[4].value=response.data.data.preparation_fire_air_pressure;
that.items[5].value=response.data.data.ambient_pressure;//
that.items[3].value=response.data.data.application_scope;//
that.flash_point_value=response.data.data.flash_point_value;
that.material_name=response.data.data.flash_point_value.material_name;
// that.$message.success('')
that.init()
})
},
handSet() {},
handCancel() {
this.isShow = false;
},
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();
_this.nowDate = yy + "/" + mm + "/" + dd + " " + " " + hh + ":" + mf;
},
init() {
console.log('初始化')
// domecharts
var myChart = echarts.init(document.getElementById("main"));
//
var option = {
xAxis: {
name:'温度/℃',
type: 'category',
data: this.xData,
axisTick:{
show:false
},
axisLine:{
show:false
}
},
yAxis: {
name:'瞬间增压/Kpa',
type: 'value'
},
series: [
{
data: this.yData,
type: 'line',
showSymbol:false,
}
],
color:'#51A8FF'
};
// 使
myChart.setOption(option);
},
handBack(){
window.history.go('-1')
},
handDelete(){
let data={
experiment_id:JSON.parse(localStorage.getItem('experiment_info')).experiment_id
}
deleteData(data).then(response=>{
console.log(response,'删除成功')
this.$message.success('删除成功')
// this.$message.error(response.desc)
})
},
handExport(){
let data={
experiment_id:JSON.parse(localStorage.getItem('experiment_info')).experiment_id
}
exportReportList(data).then(response=>{
console.log(response,'导出成功')
this.$message.success('导出成功')
// this.$message.error(response.desc)
})
},
handClean(){
this.$router.push('/clean');
}
},
};
</script>
<style lang="less" >
.fourStep {
.header {
margin: 40px 40px 0;
width: 944px;
height: 44px;
background: linear-gradient(96deg, #e4e4e4 0%, #f3f3f3 100%);
border-radius: 0px 0px 0px 0px;
display: flex;
justify-content: space-between;
padding: 0 20px;
font-size: 20px;
color: #666666;
line-height: 44px;
}
.echarts {
margin: 0 40px;
overflow: auto;
height:400px;
.top{
.title{
text-align: center;
margin:20px auto 0;
font-size: 56px;
color: #666666;
}
.subTitle{
text-align: center;
font-size: 24px;
color: #666666;
}
}
.info{
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
.item{
width:180px;
padding:24px 30px;
font-size: 24px;
color:#808080;
.value{
margin-top:10px;
}
}
.item:nth-child(1),.item:nth-child(4),.item:nth-child(5){
width:280px
}
}
}
.bottom {
width: 1024px;
height: 120px;
background: #ffffff;
box-shadow: 0px -3px 6px 1px rgba(0, 0, 0, 0.16);
border-radius: 0px 0px 0px 0px;
opacity: 1;
position: fixed;
bottom: 0;
display: flex;
justify-content: space-between;
padding: 0 40px;
.button {
margin-top: 12px;
width: 208px;
height: 84px;
box-shadow: 0px 3px 6px 1px rgba(0, 0, 0, 0.16);
border-radius: 8px 8px 8px 8px;
line-height: 84px;
font-size: 36px;
text-align: center;
color: #fff;
}
.goBack {
background: linear-gradient(180deg, #ffffff 0%, #ececec 100%);
color: #3a3a3a;
}
.delete {
background: linear-gradient(180deg, #ff7b83 0%, #850006 100%);
}
.export {
background: linear-gradient(180deg, #59cc74 0%, #0a8828 100%);
}
.instrument {
background: linear-gradient(180deg, #51a8ff 0%, #1564b1 100%);
}
}
}
</style>

@ -0,0 +1,352 @@
<template>
<div class="secStep">
<div class="top">
<div class="left">
<!-- <video class='video' ref='videoRef' src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"></video> -->
<img v-if="pic_step=='1'" class="video" src="@/assets/step/1取样前.gif"/>
<img v-if="pic_step=='2'" class="video" src="@/assets/step/2样品杯出仓.gif"/>
<img v-if="pic_step=='3'" class="video" src="@/assets/step/3取样等待.gif"/>
<img v-if="pic_step=='4'" class="video" src="@/assets/step/4样品杯回仓.gif"/>
<img v-if="pic_step=='5'" class="video" src="@/assets/step/5升杯前蓝光闪火.gif"/>
<img v-if="pic_step=='6'" class="video" src="@/assets/step/6升杯转透视.gif"/>
<img v-if="pic_step=='7'" class="video" src="@/assets/step/7杯盖升温.gif"/>
<img v-if="pic_step=='8'" class="video" src="@/assets/step/8蓝光闪火.gif"/>
<div class="bottomDec">
<div class="item">
<div class="itemLeft">
<div class="title">炉盖温度</div>
<div class="num">{{lit_temperature}}</div>
</div>
<span class="itemRight"></span>
</div>
<div class="item">
<div class="itemLeft">
<div class="title">样品温度</div>
<div class="num">{{samples_temperature}}</div>
</div>
<span class="itemRight"></span>
</div>
<div class="item">
<div class="itemLeft">
<div class="title">瞬间增压</div>
<div class="num">{{moment_pressure}}</div>
</div>
<span class="itemRight">Kpa</span>
</div>
</div>
</div>
<div class="right">
<div class="title">
{{experiment_info.temperature_selection}}
</div>
<div class="subTitle">
{{experiment_info.determination_standard}}
</div>
<div class="itemBox">
<div class="item" v-for="(item,index) in items" :key="index">
<div class="label">{{ item.label }}</div>
<div class="value">
{{ item.value }}
<span></span>
</div>
</div>
</div>
</div>
</div>
<div class="bottom">
<div class="goBack" @click="handBack"></div>
<div v-if='isMeasure' class="nextButton noButton" >测量</div>
<div v-else class="nextButton" @click="handMeasure"></div>
</div>
<div class="model" v-show="barn_door_confirm">
<span class="icon">!</span>
<div class="dec">关闭样品仓</div>
<div class="tip">请摇匀容器内样品取1ml样品到样品杯置入搅拌磁片</div>
<div class="bottom">
<div class="cancel button" @click="handCancel"></div>
<div class="continue button" @click="handTake"></div>
</div>
</div>
</div>
</template>
<script>
import { startExperiment } from "@/api/step";
export default {
props:{
lit_temperature:{
type:Number,
default:0
},
moment_pressure:{
type:Number,
default:0
},
samples_temperature:{
type:Number,
default:0
},
barn_door_confirm:{
type:Boolean,
default:false
},
next_step:{
type:Boolean,
default:false
},
pic_step:{//
type:Number,
default:1
},
},
mounted(){
this.experiment_info=JSON.parse(localStorage.experiment_info)
console.log(this.experiment_info,'本地储存')
this.items[0].value=this.experiment_info.expected_flash_point;
this.items[1].value=this.experiment_info.initial_temperature_set;
this.items[2].value=this.experiment_info.final_temperature_set;
// this.$refs.videoRef.play()
},
data() {
return {
experiment_info:{},
isMeasure:true,
isShow:false,
items:[
{
label:'预计闪点',
value:'78.6'
},
{
label:'初始温度',
value:'60.6'
},
{
label:'最终温度',
value:'86.6'
}
],
};
},
methods: {
handSet() {},
handBack(){
window.history.go('-1')
console.log('111')
},
handCancel(){
this.isMeasure=false
this.$emit('close')
},
handTake(formName){
console.log('测量',JSON.parse(localStorage.getItem('experiment_info')).experiment_id)
let data={
experiment_id:JSON.parse(localStorage.getItem('experiment_info')).experiment_id
}
//
startExperiment(data).then(res=>{
console.log('测试111',res.status)
this.$emit('next')
if(res.status=='0'){
this.$emit('next')
}
})
},
handMeasure(){
this.$emit('open')
}
},
};
</script>
<style lang="less" >
.secStep{
padding:24px 40px;
.top{
height:440px;
display: flex;
justify-content: space-between;
.left{
width: 648px;
height: 439px;
background: #DCDCDC;
border-radius: 8px 8px 8px 8px;
position: relative;
overflow: hidden;
.video{
height: 100%;
}
.bottomDec{
width:100%;
height: 87px;
background: #000000;
border-radius: 0px 0px 8px 8px;
opacity: 0.35;
position:absolute;
bottom:0;
display: flex;
justify-content: space-between;
padding:15px 28px;
.item{
display: flex;
justify-content: flex-start;
.itemLeft{
.title{
font-size: 16px;
color: rgba(255,255,255,0.6);
}
.num{
font-size: 32px;
font-weight: 400;
color: #FFFFFF;
}
}
.itemRight{
margin:30px 10px 0;
font-size: 16px;
color: rgba(255,255,255,0.6);
}
}
}
}
.right{
width: 276px;
height: 439px;
background: #FFFFFF;
border-radius: 8px 8px 8px 8px;
opacity: 1;
border: 1px solid #DCDCDC;
.title{
margin:56px auto 0;
font-size: 32px;
color: #3A3A3A;
text-align: center;
}
.subTitle{
text-align: center;
margin:18px auto 0;
font-size: 20px;
color: #C3C3C3;;
}
.itemBox{
margin-top:28px;
.item{
display: flex;
justify-content: space-around;
padding:0 24px;
margin-top:38px;
font-size: 24px;
color:#3A3A3A;
.value{
span{
font-size: 16px;
color: #C3C3C3
}
}
}
}
}
}
.bottom{
height:84px;
display: flex;
justify-content: space-between;
margin-top:9px;
.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;
color: #666666;
line-height:84px;
text-align: center;
}
.nextButton{
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;
color: #fff;
line-height:84px;
text-align: center;
}
.noButton{
background: linear-gradient(360deg, #FFFFFF 0%, #ECECEC 100%);
color:#C3C3C3 !important;
}
}
.model{
position: fixed;
top:116px;
left:286px;
width:440px;
height:534px;
box-shadow: 0px 3px 6px 1px rgba(0,0,0,0.16);
border-radius: 8px 8px 8px 8px;
background:#fff;
.icon{
display:block ;
border-radius: 50%;
margin:80px auto 0;
width: 94px;
height: 94px;
background: linear-gradient(180deg, #FFB300 0%, #FF7D00 100%);
font-size: 80px;
color:#fff;
text-align: center;
}
.dec{
margin:70px auto 0;
font-size: 28px;
font-weight: bold;
color: #3A3A3A;
text-align: center;
}
.tip{
margin:32px auto 0;
font-size: 24px;
font-weight: 400;
color: #C3C3C3;
text-align: center;
}
.bottom{
margin-top:64px;
display: flex;
justify-content: center;
text-align: center;
width:100%;
height:70px;
.button{
width: 136px;
height: 68px;
box-shadow: 0px 3px 6px 1px rgba(0,0,0,0.16);
border-radius: 8px 8px 8px 8px;
font-size: 28px;
}
.cancel{
background: linear-gradient(180deg, #FFFFFF 0%, #ECECEC 100%);
color: #3A3A3A;
margin-right:12px;
line-height:68px;
}
.continue{
background: linear-gradient(180deg, #FF7B83 0%, #850006 100%);
color: #fff;
line-height:68px;
}
}
}
}
</style>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save